erne-universal 0.10.13 → 0.10.15
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 +5 -40
- package/package.json +1 -1
package/lib/init.js
CHANGED
|
@@ -273,46 +273,11 @@ module.exports = async function init() {
|
|
|
273
273
|
console.log(` ⚠ Audit skipped: ${err.message}`);
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
// ───
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const fs = require('fs');
|
|
282
|
-
const dashboardDir = path.resolve(__dirname, '..', 'dashboard');
|
|
283
|
-
const serverPath = path.resolve(dashboardDir, 'server.js');
|
|
284
|
-
const depsInstalled = fs.existsSync(path.join(dashboardDir, 'node_modules', 'better-sqlite3'));
|
|
285
|
-
|
|
286
|
-
if (depsInstalled) {
|
|
287
|
-
// Deps already installed — fork server immediately (fast, <1s)
|
|
288
|
-
const child = fork(serverPath, ['--no-open'], {
|
|
289
|
-
cwd,
|
|
290
|
-
detached: true,
|
|
291
|
-
stdio: 'ignore',
|
|
292
|
-
env: { ...process.env, ERNE_PROJECT_DIR: cwd },
|
|
293
|
-
});
|
|
294
|
-
child.unref();
|
|
295
|
-
|
|
296
|
-
// Open browser after brief startup delay (non-blocking)
|
|
297
|
-
setTimeout(() => {
|
|
298
|
-
try {
|
|
299
|
-
const { resolveDashboardPort } = require('../scripts/hooks/lib/port-registry');
|
|
300
|
-
const port = resolveDashboardPort(cwd) || 3333;
|
|
301
|
-
const open = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
|
|
302
|
-
require('child_process').exec(`${open} http://localhost:${port}`);
|
|
303
|
-
} catch { /* silent */ }
|
|
304
|
-
}, 1500);
|
|
305
|
-
console.log(' ✓ Dashboard launched in background');
|
|
306
|
-
} else {
|
|
307
|
-
// First time — skip install to keep init fast
|
|
308
|
-
console.log(' Dashboard: run `erne dashboard` to install and launch (first time takes ~2min)');
|
|
309
|
-
}
|
|
310
|
-
} catch {
|
|
311
|
-
// Silent — dashboard is optional
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
console.log('\n Done! Run /erne-plan to start your first feature.\n');
|
|
276
|
+
// ─── Dashboard ───
|
|
277
|
+
console.log(' ℹ Dashboard: run \x1b[36mnpx erne-universal dashboard\x1b[0m to launch');
|
|
278
|
+
console.log('');
|
|
279
|
+
console.log(' \x1b[32mDone!\x1b[0m ERNE is ready. Use /erne- commands (e.g. /erne-plan, /erne-perf, /erne-doctor).');
|
|
280
|
+
console.log('');
|
|
316
281
|
} finally {
|
|
317
282
|
if (rl) rl.close();
|
|
318
283
|
}
|