Repository navigation
perf(cli): issues() reads Core templates only for integration templates - #10008
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
Project.issues() now skips the Core template catalog when no loaded integration has a templates root, and, through the commit from #9965 carried here, when no integration is loaded. The issues it returns are unchanged: an integration that ships templates still gets its replacement and template errors, and doctor, discover and component print the same output while Core template doc imports drop from 749 to 0 in those projects. There are no blocking findings.
Next step: once the draft is marked ready for review, a maintainer adds the ci:run label so CI runs on the fork branch.
[Automated review]
issues() resolved the whole template catalog whenever an integration was loaded, which imports every Core template doc. Only an integration's own templates can carry a replacement, so with no integration templates root that read finds no issue. issues() now resolves the catalog only when a loaded integration has a templates root, the same check discoverIntegrationTemplatesForOne makes. A doctor run in a project whose integrations ship only icon sets reads none of them.
8a41db8 to
44d4950
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
Project.issues() now reads Core's template catalog only when a loaded integration ships a templates root, so astryx doctor in an icon-set-only project imports no Core template doc and reports the same issues, while an integration that ships templates still gets its replacement and template errors. There are no blocking findings.
Next step: once the draft is marked ready for review, a maintainer adds the ci:run label so CI runs on the fork branch.
[Automated review]
Maintainer impact
doctor/icon-sets.test.mjs's first case times out in full node runs on a loaded machine. It runs the whole doctor three times on projects whose integrations are icon-set packages, and everyProject.issues()with an integration loaded resolves the whole template catalog, importing every Core template doc. Users pay the same import on everyastryx doctorin such a project.Intended invariant
issues()returns the same issues whichever discovery method ran first, and reads Core's templates only when an integration's templates could replace one.Change
foundation/config/project.mjs:issues()resolves the template catalog only when a loaded integration has a templates root that exists, the same checkdiscoverIntegrationTemplatesForOnemakes before it reads any template. Without one, that discovery finds nothing, andapplyTemplateReplacementshas no replacement to judge, because Core templates declare none; every other issue source (#collectIssues, component replacements) still runs.Evidence
project.issues.test.mjscounts template doc imports. With one loaded integration that ships only a themes root,issues()imports 749 template docs on the parent commit and none here.missing_template_replacement_target, and the broken-template case still reportsinvalid_template.Scope
Testing
At 44d4950 on
maine2b522f:vitest run --project node packages/cli/foundation/config packages/cli/api/doctor packages/cli/foundation/discovery/template-adapter packages/cli/clients/cli/commands/doctor: 20 files, 448 tests passed.eslint(CI=true),pnpm linton the changed files, the CLI'spnpm typecheck, Prettier andcheck:changesetspass.pnpm review:pre: 0 findings.