From c026a2e67357bd4bd4fcc4c10f8c5cd4749435c9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 17 Dec 2019 15:33:58 +0100 Subject: [PATCH] Remove watch scripts --- client/src/standalone/player/package.json | 1 + package.json | 7 ++++--- scripts/build/client.sh | 2 +- scripts/build/embed.sh | 5 +++++ scripts/build/index.sh | 7 +++++++ scripts/dev/client.sh | 2 +- scripts/dev/embed.sh | 7 +++++++ scripts/dev/server.sh | 17 ++++++++++++++++- scripts/watch/client.sh | 7 ------- scripts/watch/server.sh | 20 -------------------- 10 files changed, 42 insertions(+), 33 deletions(-) create mode 100755 scripts/build/embed.sh create mode 100755 scripts/build/index.sh create mode 100644 scripts/dev/embed.sh delete mode 100755 scripts/watch/client.sh delete mode 100755 scripts/watch/server.sh diff --git a/client/src/standalone/player/package.json b/client/src/standalone/player/package.json index a521515e5..b056de718 100644 --- a/client/src/standalone/player/package.json +++ b/client/src/standalone/player/package.json @@ -13,6 +13,7 @@ "peertube", "embed" ], + "main": "./player.ts", "author": "Chocobozzz", "license": "AGPL-3.0", "bugs": { diff --git a/package.json b/package.json index 5c12bd33c..acc4b7e1f 100644 --- a/package.json +++ b/package.json @@ -24,14 +24,13 @@ "e2e": "scripty", "e2e:local": "scripty", "setup:cli": "scripty", - "build": "SCRIPTY_PARALLEL=true scripty", + "build": "scripty", + "build:embed": "scripty", "build:server": "scripty", "build:client": "scripty", "clean:client": "scripty", "clean:server": "scripty", "clean:server:test": "scripty", - "watch:client": "scripty", - "watch:server": "scripty", "danger:clean:dev": "scripty", "danger:clean:prod": "scripty", "danger:clean:modules": "scripty", @@ -44,8 +43,10 @@ "play": "scripty", "dev": "scripty", "dev:server": "scripty", + "dev:embed": "scripty", "dev:client": "scripty", "dev:cli": "scripty", + "dev:embed": "scripty", "start": "node dist/server", "start:server": "node dist/server --no-client", "update-host": "node ./dist/scripts/update-host.js", diff --git a/scripts/build/client.sh b/scripts/build/client.sh index 2518702cf..fd9190660 100755 --- a/scripts/build/client.sh +++ b/scripts/build/client.sh @@ -62,7 +62,7 @@ if [ -z ${1+x} ] || [ "$1" != "--light" ]; then done fi -NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/embed-stats.json" +npm run build:embed # Copy runtime locales cp -r "./src/locale" "./dist/locale" diff --git a/scripts/build/embed.sh b/scripts/build/embed.sh new file mode 100755 index 000000000..ea5e7d57d --- /dev/null +++ b/scripts/build/embed.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -eu + +NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/embed-stats.json" diff --git a/scripts/build/index.sh b/scripts/build/index.sh new file mode 100755 index 000000000..fde6efe32 --- /dev/null +++ b/scripts/build/index.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -eu + +npm run concurrently -- -k \ + "npm run build:client" \ + "npm run build:server" diff --git a/scripts/dev/client.sh b/scripts/dev/client.sh index c630de2c4..d6669ed78 100755 --- a/scripts/dev/client.sh +++ b/scripts/dev/client.sh @@ -3,5 +3,5 @@ set -eu NODE_ENV=test npm run concurrently -- -k \ - "npm run watch:client" \ + "cd client && npm run ng -- serve --proxy-config proxy.config.json --hmr --configuration hmr --host 0.0.0.0 --disable-host-check --port 3000" \ "npm run build:server && NODE_ENV=test npm start" diff --git a/scripts/dev/embed.sh b/scripts/dev/embed.sh new file mode 100644 index 000000000..9b0ef27cf --- /dev/null +++ b/scripts/dev/embed.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -eu + +NODE_ENV=test npm run concurrently -- -k \ + "cd client && npm run webpack -- --config webpack/webpack.video-embed.js --mode development --watch" \ + "npm run build:server && NODE_ENV=test npm start" diff --git a/scripts/dev/server.sh b/scripts/dev/server.sh index beee5b8d4..a7fa88fbd 100755 --- a/scripts/dev/server.sh +++ b/scripts/dev/server.sh @@ -7,4 +7,19 @@ if [ ! -f "./client/dist/en-US/index.html" ]; then npm run build:client -- --light fi -npm run watch:server +# Copy locales +mkdir -p "./client/dist" +rm -rf "./client/dist/locale" +cp -r "./client/src/locale" "./client/dist/locale" + +rm -rf "./dist" + +mkdir "./dist" +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" diff --git a/scripts/watch/client.sh b/scripts/watch/client.sh deleted file mode 100755 index 1d6b8c2aa..000000000 --- a/scripts/watch/client.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -set -eu - -cd client - -npm run ng -- serve --proxy-config proxy.config.json --hmr --configuration hmr --host 0.0.0.0 --disable-host-check --port 3000 diff --git a/scripts/watch/server.sh b/scripts/watch/server.sh deleted file mode 100755 index 2e3231865..000000000 --- a/scripts/watch/server.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -set -eu - -# Copy locales -mkdir -p "./client/dist" -rm -rf "./client/dist/locale" -cp -r "./client/src/locale" "./client/dist/locale" - -rm -rf "./dist" - -mkdir "./dist" -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" -- 2.25.1