Skip to content

Commit cb9f71b

Browse files
committed
fix(create-objectstack): declare the generator's inputs and its merge disposition
Three gate findings from the first pass, all in the wiring rather than the mechanism: - `check:cross-package-test-inputs` — the emission-policy pin names `scripts/sync-scaffold-emission-policy.mjs`, so `@objectstack/cli` must declare it (with the on-ramp's `bin/` entry and bundled template) or a change to it would replay a cached green over the divergence the pin exists to catch. - `check:merge-driver` — every `gen:` name owes a recorded merge disposition. The bundled `package.json` is MIXED: the generator rewrites two values and reproduces none of the rest, so it is `NOT_DRIVER_MANAGED` with the reason. - The same gate counts generator NAMES, so `create-objectstack`'s build calls the script directly rather than declaring a second `gen:` alias for it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YFY46JydE1gMxQG1TqBcMZ
1 parent 88f60da commit cb9f71b

4 files changed

Lines changed: 23 additions & 2 deletions

File tree

packages/create-objectstack/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
}
1313
},
1414
"scripts": {
15-
"build": "pnpm gen:emission-policy && tsup && node ../../scripts/check-dts-emitted.mjs",
16-
"gen:emission-policy": "node ../../scripts/sync-scaffold-emission-policy.mjs",
15+
"build": "node ../../scripts/sync-scaffold-emission-policy.mjs && tsup && node ../../scripts/check-dts-emitted.mjs",
1716
"typecheck": "tsc --noEmit",
1817
"dev": "tsup --watch",
1918
"test": "vitest run"

scripts/cross-package-test-inputs.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,12 @@ export const CROSS_PACKAGE_TEST_INPUTS = {
544544
// same and replays a cached green over it.
545545
'packages/create-objectstack/bin/create-objectstack.js',
546546
'packages/create-objectstack/src/templates/blank/package.json',
547+
// The generator that ties those two to this package's own constants, and
548+
// the third entry of the mention shape on this package — settled the way
549+
// check-nul-bytes.mjs above is. It earns the declaration on the merits
550+
// too: it is what makes the bundled template equal `SCAFFOLD_*`, so a
551+
// change to it changes what that pin measures.
552+
'scripts/sync-scaffold-emission-policy.mjs',
547553
// The two files that hold the COLUMN authority the CLI's migration
548554
// generators mirror, READ by
549555
// src/commands/generate-multiple-json-column.pin.test.ts (#14829). That

scripts/regen-artifacts.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,21 @@ export const NOT_DRIVER_MANAGED = Object.freeze([
786786
+ 'block inside 267 lines of hand-written guide prose. Same generator, same deferral hazard, '
787787
+ 'same answer: guard the block with `check:skill-docs`, leave the prose to text-merge.',
788788
},
789+
{
790+
path: 'packages/create-objectstack/src/templates/*/package.json',
791+
gen: 'gen:scaffold-emission-policy',
792+
owner: ROOT_OWNER,
793+
why:
794+
'MIXED, and the generated part is TWO VALUES of it. `gen:scaffold-emission-policy` rewrites '
795+
+ "only `engines.pnpm` and `devDependencies.typescript` from the CLI's shared `SCAFFOLD_*` "
796+
+ 'constants; everything else in the file — the scripts block, the dependency LIST, and the '
797+
+ '`@objectstack/*` ranges a different pass (`scripts/sync-template-versions.mjs`) stamps at '
798+
+ 'version time — is authored or owned elsewhere. So "discard both sides and re-run the '
799+
+ 'generator" is not even defined here: the generator REFUSES a template that does not '
800+
+ 'already declare the keys it stamps, and it would reproduce none of the rest. Guarding the '
801+
+ 'two values with `check:scaffold-emission-policy` is the whole mechanism; a conflict in '
802+
+ 'this file is a human\'s, exactly as it was before those two values were generated.',
803+
},
789804
{
790805
path: 'packages/spec/json-schema/**',
791806
gen: 'gen:openapi',

turbo.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@
137137
"$TURBO_ROOT$/packages/create-objectstack/src/templates/blank/pnpm-workspace.yaml",
138138
"$TURBO_ROOT$/packages/create-objectstack/bin/create-objectstack.js",
139139
"$TURBO_ROOT$/packages/create-objectstack/src/templates/blank/package.json",
140+
"$TURBO_ROOT$/scripts/sync-scaffold-emission-policy.mjs",
140141
"$TURBO_ROOT$/packages/drivers/driver-sql/src/sql-driver.ts",
141142
"$TURBO_ROOT$/packages/drivers/driver-sql/src/schema-drift.ts",
142143
"$TURBO_ROOT$/packages/spec/src/data/field.zod.ts"

0 commit comments

Comments
 (0)