Repository navigation
test(ui): doc-version-claims reads the spec major from the package it resolves, not a fixed workspace path - #38089
Conversation
… resolves, not a fixed workspace path
The module-top read of workspaceRoot()/packages/spec/package.json threw on load in a
standalone objectui checkout, where no packages/spec exists. The manifest now comes from
createRequire().resolve('@objectstack/spec/package.json'), which under the monorepo is
the same workspace file the version step rewrites; a new describe pins that.
Claude-Session: https://claude.ai/code/session_01L9qibxRSo4RBpRknKqBLmy
Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-tesla · session_01L9qibxRSo4RBpRknKqBLmy CI at head The one failing test is I judge this failure as not caused by this PR:
The seat decides on a re-run, since a dev doesn't re-run. The case runs about 5 s alone and 15 s on a CI shard, so it sits at the timeout edge. That goes to the seat as an out-of-scope finding, and this PR doesn't change it. |
|
repo:objectstack#3 · os-tesla · session_01L9qibxRSo4RBpRknKqBLmy Final head: Refs #38101, the flake card for the |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1-a: ACCEPT at
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-28T02:36Z · zone
|
Requested by Tesla · project thread
Part of #37587
repo:objectstack#3 · os-tesla · session_01L9qibxRSo4RBpRknKqBLmy
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
ui/scripts/__tests__/doc-version-claims.test.ts:SPEC_MANIFESTis nowcreateRequire(import.meta.url).resolve('@objectstack/spec/package.json'): the spec package this tree's own dependency (ui/package.json,"@objectstack/spec": "workspace:^") resolves to.SPEC_MAJORreads its version from there instead ofpath.join(workspaceRoot(), 'packages/spec/package.json').packages/spec, the module no longer throws on load; it reads the installed package, matching howskill-bundle-root.mjsalready degrades in that layout.describe"doc version claims - the source of the spec major" in the same file: under the monorepo the resolved manifest's realpath equalsworkspaceRoot()/packages/spec/package.json; in the standalone layout it lies undernode_modules. A second case checks the version read starts with${SPEC_MAJOR}..ui/scripts/, and nothing it touches publishes.Tests
Readings at 5508f9f (base origin/main 815e882)
path.join(workspaceRoot(), 'packages/spec/package.json')at module scope.workspaceRoot()is the objectui root when that root holdspnpm-workspace.yaml(the standalone layout), and that root has nopackages/spec.createRequire(<test file>).resolve('@objectstack/spec/package.json')gives<root>/packages/spec/package.json, the same realpath as the workspace path, version19.0.0-next.1.pnpm --dir ui exec vitest run scripts/__tests__/doc-version-claims.test.ts:Tests 31 passed (31)(29 before, plus the two new cases).SPEC_MANIFESTpointed at a byte-identical copy of the spec manifest in a temp directory.× under the monorepo, resolves the workspace spec package the version step rewrites,Tests 1 failed | 30 passed (31). Restored withgit checkout HEAD -- <file>;git status --porcelainempty.Gates at 5508f9f, then the merge 1ea0196
dispatch-gates --ranonui/scripts/__tests__/doc-version-claims.test.ts: 21 derived, 21 run, every oneexit 0, 0 NOT-MEASURED (a derived zero: each line records its exit code), 0 unrun. That includespnpm --dir ui exec vitest run scripts/:Test Files 172 passed | 2 skipped (174),Tests 5144 passed | 2 skipped (5146), 4 m 27 s.pnpm --dir ui type-check:scripts(tsc -p tsconfig.scripts.json, the program that compilesscripts/__tests__): exit 0.eslinton the file: exit 0.origin/mainf72f335 (4 commits, none underui/scripts/,ui/package.jsonorpackages/spec/package.json); afterpnpm install --frozen-lockfilethe file readsTests 31 passed (31)again.Acceptance notes
.github/workflows/release.ymlpost-version validation runs the region pin) is Tier H by path and follows in its own PR on this branch once this one lands, as the seat ruled on the card.Generated by Claude Code