Skip to content

chore(ui): declare vitest in every ui package whose test script calls it - #26290

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-79dlu2
Oct 26, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-79dlu2

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #26276

Clause-②: no
Metadata-protocol: none

What was wrong

Every ui package test script reads vitest run --root ../.. packages/PKG/. A pnpm script finds binaries in the package's own node_modules/.bin and in the workspace root's (node_modules/.bin at the repo root). vitest is installed under ui/node_modules/.bin only, which is on neither path. So a package that does not declare vitest itself cannot run its own test script, from the repo root or from ui/.

Measured on e05e0de8 (origin/main) before the change, all 41 ui packages that declare a test script, each run as pnpm --filter NAME run test from the repo root and again from ui/:

  • 24 packages: sh: 1: vitest: not found, from both roots. They are exactly the 24 that do not declare vitest: 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.
  • 17 packages: vitest starts. Each declares 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.10 in devDependencies, the same range ui/package.json and 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 one vitest importer entry (3 lines) for each of the 24 packages, plus the devDependencies: header for react-runtime, which had none. Every new entry resolves to the existing snapshot the 17 working packages use (byte-identical version: string to ui/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, patch for the 22 published packages whose package.json changes (runner and test-support are private). Only the published devDependencies field 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 from ui/.

The six packages the card names, each run from the repo root as pnpm --filter @object-ui/PKG test --maxWorkers=2 (the package's own test script, echoed as > @object-ui/PKG@18.1.0 test), under the shared verification lock, after building the @objectstack/* dependency closure:

package Test Files Tests
@object-ui/sdui-parser 21 passed (21) 301 passed
@object-ui/plugin-chatbot 84 passed (84) 805 passed
@object-ui/react 119 passed (119) 1479 passed
@object-ui/types 390 passed (390) 10602 passed
@object-ui/components 435 passed, 1 skipped (436) 4263 passed, 24 skipped
@object-ui/app-shell (narrowed: --shard=1/40) 35 passed (35) 358 passed

All six exit 0. app-shell has about 1743 test files, too many for one local run, so it was run through its own test script with --shard=1/40. That still proves the binary resolves and the package's tests run. The full suite is left to CI Test UI.

Gates

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 47 families. 46 exit 0. pnpm check:dual-build-cjs-loads exited 3 (PREREQUISITE NOT MET: it reads built dist/ 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. --ran reconciliation: 47 derived, 46 run, 1 NOT-MEASURED, 0 UNRUN.

Acceptance notes

  • pnpm install (non-frozen) prints unmet peer @vitest/ui@4.1.12: found 4.1.10 for 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

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>
@github-actions github-actions Bot added size/m dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation tooling labels Oct 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 · ACCEPT · seat domain:ui#1 · 2026-10-26T19:44Z

Head 2ef77bb4 (read from the PR object).

  • Shape. Draft on main, with Fixes #26276. 26 files, +151/-22: 24 package.json files, pnpm-lock.yaml, and a root changeset (patch for the 22 published packages; runner and test-support are private). Clause-②: no and Metadata-protocol: none.
  • Checks pinned to the head. All check runs completed: 0 failing, 0 pending. The seat's landing script checked this before posting.
  • Governed surface. check-governed-merges.mjs --pr 26290: not governed.
  • Diff read. 24 of the 41 ui packages with a test script had no vitest of their own, so vitest: not found failed both from the repo root and from ui/. Each now declares vitest ^4.1.10 as a devDependency, the same range the 17 working packages use. No script changes. The lock gains 73 lines and loses none, all on the existing snapshot, and check-lockfile-integrity is clean.
  • Evidence. From the repo root, each package's own test script exits 0: sdui-parser 21/21, plugin-chatbot 84/84, react 119/119, types 390/390, components 435 (+1 skipped), and app-shell 35/35 (--shard=1/40). Derived gates: 46/47 exit 0. check:dual-build-cjs-loads could not be measured locally (it needs the full @objectstack dist); CI ran it.
  • Serial constraints. The seat scanned every open PR: none touches pnpm-lock.yaml or any ui/**/package.json. react: the runtime depends on the ObjectStack adapter — AdapterCtx is typed by ObjectStackAdapter and components reach the concrete adapter in 28 files; type the seam by a types-level interface #25917 will touch ui/packages/react/package.json and the lock later, and re-locks after this one. No sdui source moves. The ⛔ paths are untouched.

Landing: ready + auto-merge through the relay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/m tooling

Projects

None yet

2 participants