@calo-design/cli 0.4.4 → 0.4.5
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 +21 -2
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -589,16 +589,35 @@ async function cmdUpdate() {
|
|
|
589
589
|
// Re-pin when the runtime is fully present OR merely scaffolded (package.json on disk),
|
|
590
590
|
// so a half-installed runtime self-heals via plain `update` instead of being stranded.
|
|
591
591
|
const scaffolded = fs.existsSync(path.join(runtimeDir(), "package.json"));
|
|
592
|
+
// Snapshot the pinned @calo commit SHAs BEFORE re-pinning, so we can tell whether this update
|
|
593
|
+
// actually moved anything. The design system is git-HEAD-tracked (pinned by commit, not by an
|
|
594
|
+
// npm version bump — its package.json version can sit unchanged across many real commits), so
|
|
595
|
+
// the SHA is the true "did anything change" signal.
|
|
596
|
+
const before = installedCaloShas(runtimeDir()) || {};
|
|
597
|
+
let repinned = false;
|
|
592
598
|
if (runtimeExists() || scaffolded || has("--build")) {
|
|
593
599
|
await ensureRuntime({ force: true });
|
|
594
600
|
ok("shared runtime re-pinned — every linked prototype now uses the latest Calo stack");
|
|
601
|
+
repinned = true;
|
|
595
602
|
} else {
|
|
596
603
|
log(c.dim(" No shared runtime yet — run `calo-design init` in a prototype folder to create one."));
|
|
597
604
|
}
|
|
598
|
-
//
|
|
605
|
+
// Only record an update event when the pinned code ACTUALLY changed (or we can't tell / it's a
|
|
606
|
+
// first install). A no-op re-pin — clicking Update when nothing new shipped — writes nothing,
|
|
607
|
+
// so the feed stops filling with identical "updated the design system to 0.2.0" rows.
|
|
608
|
+
const after = installedCaloShas(runtimeDir()) || {};
|
|
609
|
+
const changed = !Object.keys(before).length || JSON.stringify(before) !== JSON.stringify(after);
|
|
610
|
+
if (repinned && !changed) {
|
|
611
|
+
log(c.dim(" Already up to date — nothing new to record in the feed."));
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
// Tag the feed entry with the DS version we floated to (read fresh from disk, not require()'s
|
|
615
|
+
// cache). Bump @calo/design-system's version on real releases (`npm run release` there) to make
|
|
616
|
+
// this number meaningful — the SHA gate above already guarantees it only logs on real change.
|
|
599
617
|
let dsVersion = "";
|
|
600
618
|
try {
|
|
601
|
-
|
|
619
|
+
const pj = JSON.parse(fs.readFileSync(path.join(runtimeDir(), "node_modules", "@calo", "design-system", "package.json"), "utf8"));
|
|
620
|
+
dsVersion = pj.version || "";
|
|
602
621
|
} catch { /* runtime not present — report without a version */ }
|
|
603
622
|
await reportEvent("update", dsVersion);
|
|
604
623
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@calo-design/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "One-line setup for Calo design tooling: logs in with your Calo email and installs the calo-design skill + design-system packages. No GitHub account needed.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"calo-design": "bin/cli.js"
|