diff options
-rw-r--r-- | package.json | 7 | ||||
-rwxr-xr-x | scripts/build.sh | 5 | ||||
-rwxr-xr-x | scripts/build/client/dev.sh | 7 | ||||
-rwxr-xr-x | scripts/build/server/prod.sh | 5 | ||||
-rwxr-xr-x | scripts/dev.sh | 2 | ||||
-rwxr-xr-x | scripts/help.sh | 2 | ||||
-rwxr-xr-x | scripts/play.sh | 2 |
7 files changed, 17 insertions, 13 deletions
diff --git a/package.json b/package.json index 71cd789ba..3ee935572 100644 --- a/package.json +++ b/package.json | |||
@@ -17,8 +17,8 @@ | |||
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:prod", | 20 | "build": "scripty", |
21 | "build:client:dev": "scripty", | 21 | "build:server:prod": "scripty", |
22 | "build:client:prod": "scripty", | 22 | "build:client:prod": "scripty", |
23 | "clean": "npm run clean:client", | 23 | "clean": "npm run clean:client", |
24 | "clean:client": "scripty", | 24 | "clean:client": "scripty", |
@@ -30,12 +30,13 @@ | |||
30 | "reset-password": "scripty", | 30 | "reset-password": "scripty", |
31 | "play": "scripty", | 31 | "play": "scripty", |
32 | "dev": "scripty", | 32 | "dev": "scripty", |
33 | "start": "node server", | 33 | "start": "node dist/server", |
34 | "check": "scripty", | 34 | "check": "scripty", |
35 | "upgrade": "scripty", | 35 | "upgrade": "scripty", |
36 | "update-host": "scripty", | 36 | "update-host": "scripty", |
37 | "test": "scripty", | 37 | "test": "scripty", |
38 | "help": "scripty", | 38 | "help": "scripty", |
39 | "tsc": "tsc", | ||
39 | "postinstall": "cd client && yarn install" | 40 | "postinstall": "cd client && yarn install" |
40 | }, | 41 | }, |
41 | "dependencies": { | 42 | "dependencies": { |
diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 000000000..5be6afcdf --- /dev/null +++ b/scripts/build.sh | |||
@@ -0,0 +1,5 @@ | |||
1 | #!/usr/bin/env sh | ||
2 | |||
3 | NODE_ENV=test concurrently \ | ||
4 | "npm run build:client:prod" \ | ||
5 | "npm run build:server:prod" | ||
diff --git a/scripts/build/client/dev.sh b/scripts/build/client/dev.sh deleted file mode 100755 index 1fd0ad416..000000000 --- a/scripts/build/client/dev.sh +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #!/usr/bin/env sh | ||
2 | |||
3 | cd client || exit -1 | ||
4 | |||
5 | rm -rf ./compiled | ||
6 | |||
7 | npm run webpack -- --config config/webpack.dev.js --progress --profile --colors --display-error-details --display-cached | ||
diff --git a/scripts/build/server/prod.sh b/scripts/build/server/prod.sh new file mode 100755 index 000000000..811da2154 --- /dev/null +++ b/scripts/build/server/prod.sh | |||
@@ -0,0 +1,5 @@ | |||
1 | #!/usr/bin/env sh | ||
2 | |||
3 | rm -rf ./dist | ||
4 | |||
5 | npm run tsc | ||
diff --git a/scripts/dev.sh b/scripts/dev.sh index 3f5b83f12..1cfa638ad 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh | |||
@@ -2,4 +2,4 @@ | |||
2 | 2 | ||
3 | NODE_ENV=test concurrently -k \ | 3 | NODE_ENV=test concurrently -k \ |
4 | "npm run watch:client" \ | 4 | "npm run watch:client" \ |
5 | "npm start" | 5 | "tsc && npm start" |
diff --git a/scripts/help.sh b/scripts/help.sh index 0f672d520..51f55547e 100755 --- a/scripts/help.sh +++ b/scripts/help.sh | |||
@@ -3,7 +3,7 @@ | |||
3 | printf "############# PeerTube help #############\n\n" | 3 | printf "############# PeerTube help #############\n\n" |
4 | printf "npm run ...\n" | 4 | printf "npm run ...\n" |
5 | printf " build -> Build the application for production (alias of build:client:prod)\n" | 5 | printf " build -> Build the application for production (alias of build:client:prod)\n" |
6 | printf " build:client:dev -> Build the client for development\n" | 6 | printf " build:server:prod -> Build the server for production\n" |
7 | printf " build:client:prod -> Build the client for production\n" | 7 | printf " build:client:prod -> Build the client for production\n" |
8 | printf " clean -> Clean the application\n" | 8 | printf " clean -> Clean the application\n" |
9 | printf " clean:client -> Clean the client build files (dist directory)\n" | 9 | printf " clean:client -> Clean the client build files (dist directory)\n" |
diff --git a/scripts/play.sh b/scripts/play.sh index ab812025c..3cfd82679 100755 --- a/scripts/play.sh +++ b/scripts/play.sh | |||
@@ -8,6 +8,6 @@ fi | |||
8 | max=${1:-3} | 8 | max=${1:-3} |
9 | 9 | ||
10 | for i in $(seq 1 $max); do | 10 | for i in $(seq 1 $max); do |
11 | NODE_ENV=test NODE_APP_INSTANCE=$i node server.js & | 11 | NODE_ENV=test NODE_APP_INSTANCE=$i node dist/server.js & |
12 | sleep 1 | 12 | sleep 1 |
13 | done | 13 | done |