mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 08:33:36 +00:00
feat: add cross-platform dev script (Windows/macOS/Linux support)
Replace Unix-only init.sh with cross-platform init.mjs Node.js script. Changes: - Add init.mjs: Cross-platform Node.js implementation of init.sh - Update package.json: Change dev script from ./init.sh to node init.mjs - Add tree-kill dependency for reliable cross-platform process termination Key features of init.mjs: - Cross-platform port detection (netstat on Windows, lsof on Unix) - Cross-platform process killing using tree-kill package - Uses cross-spawn for reliable npm/npx command execution on Windows - Interactive prompts via Node.js readline module - Colored terminal output (works on modern Windows terminals) - Proper cleanup handlers for Ctrl+C/SIGTERM Bug fix: - Fixed Playwright browser check to run from apps/app directory where @playwright/test is actually installed (was silently failing before) The original init.sh is preserved for backward compatibility.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
],
|
||||
"scripts": {
|
||||
"postinstall": "node -e \"const fs=require('fs');if(process.platform==='darwin'){['darwin-arm64','darwin-x64'].forEach(a=>{const p='node_modules/node-pty/prebuilds/'+a+'/spawn-helper';if(fs.existsSync(p))fs.chmodSync(p,0o755)})}\"",
|
||||
"dev": "./init.sh",
|
||||
"dev": "node init.mjs",
|
||||
"dev:web": "npm run dev:web --workspace=apps/app",
|
||||
"dev:electron": "npm run dev:electron --workspace=apps/app",
|
||||
"dev:electron:debug": "npm run dev:electron:debug --workspace=apps/app",
|
||||
@@ -32,6 +32,7 @@
|
||||
"lint:lockfile": "! grep -q 'git+ssh://' package-lock.json || (echo 'Error: package-lock.json contains git+ssh:// URLs. Run: git config --global url.\"https://github.com/\".insteadOf \"git@github.com:\"' && exit 1)"
|
||||
},
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.6"
|
||||
"cross-spawn": "^7.0.6",
|
||||
"tree-kill": "^1.2.2"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user