Repository navigation
Commit 6ea429d
chore(ui): declare vitest in every ui package whose test script calls it (#26290)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi93uHdrJhCaZjEQjoR2jXwwH)_
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](https://claude.ai/code/session_01CQYwcp65XPKU6W8H7gaJ9x)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent ff91895 commit 6ea429d
26 files changed
Lines changed: 151 additions & 22 deletions
File tree
- .changeset
- ui/packages
- 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-runtime
- react
- runner
- sdui-parser
- test-support
- types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
0 commit comments