froggo-mission-control 1.2.5 → 1.2.7
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/cli.js +31 -9
- package/package.json +1 -1
- package/scripts/postinstall.js +4 -2
- package/src/hooks/useFirstTimeUser.ts +4 -2
package/bin/cli.js
CHANGED
|
@@ -498,7 +498,9 @@ async function cmdSetup(force = false) {
|
|
|
498
498
|
// ── Install persistent service ──────────────────────────────────────────
|
|
499
499
|
step('Installing persistent service (auto-start at login)');
|
|
500
500
|
const nodeBin = findNodeBin();
|
|
501
|
-
|
|
501
|
+
// Use the actual Next.js JS entry point — avoids the .bin/next shell wrapper
|
|
502
|
+
// which fails in LaunchAgent/systemd contexts where node isn't in PATH
|
|
503
|
+
const nextScript = path.join(INSTALL_DIR, 'node_modules', 'next', 'dist', 'bin', 'next');
|
|
502
504
|
const logPath = path.join(HOME, 'Library', 'Logs', 'mission-control-app.log');
|
|
503
505
|
|
|
504
506
|
const envVars = {
|
|
@@ -536,9 +538,11 @@ async function cmdSetup(force = false) {
|
|
|
536
538
|
<string>com.mission-control.app</string>
|
|
537
539
|
<key>ProgramArguments</key>
|
|
538
540
|
<array>
|
|
539
|
-
<string
|
|
540
|
-
<string
|
|
541
|
-
<string
|
|
541
|
+
<string>${nodeBin}</string>
|
|
542
|
+
<string>${nextScript}</string>
|
|
543
|
+
<string>start</string>
|
|
544
|
+
<string>--port</string>
|
|
545
|
+
<string>${port}</string>
|
|
542
546
|
</array>
|
|
543
547
|
<key>WorkingDirectory</key>
|
|
544
548
|
<string>${INSTALL_DIR}</string>
|
|
@@ -618,7 +622,7 @@ After=network.target
|
|
|
618
622
|
[Service]
|
|
619
623
|
Type=simple
|
|
620
624
|
WorkingDirectory=${INSTALL_DIR}
|
|
621
|
-
ExecStart
|
|
625
|
+
ExecStart=${nodeBin} ${nextScript} start --port ${port}
|
|
622
626
|
Restart=always
|
|
623
627
|
RestartSec=5
|
|
624
628
|
${envLines}
|
|
@@ -637,6 +641,22 @@ WantedBy=default.target
|
|
|
637
641
|
warn(`Platform: ${os.platform()} — auto-start not supported. Use \`mission-control start\` manually.`);
|
|
638
642
|
}
|
|
639
643
|
|
|
644
|
+
// ── Ensure Next.js build exists ─────────────────────────────────────────
|
|
645
|
+
const nextDir = path.join(INSTALL_DIR, '.next');
|
|
646
|
+
if (!existsSync(nextDir)) {
|
|
647
|
+
step('Building dashboard (Next.js build not found)...');
|
|
648
|
+
const nextScript = path.join(INSTALL_DIR, 'node_modules', 'next', 'dist', 'bin', 'next');
|
|
649
|
+
const buildResult = spawnSync(process.execPath, [nextScript, 'build'], {
|
|
650
|
+
cwd: INSTALL_DIR,
|
|
651
|
+
stdio: 'inherit',
|
|
652
|
+
env: { ...process.env, NEXT_TELEMETRY_DISABLED: '1' },
|
|
653
|
+
});
|
|
654
|
+
if (buildResult.status !== 0) {
|
|
655
|
+
fail('Next.js build failed. Check error output above, then run: mission-control build');
|
|
656
|
+
}
|
|
657
|
+
success('Dashboard built');
|
|
658
|
+
}
|
|
659
|
+
|
|
640
660
|
// ── Start and open ──────────────────────────────────────────────────────
|
|
641
661
|
step('Launching Mission Control');
|
|
642
662
|
info(`Waiting for server on port ${port}...`);
|
|
@@ -644,9 +664,11 @@ WantedBy=default.target
|
|
|
644
664
|
console.log('');
|
|
645
665
|
|
|
646
666
|
const appUrl = `http://localhost:${port}`;
|
|
667
|
+
// Pass ?setup=1 on first launch so the wizard shows even if localStorage is stale
|
|
668
|
+
const launchUrl = `${appUrl}?setup=1`;
|
|
647
669
|
if (health) {
|
|
648
670
|
success(`Running at ${appUrl}`);
|
|
649
|
-
openBrowser(
|
|
671
|
+
openBrowser(launchUrl);
|
|
650
672
|
} else {
|
|
651
673
|
warn('Server did not respond — check logs:');
|
|
652
674
|
if (IS_MAC) info(`tail -f ${logPath}`);
|
|
@@ -658,7 +680,7 @@ WantedBy=default.target
|
|
|
658
680
|
console.log(c.bold(c.green('║ Setup complete! ║')));
|
|
659
681
|
console.log(c.bold(c.green('╚══════════════════════════════════════╝')));
|
|
660
682
|
console.log('');
|
|
661
|
-
console.log(` Opening dashboard at ${c.bold(c.cyan(appUrl))}`);
|
|
683
|
+
console.log(` Opening dashboard at ${c.bold(c.cyan(appUrl))} — setup wizard will launch automatically`);
|
|
662
684
|
console.log('');
|
|
663
685
|
console.log(` ${c.bold('Data:')} ~/mission-control/`);
|
|
664
686
|
console.log(` ${c.bold('Platform:')} ${INSTALL_DIR}`);
|
|
@@ -688,8 +710,8 @@ async function cmdStart() {
|
|
|
688
710
|
spawnSync('systemctl', ['--user', 'start', 'mission-control.service'], { stdio: 'inherit' });
|
|
689
711
|
} else {
|
|
690
712
|
// Direct start
|
|
691
|
-
const
|
|
692
|
-
const proc = spawn(
|
|
713
|
+
const nextScriptFallback = path.join(INSTALL_DIR, 'node_modules', 'next', 'dist', 'bin', 'next');
|
|
714
|
+
const proc = spawn(process.execPath, [nextScriptFallback, 'start'], {
|
|
693
715
|
cwd: INSTALL_DIR,
|
|
694
716
|
detached: true,
|
|
695
717
|
stdio: 'ignore',
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -150,9 +150,11 @@ for (const mod of ['better-sqlite3', 'keytar']) {
|
|
|
150
150
|
info('Building dashboard (Next.js)...');
|
|
151
151
|
process.env.NEXT_TELEMETRY_DISABLED = '1';
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
// Use the actual Next.js JS entry point — avoids the shell wrapper which
|
|
154
|
+
// may fail if node isn't on PATH in the spawn context
|
|
155
|
+
const nextScript = path.join(ROOT, 'node_modules', 'next', 'dist', 'bin', 'next');
|
|
156
|
+
const buildResult = spawnSync(process.execPath, [nextScript, 'build'], {
|
|
154
157
|
cwd: ROOT,
|
|
155
|
-
shell: true,
|
|
156
158
|
stdio: 'inherit',
|
|
157
159
|
env: { ...process.env, NEXT_TELEMETRY_DISABLED: '1' },
|
|
158
160
|
});
|
|
@@ -24,9 +24,11 @@ export function useFirstTimeUser(
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
const onboardingDone = localStorage.getItem(ONBOARDING_KEY);
|
|
26
26
|
const tourSeen = localStorage.getItem(TOUR_SEEN_KEY);
|
|
27
|
+
// ?setup=1 forces wizard open (used by CLI on first launch to bypass stale localStorage)
|
|
28
|
+
const forceSetup = new URLSearchParams(window.location.search).get('setup') === '1';
|
|
27
29
|
|
|
28
|
-
if (!onboardingDone) {
|
|
29
|
-
// Wizard not completed -- show it first
|
|
30
|
+
if (!onboardingDone || forceSetup) {
|
|
31
|
+
// Wizard not completed (or forced) -- show it first
|
|
30
32
|
setShowOnboardingWizard(true);
|
|
31
33
|
} else if (!tourSeen && !hasCompletedTour('getting-started')) {
|
|
32
34
|
// Wizard done but tour not seen -- auto-start tour after brief delay
|