@norskvideo/ctl-dev-kit 0.2.92 → 0.2.93

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.
@@ -176,12 +176,14 @@ ln -s ../../../../../docs/generated/<slug> website/src/content/docs/guides/<slug
176
176
  ```
177
177
 
178
178
  `docs:site` runs the dev-kit's `docs/guide-stubs.ts stub` first, so the site
179
- builds on a checkout that has never captured; `publish-docs-site.yml` runs
180
- `guide-stubs.ts check` after the build and refuses to deploy while any guide
181
- is still a placeholder. That refusal is deliberate: a product that declares
182
- recorded guides must also restore (or regenerate) its captures in that
183
- workflow before the build, and until it does, the publish stops rather than
184
- shipping an empty page.
179
+ builds on a checkout that has never captured. The captures come from the
180
+ product's nightly `publish-docs.yml`, which saves `docs/generated` to the
181
+ Actions cache after a passing engine tier; `publish-docs-site.yml` restores
182
+ the newest set before its build (and runs when `publish-docs` completes, so a
183
+ fresh capture publishes without waiting for a push). It then runs
184
+ `guide-stubs.ts check` and refuses to deploy while any guide is still a
185
+ placeholder: until the guide has been captured once, the publish stops rather
186
+ than shipping an empty page.
185
187
 
186
188
  ## The two builds
187
189
 
@@ -211,9 +213,10 @@ holds the copy byte-identical, and `bun run sync:drift` writes it — creating i
211
213
  where the repo has a site and is not a turnkey. On every push to `main` (and on
212
214
  demand) it installs `website/`, builds the public variant and deploys
213
215
  `website/dist-public` to Cloudflare Pages with `wrangler`. It never cancels a
214
- run in flight, because a cancelled deploy is a half-published site. It restores
215
- no capture cache: a product site builds from the committed prose, so there is
216
- nothing a nightly run would have that a push does not.
216
+ run in flight, because a cancelled deploy is a half-published site. Before the
217
+ build it restores the newest recorded-guide captures from the Actions cache
218
+ (`docs-captures-*`, saved by `publish-docs.yml`); a site with no recorded
219
+ guides restores nothing it reads, and builds from its committed prose.
217
220
 
218
221
  Where it may exist is the gate's business (ADR-0012, and the documentation
219
222
  plan): a repo with `website/astro.config.mjs` may carry it; a repo without a
@@ -4,12 +4,14 @@
4
4
  #
5
5
  # This is the SITE channel, not the bundle: publish-docs.yml / build-docs.yml
6
6
  # regenerate the illustrated manual the product image serves at /docs, nightly,
7
- # from a licensed Docker run. The site builds from the committed prose alone,
8
- # needs no licence and no Docker, and so rides every push (conventions/
9
- # docs-site.md, "Two documentation channels"). A site that also symlinks
10
- # RECORDED guides (website/src/content/docs/guides/<slug> -> docs/generated/<slug>)
11
- # builds against a placeholder when the capture is absent, and the gate below
12
- # refuses to deploy one.
7
+ # from a licensed Docker run. The site needs no licence and no Docker, and so
8
+ # rides every push (conventions/docs-site.md, "Two documentation channels").
9
+ # A site that also symlinks RECORDED guides (website/src/content/docs/guides/
10
+ # <slug> -> docs/generated/<slug>) publishes them from the captures that nightly
11
+ # run saves to the Actions cache: they are restored before the build, which
12
+ # stubs only a guide never captured, and the gate below refuses to deploy a
13
+ # stub. So the site also runs when publish-docs completes, to publish a fresh
14
+ # capture without waiting for the next push.
13
15
  #
14
16
  # This workflow is SINGLE-SOURCED in @norskvideo/ctl-dev-kit
15
17
  # (conventions/publish-docs-site.yml) and copied verbatim: there is no per-repo
@@ -40,6 +42,11 @@ on:
40
42
  push:
41
43
  branches: [main]
42
44
  workflow_dispatch:
45
+ # a fresh capture of the recorded guides (publish-docs.yml saves it)
46
+ workflow_run:
47
+ workflows: [publish-docs]
48
+ types: [completed]
49
+ branches: [main]
43
50
 
44
51
  permissions:
45
52
  contents: read
@@ -114,6 +121,19 @@ jobs:
114
121
  with:
115
122
  clean: true
116
123
 
124
+ # The recorded guides' captures, from the product's nightly capture run
125
+ # (publish-docs.yml saves docs/generated after a passing engine tier):
126
+ # the newest set, restored where docs:site:public expects it. None yet --
127
+ # a site that records no guides, or before the first capture -- restores
128
+ # nothing; the build stubs what is missing and the gate below refuses to
129
+ # deploy a stub.
130
+ - name: Restore the recorded guides' captures
131
+ uses: actions/cache/restore@v4
132
+ with:
133
+ path: docs/generated
134
+ key: docs-captures-${{ github.sha }}
135
+ restore-keys: docs-captures-
136
+
117
137
  # website/ is a STANDALONE package -- its own bun.lock, outside the root
118
138
  # workspaces -- so the repo-root install never covers it, and the build
119
139
  # needs both: the root for @norskvideo/ctl-dev-kit (docs:site:public stubs
@@ -145,8 +165,9 @@ jobs:
145
165
  # be replaced with "run the doc-guide locally", and nothing else would
146
166
  # notice -- the build is green, the links resolve. --content reads the
147
167
  # guides the site declares by symlink, so a site that declares none has
148
- # nothing to refuse; one that does needs its captures on the runner, and
149
- # until the repo restores them this step says which pages are missing.
168
+ # nothing to refuse; one that does needs its captures, restored above,
169
+ # and until the nightly run has captured them this step says which pages
170
+ # are missing.
150
171
  - name: Refuse to publish placeholder guides
151
172
  run: |
152
173
  nix develop .#build --command bash -c '
@@ -318,6 +318,18 @@ jobs:
318
318
  if: ${{ steps.engine.outcome == 'success' }}
319
319
  run: nix develop .#build --command bun run docs:manual
320
320
 
321
+ # The captures, for the product's own docs site: publish-docs-site.yml
322
+ # restores the newest set, so its recorded guides publish from this run,
323
+ # the only one that can make them. Only after a passing engine tier, so a
324
+ # site never takes a half-captured set over the last good one. Each run
325
+ # its own key: a cache entry is never overwritten.
326
+ - name: Cache the guide captures for the docs site
327
+ if: ${{ steps.engine.outcome == 'success' }}
328
+ uses: actions/cache/save@v4
329
+ with:
330
+ path: docs/generated
331
+ key: docs-captures-${{ github.sha }}-${{ github.run_id }}
332
+
321
333
  # Said three ways, so a failure is never silent: a warning on the run, a
322
334
  # line in its summary, and the cell's detail (the notify job).
323
335
  - name: Report the engine tier (not gating)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-dev-kit",
3
- "version": "0.2.92",
3
+ "version": "0.2.93",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./create-product": "./create-product/create-product.ts",