Adapt scripts to typescript

This commit is contained in:
Chocobozzz 2017-06-10 22:57:31 +02:00
parent 69818c9394
commit 75fb0c0b2e
7 changed files with 17 additions and 13 deletions

View File

@ -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": {

5
scripts/build.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env sh
NODE_ENV=test concurrently \
"npm run build:client:prod" \
"npm run build:server:prod"

View File

@ -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

5
scripts/build/server/prod.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env sh
rm -rf ./dist
npm run tsc

View File

@ -2,4 +2,4 @@
NODE_ENV=test concurrently -k \
"npm run watch:client" \
"npm start"
"tsc && npm start"

View File

@ -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"

View File

@ -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