@norskvideo/ctl-dev-kit 0.1.68 → 0.1.69

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.
@@ -254,6 +254,11 @@ export interface CanonicalBytes {
254
254
  smoke: string;
255
255
  /** conventions/demo.sh — the scripts/demo shim a product with tests/demo.spec.ts carries. */
256
256
  demoShim: string;
257
+ /** doc-guide/with-display.sh — the X-display wrapper BOTH docs workflows invoke
258
+ * as `scripts/with-display.sh`. Gated because the workflow is: an ungated
259
+ * hand copy is how build-docs.yml came to fail in both turnkeys, which never
260
+ * made one. */
261
+ withDisplay: string;
257
262
  }
258
263
 
259
264
  // 05-demo s6: a product that has a demo (tests/demo.spec.ts) exposes it the
@@ -568,6 +573,32 @@ export function checkDrift(repoRoot: string, canonical: CanonicalBytes, opts: Ch
568
573
  }
569
574
  for (const p of docsExposureProblems(existsSync(publishDocsPath), existsSync(buildDocsPath), opts.repoName)) push(p);
570
575
 
576
+ // Both docs workflows run `bash scripts/with-display.sh scripts/doc-guide/...`.
577
+ // The workflow is gated byte-for-byte and the script it invokes was not gated
578
+ // at all, so a repo could satisfy the gate and still have no way to run the
579
+ // step: build-docs.yml failed on its first scheduled run in BOTH turnkeys with
580
+ // "bash: scripts/with-display.sh: No such file or directory", after the prose
581
+ // bundle had already built. It stays a repo-local executable on purpose (the
582
+ // package.json guide scripts invoke it by that path); it is the ABSENCE from
583
+ // the gate that was the bug.
584
+ const carriesDocs = existsSync(publishDocsPath) || existsSync(buildDocsPath);
585
+ if (carriesDocs) {
586
+ const which = existsSync(buildDocsPath) ? "build-docs.yml" : "publish-docs.yml";
587
+ const withDisplayPath = join(repoRoot, "scripts", "with-display.sh");
588
+ if (!existsSync(withDisplayPath)) {
589
+ push(
590
+ `.github/workflows/${which} runs \`bash scripts/with-display.sh\`, but this repo has no scripts/with-display.sh — the step cannot run. ${RESYNC}`,
591
+ );
592
+ } else {
593
+ const actual = readFileSync(withDisplayPath, "utf8");
594
+ if (actual !== canonical.withDisplay) {
595
+ push(
596
+ `scripts/with-display.sh has drifted from @norskvideo/ctl-dev-kit doc-guide/with-display.sh (${firstDiffLine(actual, canonical.withDisplay)}). ${RESYNC}`,
597
+ );
598
+ }
599
+ }
600
+ }
601
+
571
602
  for (const p of demoProblems(repoRoot, canonical.demoShim)) push(p);
572
603
 
573
604
  return { ok: problems.length === 0, problems };
@@ -583,6 +614,7 @@ if (import.meta.main) {
583
614
  syncCtlPackages: readFileSync(join(import.meta.dir, "sync-ctl-packages.yml"), "utf8"),
584
615
  publishDocs: readFileSync(join(import.meta.dir, "publish-docs.yml"), "utf8"),
585
616
  buildDocs: readFileSync(join(import.meta.dir, "build-docs.yml"), "utf8"),
617
+ withDisplay: readFileSync(join(import.meta.dir, "..", "doc-guide", "with-display.sh"), "utf8"),
586
618
  checks: readFileSync(join(import.meta.dir, "checks.yml"), "utf8"),
587
619
  biome: readFileSync(join(import.meta.dir, "biome.base.json"), "utf8"),
588
620
  tsconfigBase: readFileSync(join(import.meta.dir, "tsconfig.base.json"), "utf8"),
@@ -214,6 +214,22 @@ function syncDemoShim(repoRoot: string, canonical: string, r: SyncReport): void
214
214
  chmodSync(path, 0o755);
215
215
  }
216
216
 
217
+ // Both docs workflows run `bash scripts/with-display.sh ...`. It stays a
218
+ // repo-local executable (the package.json guide scripts invoke it by that path),
219
+ // so a repo that carries a docs workflow gets the canonical copy written here
220
+ // rather than hand-copied — which is what neither turnkey ever did.
221
+ function syncWithDisplay(repoRoot: string, canonical: string, r: SyncReport): void {
222
+ const carriesDocs =
223
+ existsSync(join(repoRoot, ".github/workflows/publish-docs.yml")) ||
224
+ existsSync(join(repoRoot, ".github/workflows/build-docs.yml"));
225
+ if (!carriesDocs) return;
226
+ const rel = "scripts/with-display.sh";
227
+ const path = join(repoRoot, rel);
228
+ mkdirSync(dirname(path), { recursive: true });
229
+ writeIfChanged(path, canonical, rel, r.written);
230
+ chmodSync(path, 0o755);
231
+ }
232
+
217
233
  export function syncDrift(repoRoot: string, canonical: CanonicalBytes): SyncReport {
218
234
  const r: SyncReport = { written: [], skipped: [] };
219
235
 
@@ -253,6 +269,7 @@ export function syncDrift(repoRoot: string, canonical: CanonicalBytes): SyncRepo
253
269
  syncGitignore(repoRoot, canonical.gitignoreCore, r);
254
270
  syncDprint(repoRoot, canonical.dprint, r);
255
271
  syncDemoShim(repoRoot, canonical.demoShim, r);
272
+ syncWithDisplay(repoRoot, canonical.withDisplay, r);
256
273
 
257
274
  return r;
258
275
  }
@@ -268,6 +285,7 @@ if (import.meta.main) {
268
285
  syncCtlPackages: readFileSync(join(dir, "sync-ctl-packages.yml"), "utf8"),
269
286
  publishDocs: readFileSync(join(dir, "publish-docs.yml"), "utf8"),
270
287
  buildDocs: readFileSync(join(dir, "build-docs.yml"), "utf8"),
288
+ withDisplay: readFileSync(join(dir, "..", "doc-guide", "with-display.sh"), "utf8"),
271
289
  checks: readFileSync(join(dir, "checks.yml"), "utf8"),
272
290
  biome: readFileSync(join(dir, "biome.base.json"), "utf8"),
273
291
  tsconfigBase: readFileSync(join(dir, "tsconfig.base.json"), "utf8"),
@@ -1616,6 +1616,7 @@ export const backendTurnkey: ShapeModule = {
1616
1616
  { path: "docs/known-limitations.md", content: KNOWN_LIMITATIONS_MD },
1617
1617
  { path: ".github/workflows/build-docs.yml", content: ctx.canon.buildDocs },
1618
1618
  { path: "scripts/doc-guide/regen-manual.sh", content: REGEN_MANUAL_SH, executable: true },
1619
+ { path: "scripts/with-display.sh", content: ctx.canon.withDisplay, executable: true },
1619
1620
  { path: "scripts/docs-handover.sh", content: DOCS_HANDOVER_SH, executable: true },
1620
1621
  { path: "tests/demo.spec.ts", content: demoSpecTs(ctx) },
1621
1622
  { path: "tests/unit/demo-spec.test.ts", content: DEMO_SPEC_TEST_TS },
@@ -31,6 +31,9 @@ export interface Canon {
31
31
  invariantsTemplate: string;
32
32
  /** conventions/demo.sh, emitted as scripts/demo. */
33
33
  demoShim: string;
34
+ /** doc-guide/with-display.sh, emitted as scripts/with-display.sh — the docs
35
+ * workflow invokes it by that repo-local path. */
36
+ withDisplay: string;
34
37
  }
35
38
 
36
39
  export function loadCanon(): Canon {
@@ -43,6 +46,7 @@ export function loadCanon(): Canon {
43
46
  syncCtlPackages: readFileSync(join(conventionsDir, "sync-ctl-packages.yml"), "utf8"),
44
47
  checks: readFileSync(join(conventionsDir, "checks.yml"), "utf8"),
45
48
  buildDocs: readFileSync(join(conventionsDir, "build-docs.yml"), "utf8"),
49
+ withDisplay: readFileSync(join(conventionsDir, "..", "doc-guide", "with-display.sh"), "utf8"),
46
50
  biome: readFileSync(join(conventionsDir, "biome.base.json"), "utf8"),
47
51
  tsconfigBase: readFileSync(join(conventionsDir, "tsconfig.base.json"), "utf8"),
48
52
  dprint: readFileSync(join(conventionsDir, "dprint.base.jsonc"), "utf8"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-dev-kit",
3
- "version": "0.1.68",
3
+ "version": "0.1.69",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./create-product": "./create-product/create-product.ts",