From a24a7cd5d1abc6ac01448a700762226638030db6 Mon Sep 17 00:00:00 2001 From: sanex3339 Date: Mon, 27 Jun 2016 15:37:10 +0300 Subject: [PATCH] moved all scripts from package.json to scripts/ folder --- package.json | 28 ++++++++++++++-------------- scripts/build | 5 +++++ scripts/start | 3 +++ scripts/test | 4 ++++ scripts/test-compile | 4 ++++ scripts/test-coveralls | 6 ++++++ scripts/test-dev | 3 +++ scripts/test-full | 5 +++++ scripts/test-mocha | 5 +++++ scripts/test-remove-tmp-dir | 3 +++ scripts/travis | 4 ++++ scripts/tslint | 3 +++ scripts/typings | 3 +++ scripts/watch | 3 +++ scripts/webpack | 3 +++ webpack.config.js | 2 +- 16 files changed, 69 insertions(+), 15 deletions(-) create mode 100755 scripts/build create mode 100755 scripts/start create mode 100755 scripts/test create mode 100755 scripts/test-compile create mode 100755 scripts/test-coveralls create mode 100755 scripts/test-dev create mode 100755 scripts/test-full create mode 100755 scripts/test-mocha create mode 100755 scripts/test-remove-tmp-dir create mode 100755 scripts/travis create mode 100755 scripts/tslint create mode 100755 scripts/typings create mode 100755 scripts/watch create mode 100755 scripts/webpack diff --git a/package.json b/package.json index 02515454..51ead1a3 100644 --- a/package.json +++ b/package.json @@ -47,20 +47,20 @@ "url": "git+https://github.com/sanex3339/javascript-obfuscator.git" }, "scripts": { - "start": "npm run watch", - "webpack": "node_modules/.bin/webpack", - "build": "npm run webpack && npm run tslint && npm test", - "watch": "node_modules/.bin/webpack --watch", - "test:compile": "node_modules/.bin/tsc -p tsconfig-test.json", - "test:dev": "node test/dev/test.js", - "test:full": "npm run test:compile && node_modules/.bin/istanbul cover node_modules/.bin/_mocha -- test-tmp/test/**/**.spec.js && npm run test:removeTestTmpDir", - "test:coveralls": "npm run test:compile && node_modules/.bin/istanbul cover node_modules/.bin/_mocha -- test-tmp/test/**/**.spec.js --report lcovonly && cat ./coverage/lcov.info | coveralls && npm run test:removeTestTmpDir", - "test:mocha": "npm run test:compile && node_modules/.bin/mocha test-tmp/test/**/**.spec.js && npm run test:removeTestTmpDir", - "test:removeTestTmpDir": "rm -rf test-tmp", - "test": "npm run test:dev && npm run test:full", - "tslint": "tslint src/**/*.ts", - "travis": "npm run tslint && npm test", - "typings": "node_modules/.bin/typings install" + "start": "scripts/start", + "webpack": "scripts/webpack", + "build": "scripts/build", + "watch": "scripts/watch", + "test:compile": "scripts/test-compile", + "test:dev": "scripts/test-dev", + "test:full": "scripts/test-full", + "test:coveralls": "scripts/test-coveralls", + "test:mocha": "scripts/test-mocha", + "test:removeTmpDir": "scripts/test-remove-tmp-dir", + "test": "scripts/test", + "tslint": "scripts/tslint", + "travis": "scripts/travis", + "typings": "srcipts/typings" }, "author": { "name": "Timofey Kachalov" diff --git a/scripts/build b/scripts/build new file mode 100755 index 00000000..a3dccd46 --- /dev/null +++ b/scripts/build @@ -0,0 +1,5 @@ +#!/bin/bash + +npm run webpack +npm run tslint +npm test \ No newline at end of file diff --git a/scripts/start b/scripts/start new file mode 100755 index 00000000..bb5862c8 --- /dev/null +++ b/scripts/start @@ -0,0 +1,3 @@ +#!/bin/bash + +npm run watch \ No newline at end of file diff --git a/scripts/test b/scripts/test new file mode 100755 index 00000000..6d85aa31 --- /dev/null +++ b/scripts/test @@ -0,0 +1,4 @@ +#!/bin/bash + +npm run test:dev +npm run test:full \ No newline at end of file diff --git a/scripts/test-compile b/scripts/test-compile new file mode 100755 index 00000000..8dc2aae9 --- /dev/null +++ b/scripts/test-compile @@ -0,0 +1,4 @@ +#!/bin/bash + +$(npm bin)/tsc -p tsconfig-test.json +$(npm bin)/babel test-tmp --out-dir test-tmp --source-maps \ No newline at end of file diff --git a/scripts/test-coveralls b/scripts/test-coveralls new file mode 100755 index 00000000..5df8e26f --- /dev/null +++ b/scripts/test-coveralls @@ -0,0 +1,6 @@ +#!/bin/bash + +npm run test:compile +$(npm bin)/istanbul cover $(npm bin)/_mocha -- test-tmp/test/**/**.spec.js --report lcovonly +cat ./coverage/lcov.info | $(npm bin)/coveralls +npm run test:removeTmpDir \ No newline at end of file diff --git a/scripts/test-dev b/scripts/test-dev new file mode 100755 index 00000000..26921881 --- /dev/null +++ b/scripts/test-dev @@ -0,0 +1,3 @@ +#!/bin/bash + +node test/dev/test.js \ No newline at end of file diff --git a/scripts/test-full b/scripts/test-full new file mode 100755 index 00000000..14588854 --- /dev/null +++ b/scripts/test-full @@ -0,0 +1,5 @@ +#!/bin/bash + +npm run test:compile +$(npm bin)/istanbul cover $(npm bin)/_mocha -- test-tmp/test/**/**.spec.js +npm run test:removeTmpDir \ No newline at end of file diff --git a/scripts/test-mocha b/scripts/test-mocha new file mode 100755 index 00000000..d121c548 --- /dev/null +++ b/scripts/test-mocha @@ -0,0 +1,5 @@ +#!/bin/bash + +npm run test:compile +$(npm bin)/mocha test-tmp/test/**/**.spec.js +npm run test:removeTmpDir \ No newline at end of file diff --git a/scripts/test-remove-tmp-dir b/scripts/test-remove-tmp-dir new file mode 100755 index 00000000..efb291a9 --- /dev/null +++ b/scripts/test-remove-tmp-dir @@ -0,0 +1,3 @@ +#!/bin/bash + +rm -rf test-tmp \ No newline at end of file diff --git a/scripts/travis b/scripts/travis new file mode 100755 index 00000000..2d4e4775 --- /dev/null +++ b/scripts/travis @@ -0,0 +1,4 @@ +#!/bin/bash + +npm run tslint +npm test \ No newline at end of file diff --git a/scripts/tslint b/scripts/tslint new file mode 100755 index 00000000..3e68208f --- /dev/null +++ b/scripts/tslint @@ -0,0 +1,3 @@ +#!/bin/bash + +$(npm bin)/tslint src/**/*.ts \ No newline at end of file diff --git a/scripts/typings b/scripts/typings new file mode 100755 index 00000000..c8ebddd7 --- /dev/null +++ b/scripts/typings @@ -0,0 +1,3 @@ +#!/bin/bash + +$(npm bin)/typings install \ No newline at end of file diff --git a/scripts/watch b/scripts/watch new file mode 100755 index 00000000..f1b9775c --- /dev/null +++ b/scripts/watch @@ -0,0 +1,3 @@ +#!/bin/bash + +$(npm bin)/webpack --watch \ No newline at end of file diff --git a/scripts/webpack b/scripts/webpack new file mode 100755 index 00000000..640703d8 --- /dev/null +++ b/scripts/webpack @@ -0,0 +1,3 @@ +#!/bin/bash + +$(npm bin)/webpack \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index b99b5d7e..35463a2a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,4 @@ -var fs = require("fs"), +let fs = require("fs"), nodeExternals = require('webpack-node-externals'), webpack = require('webpack');