@norskvideo/ctl-dev-kit 0.2.139 → 0.2.141
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.
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
<!--
|
|
3
3
|
This block is the SHARED conventions core, single-sourced in
|
|
4
4
|
@norskvideo/ctl-dev-kit (conventions/CLAUDE.core.md). It is copied verbatim
|
|
5
|
-
into each product repo's CLAUDE.md between these fenced markers
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
into each product repo's CLAUDE.md between these fenced markers, and
|
|
6
|
+
`check:drift` fails CI if a copy diverges from the dev-kit's version: do NOT
|
|
7
|
+
hand-edit a copy, edit the dev-kit source and re-sync. The per-product tail
|
|
8
|
+
(this product's build, iterate loop, gotchas) lives OUTSIDE the markers and is
|
|
9
|
+
yours to own.
|
|
10
10
|
|
|
11
11
|
It is copied (not `@import`ed) on purpose: CLAUDE.md's value is being read
|
|
12
12
|
verbatim by a human on GitHub with no tooling, and an @import shows a human a
|
|
@@ -94,6 +94,36 @@
|
|
|
94
94
|
same as this core block and `nix/ctl-shell.nix`; `check:drift` fails CI if a copy
|
|
95
95
|
diverges. Only the `product:` key is per-repo. Never hand-edit the copy — edit
|
|
96
96
|
the dev-kit source and re-sync.
|
|
97
|
+
- **The dev-kit gates fail `checks` on rules you cannot see from this repo: run
|
|
98
|
+
them before you push.** `bun run check:drift` and `bun run docs:check` (both
|
|
99
|
+
from `@norskvideo/ctl-dev-kit`, both in the `drift`/`quality` jobs) enforce:
|
|
100
|
+
- **Verbatim copies:** this fenced block, `nix/ctl-shell.nix`, `biome.json`,
|
|
101
|
+
`tsconfig.base.json`, the `.gitignore` core block, `bot-prs.yml`,
|
|
102
|
+
`publish-docs-site.yml` and the other shared workflows (only their
|
|
103
|
+
`product:` line is per-repo). `bun run sync:drift` rewrites them from the
|
|
104
|
+
installed dev-kit; never hand-edit one.
|
|
105
|
+
- **`dprint.json`:** the shared config, plus a `// BEGIN repo-specific
|
|
106
|
+
excludes` block that may hold only `"path",` lines and whole-line `//`
|
|
107
|
+
comments.
|
|
108
|
+
- **Structure:** the root `tsconfig.json` carries only `extends` and `include`
|
|
109
|
+
(which must cover `tests/**/*`), no `compilerOptions`;
|
|
110
|
+
`deployment/build-image.sh` keeps the dev-kit bootstrap; `manifest.seed.json`
|
|
111
|
+
matches the SDK's seed schema; `flake.nix` imports the shared module and
|
|
112
|
+
exposes `packages.<system>.norsk-ctl`.
|
|
113
|
+
- **One dev-kit range in every `package.json`**, nested ones
|
|
114
|
+
(`tests/`, `dashboard/`) included.
|
|
115
|
+
- **Doc paths (`docs:check`):** every backticked path in `README.md`,
|
|
116
|
+
`CLAUDE.md` and `docs/**/*.md` must exist in this repo, written from the repo
|
|
117
|
+
root or the doc's own directory, never shortened (`src/cluster/feed.ts`, not
|
|
118
|
+
`cluster/feed.ts`). A line naming a file in another repo, or a backticked
|
|
119
|
+
token that is not a path, ends with `<!-- path-allow -->`.
|
|
120
|
+
- **`docs/tools/site/`** is a byte-stamped copy from norsk-contracts: change it
|
|
121
|
+
there and re-sync (`bun run sync:docs-site -- <this repo>` in
|
|
122
|
+
norsk-contracts).
|
|
123
|
+
|
|
124
|
+
A rule that is wrong is changed in the dev-kit, with a test, and reaches this
|
|
125
|
+
repo by the bump; don't work around it in the copy. A new or changed gate
|
|
126
|
+
updates this list in the same commit.
|
|
97
127
|
- **CI runs the norsk-ctl this repo pins** (`flake.nix` `ctlVersion`), never S3's
|
|
98
128
|
moving `latest`; only a `ctl-candidate` run tests a channel (`rc`). One nightly
|
|
99
129
|
bump, `bump.yml`, moves the dev-kit, the ctl-* and moq-* packages (with zod,
|
|
@@ -151,8 +151,9 @@ export function ctlPackageProblem(flake: string): string | undefined {
|
|
|
151
151
|
// dprint.json is canonical-plus-extension: the shared config is verbatim, but a
|
|
152
152
|
// repo may exclude paths only it has (e.g. probe's generated components/lib/)
|
|
153
153
|
// inside a sanctioned marker block at the head of `excludes`. Everything outside
|
|
154
|
-
// the block is byte-compared; inside, only well-formed `"entry",` lines
|
|
155
|
-
//
|
|
154
|
+
// the block is byte-compared; inside, only well-formed `"entry",` lines and
|
|
155
|
+
// whole-line `//` comments (saying why a path is excluded) are allowed, so the
|
|
156
|
+
// block can't smuggle arbitrary config past the byte check.
|
|
156
157
|
export const DPRINT_BEGIN = "// BEGIN repo-specific excludes";
|
|
157
158
|
export const DPRINT_END = "// END repo-specific excludes";
|
|
158
159
|
|
|
@@ -179,9 +180,9 @@ function dprintProblem(actual: string, canonical: string): string | undefined {
|
|
|
179
180
|
if (masked(a) !== masked(c)) {
|
|
180
181
|
return `dprint.json has drifted from @norskvideo/ctl-dev-kit conventions/dprint.base.jsonc outside the repo-specific excludes block (${firstDiffLine(masked(a), masked(c))}). ${RESYNC}`;
|
|
181
182
|
}
|
|
182
|
-
const badLine = a.body.find((l) => !/^\s*"[^"]*"
|
|
183
|
+
const badLine = a.body.find((l) => !/^\s*("[^"]*",|\/\/.*)$/.test(l));
|
|
183
184
|
if (badLine !== undefined) {
|
|
184
|
-
return `dprint.json repo-specific excludes block has a malformed line (${JSON.stringify(badLine.trim())}) — one double-quoted exclude entry per line, each ending with a comma.`;
|
|
185
|
+
return `dprint.json repo-specific excludes block has a malformed line (${JSON.stringify(badLine.trim())}) — one double-quoted exclude entry per line, each ending with a comma, or a whole-line // comment.`;
|
|
185
186
|
}
|
|
186
187
|
return undefined;
|
|
187
188
|
}
|