@krapwoo/ds-viewer 0.12.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/cli/dev.js +14 -0
- package/package.json +1 -1
package/dist/cli/dev.js
CHANGED
|
@@ -358,6 +358,20 @@ export function repairWorkspaceIfMissing(deps) {
|
|
|
358
358
|
}
|
|
359
359
|
if (!existsSync(workspacePath(config, 'version.json')))
|
|
360
360
|
writeVersionFile(config.projectRoot, status, config.workspaceDir);
|
|
361
|
+
// `endpoint.json` is not a defining file — Metro never reads it, so its absence does not break
|
|
362
|
+
// the catalog that is serving right now. It is what lets a *restarted* `dev` reuse this address
|
|
363
|
+
// instead of picking a new port and secret (0.9.1), and the observed failure removes it with
|
|
364
|
+
// everything else. Repairing without it leaves a working catalog that has quietly lost its
|
|
365
|
+
// restart stability: the next `dev` comes back on a different port, and an open page keeps
|
|
366
|
+
// calling the old one — the exact defect 0.9.1 fixed. Restored from the live endpoint this
|
|
367
|
+
// server is already serving, never rebuilt from Metro's port, for the same reason the endpoint
|
|
368
|
+
// is passed through rather than derived. `readEndpointRecord` returning undefined also covers a
|
|
369
|
+
// record left corrupt or truncated, which is equally unusable to the next run.
|
|
370
|
+
if (updateEndpoint && !readEndpointRecord(config)) {
|
|
371
|
+
const port = Number(new URL(updateEndpoint.baseUrl).port);
|
|
372
|
+
if (Number.isInteger(port) && port > 0)
|
|
373
|
+
writeEndpointRecord(config, { port, secret: updateEndpoint.secret });
|
|
374
|
+
}
|
|
361
375
|
reclaimLock();
|
|
362
376
|
sync(config);
|
|
363
377
|
return { missing, repaired: true };
|