Init commit
This commit is contained in:
35
scripts/dev/client.sh
Normal file
35
scripts/dev/client.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
(cd client/src/standalone/player && npm run build)
|
||||
|
||||
clientConfiguration="hmr"
|
||||
|
||||
if [ ! -z ${2+x} ] && [ "$2" = "--ar-locale" ]; then
|
||||
clientConfiguration="ar-locale"
|
||||
fi
|
||||
|
||||
embedCommand="cd client/src/standalone/player && npm run dev"
|
||||
sslArgs=""
|
||||
if [ "${DEV_SSL:-false}" = "true" ]; then
|
||||
certPath="${DEV_SSL_CERT:-../certs/cert.pem}"
|
||||
keyPath="${DEV_SSL_KEY:-../certs/key.pem}"
|
||||
sslArgs="--ssl true --ssl-cert $certPath --ssl-key $keyPath"
|
||||
fi
|
||||
|
||||
clientCommand="cd client && NODE_OPTIONS=--max_old_space_size=8192 node_modules/.bin/ng serve --proxy-config proxy.config.json --hmr --configuration $clientConfiguration --host 0.0.0.0 --port 3000 $sslArgs"
|
||||
serverCommand="ANGULAR_CLIENT_ENABLED=true NODE_ENV=dev node dist/server"
|
||||
|
||||
if [ ! -z ${1+x} ] && [ "$1" = "--skip-server" ]; then
|
||||
node_modules/.bin/concurrently -k \
|
||||
"$embedCommand" \
|
||||
"$clientCommand"
|
||||
else
|
||||
npm run build:server
|
||||
|
||||
node_modules/.bin/concurrently -k \
|
||||
"$embedCommand" \
|
||||
"$clientCommand" \
|
||||
"$serverCommand"
|
||||
fi
|
||||
11
scripts/dev/embed.sh
Normal file
11
scripts/dev/embed.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
npm run build:server -- --incremental
|
||||
(cd client/src/standalone/player && npm run build)
|
||||
|
||||
npm run concurrently -- -k \
|
||||
"cd client/src/standalone/player && npm run dev" \
|
||||
"cd client && ./node_modules/.bin/vite -c ./src/standalone/videos/vite.config.mjs dev" \
|
||||
"NODE_ENV=dev npm start"
|
||||
7
scripts/dev/index.sh
Normal file
7
scripts/dev/index.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
npm run concurrently -- -k \
|
||||
"sh scripts/dev/client.sh --skip-server ${1:-}" \
|
||||
"ANGULAR_CLIENT_ENABLED=true sh scripts/dev/server.sh --skip-client"
|
||||
11
scripts/dev/peertube-cli.sh
Normal file
11
scripts/dev/peertube-cli.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
rm -rf ./apps/peertube-cli/dist
|
||||
|
||||
cd ./apps/peertube-cli
|
||||
|
||||
../../node_modules/.bin/concurrently -k \
|
||||
"../../node_modules/.bin/tsc -w --noEmit" \
|
||||
"node ./scripts/watch.js"
|
||||
13
scripts/dev/peertube-runner.sh
Normal file
13
scripts/dev/peertube-runner.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
rm -rf ./apps/peertube-runner/dist
|
||||
|
||||
cd ./apps/peertube-runner
|
||||
|
||||
../../node_modules/.bin/tsc -b --verbose
|
||||
|
||||
../../node_modules/.bin/concurrently -k \
|
||||
"../../node_modules/.bin/tsc -w --noEmit" \
|
||||
"node ./scripts/watch.js"
|
||||
25
scripts/dev/server.sh
Normal file
25
scripts/dev/server.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
if [ ! -f "./client/dist/en-US/index.html" ]; then
|
||||
if [ -z ${1+x} ] || [ "$1" != "--skip-client" ]; then
|
||||
echo "client/dist/en-US/index.html does not exist, compile client files..."
|
||||
npm run build:client
|
||||
fi
|
||||
fi
|
||||
|
||||
# Copy locales
|
||||
mkdir -p "./client/dist"
|
||||
rm -rf "./client/dist/locale"
|
||||
cp -r "./client/src/locale" "./client/dist/locale"
|
||||
|
||||
mkdir -p "./dist/core/lib"
|
||||
|
||||
npm run tsc -- -b -v --incremental server/tsconfig.json
|
||||
npm run resolve-tspaths:server
|
||||
|
||||
cp -r "./server/core/static" "./server/core/assets" ./dist/core
|
||||
cp -r "./server/locales" ./dist
|
||||
|
||||
./node_modules/.bin/tsc-watch --build --preserveWatchOutput --verbose --onSuccess 'sh -c "npm run resolve-tspaths:server && NODE_ENV=dev node --inspect dist/server"' server/tsconfig.json
|
||||
Reference in New Issue
Block a user