Repository navigation
chore(ui): declare vitest in every ui package whose test script calls it - #26290
Merged
Merged
Conversation
pnpm --filter @object-ui/PKG test failed with 'vitest: not found' for 24 ui packages, from the repo root and from ui/, because vitest was installed only under ui/node_modules/.bin. Each now declares vitest ^4.1.10 like the 17 packages that already work; the lockfile change is the 24 importer entries, all on the existing snapshot. Claude-Session: https://claude.ai/code/session_01CQYwcp65XPKU6W8H7gaJ9x Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对 · ACCEPT · seat
|
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steve · project thread
Fixes #26276
Clause-②: no
Metadata-protocol: none
What was wrong
Every ui package
testscript readsvitest run --root ../.. packages/PKG/. A pnpm script finds binaries in the package's ownnode_modules/.binand in the workspace root's (node_modules/.binat the repo root). vitest is installed underui/node_modules/.binonly, which is on neither path. So a package that does not declare vitest itself cannot run its owntestscript, from the repo root or fromui/.Measured on
e05e0de8(origin/main) before the change, all 41 ui packages that declare atestscript, each run aspnpm --filter NAME run testfrom the repo root and again fromui/:sh: 1: vitest: not found, from both roots. They are exactly the 24 that do not declarevitest: app-shell, components, fields, plugin-calendar, plugin-charts, plugin-chatbot, plugin-dashboard, plugin-editor, plugin-form, plugin-gantt, plugin-grid, plugin-kanban, plugin-map, plugin-markdown, plugin-timeline, plugin-tree, plugin-view, providers, react, react-runtime, runner, sdui-parser, test-support, types.vitest: ^4.1.10(auth, cli, collaboration, core, create-plugin, data-objectstack, i18n, layout, mobile, permissions, plugin-ai, plugin-designer, plugin-detail, plugin-list, plugin-report, the vscode extension, and the console).The fix
The 24 packages now declare
vitest: ^4.1.10indevDependencies, the same rangeui/package.jsonand the 17 working packages already declare. No script changes, so the form CI and ui/AGENTS.md prescribe (pnpm --dir ui exec vitest run packages/PKG/) is untouched.pnpm-lock.yaml: +73 lines, 0 removed. That is onevitestimporter entry (3 lines) for each of the 24 packages, plus thedevDependencies:header for react-runtime, which had none. Every new entry resolves to the existing snapshot the 17 working packages use (byte-identicalversion:string toui/packages/auth).node ui/scripts/check-lockfile-integrity.mjs --base-ref origin/main:VERDICT clean — no package gained a copy(1941 resolutions on both sides).Changeset:
.changeset/26276-ui-package-test-vitest.md,patchfor the 22 published packages whosepackage.jsonchanges (runner and test-support are private). Only the publisheddevDependenciesfield moves; nothing a consumer installs changes.Evidence (head
2ef77bb4)After the change,
pnpm --filter NAME exec sh -c 'command -v vitest'resolves for 41 of 41 packages from the repo root and fromui/.The six packages the card names, each run from the repo root as
pnpm --filter @object-ui/PKG test --maxWorkers=2(the package's owntestscript, echoed as> @object-ui/PKG@18.1.0 test), under the shared verification lock, after building the@objectstack/*dependency closure:@object-ui/sdui-parser@object-ui/plugin-chatbot@object-ui/react@object-ui/types@object-ui/components@object-ui/app-shell(narrowed:--shard=1/40)All six exit 0. app-shell has about 1743 test files, too many for one local run, so it was run through its own
testscript with--shard=1/40. That still proves the binary resolves and the package's tests run. The full suite is left to CITest UI.Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 47 families. 46 exit 0.pnpm check:dual-build-cjs-loadsexited 3 (PREREQUISITE NOT MET: it reads builtdist/of every published@objectstack/*package, and only the spec/client/formula/lint closure was built here), so it is NOT MEASURED locally and left to CI.--ranreconciliation: 47 derived, 46 run, 1 NOT-MEASURED, 0 UNRUN.Acceptance notes
pnpm install(non-frozen) printsunmet peer @vitest/ui@4.1.12: found 4.1.10for the snapshot all these packages share. It is the same snapshot the 17 working packages and the console already resolve to, so this PR adds no new peer mismatch. Noted, not filed.Generated by Claude Code