@norskvideo/ctl-dev-kit 0.2.127 → 0.2.129
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.
|
@@ -96,10 +96,11 @@
|
|
|
96
96
|
the dev-kit source and re-sync.
|
|
97
97
|
- **CI runs the norsk-ctl this repo pins** (`flake.nix` `ctlVersion`), never S3's
|
|
98
98
|
moving `latest`; only a `ctl-candidate` run tests a channel (`rc`). One nightly
|
|
99
|
-
bump, `bump.yml`, moves the dev-kit, the ctl-* and moq-* packages
|
|
100
|
-
engine/Studio/norsk-ctl pins
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
bump, `bump.yml`, moves the dev-kit, the ctl-* and moq-* packages (with zod,
|
|
100
|
+
to exactly the version they declare), and the engine/Studio/norsk-ctl pins
|
|
101
|
+
together, and never pushes to main: it opens one PR on `bump/nightly`, and
|
|
102
|
+
`bot-prs` merges it once checks, smoke, integration and the guides gate
|
|
103
|
+
(build-image) are green on it. A red bump PR is the alarm for a
|
|
103
104
|
bad upstream change, and names what moved; main stays green. To land the rest
|
|
104
105
|
without a bad component: `gh workflow run bump.yml -f components=<the others>`
|
|
105
106
|
(`dev-kit`, `ctl-packages`, `pins`).
|
|
@@ -226,6 +226,13 @@ jobs:
|
|
|
226
226
|
[ -n "$v" ] || refuse "could not resolve @norskvideo/$short latest"
|
|
227
227
|
latest[$short]="$v"
|
|
228
228
|
done
|
|
229
|
+
# zod moves with this family. zod-singleton.ts requires a product's
|
|
230
|
+
# one zod to be exactly the zod the ctl-* packages declare, so moving
|
|
231
|
+
# their pins without it would fail that gate in every product the
|
|
232
|
+
# night a new ctl-sdk declares a new zod. Resolved here, before
|
|
233
|
+
# anything is rewritten, so an unreadable answer refuses the step.
|
|
234
|
+
zod="$(curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 "$reg/@norskvideo%2Fctl-sdk/${latest[ctl-sdk]}" | jq -r '.dependencies.zod // empty' || true)"
|
|
235
|
+
[ -n "$zod" ] || refuse "could not resolve the zod @norskvideo/ctl-sdk ${latest[ctl-sdk]} declares"
|
|
229
236
|
|
|
230
237
|
# Every tracked package.json, not just the root: a repo can pin the
|
|
231
238
|
# same package in a nested workspace (playout pins the harness twice),
|
|
@@ -259,6 +266,22 @@ jobs:
|
|
|
259
266
|
done
|
|
260
267
|
for v in $moq; do parts+=("moq \`$v\`"); done
|
|
261
268
|
|
|
269
|
+
# Exactly the version, in every manifest that declares zod (root
|
|
270
|
+
# overrides and workspace dependencies alike), as create-product
|
|
271
|
+
# emits it. workspace:, file: and link: values are not versions and
|
|
272
|
+
# stay as they are.
|
|
273
|
+
zhit=0
|
|
274
|
+
for m in "${manifests[@]}"; do
|
|
275
|
+
for old in $(grep -oE '"zod"[[:space:]]*:[[:space:]]*"[~^]?[0-9][^"]*"' "$m" | sed -E 's/.*"([^"]*)"$/\1/' | sort -u); do
|
|
276
|
+
[ "$old" != "$zod" ] || continue
|
|
277
|
+
echo "$m: zod $old -> $zod"
|
|
278
|
+
moved+=("- zod: $old -> $zod ($m)")
|
|
279
|
+
zhit=1
|
|
280
|
+
done
|
|
281
|
+
sed -i -E "s|(\"zod\"[[:space:]]*:[[:space:]]*\")[~^]?[0-9][^\"]*(\")|\1$zod\2|g" "$m"
|
|
282
|
+
done
|
|
283
|
+
[ "$zhit" = 0 ] || parts+=("zod \`$zod\`")
|
|
284
|
+
|
|
262
285
|
if [ ${#moved[@]} -eq 0 ]; then
|
|
263
286
|
echo "every ctl-* and moq-* pin is already on its newest published version."
|
|
264
287
|
{ echo "changed=0"; echo "summary="; echo "refused="; } >> "$GITHUB_OUTPUT"
|
package/conventions/bump.yml
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
# run and one PR:
|
|
4
4
|
# 1. dev-kit: @norskvideo/ctl-dev-kit to npm `latest`, and every convention
|
|
5
5
|
# copy re-synced from it (sync-drift) -- this workflow included;
|
|
6
|
-
# 2. ctl-packages: the @norskvideo/ctl-* and moq-* family to npm `latest
|
|
6
|
+
# 2. ctl-packages: the @norskvideo/ctl-* and moq-* family to npm `latest`,
|
|
7
|
+
# and every zod pin to exactly the zod ctl-sdk declares;
|
|
7
8
|
# 3. pins: the engine and Studio image pair from the nightly entry of
|
|
8
9
|
# norsk-studio's channel manifest, and flake.nix's norsk-ctl pin to the
|
|
9
10
|
# `rc` channel (hourly builds of main that passed ctl's release checks;
|
|
@@ -251,6 +252,13 @@ jobs:
|
|
|
251
252
|
[ -n "$v" ] || refuse "could not resolve @norskvideo/$short latest"
|
|
252
253
|
latest[$short]="$v"
|
|
253
254
|
done
|
|
255
|
+
# zod moves with this family. zod-singleton.ts requires a product's
|
|
256
|
+
# one zod to be exactly the zod the ctl-* packages declare, so moving
|
|
257
|
+
# their pins without it would fail that gate in every product the
|
|
258
|
+
# night a new ctl-sdk declares a new zod. Resolved here, before
|
|
259
|
+
# anything is rewritten, so an unreadable answer refuses the step.
|
|
260
|
+
zod="$(curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 "$reg/@norskvideo%2Fctl-sdk/${latest[ctl-sdk]}" | jq -r '.dependencies.zod // empty' || true)"
|
|
261
|
+
[ -n "$zod" ] || refuse "could not resolve the zod @norskvideo/ctl-sdk ${latest[ctl-sdk]} declares"
|
|
254
262
|
|
|
255
263
|
# Every tracked package.json, not just the root: a repo can pin the
|
|
256
264
|
# same package in a nested workspace (playout pins the harness twice),
|
|
@@ -284,6 +292,22 @@ jobs:
|
|
|
284
292
|
done
|
|
285
293
|
for v in $moq; do parts+=("moq \`$v\`"); done
|
|
286
294
|
|
|
295
|
+
# Exactly the version, in every manifest that declares zod (root
|
|
296
|
+
# overrides and workspace dependencies alike), as create-product
|
|
297
|
+
# emits it. workspace:, file: and link: values are not versions and
|
|
298
|
+
# stay as they are.
|
|
299
|
+
zhit=0
|
|
300
|
+
for m in "${manifests[@]}"; do
|
|
301
|
+
for old in $(grep -oE '"zod"[[:space:]]*:[[:space:]]*"[~^]?[0-9][^"]*"' "$m" | sed -E 's/.*"([^"]*)"$/\1/' | sort -u); do
|
|
302
|
+
[ "$old" != "$zod" ] || continue
|
|
303
|
+
echo "$m: zod $old -> $zod"
|
|
304
|
+
moved+=("- zod: $old -> $zod ($m)")
|
|
305
|
+
zhit=1
|
|
306
|
+
done
|
|
307
|
+
sed -i -E "s|(\"zod\"[[:space:]]*:[[:space:]]*\")[~^]?[0-9][^\"]*(\")|\1$zod\2|g" "$m"
|
|
308
|
+
done
|
|
309
|
+
[ "$zhit" = 0 ] || parts+=("zod \`$zod\`")
|
|
310
|
+
|
|
287
311
|
if [ ${#moved[@]} -eq 0 ]; then
|
|
288
312
|
echo "every ctl-* and moq-* pin is already on its newest published version."
|
|
289
313
|
{ echo "changed=0"; echo "summary="; echo "refused="; } >> "$GITHUB_OUTPUT"
|
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
//
|
|
5
5
|
// norsk-studio consolidated onto one hoisted zod 4 (2026-08) and guards it with
|
|
6
6
|
// its own scripts/check-zod-singleton.mjs — but that guard is repo-local and was
|
|
7
|
-
// never shipped, so the products are the one layer where studio's
|
|
8
|
-
// norsk-ctl's exact
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
// zod-openapi) stops typechecking.
|
|
7
|
+
// never shipped, so the products are the one layer where studio's zod range,
|
|
8
|
+
// norsk-ctl's exact zod pin and @norskvideo/moq-watch's range all meet, with
|
|
9
|
+
// the loosest declared range (`^4.3.6`) and nothing checking the result. That
|
|
10
|
+
// is how probe went red and how funke/reuters ended up latently split: the tree
|
|
11
|
+
// resolves TWO zod instances and a schema handed across the boundary (e.g.
|
|
12
|
+
// ManifestSchema from ctl-sdk into zod-openapi) stops typechecking.
|
|
14
13
|
//
|
|
15
14
|
// This is the products' analogue of that guard, run in the `checks` quality job
|
|
16
15
|
// (conventions/checks.yml) the same way as check-drift.ts — invoked by its
|
|
@@ -20,9 +19,11 @@
|
|
|
20
19
|
// zod 3.x (a dev-only tool npm/bun isolates) is tolerated and only noted. Any
|
|
21
20
|
// second distinct 4.x — the split — fails, and the fix is a single-version pin
|
|
22
21
|
// in the root package.json `overrides`, matching the exact zod the @norskvideo/ctl-*
|
|
23
|
-
// packages depend on (create-product emits it as PRODUCT_ZOD).
|
|
24
|
-
//
|
|
25
|
-
//
|
|
22
|
+
// packages depend on (create-product emits it as PRODUCT_ZOD). Products follow
|
|
23
|
+
// that pin: the nightly bump (bump.yml) moves zod with the ctl-* pins. (zod 4.5+ renders a schema with a
|
|
24
|
+
// root registry id as a bare `$ref`, which the MCP client rejects as a tool's
|
|
25
|
+
// inputSchema; norsk-ctl strips the root id with `withoutRootId` before it
|
|
26
|
+
// registers a tool, so that is no reason to hold zod back.)
|
|
26
27
|
|
|
27
28
|
import { existsSync, readFileSync } from "node:fs";
|
|
28
29
|
import { join } from "node:path";
|
|
@@ -120,8 +121,7 @@ export function checkZodSingleton(repoRoot: string): ZodSingletonResult {
|
|
|
120
121
|
errors.push(`bun.lock: unexpected zod ${v} (${keys.join(", ")}) — only zod 4 is permitted`);
|
|
121
122
|
}
|
|
122
123
|
|
|
123
|
-
// The ctl-* packages pin zod exactly
|
|
124
|
-
// work with 4.5 whatever its range says). A product's one zod must be that one.
|
|
124
|
+
// The ctl-* packages pin zod exactly. A product's one zod must be that one.
|
|
125
125
|
const required = ctlZod.size === 1 ? [...ctlZod.keys()][0] : undefined;
|
|
126
126
|
if (ctlZod.size > 1) {
|
|
127
127
|
const detail = [...ctlZod].map(([v, pkgs]) => ` zod ${v}: ${pkgs.join(", ")}`).join("\n");
|
|
@@ -157,8 +157,7 @@ const DEFAULT_STUDIO_LIB = devKitPin(devKitPackageJson, "@norskvideo/norsk-studi
|
|
|
157
157
|
* and declared by every workspace that uses zod. Derived from the dev-kit's own
|
|
158
158
|
* pin, the same exact version the published ctl-* packages depend on, so the
|
|
159
159
|
* product's tree dedupes onto it instead of splitting beside a newer zod and
|
|
160
|
-
* failing conventions/zod-singleton.ts on day one.
|
|
161
|
-
* @modelcontextprotocol/sdk does not work with 4.5 despite its declared range. */
|
|
160
|
+
* failing conventions/zod-singleton.ts on day one. */
|
|
162
161
|
export const PRODUCT_ZOD = devKitPin(devKitPackageJson, "zod");
|
|
163
162
|
|
|
164
163
|
const bareTag = (ref: string) => ref.slice(ref.lastIndexOf(":") + 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@norskvideo/ctl-dev-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.129",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"vite": "^8.3.5",
|
|
68
68
|
"vitest": "^4.1.12",
|
|
69
69
|
"yaml": "^2.8.0",
|
|
70
|
-
"zod": "4.
|
|
70
|
+
"zod": "4.6.7"
|
|
71
71
|
},
|
|
72
72
|
"peerDependenciesMeta": {
|
|
73
73
|
"@playwright/test": {
|