From fc76359be11956f8514fc0dda1f66bb1c3397d26 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 3 Jun 2016 22:34:39 +0200 Subject: [PATCH] Adapt npm scripts --- client/package.json | 6 ++---- package.json | 15 ++++----------- scripts/build/client/dev.sh | 5 +++++ scripts/build/client/sass.sh | 9 --------- scripts/build/client/tsc.sh | 5 ----- .../{watch/client/tsc.sh => clean/client/dist.sh} | 3 +-- scripts/clean/client/sass.sh | 5 ----- scripts/clean/client/tsc.sh | 6 ------ scripts/dev.sh | 1 - scripts/help.sh | 14 ++++---------- scripts/watch/client/livereload.sh | 2 +- scripts/watch/client/sass.sh | 7 ------- scripts/watch/client/webpack.sh | 5 +++++ 13 files changed, 22 insertions(+), 61 deletions(-) create mode 100755 scripts/build/client/dev.sh delete mode 100755 scripts/build/client/sass.sh delete mode 100755 scripts/build/client/tsc.sh rename scripts/{watch/client/tsc.sh => clean/client/dist.sh} (72%) delete mode 100755 scripts/clean/client/sass.sh delete mode 100755 scripts/clean/client/tsc.sh delete mode 100755 scripts/watch/client/sass.sh create mode 100755 scripts/watch/client/webpack.sh diff --git a/client/package.json b/client/package.json index bfdfe5574..670697b0f 100644 --- a/client/package.json +++ b/client/package.json @@ -13,11 +13,9 @@ "url": "git://github.com/Chocobozzz/PeerTube.git" }, "scripts": { - "typings": "typings", "postinstall": "typings install", - "test": "standard && tslint -c ./tslint.json angular/**/*.ts", - "build": "webpack --config config/webpack.dev.js --progress --profile --colors --display-error-details --display-cached", - "watch": "npm run build -- --watch" + "test": "standard && tslint -c ./tslint.json src/**/*.ts", + "webpack": "webpack" }, "license": "GPLv3", "dependencies": { diff --git a/package.json b/package.json index 1dd8aee1d..5e437b982 100644 --- a/package.json +++ b/package.json @@ -17,24 +17,17 @@ "url": "git://github.com/Chocobozzz/PeerTube.git" }, "scripts": { - "build": "npm run build:client", - "build:client": "SCRIPTY_PARALLEL=true scripty", - "build:client:sass": "scripty", - "build:client:tsc": "scripty", + "build": "npm run build:client:prod", + "build:client:dev": "scripty", + "build:client:prod": "scripty", "clean": "npm run clean:client", - "clean:client": "SCRIPTY_PARALLEL=true scripty", - "clean:client:sass": "scripty", - "clean:client:tsc": "scripty", + "clean:client": "scripty", "clean:server:test": "scripty", "watch:client": "SCRIPTY_PARALLEL=true scripty", - "watch:client:livereload": "scripty", - "watch:client:sass": "scripty", - "watch:client:tsc": "scripty", "danger:clean:server": "scripty", "danger:clean:modules": "scripty", "play": "scripty", "dev": "scripty", - "livereload": "livereload ./client", "start": "node server", "test": "scripty", "help": "scripty", diff --git a/scripts/build/client/dev.sh b/scripts/build/client/dev.sh new file mode 100755 index 000000000..b75b72f12 --- /dev/null +++ b/scripts/build/client/dev.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +cd client || exit -1 + +npm run webpack -- --config config/webpack.dev.js --progress --profile --colors --display-error-details --display-cached diff --git a/scripts/build/client/sass.sh b/scripts/build/client/sass.sh deleted file mode 100755 index d8dfedca3..000000000 --- a/scripts/build/client/sass.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env sh - -npm run clean:client:sass -cd client || exit -1 - -# Compile index and angular files -concurrently \ - "node-sass --include-path node_modules/bootstrap-sass/assets/stylesheets/ stylesheets/application.scss stylesheets/index.css" \ - "node-sass app/ --output app/" diff --git a/scripts/build/client/tsc.sh b/scripts/build/client/tsc.sh deleted file mode 100755 index cca1643d4..000000000 --- a/scripts/build/client/tsc.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env sh - -cd client || exit -1 -node systemjs.bundle.js -npm run tsc diff --git a/scripts/watch/client/tsc.sh b/scripts/clean/client/dist.sh similarity index 72% rename from scripts/watch/client/tsc.sh rename to scripts/clean/client/dist.sh index f00656d2e..2cbbf90dc 100755 --- a/scripts/watch/client/tsc.sh +++ b/scripts/clean/client/dist.sh @@ -1,5 +1,4 @@ #!/usr/bin/env sh cd client || exit -1 - -npm run tsc:w +rm -rf dist/ diff --git a/scripts/clean/client/sass.sh b/scripts/clean/client/sass.sh deleted file mode 100755 index 04d239ffc..000000000 --- a/scripts/clean/client/sass.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env sh - -cd client || exit -1 -rm -f stylesheets/index.css -find app -regextype posix-egrep -regex ".*\.(css)$" -exec rm -f {} \; diff --git a/scripts/clean/client/tsc.sh b/scripts/clean/client/tsc.sh deleted file mode 100755 index b17888640..000000000 --- a/scripts/clean/client/tsc.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env sh - -cd client || exit -1 -find app -regextype posix-egrep -regex ".*\.(js|map)$" -exec rm -f {} \; -rm -rf ./bundles -rm -f main.js main.js.map diff --git a/scripts/dev.sh b/scripts/dev.sh index ddb5b8d33..e792c1448 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -1,6 +1,5 @@ #!/usr/bin/env sh -npm run build NODE_ENV=test concurrently \ "npm run watch:client" \ "npm start" diff --git a/scripts/help.sh b/scripts/help.sh index 3ed9f15cc..a2c8e4df0 100755 --- a/scripts/help.sh +++ b/scripts/help.sh @@ -2,23 +2,17 @@ printf "############# PeerTube help #############\n\n" printf "npm run ...\n" -printf " build -> Build the application\n" -printf " build:client -> Build the client (css, js files)\n" -printf " build:client:sass -> Build the sass files\n" -printf " build:client:tsc -> Build the javascript files\n" +printf " build -> Build the application for production (alias of build:client:prod)\n" +printf " build:client:dev -> Build the client for development\n" +printf " build:client:prod -> Build the client for production\n" printf " clean -> Clean the application\n" -printf " clean:client -> Clean the client (css, js files)\n" -printf " clean:client:sass -> Clean the sass build files\n" -printf " clean:client:tsc -> Clean the javascript files\n" +printf " clean:client -> Clean the client build files (dist directory)\n" printf " clean:server:test -> Clean certificates, logs, uploads and database of the test instances\n" printf " watch:client -> Watch the client files\n" -printf " watch:client:sass -> Watch the sass client files\n" -printf " watch:client:tsc -> Watch the typescript files\n" printf " danger:clean:server -> /!\ Clean certificates, logs, uploads and database\n" printf " danger:clean:modules -> /!\ Clean node and typescript modules\n" printf " play -> Run 3 fresh nodes so that you can test the communication between them\n" printf " dev -> Watch, run the livereload and run the server so that you can develop the application\n" -printf " livereload -> Run the livereload on the client\n" printf " start -> Run the server\n" printf " test -> Run the tests\n" printf " help -> Print this help\n" diff --git a/scripts/watch/client/livereload.sh b/scripts/watch/client/livereload.sh index 5f095265e..11d27754f 100755 --- a/scripts/watch/client/livereload.sh +++ b/scripts/watch/client/livereload.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh -livereload client/app -e scss +livereload client/dist diff --git a/scripts/watch/client/sass.sh b/scripts/watch/client/sass.sh deleted file mode 100755 index f7a8c8a2b..000000000 --- a/scripts/watch/client/sass.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env sh - -cd client || exit -1 - -concurrently \ - "node-sass -w --include-path node_modules/bootstrap-sass/assets/stylesheets/ stylesheets/application.scss stylesheets/index.css" \ - "node-sass -w app/ --output app/" diff --git a/scripts/watch/client/webpack.sh b/scripts/watch/client/webpack.sh new file mode 100755 index 000000000..3e4522547 --- /dev/null +++ b/scripts/watch/client/webpack.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +cd client || exit -1 + +npm run webpack -- --config config/webpack.dev.js --progress --profile --colors --display-error-details --display-cached --watch