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:
Auto
2025-12-18 09:33:35 +02:00
parent bacafd129f
commit 9fcdd899b2
3 changed files with 428 additions and 11 deletions

20
package-lock.json generated
View File

@@ -13,7 +13,8 @@
"libs/*"
],
"dependencies": {
"cross-spawn": "^7.0.6"
"cross-spawn": "^7.0.6",
"tree-kill": "^1.2.2"
}
},
"apps/app": {
@@ -8223,14 +8224,6 @@
"node": ">=8.0"
}
},
"apps/app/node_modules/tree-kill": {
"version": "1.2.2",
"dev": true,
"license": "MIT",
"bin": {
"tree-kill": "cli.js"
}
},
"apps/app/node_modules/trim-lines": {
"version": "3.0.1",
"license": "MIT",
@@ -15171,6 +15164,15 @@
"node": ">=6"
}
},
"node_modules/tree-kill": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",
"integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
"license": "MIT",
"bin": {
"tree-kill": "cli.js"
}
},
"node_modules/tslib": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",