Repository navigation
fix(cli): an os create --in-repo plugin passes its own typecheck and build - #26395
Conversation
…build The in-repo placement declares the workspace's TypeScript (^6.0.3, the range the root and every sibling plugin declare) instead of the standalone SCAFFOLD_TYPESCRIPT_RANGE, whose 5.x install refused the base's ignoreDeprecations "6.0" with TS5103. The starter's unused init parameter is _context, so it compiles under the base's noUnusedParameters (TS6133). Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019uZ84EhCM1NaBkJM8y1sjE
…eScript Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019uZ84EhCM1NaBkJM8y1sjE
The in-repo scaffold typecheck test copies the repo-root base into its sandbox, so check:cross-package-test-inputs requires the read declared: the cli roster glob, the turbo.json input, and the pinned root-file list. The test now reads the cli package's own typescript range instead of the root manifest and the sibling plugins. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019uZ84EhCM1NaBkJM8y1sjE
📓 Docs Drift CheckThis PR changes 1 package(s): 6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 31 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 708b1bd33b3b2967e571f1a2955841be7ebb8dde && git checkout 708b1bd33b3b2967e571f1a2955841be7ebb8dde
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin abb9046057b6713b78712dfe53a329deefa534ba 89522f6b56da1a49da6881f728ccdaea7ec7fee1 && git checkout -B drift-repro abb9046057b6713b78712dfe53a329deefa534ba && git merge --no-ff 89522f6b56da1a49da6881f728ccdaea7ec7fee1
node scripts/docs-audit/affected-docs.mjs --json abb9046057b6713b78712dfe53a329deefa534ba
|
席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | Draft, base main, Fixes #26332, patch changeset for @objectstack/cli. Not governed (0 of 6 paths), 215 changed lines. |
| Fix | Triage 6428264123. TS5103: typescriptDependencySpec(placement) gives the in-repo placement IN_REPO_TYPESCRIPT_RANGE (^6.0.3, the workspace's range), and standalone keeps SCAFFOLD_TYPESCRIPT_RANGE. TS6133: the starter's init(_context), with a comment on what the parameter is for. The starter is shared, so the standalone src/index.ts takes the same rename; its manifest, tsconfig and range are unchanged. The seat accepts that. |
| Evidence | 56 check runs succeeded and 6 were expected skips on this head, 0 failed; mergeable clean. create-in-repo-scaffold-typechecks.test.ts copies the real tsconfig.base.json into a sandbox and spawns the emitted typecheck and build (a TS6133 control included). It also pins the in-repo range to the package's own and standalone to SCAFFOLD_TYPESCRIPT_RANGE. Red on main 3 of 5, green 5 of 5, and the two-leg ablation is red. Test budget: three tsc spawns and no CLI spawn; module line 2.6–3.2 s, under 10 s, so no header. Derived gates: 90 of 90 exit 0. |
| Carried | The tsconfig.base.json test input is declared in turbo.json, TURBO_ROOT_FILE_INPUTS and the cli roster (amendments above). check:cross-package-test-inputs exits 0. |
| Landing | 「按照 pm-dispatch 规则复核过的都授权」 (Leehom, 2026-10-25T11:35Z): ready and auto-merge through the relay, once every check on this head is green or an expected skip. |
Generated by Claude Code
Requested by Leehom · project thread
Fixes #26332
Clause-②: no
Metadata-protocol: none
维护者速读
os create plugin NAME --in-repo生成的包改为声明工作区的 TypeScript(^6.0.3,与仓根和所有兄弟插件一致);starter 的init(context)改为init(_context)并加一行说明。独立(默认)脚手架的 TypeScript 范围不变,仍是^5.3.0。pnpm typecheck/pnpm build就红:TS5103(5.x 不认 base 的ignoreDeprecations: "6.0")和 TS6133(未用的context撞上noUnusedParameters)。贡献者的第一步命令就失败。tsconfig.base.json登记为 cli 测试任务的输入(turbo.json 与两处门禁名单各一行,席位已批)。回滚即 revert 本 PR。packages/cli/src/commands/create.ts(IN_REPO_TYPESCRIPT_RANGE/typescriptDependencySpec与 starter 的init行);packages/cli/test/create-in-repo-scaffold-typechecks.test.ts;turbo.json新增的一行输入。pnpm --filter @objectstack/cli exec vitest run test/create-in-repo-scaffold-typechecks.test.ts,预期 5/5 通过(在main上同一文件 3 红)。What changes
plugintemplate'sdevDependencies.typescriptnow follows the placement throughtypescriptDependencySpec(placement), the same shape asobjectstackDependencySpec.in-repodeclaresIN_REPO_TYPESCRIPT_RANGE(^6.0.3), the range the repository root,@objectstack/cliand every sibling underpackages/plugins/declare.standalonestill declaresSCAFFOLD_TYPESCRIPT_RANGE(^5.3.0), unchanged, andinit.tsis not touched.src/index.tsdeclaresasync init(_context), with a two-line comment above it: the parameter is the kernel's plugin context, and the underscore goes onceinitreads it. The starter is one template for both placements, so the standalonesrc/index.tstakes the same rename. The standalone manifest,tsconfig.jsonand TypeScript range are byte-unchanged.tsconfig.base.jsoninto its sandbox, socheck:cross-package-test-inputsrequires that read declared. Three one-line additions, approved as claim amendments 6431310360 and 6431339243:$TURBO_ROOT$/tsconfig.base.jsoninturbo.json's@objectstack/cli#testinputs,tsconfig.base.jsonin the@objectstack/cliroster globs (scripts/cross-package-test-inputs.mjs), and in the pinnedTURBO_ROOT_FILE_INPUTS(scripts/check-cross-package-test-inputs.mjs). The file is already a turboglobalDependenciesentry, which the gate does not read..changeset/26332-create-in-repo-typescript.md:@objectstack/clipatch, with the before/after and what to do for an in-repo plugin scaffolded earlier.Tests
packages/cli/test/create-in-repo-scaffold-typechecks.test.ts(unit tier: it spawnstsc, not the CLI). It materialises the in-repo emission throughcreate's own renderers into a sandbox laid out like this repository (the realtsconfig.base.jsonat its root, the scaffold atpackages/plugins/plugin-probe), then spawns the emittedtypecheckandbuildscripts with the workspace'stsc6.0.3.typecheckwith TS6133, so the scaffold really compiles under the base's strictness.typecheckandbuildexit 0;buildwritesdist/index.jsanddist/index.d.tsand nodist/index.test.js.typescriptrange equals the range@objectstack/clideclares for thetscthe cases spawn, and its floor major accepts the base'signoreDeprecations(read throughts.readConfigFile).SCAFFOLD_TYPESCRIPT_RANGE.Module line 2.6 s red and 3.2 s green on this box (a shared container), under the 10 s line, so no
test-budgetheader.Red first, on
main6390fe52c(the test file alone, source untouched): 3 failed, 2 passed.red run on main
Ablation (one-shot, through
scripts/ablation-replace.mjs, each leg restored to the HEAD blob withgit diff HEADempty; the test importssrc/, so no build is involved):typescript: typescriptDependencySpec(placement)back toSCAFFOLD_TYPESCRIPT_RANGE: 2 failed (the range and floor cases), 3 passed.async init(_context)back toasync init(context): 1 failed (typecheck, TS6133), 4 passed.Acceptance notes
IN_REPO_TYPESCRIPT_RANGEis a literal pinned against@objectstack/cli's owndevDependencies.typescript. A workspace TypeScript bump reddens the pin until the constant moves with it. Reading the root manifest at scaffold time was not taken: the template renderers take only a placement, and a missing root range would need a fallback.src/index.tschanges by the_contextrename (see What changes). Placement-gating the starter would teach two shapes of one plugin.@objectstack/cli's published entry re-exports only the command's default export, so the two new named exports increate.tsdo not reach the published surface.packages/cli/src/commands/create.ts(20 open PRs listed, each one's files read).Verification
Head
89522f6b5.pnpm --filter @objectstack/cli exec vitest run --project unit(ataafab270, the fix commit; later commits touch only the new test file and input declarations): 336/336 files, 4894/4894 tests. Re-run on the final head for the touched files:create-in-repo-scaffold-typechecks,create,scaffold-test-script-passes, 3/3 files, 31/31 tests. Theintegrationtier is declared to CI.pnpm --filter @objectstack/cli buildexit 0;pnpm --filter @objectstack/cli typecheck(tsc pluscheck:test-typecheck) exit 0.eslint --no-inline-config packages/cli: exit 0.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 90 commands on this diff; each ran with its exit code captured by redirect before any pipe. All 90 exited 0, among themcheck:cross-package-test-inputs(red untiltsconfig.base.jsonwas declared),check:turbo-task-graph,check:ci-filter-parity,check:pm-dispatch-gates(fast tier, 1901 cases) andcheck-plugin-teardown-shape --self-test(after fetching its pinned positive-control commit).check:dual-build-cjs-loads,check:dts-closureandcheck:i18n-coveragemeasured on a tree an earlier sweep had built.--ranreconciliation: "90 derived, 90 run, 0 NOT-MEASURED, 0 UNRUN", exit 0.node scripts/pm/check-governed-merges.mjs --branch claude/project-thread-z61um0: 0 of 6 paths governed, ordinary queue landing.origin/mainis 11 commits ahead atabb904605, none on this diff's files, andgit merge-treeis clean; not merged in.Generated by Claude Code