diff --git a/package.json b/package.json index 71cd789ba305871bdfdaa139a954c4117845c1c9..3ee93557263a94779845e29621aff13d1a10b703 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "url": "git://github.com/Chocobozzz/PeerTube.git" }, "scripts": { - "build": "npm run build:client:prod", - "build:client:dev": "scripty", + "build": "scripty", + "build:server:prod": "scripty", "build:client:prod": "scripty", "clean": "npm run clean:client", "clean:client": "scripty", @@ -30,12 +30,13 @@ "reset-password": "scripty", "play": "scripty", "dev": "scripty", - "start": "node server", + "start": "node dist/server", "check": "scripty", "upgrade": "scripty", "update-host": "scripty", "test": "scripty", "help": "scripty", + "tsc": "tsc", "postinstall": "cd client && yarn install" }, "dependencies": { diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..5be6afcdf2465e38e5091d416dd878c062706d02 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +NODE_ENV=test concurrently \ + "npm run build:client:prod" \ + "npm run build:server:prod" diff --git a/scripts/build/client/dev.sh b/scripts/build/client/dev.sh deleted file mode 100755 index 1fd0ad41611d5bd686daba6f9b5c9e0e95bb2251..0000000000000000000000000000000000000000 --- a/scripts/build/client/dev.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env sh - -cd client || exit -1 - -rm -rf ./compiled - -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 0000000000000000000000000000000000000000..811da2154425093bf666f970e18ba90e33288eda --- /dev/null +++ b/scripts/build/server/prod.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +rm -rf ./dist + +npm run tsc diff --git a/scripts/dev.sh b/scripts/dev.sh index 3f5b83f12956002d5845c96e512521947735176d..1cfa638ad772bbb9219a644e94e99cf25b6e8dd0 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -2,4 +2,4 @@ NODE_ENV=test concurrently -k \ "npm run watch:client" \ - "npm start" + "tsc && npm start" diff --git a/scripts/help.sh b/scripts/help.sh index 0f672d5209fa55ccb7c97c0fd90f77b927e678a3..51f55547e8f4976ae03a2f564753b00d81593fa4 100755 --- a/scripts/help.sh +++ b/scripts/help.sh @@ -3,7 +3,7 @@ printf "############# PeerTube help #############\n\n" printf "npm run ...\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:server:prod -> Build the server for production\n" printf " build:client:prod -> Build the client for production\n" printf " clean -> Clean the application\n" printf " clean:client -> Clean the client build files (dist directory)\n" diff --git a/scripts/play.sh b/scripts/play.sh index ab812025cda98d52c1251173ed558980e1a03d33..3cfd82679f8b4ac437606db647b44ff43db8ee05 100755 --- a/scripts/play.sh +++ b/scripts/play.sh @@ -8,6 +8,6 @@ fi max=${1:-3} for i in $(seq 1 $max); do - NODE_ENV=test NODE_APP_INSTANCE=$i node server.js & + NODE_ENV=test NODE_APP_INSTANCE=$i node dist/server.js & sleep 1 done