Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Adapt npm scripts

Chocobozzzfc76359be119
diff --git a/client/package.json b/client/package.json
index bfdfe55749..670697b0ff 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 1dd8aee1d1..5e437b9829 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 0000000000..b75b72f12a
--- /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 d8dfedca36..0000000000
--- 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 cca1643d4b..0000000000
--- 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 f00656d2ec..2cbbf90dc4 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 04d239ffc6..0000000000
--- 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 b17888640b..0000000000
--- 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 ddb5b8d33c..e792c14487 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 3ed9f15cc7..a2c8e4df08 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 5f095265ef..11d27754fd 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 f7a8c8a2b9..0000000000
--- 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 0000000000..3e45225479
--- /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