@tokenoftrust/cli 1.3.4-rc.0 → 1.3.4-rc.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/src/commands/dev.mjs +26 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/cli",
|
|
3
|
-
"version": "1.3.4-rc.
|
|
3
|
+
"version": "1.3.4-rc.1",
|
|
4
4
|
"description": "Token of Trust developer CLI — check out a tenant store, run it locally with save→reload, and submit it for preview. Installs the `tot` command.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Token of Trust",
|
package/src/commands/dev.mjs
CHANGED
|
@@ -425,12 +425,15 @@ export async function resolveRendererSource(args, { client } = {}) {
|
|
|
425
425
|
* is keyed by version, upgrading the CLI busts the stale-runner cache automatically
|
|
426
426
|
* (the 2026-07-14 "cached runner (prior tot dev)" staleness).
|
|
427
427
|
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
*
|
|
433
|
-
*
|
|
428
|
+
* EXACT-FIRST (the CLI requests its OWN version): with lockstep publishing the runner
|
|
429
|
+
* is published at the SAME version as the CLI, so the exact match (step 2) is the normal
|
|
430
|
+
* path. An explicit pin (`--renderer-version` / TOT_RUNNER_VERSION) always wins. When no
|
|
431
|
+
* exact match exists we degrade ONLY DOWNWARD — a runner at or below the CLI's major.minor
|
|
432
|
+
* (never ahead) — and NEVER to a floating dist-tag like `latest` (a channel can point at a
|
|
433
|
+
* version this CLI doesn't expect; that floating-tag drift is the exact bug this avoids).
|
|
434
|
+
* The caller emits a LOUD skew warning whenever the resolved version isn't the exact CLI
|
|
435
|
+
* version, so a mismatch is visible, not silent. If nothing exact/minor/≤-ceiling is
|
|
436
|
+
* published, we THROW — a release gap to fix by publishing the aligned runner, not paper over.
|
|
434
437
|
*
|
|
435
438
|
* Pure (no I/O) for testability.
|
|
436
439
|
* @param {any} meta npm packument (`dist-tags` + `versions`)
|
|
@@ -493,10 +496,12 @@ export function pickRunnerVersion(meta, { cliVersion, explicitPin }) {
|
|
|
493
496
|
const version = capped[capped.length - 1];
|
|
494
497
|
return { version, reason: `highest ≤ CLI major.minor ${cliMM ? `${cliMM.major}.${cliMM.minor}` : "?"}` };
|
|
495
498
|
}
|
|
496
|
-
//
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
499
|
+
// NO floating-tag last resort. We deliberately do NOT fall back to the `latest`
|
|
500
|
+
// dist-tag: a channel can drift behind/ahead of what THIS CLI expects (the exact
|
|
501
|
+
// failure mode that shipped stale CLIs — see the copy-paste pin in the storefront
|
|
502
|
+
// cockpit). If nothing exact/minor/≤-ceiling is published, that's a release gap to
|
|
503
|
+
// fix by publishing the runner at the CLI's version — not something to paper over
|
|
504
|
+
// with whatever `latest` happens to point at.
|
|
500
505
|
throw new Error(
|
|
501
506
|
`no runner version at or below the CLI's major.minor (${cliMM ? `${cliMM.major}.${cliMM.minor}` : cliVersion})`,
|
|
502
507
|
);
|
|
@@ -536,7 +541,17 @@ export async function resolvePublicRendererSource(args, env = process.env) {
|
|
|
536
541
|
throw new Error(`npm metadata for ${pkg} failed: HTTP ${res.status} ${res.statusText}`);
|
|
537
542
|
}
|
|
538
543
|
const meta = await res.json();
|
|
539
|
-
const { version } = pickRunnerVersion(meta, { cliVersion: CLI_VERSION, explicitPin });
|
|
544
|
+
const { version, reason } = pickRunnerVersion(meta, { cliVersion: CLI_VERSION, explicitPin });
|
|
545
|
+
// Exact is the goal (lockstep publish → runner@CLI_VERSION always present). If we
|
|
546
|
+
// resolved something ELSE, the versions are skewed — surface it LOUDLY instead of
|
|
547
|
+
// silently running a mismatched runner (the class of bug this whole change targets).
|
|
548
|
+
if (!explicitPin && version !== CLI_VERSION) {
|
|
549
|
+
console.warn(
|
|
550
|
+
` ⚠ runner ${version} — no exact @${CLI_VERSION} published (${reason}). ` +
|
|
551
|
+
`CLI/runner versions are SKEWED; publish the runner at ${CLI_VERSION} to align ` +
|
|
552
|
+
`(or pin with --renderer-version to silence).`,
|
|
553
|
+
);
|
|
554
|
+
}
|
|
540
555
|
const tarball = meta?.versions?.[version]?.dist?.tarball;
|
|
541
556
|
if (!tarball) throw new Error(`no published ${pkg}@${version} on npm`);
|
|
542
557
|
return { kind: "public", version, url: tarball, strip: 1, cacheKey: `public-${version}` };
|