Reduce dev commands RAM usage
authorChocobozzz <me@florianbigard.com>
Wed, 22 Jan 2020 09:00:38 +0000 (10:00 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 22 Jan 2020 09:18:57 +0000 (10:18 +0100)
package.json
scripts/ci.sh
scripts/dev/client.sh
scripts/dev/server.sh

index 7f704b5a83c8f503d800db72560dd5a946747d0e..0122a54e405e1b886674956ee45e5e157adaa733 100644 (file)
@@ -42,9 +42,9 @@
     "reset-password": "node ./dist/scripts/reset-password.js",
     "play": "scripty",
     "dev": "scripty",
-    "dev:server": "scripty",
+    "dev:server": "sh ./scripts/dev/server.sh",
     "dev:embed": "scripty",
-    "dev:client": "scripty",
+    "dev:client": "sh ./scripts/dev/client.sh",
     "dev:cli": "scripty",
     "start": "node dist/server",
     "start:server": "node dist/server --no-client",
index 6281e1aa496a18c1f683221740271a161a086560..d111b7447e76cfb2ca0cd1c9624a9dd307f3136b 100755 (executable)
@@ -9,7 +9,7 @@ fi
 
 killall -q peertube || true
 
-perl -0777 -i  -pe 's#proxy:(\n\s+)enabled: false\n\s+url: ""#proxy:$1enabled: true$1url: "https://cpy.re:7899"#' config/test.yaml
+perl -0777 -i  -pe 's#proxy:(\n\s+)enabled: false\n\s+url: ""#proxy:$1enabled: true$1url: "http://188.165.225.149:7899"#' config/test.yaml
 
 if [ "$1" = "misc" ]; then
     npm run build -- --light-fr
index cdcf29ef2761f76d5efcbba3d9324e2f55956b94..bcb8b88f607ecc71faa862ea893b56c20fb90dfb 100755 (executable)
@@ -2,13 +2,13 @@
 
 set -eu
 
-clientCommand="cd client && npm run ng -- serve --proxy-config proxy.config.json --hmr --configuration hmr --host 0.0.0.0 --disable-host-check --port 3000"
-serverCommand="npm run build:server && NODE_ENV=test npm start"
+clientCommand="cd client && node node_modules/.bin/ng serve --proxy-config proxy.config.json --hmr --configuration hmr --host 0.0.0.0 --disable-host-check --port 3000"
+serverCommand="npm run build:server && NODE_ENV=test node dist/server"
 
 if [ ! -z ${1+x} ] && [ "$1" == "--skip-server" ]; then
   NODE_ENV=test eval $clientCommand
 else
-  NODE_ENV=test npm run concurrently -- -k \
+  NODE_ENV=test node node_modules/.bin/concurrently -k \
     "$clientCommand" \
     "$serverCommand"
 fi
index a7fa88fbd880d9637bad92f4f1a400f9a0f47bef..b09a966dd2fbf630af09e8f326cefafda8cbf60b 100755 (executable)
@@ -20,6 +20,6 @@ cp "./tsconfig.json" "./dist"
 npm run tsc -- --incremental --sourceMap
 cp -r ./server/static ./server/assets ./dist/server
 
-NODE_ENV=test npm run concurrently -- -k \
-  "npm run nodemon -- --delay 1 --watch ./dist dist/server" \
-  "npm run tsc -- --incremental --sourceMap --preserveWatchOutput -w"
+NODE_ENV=test node node_modules/.bin/concurrently -k \
+  "node_modules/.bin/nodemon --delay 1 --watch ./dist dist/server" \
+  "node_modules/.bin/tsc --incremental --sourceMap --preserveWatchOutput -w"