aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-06-03 22:34:39 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-06-03 22:34:39 +0200
commitfc76359be11956f8514fc0dda1f66bb1c3397d26 (patch)
tree4d80142778971f1d9e09606e8f8745d56cee8507
parent4a6995be18b15de1834a39c8921a0e4109671bb6 (diff)
downloadPeerTube-fc76359be11956f8514fc0dda1f66bb1c3397d26.tar.gz
PeerTube-fc76359be11956f8514fc0dda1f66bb1c3397d26.tar.zst
PeerTube-fc76359be11956f8514fc0dda1f66bb1c3397d26.zip
Adapt npm scripts
-rw-r--r--client/package.json6
-rw-r--r--package.json15
-rwxr-xr-xscripts/build/client/dev.sh5
-rwxr-xr-xscripts/build/client/sass.sh9
-rwxr-xr-xscripts/build/client/tsc.sh5
-rwxr-xr-xscripts/clean/client/dist.sh (renamed from scripts/watch/client/tsc.sh)3
-rwxr-xr-xscripts/clean/client/sass.sh5
-rwxr-xr-xscripts/clean/client/tsc.sh6
-rwxr-xr-xscripts/dev.sh1
-rwxr-xr-xscripts/help.sh14
-rwxr-xr-xscripts/watch/client/livereload.sh2
-rwxr-xr-xscripts/watch/client/sass.sh7
-rwxr-xr-xscripts/watch/client/webpack.sh5
13 files changed, 22 insertions, 61 deletions
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 @@
13 "url": "git://github.com/Chocobozzz/PeerTube.git" 13 "url": "git://github.com/Chocobozzz/PeerTube.git"
14 }, 14 },
15 "scripts": { 15 "scripts": {
16 "typings": "typings",
17 "postinstall": "typings install", 16 "postinstall": "typings install",
18 "test": "standard && tslint -c ./tslint.json angular/**/*.ts", 17 "test": "standard && tslint -c ./tslint.json src/**/*.ts",
19 "build": "webpack --config config/webpack.dev.js --progress --profile --colors --display-error-details --display-cached", 18 "webpack": "webpack"
20 "watch": "npm run build -- --watch"
21 }, 19 },
22 "license": "GPLv3", 20 "license": "GPLv3",
23 "dependencies": { 21 "dependencies": {
diff --git a/package.json b/package.json
index 1dd8aee1d..5e437b982 100644
--- a/package.json
+++ b/package.json
@@ -17,24 +17,17 @@
17 "url": "git://github.com/Chocobozzz/PeerTube.git" 17 "url": "git://github.com/Chocobozzz/PeerTube.git"
18 }, 18 },
19 "scripts": { 19 "scripts": {
20 "build": "npm run build:client", 20 "build": "npm run build:client:prod",
21 "build:client": "SCRIPTY_PARALLEL=true scripty", 21 "build:client:dev": "scripty",
22 "build:client:sass": "scripty", 22 "build:client:prod": "scripty",
23 "build:client:tsc": "scripty",
24 "clean": "npm run clean:client", 23 "clean": "npm run clean:client",
25 "clean:client": "SCRIPTY_PARALLEL=true scripty", 24 "clean:client": "scripty",
26 "clean:client:sass": "scripty",
27 "clean:client:tsc": "scripty",
28 "clean:server:test": "scripty", 25 "clean:server:test": "scripty",
29 "watch:client": "SCRIPTY_PARALLEL=true scripty", 26 "watch:client": "SCRIPTY_PARALLEL=true scripty",
30 "watch:client:livereload": "scripty",
31 "watch:client:sass": "scripty",
32 "watch:client:tsc": "scripty",
33 "danger:clean:server": "scripty", 27 "danger:clean:server": "scripty",
34 "danger:clean:modules": "scripty", 28 "danger:clean:modules": "scripty",
35 "play": "scripty", 29 "play": "scripty",
36 "dev": "scripty", 30 "dev": "scripty",
37 "livereload": "livereload ./client",
38 "start": "node server", 31 "start": "node server",
39 "test": "scripty", 32 "test": "scripty",
40 "help": "scripty", 33 "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 @@
1#!/usr/bin/env sh
2
3cd client || exit -1
4
5npm 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 @@
1#!/usr/bin/env sh
2
3npm run clean:client:sass
4cd client || exit -1
5
6# Compile index and angular files
7concurrently \
8 "node-sass --include-path node_modules/bootstrap-sass/assets/stylesheets/ stylesheets/application.scss stylesheets/index.css" \
9 "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 @@
1#!/usr/bin/env sh
2
3cd client || exit -1
4node systemjs.bundle.js
5npm run tsc
diff --git a/scripts/watch/client/tsc.sh b/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 @@
1#!/usr/bin/env sh 1#!/usr/bin/env sh
2 2
3cd client || exit -1 3cd client || exit -1
4 4rm -rf dist/
5npm run tsc:w
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 @@
1#!/usr/bin/env sh
2
3cd client || exit -1
4rm -f stylesheets/index.css
5find 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 @@
1#!/usr/bin/env sh
2
3cd client || exit -1
4find app -regextype posix-egrep -regex ".*\.(js|map)$" -exec rm -f {} \;
5rm -rf ./bundles
6rm -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 @@
1#!/usr/bin/env sh 1#!/usr/bin/env sh
2 2
3npm run build
4NODE_ENV=test concurrently \ 3NODE_ENV=test concurrently \
5 "npm run watch:client" \ 4 "npm run watch:client" \
6 "npm start" 5 "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 @@
2 2
3printf "############# PeerTube help #############\n\n" 3printf "############# PeerTube help #############\n\n"
4printf "npm run ...\n" 4printf "npm run ...\n"
5printf " build -> Build the application\n" 5printf " build -> Build the application for production (alias of build:client:prod)\n"
6printf " build:client -> Build the client (css, js files)\n" 6printf " build:client:dev -> Build the client for development\n"
7printf " build:client:sass -> Build the sass files\n" 7printf " build:client:prod -> Build the client for production\n"
8printf " build:client:tsc -> Build the javascript files\n"
9printf " clean -> Clean the application\n" 8printf " clean -> Clean the application\n"
10printf " clean:client -> Clean the client (css, js files)\n" 9printf " clean:client -> Clean the client build files (dist directory)\n"
11printf " clean:client:sass -> Clean the sass build files\n"
12printf " clean:client:tsc -> Clean the javascript files\n"
13printf " clean:server:test -> Clean certificates, logs, uploads and database of the test instances\n" 10printf " clean:server:test -> Clean certificates, logs, uploads and database of the test instances\n"
14printf " watch:client -> Watch the client files\n" 11printf " watch:client -> Watch the client files\n"
15printf " watch:client:sass -> Watch the sass client files\n"
16printf " watch:client:tsc -> Watch the typescript files\n"
17printf " danger:clean:server -> /!\ Clean certificates, logs, uploads and database\n" 12printf " danger:clean:server -> /!\ Clean certificates, logs, uploads and database\n"
18printf " danger:clean:modules -> /!\ Clean node and typescript modules\n" 13printf " danger:clean:modules -> /!\ Clean node and typescript modules\n"
19printf " play -> Run 3 fresh nodes so that you can test the communication between them\n" 14printf " play -> Run 3 fresh nodes so that you can test the communication between them\n"
20printf " dev -> Watch, run the livereload and run the server so that you can develop the application\n" 15printf " dev -> Watch, run the livereload and run the server so that you can develop the application\n"
21printf " livereload -> Run the livereload on the client\n"
22printf " start -> Run the server\n" 16printf " start -> Run the server\n"
23printf " test -> Run the tests\n" 17printf " test -> Run the tests\n"
24printf " help -> Print this help\n" 18printf " 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 @@
1#!/usr/bin/env sh 1#!/usr/bin/env sh
2 2
3livereload client/app -e scss 3livereload 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 @@
1#!/usr/bin/env sh
2
3cd client || exit -1
4
5concurrently \
6 "node-sass -w --include-path node_modules/bootstrap-sass/assets/stylesheets/ stylesheets/application.scss stylesheets/index.css" \
7 "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 @@
1#!/usr/bin/env sh
2
3cd client || exit -1
4
5npm run webpack -- --config config/webpack.dev.js --progress --profile --colors --display-error-details --display-cached --watch