@floless/app 0.11.0 → 0.12.1
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/dist/floless-server.cjs +805 -335
- package/dist/skills/floless-app-ui/SKILL.md +131 -0
- package/dist/web/app.css +183 -0
- package/dist/web/aware.js +85 -7
- package/dist/web/index.html +48 -4
- package/dist/web/panels.js +660 -0
- package/launch.mjs +11 -1
- package/package.json +1 -1
package/launch.mjs
CHANGED
|
@@ -17,6 +17,7 @@ import { createInterface } from 'node:readline';
|
|
|
17
17
|
import { rotateLog, openLogFd } from './log.mjs';
|
|
18
18
|
import { supervisorPidsToKill, teardownDecision, awareIsPresent, RUN_KEY, RUN_VALUE, PROTOCOL_KEY } from './teardown.mjs';
|
|
19
19
|
import { resolveRealInstallExe } from './install-path.mjs';
|
|
20
|
+
import { consumePostUpdateMarker } from './post-update-marker.mjs';
|
|
20
21
|
|
|
21
22
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
22
23
|
const PORT = Number(process.env.PORT ?? 4317);
|
|
@@ -163,6 +164,11 @@ async function ensureServerUp() {
|
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
export async function cmdOpen() {
|
|
167
|
+
// A post-self-update relaunch must start the server but NOT open a second browser tab —
|
|
168
|
+
// Velopack relaunches FlolessApp.exe bare (→ this `open` action), while the user's existing
|
|
169
|
+
// tab is still alive and reconnects via its 5s health poll (#37). Consume the one-shot
|
|
170
|
+
// marker the updater dropped before the Update.exe handoff; if present, behave like `start`.
|
|
171
|
+
const postUpdate = consumePostUpdateMarker();
|
|
166
172
|
if (await ping()) {
|
|
167
173
|
// Something is already serving the port. If it's a DIFFERENT, OLDER floless.app build than
|
|
168
174
|
// this one, take it over ("newest wins") so the version the user just launched is the one
|
|
@@ -174,11 +180,15 @@ export async function cmdOpen() {
|
|
|
174
180
|
await new Promise((r) => setTimeout(r, 500)); // let the OS release the port
|
|
175
181
|
await ensureServerUp();
|
|
176
182
|
} else {
|
|
177
|
-
log(`already running${running ? ` (v${running})` : ''}
|
|
183
|
+
log(`already running${running ? ` (v${running})` : ''}`);
|
|
178
184
|
}
|
|
179
185
|
} else {
|
|
180
186
|
await ensureServerUp();
|
|
181
187
|
}
|
|
188
|
+
if (postUpdate) {
|
|
189
|
+
log('post-update relaunch — server up; the existing tab reconnects via its health poll (no new tab)');
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
182
192
|
log(`opening ${BROWSER_URL}`);
|
|
183
193
|
openBrowser(BROWSER_URL);
|
|
184
194
|
}
|