Feat: windows build script

This commit is contained in:
unitwk 2023-08-21 11:06:09 +08:00
parent cf02114970
commit 9683addf56
9 changed files with 75 additions and 4 deletions

3
.gitignore vendored
View File

@ -5,10 +5,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
test.txt
*.bat
src/public
*.code-workspace
vscode/
.vscode/

47
build.bat Executable file
View File

@ -0,0 +1,47 @@
rd /s /q "production-code"
rd /s /q ".\daemon\dist"
rd /s /q ".\daemon\production"
rd /s /q ".\panel\dist"
rd /s /q ".\panel\production"
echo "Build daemon..."
cd daemon
npm run build
echo "Build panel..."
cd ..
cd panel
npm run build
echo "Build frontend..."
cd ..
cd frontend
npm run build
echo "Collecting files..."
cd ..
mkdir "production-code"
mkdir "production-code\daemon"
mkdir "production-code\web"
mkdir "production-code\web\public"
copy ".\daemon\production\app.js" ".\production-code\daemon\app.js"
copy ".\daemon\package.json" ".\production-code\daemon\package.json"
copy ".\daemon\package-lock.json" ".\production-code\daemon\package-lock.json"
copy ".\panel\production\app.js" ".\production-code\web\app.js"
copy ".\panel\package.json" ".\production-code\web\package.json"
copy ".\panel\package-lock.json" ".\production-code\web\package-lock.json"
xcopy ".\frontend\dist" ".\production-code\web\public" /E /I /H /Y
rd /s /q ".\panel\production"
rd /s /q ".\daemon\production"
rd /s /q ".\daemon\dist"
rd /s /q ".\panel\dist"
rd /s /q ".\frontend\dist"
echo "------------"
echo "Done!"
echo "------------"

10
install-dependents.bat Executable file
View File

@ -0,0 +1,10 @@
cd daemon
npm install
cd ../panel
npm install
cd ../frontend
npm install
echo "------------"
echo "Done!"
echo "------------"

View File

@ -1,3 +1,5 @@
#!/bin/sh
cd daemon
npm install
cd ../panel

View File

@ -2,4 +2,4 @@
open -a Terminal.app "start-daemon.sh"
open -a Terminal.app "start-panel.sh"
open -a Terminal.app "start-frontend.sh"
./start-frontend.sh

3
npm-dev-windows.sh Normal file
View File

@ -0,0 +1,3 @@
start ./start-daemon.bat
start ./start-panel.bat
./start-frontend.bat

4
start-daemon.bat Executable file
View File

@ -0,0 +1,4 @@
cd daemon
npm run dev

4
start-frontend.bat Executable file
View File

@ -0,0 +1,4 @@
cd frontend
npm run dev

4
start-panel.bat Executable file
View File

@ -0,0 +1,4 @@
cd panel
npm run dev