aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-10 22:57:31 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-10 22:57:31 +0200
commit75fb0c0b2efe7fb952d45d2bf111e9594f7d5b42 (patch)
treeec2f38883fd53e7e2e2d451b9275ca984631c6c1
parent69818c9394366b954b6ba3bd697bd9d2b09f2a16 (diff)
downloadPeerTube-75fb0c0b2efe7fb952d45d2bf111e9594f7d5b42.tar.gz
PeerTube-75fb0c0b2efe7fb952d45d2bf111e9594f7d5b42.tar.zst
PeerTube-75fb0c0b2efe7fb952d45d2bf111e9594f7d5b42.zip
Adapt scripts to typescript
-rw-r--r--package.json7
-rwxr-xr-xscripts/build.sh5
-rwxr-xr-xscripts/build/client/dev.sh7
-rwxr-xr-xscripts/build/server/prod.sh5
-rwxr-xr-xscripts/dev.sh2
-rwxr-xr-xscripts/help.sh2
-rwxr-xr-xscripts/play.sh2
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
3NODE_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
3cd client || exit -1
4
5rm -rf ./compiled
6
7npm 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
3rm -rf ./dist
4
5npm 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
3NODE_ENV=test concurrently -k \ 3NODE_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 @@
3printf "############# PeerTube help #############\n\n" 3printf "############# PeerTube help #############\n\n"
4printf "npm run ...\n" 4printf "npm run ...\n"
5printf " build -> Build the application for production (alias of build:client:prod)\n" 5printf " build -> Build the application for production (alias of build:client:prod)\n"
6printf " build:client:dev -> Build the client for development\n" 6printf " build:server:prod -> Build the server for production\n"
7printf " build:client:prod -> Build the client for production\n" 7printf " build:client:prod -> Build the client for production\n"
8printf " clean -> Clean the application\n" 8printf " clean -> Clean the application\n"
9printf " clean:client -> Clean the client build files (dist directory)\n" 9printf " 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
8max=${1:-3} 8max=${1:-3}
9 9
10for i in $(seq 1 $max); do 10for 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
13done 13done