Skip to content

Commit b9063ce

Browse files
fix(ui-merge): two tests that #25745 broke on main read the merged tree — the Changesets config through changesetConfigPath(), the SDUI html tier by its tags (#25711) (#25852)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6JaoKAHLK79xmvJyPStopRpPQ2)_ Part of #25677 Part of #25711 Clause-②: no Metadata-protocol: none Follow-up to #25745 (4a), per ruling 30 = B: the two Test UI / Test Core reds that #25745 caused once it merged are fixed here, on the same card. Test-only; nothing is released, so this carries `skip-changeset`. ## What changes **1. Test UI shard 3/16: `ui/packages/cli/src/__tests__/app-generator.test.ts`.** The release-lockstep test read `ui/.changeset/config.json`, which #25745 deleted (Changesets reads one config per repository). It now reads the config through `changesetConfigPath()` from `ui/scripts/workspace-root.mjs`, the helper every other reader of the Changesets config already uses: the tree's own config when standalone, the monorepo root's when nested under `ui/`. **2. Test Core 5/8: `packages/lint/src/validate-jsx-pages.production-witness.test.ts`.** The witness asserted that the SDUI manifest contains the `html` component. objectui#13449 retired `html`, and the manifest #25745 regenerated from the in-tree `ui/` has 106 components, without it. The witness now pins the html tier by two of its intrinsic tags (`a`, `p`). The shipped pages never used the raw `html` component, and the clean-run witness in the same file still checks them. ## Verification (this branch, on `main` 2a61f08) - `app-generator.test.ts`: 48/48 pass. Without fix 1: 1 failed / 47 passed (ENOENT on `ui/.changeset/config.json`). - Test UI shard 3/16, built the CI way (the 7-package turbo build, then `pnpm --dir ui run test --shard=3/16`): 361 files passed, 1 skipped; 4,724 tests passed, 102 skipped. - `validate-jsx-pages.production-witness.test.ts`: 5/5 pass. Also green: `@objectstack/sdui-parser` 225/225, the cli sdui test files 79/79, app-showcase metric-filter 7/7. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0149BHSXfCdQywGaLdpRAtWe --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent e167956 commit b9063ce

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎packages/lint/src/validate-jsx-pages.production-witness.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ describe('production witness: the checked-in manifest reaches validateTree', ()
5858
// regeneration legitimately changes them, re-check the shipped pages in the
5959
// same PR.
6060
expect(keys).toContain('flex');
61-
expect(keys).toContain('html');
61+
// The html tier's intrinsic tags. The raw `html` component itself was
62+
// retired by objectui#13449 and left the manifest when it was regenerated
63+
// from the in-tree ui/ (107 -> 106, objectstack#25711); the shipped pages
64+
// below never used it, which the clean-run witness re-checks.
65+
expect(keys).toContain('a');
66+
expect(keys).toContain('p');
6267
expect(keys).not.toContain('div');
6368
});
6469

‎ui/packages/cli/src/__tests__/app-generator.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ import {
8080
type AppGeneratorContext,
8181
type RouteInfo
8282
} from '../utils/app-generator.js';
83+
import { changesetConfigPath } from '../../../../scripts/workspace-root.mjs';
8384

8485
const __dirname = dirname(fileURLToPath(import.meta.url));
8586
/** packages/cli/src/__tests__ -> repo root */
@@ -741,8 +742,10 @@ describe('generated app manifests', () => {
741742
// current and guaranteed to exist on the registry. If that group were ever
742743
// split, deriving the range would silently start naming versions that were
743744
// never published — so the premise is asserted, not assumed.
745+
// The tree's own config standalone, the monorepo root's when nested under
746+
// objectstack's `ui/` (objectstack#25711): changesets reads one per repository.
744747
const changesetConfig = JSON.parse(
745-
readFileSync(resolve(REPO_ROOT, '.changeset/config.json'), 'utf-8')
748+
readFileSync(changesetConfigPath(REPO_ROOT), 'utf-8')
746749
) as { fixed?: string[][] };
747750
const cliVersion = readManifest(CLI_MANIFEST_PATH).version as string;
748751
const platformPackages = Object.entries(DEPENDENCY_ANCHORS)

‎ui/scripts/check-test-path-roots.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ const FS_MODULES = new Set(['fs', 'node:fs', 'fs/promises', 'node:fs/promises',
187187
* what it excuses.
188188
*/
189189
export const SUBJECT_IS_THE_CWD = Object.freeze([
190-
'packages/cli/src/__tests__/app-generator.test.ts:1326 -- `contextOfCurrentProcess()` mirrors the ambient cwd on BOTH sides of the assertion deliberately: the writer under test derives its context from `process.cwd()` and the expectation derives it the same way, so the pair is self-consistent under either cwd. Re-rooting one side desyncs the mirror and turns a passing test red. The real cost -- that WHICH generator branch those two cases pin is decided by the launch directory -- is filed as objectui#7807 and is closed in the same file by two further cases that name their branch instead of inheriting it.',
190+
'packages/cli/src/__tests__/app-generator.test.ts:1329 -- `contextOfCurrentProcess()` mirrors the ambient cwd on BOTH sides of the assertion deliberately: the writer under test derives its context from `process.cwd()` and the expectation derives it the same way, so the pair is self-consistent under either cwd. Re-rooting one side desyncs the mirror and turns a passing test red. The real cost -- that WHICH generator branch those two cases pin is decided by the launch directory -- is filed as objectui#7807 and is closed in the same file by two further cases that name their branch instead of inheriting it.',
191191
]);
192192

193193
/**

0 commit comments

Comments
 (0)