From fc76359be11956f8514fc0dda1f66bb1c3397d26 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 3 Jun 2016 22:34:39 +0200 Subject: Adapt npm scripts --- scripts/build/client/dev.sh | 5 +++++ scripts/build/client/sass.sh | 9 --------- scripts/build/client/tsc.sh | 5 ----- scripts/clean/client/dist.sh | 4 ++++ 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/tsc.sh | 5 ----- scripts/watch/client/webpack.sh | 5 +++++ 12 files changed, 19 insertions(+), 49 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 create mode 100755 scripts/clean/client/dist.sh delete mode 100755 scripts/clean/client/sass.sh delete mode 100755 scripts/clean/client/tsc.sh delete mode 100755 scripts/watch/client/sass.sh delete mode 100755 scripts/watch/client/tsc.sh create mode 100755 scripts/watch/client/webpack.sh (limited to 'scripts') 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/clean/client/dist.sh b/scripts/clean/client/dist.sh new file mode 100755 index 000000000..2cbbf90dc --- /dev/null +++ b/scripts/clean/client/dist.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +cd client || exit -1 +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/tsc.sh b/scripts/watch/client/tsc.sh deleted file mode 100755 index f00656d2e..000000000 --- a/scripts/watch/client/tsc.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env sh - -cd client || exit -1 - -npm run tsc:w 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 -- cgit v1.2.3