Adapt scripts to typescript
authorChocobozzz <florian.bigard@gmail.com>
Sat, 10 Jun 2017 20:57:31 +0000 (22:57 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Sat, 10 Jun 2017 20:57:31 +0000 (22:57 +0200)
package.json
scripts/build.sh [new file with mode: 0755]
scripts/build/client/dev.sh [deleted file]
scripts/build/server/prod.sh [new file with mode: 0755]
scripts/dev.sh
scripts/help.sh
scripts/play.sh

index 71cd789ba305871bdfdaa139a954c4117845c1c9..3ee93557263a94779845e29621aff13d1a10b703 100644 (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",
     "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 (executable)
index 0000000..5be6afc
--- /dev/null
@@ -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 (executable)
index 1fd0ad4..0000000
+++ /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 (executable)
index 0000000..811da21
--- /dev/null
@@ -0,0 +1,5 @@
+#!/usr/bin/env sh
+
+rm -rf ./dist
+
+npm run tsc
index 3f5b83f12956002d5845c96e512521947735176d..1cfa638ad772bbb9219a644e94e99cf25b6e8dd0 100755 (executable)
@@ -2,4 +2,4 @@
 
 NODE_ENV=test concurrently -k \
   "npm run watch:client" \
-  "npm start"
+  "tsc && npm start"
index 0f672d5209fa55ccb7c97c0fd90f77b927e678a3..51f55547e8f4976ae03a2f564753b00d81593fa4 100755 (executable)
@@ -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"
index ab812025cda98d52c1251173ed558980e1a03d33..3cfd82679f8b4ac437606db647b44ff43db8ee05 100755 (executable)
@@ -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