Skip to content

Commit 6979157

Browse files
huangyiireneclaude
andauthored
fix(scripts): report a stale workspace dist as a prerequisite, not a bundle problem (#7681) (#7718)
`check-i18n-bundles` had exactly one prerequisite classifier — `looksLikeMissingCliCommand`, which matches oclif's "command … not found" and therefore sees an unbuilt CLI only. A stale *dependency* dist makes the extract throw a module-export mismatch instead, which matched nothing, fell through to the in-loop `else`, and printed as "check-i18n-bundles: 1 bundle problem(s) / extract failed …": one environment fact rendered as a content verdict about translation bundles nothing had compared, in the two words that send the reader to the i18n configs. Its sibling `check-i18n-coverage` met the identical cause in the same QA run and refused to judge (#6033/#5862). `looksLikeStaleWorkspaceDist` (in the shared `cli-build-prerequisite.mjs`, so the siblings can adopt it) classifies that class in two shapes — an export mismatch on a workspace specifier, and a `Cannot find module` reaching into a workspace package's `dist/` — and the gate now raises a hard PREREQUISITE NOT MET naming the package whose build output is at fault, prescribing a rebuild of that package rather than of the CLI. Deliberately narrow: a third party's export mismatch, CommonJS interop's differently-worded named-export error, a non-dist specifier, a genuine drift and an undeclared authoring key all keep the verdict they had. The self-test pins both directions (29 → 53 assertions). `reportPrerequisiteNotMet` also learned how many packages the loop had already attempted, because the in-loop nets can fire after other packages printed "in sync" — "nothing was checked" would then be false, so the message states what was and was not judged instead. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3efe6f2 commit 6979157

2 files changed

Lines changed: 391 additions & 20 deletions

File tree

0 commit comments

Comments
 (0)