Use of shelljs to run scripts

This commit is contained in:
sanex
2020-10-06 10:24:07 +03:00
parent 774e903918
commit d79a1aeb6d
39 changed files with 36223 additions and 80 deletions
+18383 -1
View File
File diff suppressed because one or more lines are too long
+17702 -1
View File
File diff suppressed because one or more lines are too long
+19 -18
View File
@@ -80,6 +80,7 @@
"pjson": "1.0.9",
"pre-commit": "1.2.2",
"rimraf": "3.0.2",
"shelljs": "0.8.4",
"sinon": "9.1.0",
"threads": "1.6.3",
"ts-loader": "8.0.4",
@@ -95,24 +96,24 @@
},
"homepage": "https://obfuscator.io/",
"scripts": {
"start": "scripts/start",
"webpack:prod": "scripts/webpack-prod",
"webpack:dev": "scripts/webpack-dev",
"build": "scripts/build",
"watch": "scripts/watch",
"test:dev": "scripts/test-dev",
"test:devCompilePerformance": "scripts/test-dev-compile-performance",
"test:devRuntimePerformance": "scripts/test-dev-runtime-performance",
"test:full": "scripts/test-full",
"test:coveralls": "scripts/test-coveralls",
"test:mocha": "scripts/test-mocha",
"test:mocha-coverage": "scripts/test-mocha-coverage",
"test:mocha-memory-performance": "scripts/test-mocha-memory-performance",
"test": "scripts/test",
"eslint": "scripts/eslint",
"travis": "scripts/travis",
"git:addFiles": "scripts/git-add-files",
"postinstall": "opencollective || exit 0"
"start": "scripts/start.js",
"webpack:prod": "scripts/webpack-prod.js",
"webpack:dev": "scripts/webpack-dev.js",
"build": "scripts/build.js",
"watch": "scripts/watch.js",
"test:dev": "scripts/test-dev.js",
"test:devCompilePerformance": "scripts/test-dev-compile-performance.js",
"test:devRuntimePerformance": "scripts/test-dev-runtime-performance.js",
"test:full": "scripts/test-full.js",
"test:coveralls": "scripts/test-coveralls.js",
"test:mocha": "scripts/test-mocha.js",
"test:mocha-coverage": "scripts/test-mocha-coverage.js",
"test:mocha-memory-performance": "scripts/test-mocha-memory-performance.js",
"test": "scripts/test.js",
"eslint": "scripts/eslint.js",
"travis": "scripts/travis.js",
"git:addFiles": "scripts/git-add-files.js",
"postinstall": "scripts/postinstall.js"
},
"pre-commit": [
"build",
-5
View File
@@ -1,5 +0,0 @@
#!/bin/bash
yarn run webpack:prod &&
yarn run eslint &&
yarn test
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell
.exec('yarn run webpack:prod')
.exec('yarn run eslint')
.exec('yarn test');
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
$(yarn bin)/eslint src/**/*.ts
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('$(yarn bin)/eslint src/**/*.ts --color');
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
git add .
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('git add .');
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('opencollective') || shell.exit(0);
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
yarn run watch
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('yarn run watch');
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
yarn run test:full
-4
View File
@@ -1,4 +0,0 @@
#!/bin/bash
yarn run test:mocha &&
$(yarn bin)/nyc report --reporter=text-lcov | $(yarn bin)/coveralls
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell
.exec('yarn run test:mocha')
.exec('$(yarn bin)/nyc report --reporter=text-lcov | $(yarn bin)/coveralls');
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
$(yarn bin)/ts-node --type-check test/dev/dev.ts
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
$(yarn bin)/ts-node test/dev/dev-compile-performance.ts
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('$(yarn bin)/ts-node test/dev/dev-compile-performance.ts');
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
$(yarn bin)/ts-node test/dev/dev-runtime-performance.ts
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('$(yarn bin)/ts-node test/dev/dev-runtime-performance.ts');
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('$(yarn bin)/ts-node --type-check test/dev/dev.ts');
-5
View File
@@ -1,5 +0,0 @@
#!/bin/bash
yarn run test:dev &&
yarn run test:mocha-coverage &&
yarn run test:mocha-memory-performance
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell
.exec('yarn run test:dev')
.exec('yarn run test:mocha-coverage')
.exec('test:mocha-memory-performance');
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
$(yarn bin)/mocha --require ts-node/register --require source-map-support/register test/index.spec.ts --exit
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
$(yarn bin)/nyc --reporter text-summary yarn run test:mocha
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('$(yarn bin)/nyc --reporter text-summary yarn run test:mocha');
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
NODE_OPTIONS=--max-old-space-size=220 $(yarn bin)/mocha --require ts-node/register test/performance-tests/JavaScriptObfuscatorMemory.spec.ts
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('NODE_OPTIONS=--max-old-space-size=220 $(yarn bin)/mocha --require ts-node/register test/performance-tests/JavaScriptObfuscatorMemory.spec.ts');
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('$(yarn bin)/mocha --require ts-node/register --require source-map-support/register test/index.spec.ts --colors --exit');
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('yarn run test:full');
-4
View File
@@ -1,4 +0,0 @@
#!/bin/bash
yarn run eslint &&
yarn test
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell
.exec('yarn run eslint')
.exec('yarn test');
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
$(yarn bin)/webpack --config webpack/webpack.node.config.js --mode development --watch
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('$(yarn bin)/webpack --config webpack/webpack.node.config.js --mode development --watch --colors true');
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
$(yarn bin)/webpack --config webpack/webpack.node.config.js --mode production
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('$(yarn bin)/webpack --config webpack/webpack.node.config.js --mode production --colors true');
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
$(yarn bin)/webpack --config webpack/webpack.node.config.js --config webpack/webpack.browser.config.js --mode production
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env node
const shell = require('shelljs');
shell.exec('$(yarn bin)/webpack --config webpack/webpack.node.config.js --config webpack/webpack.browser.config.js --mode production --colors true');
+19 -3
View File
@@ -2550,7 +2550,7 @@ glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0:
dependencies:
is-glob "^4.0.1"
glob@7.1.6, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
glob@7.1.6, glob@^7.0.0, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
version "7.1.6"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
@@ -2862,7 +2862,7 @@ ini@^1.3.4, ini@^1.3.5:
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
interpret@^1.4.0:
interpret@^1.0.0, interpret@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e"
integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==
@@ -4483,6 +4483,13 @@ readdirp@~3.4.0:
dependencies:
picomatch "^2.2.1"
rechoir@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=
dependencies:
resolve "^1.1.6"
reflect-metadata@0.1.13:
version "0.1.13"
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08"
@@ -4609,7 +4616,7 @@ resolve-url@^0.2.1:
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=
resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.3.2:
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.3.2:
version "1.17.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444"
integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==
@@ -4788,6 +4795,15 @@ shebang-regex@^3.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
shelljs@0.8.4:
version "0.8.4"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
rechoir "^0.6.2"
shellwords@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"