@norskvideo/ctl-dev-kit 0.1.12 → 0.1.13

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.
@@ -54,6 +54,22 @@ function workflowProblem(actual: string, canonical: string): string | undefined
54
54
  return undefined;
55
55
  }
56
56
 
57
+ // The dev-only ctl pin the nightly bumps in each repo's flake: the version
58
+ // string and the four per-platform source hashes. CI downloads ctl directly, so
59
+ // this pin only feeds the dev flake; it floats per repo and over time and is NOT
60
+ // a shared convention. Mask it so the gate compares flake STRUCTURE, not the pin
61
+ // — same idea as masking upgrade-latest's product: line.
62
+ const CTL_VERSION_LINE = /ctlVersion = "[^"]*";/;
63
+ const CTL_HASH_LINE = /hash = "sha256-[^"]*";/g;
64
+
65
+ function flakeProblem(actual: string, canonical: string): string | undefined {
66
+ const mask = (s: string) =>
67
+ s.replace(CTL_VERSION_LINE, 'ctlVersion = "__CTL__";').replace(CTL_HASH_LINE, 'hash = "sha256-__HASH__";');
68
+ const [ma, mc] = [mask(actual), mask(canonical)];
69
+ if (ma === mc) return undefined;
70
+ return `flake.nix has drifted from @norskvideo/ctl-dev-kit build/flake.nix (${firstDiffLine(ma, mc)}). ${RESYNC}`;
71
+ }
72
+
57
73
  function coreProblem(claude: string, canonicalCore: string): string | undefined {
58
74
  if (claude.includes(canonicalCore)) return undefined;
59
75
 
@@ -86,12 +102,8 @@ export function checkDrift(
86
102
  `flake.nix not found at repo root (${flakePath}). It is copied verbatim from @norskvideo/ctl-dev-kit build/flake.nix.`,
87
103
  );
88
104
  } else {
89
- const flake = readFileSync(flakePath, "utf8");
90
- if (flake !== canonical.flake) {
91
- problems.push(
92
- `flake.nix has drifted from @norskvideo/ctl-dev-kit build/flake.nix (${firstDiffLine(flake, canonical.flake)}). ${RESYNC}`,
93
- );
94
- }
105
+ const problem = flakeProblem(readFileSync(flakePath, "utf8"), canonical.flake);
106
+ if (problem) problems.push(problem);
95
107
  }
96
108
 
97
109
  // upgrade-latest.yml is OPTIONAL — a product may ship without a nightly bump
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-dev-kit",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./package.json": "./package.json"