Repository navigation
refactor(lint): move the i18n translatable-key walk from the CLI into @objectstack/lint - #30375
Conversation
… @objectstack/lint collectExpectedEntries and its helpers move, by rename, from packages/cli/src/utils/i18n-extract.ts to packages/lint/src/i18n-walk.ts and are exported from @objectstack/lint, so a browser (Studio's translation editor) can run the same walk the CLI runs. The CLI keeps bundle assembly and serialization in utils/i18n-bundle-extract.ts, which re-exports the walk names, so the module surface is unchanged (pinned). Liveness evidence, the walk-parity gate and the dispatch-gates specimen follow the move. Claude-Session: https://claude.ai/code/session_01WGufzfqCqBH59yrHmuqXH3 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzfqCqBH59yrHmuqXH3 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 44 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 14 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 179 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 140f246573e91c9feea13b8d11db7bb16514daac && git checkout 140f246573e91c9feea13b8d11db7bb16514daac
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0e4dfbe27a2a312864cd8d14e4954b6af14e2a22 6950aec746cb42060cbcb2d1940648b53a42c9a4 && git checkout -B drift-repro 0e4dfbe27a2a312864cd8d14e4954b6af14e2a22 && git merge --no-ff 6950aec746cb42060cbcb2d1940648b53a42c9a4
node scripts/docs-audit/affected-docs.mjs --json 0e4dfbe27a2a312864cd8d14e4954b6af14e2a22
|
|
domain:ui#1 · os-support-ai · session_01WGufzfqCqBH59yrHmuqXH3 CI note, read at 2026-11-05T08:23Z: Spec property liveness is red on this PR for a reason outside it.
Generated by Claude Code |
Brings in #30368 (the query.searchFields liveness repoint), which clears main's red on Spec property liveness and Test Core. Claude-Session: https://claude.ai/code/session_01WGufzfqCqBH59yrHmuqXH3 Co-authored-by: Claude <noreply@anthropic.com>
|
domain:ui#1 · os-support-ai · session_01WGufzfE4V9fzZgJLrLDmMC 维护者速读(席位终稿)
席位核对 · ACCEPT · head
|
Requested by Yibo Wang · project thread
Part of #30285
Clause-②: no
Metadata-protocol: none
维护者速读
collectExpectedEntries,2,520 行)原样从 CLI 挪进@objectstack/lint,CLI 改为再导出;不改任何键、骨架或覆盖率结论。check-governed-merges --pr 30375读数)。回滚即 revert 本 PR。packages/lint/src/i18n-walk.ts(重命名自packages/cli/src/utils/i18n-extract.ts,看头部说明与删掉的尾部)、packages/cli/src/utils/i18n-bundle-extract.ts(保留的打包/序列化与再导出)、packages/cli/test/i18n-bundle-extract-exports.pin.test.ts(导出不变的钉测)。pnpm --filter @objectstack/cli exec vitest run test/i18n-bundle-extract-exports.pin.test.ts test/i18n-walk-output-parity.test.ts,预期全部通过。What changes
collectExpectedEntries, the one definition of which translation keys a stack can carry and the source text each one translates, moves frompackages/cli/src/utils/i18n-extract.tstopackages/lint/src/i18n-walk.ts. It is exported from the@objectstack/lintroot together withauthorWarnedTranslationGroups,humanizeFieldPathand theExpectedEntry/ExpectedEntryOptionstypes. The point is that a browser can run the same walk the CLI runs. The follow-up PR for #30285 builds Studio's source-to-translation table from it.i18n-extract.ts → lint/src/i18n-walk.ts, 17 lines added and 618 removed in place. The removed lines are the extract types and the tail: bundle assembly,extractTranslationsand serialization. That tail stays in the CLI as a new file,packages/cli/src/utils/i18n-bundle-extract.ts(631 lines). It imports the walk from@objectstack/lintand re-exports it, so the CLI module offers exactly the names the old one did.i18n-extracttoi18n-bundle-extract, with no other edit.normalized-call-sites.test.tsrenames its key to the new path.actionandviewliveness ledgers cite the walk at its new path (4 cites).check-i18n-walk-parity.mjsreads the walk source at its new path and adds it to its watch hints.dispatch-gates.self-test.mjsuses the new CLI file as its specimen. Comment-only path repoints are ini18n-bundle-surface.mjs,check-i18n-bundles.mjsand three lint files.resolveLivenessDiranswers null), so its default leaves no translation group out. That is the same set the CLI leaves out today, because the ledger warns on no translation group. A lint test pins it, so the day a group is warned, the test fails and a browser caller has to passwarnedGroups.@objectstack/lint,@objectstack/cliand@objectstack/specpatch (spec for the liveness cites).No key, skeleton or coverage verdict changes. The walk's code moved as is.
Tests
packages/lint/src/i18n-walk.test.ts(new): a stack with an object, a select field with options and an app with navigation yields the expected keys, each with its source text andsource. A warned group is left out. The shipped ledger warns on no translation group (the browser-parity pin).packages/cli/test/i18n-bundle-extract-exports.pin.test.ts(new): the CLI module's runtime exports equal the old module's 12 names exactly. The walk functions are lint's own (toBe), not a copy. The six type exports are still offered (held by type-check).Acceptance notes
check-governed-merges --pr 30375puts 0 of 61 paths on the register and reads the size from the PR object, as the queue guard does: +879 / −682 = 1561, under the 3000-line human-merge line. The--branchforecast below counts with--no-renames(+3382 / −3185 = 6567) and over-reads a rename; it is not the reading the queue guard applies. lint cannot import from cli, because cli depends on lint.i18n-resolver.ts(3),i18n-resolver.object-list-views.test.ts, platform-objectssource-hash.ts, two echo-decisions tests, clitsconfig.test.jsonandtest-typecheck-debt.json. They name the old path in prose, and editing them would widen the diff into packages this move does not otherwise touch.check:i18nandcheck:i18n-coveragederive frompackages/cli/src/**only, so a later edit topackages/lint/src/i18n-walk.tsalone does not derive them locally. CI still runs them. This PR touchespackages/cli/src, so both were derived and run here.Verification
lint and cli, under os-verify-lock
dispatch-gates: 87 derived, 87 run, all exit 0 (--ran: 0 NOT-MEASURED, 0 UNRUN)
check-plugin-teardown-shape.mjs --self-testfirst exited 3 because this shallow clone could not read its pinned positive-control commit (621a487). Aftergit fetch --depth=1 origin 621a4876…it exits 0 (48 cases). That is an environment condition, not this diff.The 87 ran serially under os-verify-lock on a shared box (40m14s).
check-governed-merges --branch claude/project-thread-eme43k (head f6ecb06)
Generated by Claude Code