Uh oh!
There was an error while loading. Please reload this page.
fix(cli): anchor objectui check's ignore patterns at every depth - #6387
Merged
Conversation
`packages/cli/src/commands/check.ts` passed `ignore: ['node_modules/**', 'dist/**', '.git/**']` to `globSync`. `glob` matches `ignore` patterns against the path relative to `cwd`, so an unanchored `dist/**` / `node_modules/**` excludes only a directory of that name at the scan root — every nested `packages/<name>/dist/`, `examples/<name>/dist/`, `apps/<name>/dist/` (and their `node_modules/`) was still scanned. In a built workspace this re-reads the author's own schemas a second time from build output, roughly doubling every reported count (objectui#6320). Widen both patterns to anchor at any depth: `'**/dist/**'` and `'**/node_modules/**'`. Confirmed first (per the dispatch order) that no example, template, or docs fixture in this repository authors a schema under a directory literally named `dist` — see the PR body for the grep and its control term. Adds `check-nested-dist-ignore.test.ts`: plants a nested `dist/` and a nested `node_modules/` fixture and asserts neither is scanned, while a root-level `dist/` / `node_modules/` remains excluded (the regression guard for the fix itself — widening a pattern is exactly where an exclusion can accidentally stop covering the case it already handled). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CZgmFFzqA9cX8tBMhvpFe
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
os-warren
marked this pull request as ready for review
August 25, 2026 19:36
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#6320
The defect
packages/cli/src/commands/check.tspassedignore: ['node_modules/**', 'dist/**', '.git/**']toglobSync.globmatchesignorepatterns against the path relative tocwd, sodist/**/node_modules/**excluded only a directory of that name at the scan root — every nestedpackages/<name>/dist/,examples/<name>/dist/,apps/<name>/dist/(and theirnode_modules/) was still scanned, re-reading the author's own schemas a second time from build output.Step 1 — the confirmation (done BEFORE the fix, per the dispatch order)
Grepped
examples/,templates/(absent in this repo — verified withls -d templates→ no output) and docs fixtures for any authored (git-tracked) schema living under a path segment literally nameddist:Control term (same sweep roots, proving the glob syntax itself works and a zero-hit above isn't a broken pattern): the same roots really do contain tracked schema files outside any
dist/segment —(sample hits include a 4-level-deep path, confirming
**matches at depth:examples/schema-catalog/src/schemas/actions/action-button-variants.json.)Filesystem-level double-check (not just git-tracked, in case a
dist/had been built but not committed) on a clean, unbuilt checkout:Confirmation holds: nothing in this repository authors a schema under a directory literally named
dist. Proceeding to the fix per step 2 of the dispatch order.Step 2 — the fix
packages/cli/src/commands/check.ts:203-214— widened both ignore patterns to anchor at any depth:.git/**is left as-is — it was never in scope (there is no nested.git/case analogous to nesteddist//node_modules/), matching the ruled fix exactly.The test —
packages/cli/src/__tests__/check-nested-dist-ignore.test.ts(new file)Four assertions, using a probe fixture that is unmistakable if-and-only-if it gets scanned (a positive ObjectUI structural key + an unregistered
type, so a scanned copy prints an "Unknown schema type" warning naming its own path):packages/x/dist/…jsonis not scanned (the fix)packages/y/node_modules/…jsonis not scanned (the fix,node_modulesarm)dist/…jsonis still excluded (regression guard — widening a pattern is exactly where an exclusion can accidentally stop covering the case it already handled)node_modules/…jsonis still excluded (same regression guard)Each test also writes a sibling file outside the excluded directory as a counter-probe, so a "not scanned" assertion can't be silently satisfied by a scan that read nothing at all.
Two-direction proof (required by the dispatch order)
Committed the fix + test first (commit
fe74ba7e3) so there was a real restore point, then:check.tsto the pre-fix content viagit show HEAD~1:packages/cli/src/commands/check.ts > <path>(HEAD~1is631d81dbf=origin/mainat claim time), under atrap restore EXIT INT TERMwhererestore() { git checkout HEAD -- <path>; }.git checkout HEAD -- <path>, then proved the restore:git hash-object <path>→4602e7b8f6f4961d75358b3307080b910107fbfc, identical togit rev-parse HEAD:packages/cli/src/commands/check.tstaken before the mutation (4602e7b8f6f4961d75358b3307080b910107fbfc) — exact match.git diff HEAD -- <path>→ empty.Test Files 1 passed (1)/Tests 4 passed (4).git status --porcelainwas empty after the whole sequence — the working tree exactly matches the commit.Other checks run locally
pnpm exec vitest run packages/cli/→Test Files 14 passed (14)/Tests 230 passed (230)(226 pre-existing + 4 new).pnpm exec turbo run lint --filter=@object-ui/cli→ exit 0, 0 errors (pre-existing warnings only, none touching the edited files).pnpm exec turbo run type-check --filter=@object-ui/cli→ exit 0, no errors.node scripts/check-changeset-presence.mjs→✅ 1 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s).grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]'over the edited files → no matches.Files changed
packages/cli/src/commands/check.ts(lines 203-214) — the ignore-list fix.packages/cli/src/__tests__/check-nested-dist-ignore.test.ts(new) — the pinning test..changeset/6320-check-nested-dist-ignore.md(new) — patch,@object-ui/cli.Nothing contradicts the card or the dispatch order
The measured pre-fix behaviour, the confirmation result, and the ruled fix all matched what #6320 and the dispatch order predicted — no surprises to flag.
Generated by Claude Code
Generated by Claude Code