From ec2db1e8875211bc8efbeae28e6476e4aee51a64 Mon Sep 17 00:00:00 2001 From: Brenden Harrell Date: Wed, 19 May 2021 12:50:34 -0500 Subject: [PATCH 1/6] Initial Setup Script to install Node Dependencies --- setup.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 setup.js diff --git a/setup.js b/setup.js new file mode 100644 index 000000000..61618d034 --- /dev/null +++ b/setup.js @@ -0,0 +1,49 @@ +const path = require("path"); +const process = require("process"); +const { exec } = require("child_process"); + +// Create Operating System compatable paths to each node_modules directory. +let nodeModulesDirs = [ + path.join( process.cwd(), "Client"), + path.join( process.cwd(), "Projects", "Superalgos", "TS", "Bot-Modules", "Sensor-Bot", "Exchange-Raw-Data"), + path.join( process.cwd(), "Projects", "Superalgos", "TS", "Bot-Modules", "Trading-Bot", "Announcements"), + path.join( process.cwd(), "Projects", "Superalgos", "TS", "Bot-Modules", "Trading-Bot", "Low-Frequency-Trading", "APIs"), + path.join( process.cwd(), "Projects", "Superalgos", "TS", "Task-Modules"), + path.join( process.cwd(), "Projects", "TensorFlow", "TS", "Bot-Modules") +]; + +console.log(''); +console.log("Installing node dependencies at the following directories:"); +console.log(''); +console.log(nodeModulesDirs); +console.log(''); + +// Loop through directories and run node ci in a child process shell. +let dir; +for (dir in nodeModulesDirs) { + let command = "npm ci"; + exec( command, + { + cwd: nodeModulesDirs[dir] + }, + function ( error, stdout, stderr ){ + if (error) { + console.log("there was an error: ", error); + return; + } + console.log( "Results of install at " + nodeModulesDirs[dir] ); + console.log(''); + console.log( stdout ); + }); +}; +/* + cd %~dp0 + cd .. + cd %%a + cmd /k "npm ci" +)) + +REM cmd /k "cd %~dp0 && cd .." +REM cmd /k "npm ci && cd %~dp0" +REM cmd /k "npm ci" +*/ \ No newline at end of file From a3afb73cf2422a41ee0473453b0845ddc44ba0cf Mon Sep 17 00:00:00 2001 From: Brenden Harrell Date: Wed, 19 May 2021 13:22:19 -0500 Subject: [PATCH 2/6] Package.jsons to Handle npm ci Command --- Client/package.json | 2 +- .../Sensor-Bot/Exchange-Raw-Data/package.json | 13 ++ .../Trading-Bot/Announcements/package.json | 19 +++ .../Low-Frequency-Trading/APIs/package.json | 12 ++ .../Superalgos/TS/Task-Modules/package.json | 13 ++ .../Low-Frequency-Learning/package.json | 125 ++++++++++++++++++ 6 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 Projects/Superalgos/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/package.json create mode 100644 Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/package.json create mode 100644 Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/APIs/package.json create mode 100644 Projects/Superalgos/TS/Task-Modules/package.json create mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/package.json diff --git a/Client/package.json b/Client/package.json index 7e53cebd4..0fc6f9522 100644 --- a/Client/package.json +++ b/Client/package.json @@ -1,5 +1,5 @@ { - "name": "Client", + "name": "client", "version": "0.0.6", "description": "BackendServer", "main": "client.js", diff --git a/Projects/Superalgos/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/package.json b/Projects/Superalgos/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/package.json new file mode 100644 index 000000000..aaf297494 --- /dev/null +++ b/Projects/Superalgos/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/package.json @@ -0,0 +1,13 @@ +{ + "name": "exchange-raw-data", + "version": "0.0.6", + "description": "Sensor Bot", + "main": "HistoricOHLCVs.js", + "author": { + "name": "Luis-Fernando-Molina" + }, + "dependencies": { + "ccxt": "^1.47.49" + } + } + \ No newline at end of file diff --git a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/package.json b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/package.json new file mode 100644 index 000000000..c06cbb10f --- /dev/null +++ b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/package.json @@ -0,0 +1,19 @@ +{ + "name": "announcements", + "version": "0.0.6", + "description": "Social Bots", + "main": "SocialBots.js", + "author": { + "name": "Luis-Fernando-Molina" + }, + "dependencies": { + "debug": "^4.3.1", + "minimist": "^1.2.5", + "module-alias": "^2.2.2", + "ms": "^2.1.2", + "node-fetch": "^2.6.1", + "sandwich-stream": "^2.0.2", + "telegraf": "^3.38.0", + "telegram-typings": "^3.6.1" + } + } \ No newline at end of file diff --git a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/APIs/package.json b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/APIs/package.json new file mode 100644 index 000000000..2de71c485 --- /dev/null +++ b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/APIs/package.json @@ -0,0 +1,12 @@ +{ + "name": "apis", + "version": "0.0.6", + "description": "Exchange APIs", + "main": "ExchangeAPI.js", + "author": { + "name": "Luis-Fernando-Molina" + }, + "dependencies": { + "ccxt": "^1.47.49" + } + } \ No newline at end of file diff --git a/Projects/Superalgos/TS/Task-Modules/package.json b/Projects/Superalgos/TS/Task-Modules/package.json new file mode 100644 index 000000000..b99cfa687 --- /dev/null +++ b/Projects/Superalgos/TS/Task-Modules/package.json @@ -0,0 +1,13 @@ +{ + "name": "task-modules", + "version": "0.0.6", + "description": "Tasks Server", + "main": "EventServerClient.js", + "author": { + "name": "Luis-Fernando-Molina" + }, + "dependencies": { + "ip": "^1.1.5", + "ws": "^7.4.0" + } + } \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/package.json new file mode 100644 index 000000000..10f20fb5f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/package.json @@ -0,0 +1,125 @@ +{ + "name": "low-frequency-learning", + "version": "0.0.6", + "description": "Learning Bot", + "main": "TensorFlowLibrary.js", + "author": { + "name": "Luis-Fernando-Molina" + }, + "dependencies": { + "@tensorflow/tfjs": "^3.0.0", + "@tensorflow/tfjs-backend-cpu": "^3.0.0", + "@tensorflow/tfjs-backend-webgl": "^3.0.0", + "@tensorflow/tfjs-converter": "^3.0.0", + "@tensorflow/tfjs-core": "^3.0.0", + "@tensorflow/tfjs-data": "^3.0.0", + "@tensorflow/tfjs-layers": "^3.0.0", + "@tensorflow/tfjs-node": "^3.0.0", + "@types/node": "^14.14.28", + "@types/node-fetch": "^2.5.8", + "@types/offscreencanvas": "^2019.3.0", + "@types/seedrandom": "^2.4.27", + "@types/webgl-ext": "^0.0.30", + "@types/webgl2": "^0.0.5", + "abbrev": "^1.1.1", + "adm-zip": "^0.4.16", + "agent-base": "^4.3.0", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.3.0", + "aproba": "^1.2.0", + "are-we-there-yet": "^1.1.5", + "argparse": "^1.0.10", + "asynckit": "^0.4.0", + "balanced-match": "^1.0.0", + "brace-expansion": "^1.1.11", + "chalk": "^4.1.0", + "chownr": "^1.1.4", + "cliui": "^7.0.4", + "code-point-at": "^1.1.0", + "color-convert": "^2.0.1", + "color-name": "^1.1.4", + "combined-stream": "^1.0.8", + "concat-map": "^0.0.1", + "console-control-strings": "^1.1.0", + "core-js": "^3.8.3", + "core-util-is": "^1.0.2", + "debug": "^3.2.7", + "deep-extend": "^0.6.0", + "delayed-stream": "^1.0.0", + "delegates": "^1.0.0", + "detect-libc": "^1.0.3", + "emoji-regex": "^8.0.0", + "es6-promise": "^4.2.8", + "es6-promisify":"^5.0.0", + "escalade": "^3.1.1", + "form-data": "^3.0.1", + "fs-minipass": "^1.2.7", + "fs.realpath": "^1.0.0", + "gauge": "^2.7.4", + "get-caller-file": "^2.0.5", + "glob": "^7.1.6", + "google-protobuf": "^3.14.0", + "has-flag": "^4.0.0", + "has-unicode": "^2.0.1", + "https-proxy-agent": "^2.2.4", + "iconv-lite": "^0.4.24", + "ignore-walk": "^3.0.3", + "inflight": "^1.0.6", + "inherits": "^2.0.4", + "ini": "^1.3.8", + "is-fullwidth-code-point": "^3.0.0", + "isarray": "^1.0.0", + "mime-db": "^1.45.0", + "mime-types": "^2.1.28", + "minimatch": "^3.0.4", + "minimist": "^1.2.5", + "minipass": "^2.9.0", + "minizlib": "^1.3.3", + "mkdirp": "^0.5.5", + "ms": "^2.1.3", + "needle": "^2.6.0", + "node-fetch": "^2.6.1", + "node-pre-gyp": "^0.14.0", + "nopt": "^4.0.3", + "npm-bundled": "^1.1.1", + "npm-normalize-package-bin": "^1.0.1", + "npm-packlist":"^1.4.8", + "npmlog":"^4.1.2", + "number-is-nan": "^1.0.1", + "object-assign": "^4.1.1", + "once": "^1.4.0", + "os-homedir": "^1.0.2", + "os-tmpdir": "^1.0.2", + "osenv": "^0.1.5", + "path-is-absolute": "^1.0.1", + "process-nextick-args": "^2.0.1", + "progress": "^2.0.3", + "rc": "^1.2.8", + "readable-stream": "^2.3.7", + "regenerator-runtime": "^0.13.7", + "require-directory": "^2.1.1", + "rimraf": "^2.7.1", + "safe-buffer": "^5.1.2", + "safer-buffer": "^2.1.2", + "sax": "^1.2.4", + "seedrandom": "^2.4.3", + "semver": "^5.7.1", + "set-blocking": "^2.0.0", + "signal-exit": "^3.0.3", + "sprintf-js": "^1.0.3", + "string-width": "^4.2.0", + "string_decoder": "^1.1.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^2.0.1", + "supports-color": "^7.2.0", + "tar": "^4.4.13", + "util-deprecate":"^1.0.2", + "wide-align": "^1.1.3", + "wrap-ansi": "^7.0.0", + "wrappy": "^1.0.2", + "y18n": "^5.0.5", + "yallist": "^3.1.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.5" + } + } \ No newline at end of file From 4b32d7c30a837c14e94a6315f1fab34c82e03082 Mon Sep 17 00:00:00 2001 From: Brenden Harrell Date: Wed, 19 May 2021 13:28:46 -0500 Subject: [PATCH 3/6] Add node_modules to .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6bc662642..700abaf2e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,4 @@ Projects/Superalgos/Icons/Thumbs.db !create-shortcut-windows.bat !uninstall-shortcut-windows.bat *.exe - +node_modules From a337f6f4c07591ee86ce87cbaf9722b88b497bd5 Mon Sep 17 00:00:00 2001 From: Brenden Harrell Date: Wed, 19 May 2021 15:23:17 -0500 Subject: [PATCH 4/6] Tweaks for setup script --- setup.js | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/setup.js b/setup.js index 61618d034..ccca81c45 100644 --- a/setup.js +++ b/setup.js @@ -9,7 +9,7 @@ let nodeModulesDirs = [ path.join( process.cwd(), "Projects", "Superalgos", "TS", "Bot-Modules", "Trading-Bot", "Announcements"), path.join( process.cwd(), "Projects", "Superalgos", "TS", "Bot-Modules", "Trading-Bot", "Low-Frequency-Trading", "APIs"), path.join( process.cwd(), "Projects", "Superalgos", "TS", "Task-Modules"), - path.join( process.cwd(), "Projects", "TensorFlow", "TS", "Bot-Modules") + path.join( process.cwd(), "Projects", "TensorFlow", "TS", "Bot-Modules", "Learning-Bot", "Low-Frequency-Learning") ]; console.log(''); @@ -18,32 +18,37 @@ console.log(''); console.log(nodeModulesDirs); console.log(''); -// Loop through directories and run node ci in a child process shell. + let dir; +let ifError; for (dir in nodeModulesDirs) { - let command = "npm ci"; + // Loop through directories and run node ci in a child process shell. + let command = "echo Results of install at "+ nodeModulesDirs[dir] + " & npm ci"; exec( command, { cwd: nodeModulesDirs[dir] }, - function ( error, stdout, stderr ){ + function ( error, stdout ){ if (error) { - console.log("there was an error: ", error); + console.log(''); + console.log("There was an error installing some dependencies error: "); + console.log(''); + console.log( error ); + ifError = true; return; } - console.log( "Results of install at " + nodeModulesDirs[dir] ); console.log(''); console.log( stdout ); }); -}; -/* - cd %~dp0 - cd .. - cd %%a - cmd /k "npm ci" -)) - -REM cmd /k "cd %~dp0 && cd .." -REM cmd /k "npm ci && cd %~dp0" -REM cmd /k "npm ci" -*/ \ No newline at end of file + + // Print closing message + if (dir == nodeModulesDirs.length) { + if ( ifError = true ) { + console.log(''); + console.log("Installation of node dependencies finished with errors. See error messages above.") + } else { + console.log(''); + console.log("Node dependencies installed successfully!") + } + } +}; \ No newline at end of file From 77c00b8a3cc27b35fcb639441b1060a6a3c0c82b Mon Sep 17 00:00:00 2001 From: Brenden Harrell Date: Wed, 19 May 2021 19:58:47 -0500 Subject: [PATCH 5/6] Finished Initial Setup Script --- setup.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/setup.js b/setup.js index ccca81c45..b5a5eeb49 100644 --- a/setup.js +++ b/setup.js @@ -20,7 +20,6 @@ console.log(''); let dir; -let ifError; for (dir in nodeModulesDirs) { // Loop through directories and run node ci in a child process shell. let command = "echo Results of install at "+ nodeModulesDirs[dir] + " & npm ci"; @@ -34,21 +33,9 @@ for (dir in nodeModulesDirs) { console.log("There was an error installing some dependencies error: "); console.log(''); console.log( error ); - ifError = true; return; } console.log(''); console.log( stdout ); }); - - // Print closing message - if (dir == nodeModulesDirs.length) { - if ( ifError = true ) { - console.log(''); - console.log("Installation of node dependencies finished with errors. See error messages above.") - } else { - console.log(''); - console.log("Node dependencies installed successfully!") - } - } }; \ No newline at end of file From 518c993e397c72749be372f225a738432a348e37 Mon Sep 17 00:00:00 2001 From: Brenden Harrell Date: Wed, 19 May 2021 20:01:33 -0500 Subject: [PATCH 6/6] Type Fix --- setup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.js b/setup.js index b5a5eeb49..e0c0c26d5 100644 --- a/setup.js +++ b/setup.js @@ -21,7 +21,7 @@ console.log(''); let dir; for (dir in nodeModulesDirs) { - // Loop through directories and run node ci in a child process shell. + // Loop through directories and run npm ci in a child process shell. let command = "echo Results of install at "+ nodeModulesDirs[dir] + " & npm ci"; exec( command, {