demobite 1.8.0 → 1.8.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/package.json +1 -1
- package/scripts/release.mjs +21 -2
package/package.json
CHANGED
package/scripts/release.mjs
CHANGED
|
@@ -30,7 +30,12 @@ try {
|
|
|
30
30
|
const pkg = { ...base, name, bin: { [name]: "launcher/index.mjs" } };
|
|
31
31
|
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
32
32
|
console.log(`\n── ${name}@${base.version}${dryRun ? " (dry run)" : ""}`);
|
|
33
|
-
|
|
33
|
+
// Publish under a HOLDING tag (founder's test 2026-10-14: `npx demobite@latest`
|
|
34
|
+
// failed with "No matching version found" a minute after a publish — npm
|
|
35
|
+
// moved `latest` before the tarball had propagated, and a customer in that
|
|
36
|
+
// window gets the error). `latest` moves below, once the tarball is
|
|
37
|
+
// actually downloadable.
|
|
38
|
+
const r = spawnSync("npm", ["publish", "--access", "public", "--tag", "pending", ...(dryRun ? ["--dry-run"] : [])], { cwd: root, stdio: "inherit", env: { ...process.env, DEMOBITE_RELEASE: "1" } });
|
|
34
39
|
if (r.status !== 0) { console.error(`\n${name}@${base.version} did not publish (exit ${r.status}). Published so far: ${published.join(", ") || "none"}. Fix and rerun; npm refuses to republish a version that already landed, so bump the patch if some names went out.`); process.exit(r.status ?? 1); }
|
|
35
40
|
published.push(name);
|
|
36
41
|
}
|
|
@@ -38,7 +43,21 @@ try {
|
|
|
38
43
|
fs.writeFileSync(pkgPath, original);
|
|
39
44
|
}
|
|
40
45
|
if (dryRun) { console.log(`\nDry run ok for ${NAMES.join(", ")} at ${base.version}.`); process.exit(0); }
|
|
41
|
-
console.log(`\nPublished ${NAMES.join(", ")} at ${base.version}.
|
|
46
|
+
console.log(`\nPublished ${NAMES.join(", ")} at ${base.version} under the holding tag. Waiting for the tarballs, then moving latest…`);
|
|
47
|
+
const sleep = (ms) => new Promise((res) => setTimeout(res, ms));
|
|
48
|
+
for (const name of NAMES) {
|
|
49
|
+
const url = `https://registry.npmjs.org/${name}/${base.version}`;
|
|
50
|
+
let ok = false;
|
|
51
|
+
for (let i = 0; i < 36 && !ok; i++) {
|
|
52
|
+
try { ok = (await fetch(url + `?t=${Date.now()}`, { cache: "no-store" })).status === 200; } catch { ok = false; }
|
|
53
|
+
if (!ok) await sleep(10000);
|
|
54
|
+
}
|
|
55
|
+
if (!ok) { console.error(` ✗ ${name}@${base.version} not downloadable after 6 minutes — latest NOT moved. Check the registry, then: npm dist-tag add ${name}@${base.version} latest`); process.exitCode = 1; continue; }
|
|
56
|
+
const t = spawnSync("npm", ["dist-tag", "add", `${name}@${base.version}`, "latest"], { cwd: root, stdio: "inherit" });
|
|
57
|
+
if (t.status !== 0) { console.error(` ✗ could not move latest for ${name}; run: npm dist-tag add ${name}@${base.version} latest`); process.exitCode = 1; }
|
|
58
|
+
else console.log(` ✓ ${name}@${base.version} downloadable — latest moved`);
|
|
59
|
+
}
|
|
60
|
+
console.log(`Verifying the registry…`);
|
|
42
61
|
let bad = false;
|
|
43
62
|
for (const name of NAMES) {
|
|
44
63
|
const v = spawnSync("npm", ["view", `${name}@${base.version}`, "version"], { encoding: "utf8" }).stdout.trim();
|