Skip to content

Commit 6ea429d

Browse files
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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/components': patch
4+
'@object-ui/fields': patch
5+
'@object-ui/plugin-calendar': patch
6+
'@object-ui/plugin-charts': patch
7+
'@object-ui/plugin-chatbot': patch
8+
'@object-ui/plugin-dashboard': patch
9+
'@object-ui/plugin-editor': patch
10+
'@object-ui/plugin-form': patch
11+
'@object-ui/plugin-gantt': patch
12+
'@object-ui/plugin-grid': patch
13+
'@object-ui/plugin-kanban': patch
14+
'@object-ui/plugin-map': patch
15+
'@object-ui/plugin-markdown': patch
16+
'@object-ui/plugin-timeline': patch
17+
'@object-ui/plugin-tree': patch
18+
'@object-ui/plugin-view': patch
19+
'@object-ui/providers': patch
20+
'@object-ui/react': patch
21+
'@object-ui/react-runtime': patch
22+
'@object-ui/sdui-parser': patch
23+
'@object-ui/types': patch
24+
---
25+
26+
chore(ui): every ui package whose `test` script calls `vitest` now declares `vitest` as a devDependency, so `pnpm --filter @object-ui/PKG test` runs from the repository root
27+
28+
Clause-②: no
29+
Metadata-protocol: none
30+
31+
The package `test` scripts run `vitest run --root ../.. packages/PKG/`. A pnpm script resolves its binaries from the package's own `node_modules/.bin` and the workspace root's, and vitest was installed only under `ui/node_modules/.bin`, so 24 of the 41 ui packages with a `test` script failed with `vitest: not found` from both the repository root and `ui/`. Each of them now declares `vitest: ^4.1.10`, the range `ui/package.json` and the other 17 packages already declare; the lockfile resolves every new entry to the snapshot those packages already use, so no package gains a copy. Nothing a consumer installs changes: only the `devDependencies` field of the published `package.json` moves.

‎pnpm-lock.yaml‎

Lines changed: 73 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎ui/packages/app-shell/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@
137137
"react-router-dom": "^7.18.2",
138138
"sonner": "^2.0.8",
139139
"typescript": "^6.0.3",
140-
"vite": "^8.2.1"
140+
"vite": "^8.2.1",
141+
"vitest": "^4.1.10"
141142
},
142143
"keywords": [
143144
"objectui",

‎ui/packages/components/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
"typescript": "^6.0.3",
103103
"vite": "^8.2.1",
104104
"vite-plugin-dts": "^5.0.3",
105+
"vitest": "^4.1.10",
105106
"zod": "^4.6.5"
106107
},
107108
"keywords": [

‎ui/packages/fields/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
"tailwindcss": "^4.3.3",
6060
"typescript": "^6.0.3",
6161
"vite": "^8.2.1",
62-
"vite-plugin-dts": "^5.0.3"
62+
"vite-plugin-dts": "^5.0.3",
63+
"vitest": "^4.1.10"
6364
},
6465
"publishConfig": {
6566
"access": "public"

‎ui/packages/plugin-calendar/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
"@vitejs/plugin-react": "^6.0.5",
6262
"typescript": "^6.0.3",
6363
"vite": "^8.2.1",
64-
"vite-plugin-dts": "^5.0.3"
64+
"vite-plugin-dts": "^5.0.3",
65+
"vitest": "^4.1.10"
6566
},
6667
"keywords": [
6768
"objectui",

‎ui/packages/plugin-charts/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
"@vitejs/plugin-react": "^6.0.5",
5959
"typescript": "^6.0.3",
6060
"vite": "^8.2.1",
61-
"vite-plugin-dts": "^5.0.3"
61+
"vite-plugin-dts": "^5.0.3",
62+
"vitest": "^4.1.10"
6263
},
6364
"keywords": [
6465
"objectui",

‎ui/packages/plugin-chatbot/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
"@vitejs/plugin-react": "^6.0.5",
6565
"typescript": "^6.0.3",
6666
"vite": "^8.2.1",
67-
"vite-plugin-dts": "^5.0.3"
67+
"vite-plugin-dts": "^5.0.3",
68+
"vitest": "^4.1.10"
6869
},
6970
"keywords": [
7071
"objectui",

‎ui/packages/plugin-dashboard/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
"react-grid-layout": "^2.2.4",
5151
"typescript": "^6.0.3",
5252
"vite": "^8.2.1",
53-
"vite-plugin-dts": "^5.0.3"
53+
"vite-plugin-dts": "^5.0.3",
54+
"vitest": "^4.1.10"
5455
},
5556
"keywords": [
5657
"objectui",

‎ui/packages/plugin-editor/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
"@vitejs/plugin-react": "^6.0.5",
5353
"typescript": "^6.0.3",
5454
"vite": "^8.2.1",
55-
"vite-plugin-dts": "^5.0.3"
55+
"vite-plugin-dts": "^5.0.3",
56+
"vitest": "^4.1.10"
5657
},
5758
"keywords": [
5859
"objectui",

0 commit comments

Comments
 (0)