erne-universal 0.10.13 → 0.10.14
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/lib/init.js +24 -21
- package/package.json +1 -1
package/lib/init.js
CHANGED
|
@@ -273,19 +273,18 @@ module.exports = async function init() {
|
|
|
273
273
|
console.log(` ⚠ Audit skipped: ${err.message}`);
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
// ─── Step 6:
|
|
276
|
+
// ─── Step 6: Dashboard Info ───
|
|
277
277
|
const skipDashboard = process.env.NODE_TEST || process.env.ERNE_SKIP_DASHBOARD;
|
|
278
278
|
if (!skipDashboard) {
|
|
279
279
|
try {
|
|
280
|
-
const
|
|
281
|
-
const fs = require('fs');
|
|
280
|
+
const fs2 = require('fs');
|
|
282
281
|
const dashboardDir = path.resolve(__dirname, '..', 'dashboard');
|
|
283
|
-
const
|
|
284
|
-
const depsInstalled = fs.existsSync(path.join(dashboardDir, 'node_modules', 'better-sqlite3'));
|
|
282
|
+
const depsInstalled = fs2.existsSync(path.join(dashboardDir, 'node_modules', 'better-sqlite3'));
|
|
285
283
|
|
|
286
284
|
if (depsInstalled) {
|
|
287
|
-
|
|
288
|
-
const
|
|
285
|
+
const serverPath = path.resolve(dashboardDir, 'server.js');
|
|
286
|
+
const { fork } = require('child_process');
|
|
287
|
+
const child = fork(serverPath, [], {
|
|
289
288
|
cwd,
|
|
290
289
|
detached: true,
|
|
291
290
|
stdio: 'ignore',
|
|
@@ -293,26 +292,30 @@ module.exports = async function init() {
|
|
|
293
292
|
});
|
|
294
293
|
child.unref();
|
|
295
294
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
} catch { /* silent */ }
|
|
304
|
-
}, 1500);
|
|
305
|
-
console.log(' ✓ Dashboard launched in background');
|
|
295
|
+
let port = 3333;
|
|
296
|
+
try {
|
|
297
|
+
const { resolveDashboardPort } = require('../scripts/hooks/lib/port-registry');
|
|
298
|
+
port = resolveDashboardPort(cwd) || 3333;
|
|
299
|
+
} catch { /* fallback 3333 */ }
|
|
300
|
+
|
|
301
|
+
console.log(` ✓ Dashboard: http://localhost:${port}`);
|
|
306
302
|
} else {
|
|
307
|
-
|
|
308
|
-
console.log(' Dashboard: run `erne dashboard` to install and launch (first time takes ~2min)');
|
|
303
|
+
console.log(' ℹ Dashboard: run \x1b[36mnpx erne-universal dashboard\x1b[0m to start (first launch installs deps ~2min)');
|
|
309
304
|
}
|
|
310
305
|
} catch {
|
|
311
|
-
|
|
306
|
+
console.log(' ℹ Dashboard: run \x1b[36mnpx erne-universal dashboard\x1b[0m to start');
|
|
312
307
|
}
|
|
313
308
|
}
|
|
314
309
|
|
|
315
|
-
console.log('
|
|
310
|
+
console.log('');
|
|
311
|
+
console.log(' \x1b[32mDone!\x1b[0m ERNE is ready.');
|
|
312
|
+
console.log('');
|
|
313
|
+
console.log(' Next steps:');
|
|
314
|
+
console.log(' • Type \x1b[36m/erne-plan\x1b[0m to plan a feature');
|
|
315
|
+
console.log(' • Type \x1b[36m/erne-perf\x1b[0m to profile performance');
|
|
316
|
+
console.log(' • Type \x1b[36m/erne-doctor\x1b[0m to check project health');
|
|
317
|
+
console.log(' • See all commands: type \x1b[36m/erne-\x1b[0m and press Tab');
|
|
318
|
+
console.log('');
|
|
316
319
|
} finally {
|
|
317
320
|
if (rl) rl.close();
|
|
318
321
|
}
|