create-healix 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/create-healix.js +5 -1
- package/package.json +2 -2
- package/src/scaffold.js +18 -7
package/bin/create-healix.js
CHANGED
|
@@ -11,10 +11,13 @@ Usage: create-healix [project-name] [options]
|
|
|
11
11
|
Options:
|
|
12
12
|
--help, -h Show this help
|
|
13
13
|
--port <n> Healix API port (default: 4000; avoid 3000 which is common for app servers)
|
|
14
|
+
--skip-install Scaffold files only; do NOT run npm install (run it yourself)
|
|
15
|
+
--yes, -y Accept defaults without prompting
|
|
14
16
|
|
|
15
17
|
Examples:
|
|
16
18
|
npx create-healix my-app
|
|
17
19
|
npx create-healix my-app --port 4001
|
|
20
|
+
npx create-healix my-app --skip-install # then: cd my-app && npm install
|
|
18
21
|
`);
|
|
19
22
|
process.exit(0);
|
|
20
23
|
}
|
|
@@ -22,6 +25,7 @@ Examples:
|
|
|
22
25
|
let projectName = args.find(a => !a.startsWith('--') && isNaN(Number(a)));
|
|
23
26
|
const portIdx = args.indexOf('--port');
|
|
24
27
|
const apiPort = portIdx !== -1 && args[portIdx + 1] ? parseInt(args[portIdx + 1], 10) : 4000;
|
|
28
|
+
const skipInstall = args.includes('--skip-install');
|
|
25
29
|
|
|
26
30
|
if (!projectName) {
|
|
27
31
|
const response = await prompts({
|
|
@@ -40,7 +44,7 @@ if (!projectName) {
|
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
try {
|
|
43
|
-
scaffold(projectName, process.cwd(), { apiPort });
|
|
47
|
+
scaffold(projectName, process.cwd(), { apiPort, skipInstall });
|
|
44
48
|
} catch (err) {
|
|
45
49
|
console.error(`Error: ${err.message}`);
|
|
46
50
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-healix",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Scaffold a healix WDIO project with MCP integration ready out of the box",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"prompts": "^2.4.2",
|
|
20
|
-
"wdio-healix-service": "^0.
|
|
20
|
+
"wdio-healix-service": "^0.3.0"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
package/src/scaffold.js
CHANGED
|
@@ -73,18 +73,29 @@ export function scaffold(projectName, targetDir, options = {}) {
|
|
|
73
73
|
mergeWorkspaceMcp(path.join(workspaceDir, '.mcp.json'), apiPort);
|
|
74
74
|
|
|
75
75
|
console.log(`\n✓ Project created: ${projectDir}`);
|
|
76
|
-
console.log('\nInstalling dependencies...\n');
|
|
77
76
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
// Install is the slow part (large WDIO + sharp tree). --skip-install lets callers
|
|
78
|
+
// (and agent tool-runners with short timeouts) scaffold instantly and install
|
|
79
|
+
// themselves. On failure we surface the real error LOUDLY — a silently-swallowed
|
|
80
|
+
// install leaves a broken project that looks fine.
|
|
81
|
+
if (options.skipInstall) {
|
|
82
|
+
console.log('\n⏭ Skipped dependency install (--skip-install).');
|
|
83
|
+
console.log(` Finish setup with: cd ${projectName} && npm install\n`);
|
|
84
|
+
} else {
|
|
85
|
+
console.log('\nInstalling dependencies (this can take a few minutes)...\n');
|
|
86
|
+
try {
|
|
87
|
+
execSync('npm install', { cwd: projectDir, stdio: 'inherit' });
|
|
88
|
+
console.log('\n✓ Dependencies installed');
|
|
89
|
+
} catch (e) {
|
|
90
|
+
console.error(`\n⚠ npm install FAILED: ${e.message}`);
|
|
91
|
+
console.error(` The project files are written, but node_modules is incomplete.`);
|
|
92
|
+
console.error(` Run it manually: cd ${projectName} && npm install\n`);
|
|
93
|
+
}
|
|
83
94
|
}
|
|
84
95
|
|
|
85
96
|
console.log(`
|
|
86
97
|
Done! Next steps:
|
|
87
|
-
cd ${projectName}
|
|
98
|
+
cd ${projectName}${options.skipInstall ? '\n npm install' : ''}
|
|
88
99
|
npm run session:web
|
|
89
100
|
`);
|
|
90
101
|
}
|