Skip to content

cli: include integration-contributed components in unified search/build - #5259

Merged
cixzhang merged 1 commit into
meta:mainfrom
andrskr:cli-search-integration-components
Aug 24, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
andrskr:cli-search-integration-components

Conversation

@andrskr

@andrskr andrskr commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #5258.

Problem

search/build's component candidate list came from gatherComponents(coreDir), which only ever scanned @astryxdesign/core. A project's configured integrations were never part of the pool, so an integration-only component (no core equivalent, no name collision) was invisible to astryx search and astryx build, even though component --list and component <Name> already resolve it via the same loadedIntegrations data.

Fix

Split gatherComponents into gatherCoreComponents (unchanged) and gatherIntegrationComponents, which reuses loadIntegrationsSafely + discoverIntegrationComponents — the same functions component/list.mjs already uses to make integration components show up in component --list. gatherComponents now merges both, and its call site passes cwd alongside coreDir so the integration lookup has a project root to resolve from.

An integration component's import hint is set to its owning package name (rec.package), matching the granularity component --list's brief detail already uses (package: integration.name) — no new import-path-resolution logic invented.

Testing

New tests in search.test.mjs stand up a temp consumer with a stub core and an installed integration (same harness as template-integration.test.mjs), and assert the integration's component appears in search results with the integration package as its import hint.

  • search.test.mjs alone: 13/13 passed (11 pre-existing + 2 new).
  • api/search, api/build, api/component together: 35/36 passed. The one failure (component.test.mjs, a case-sensitivity check) is in a file this diff doesn't touch, and reproduces identically without this change — it's a case-insensitive-filesystem artifact of the sandbox this was developed in, not a regression from this patch.

Happy to adjust the import hint shape or split anything out if you'd rather keep this more minimal.

search/build's component candidate list came from gatherComponents(coreDir),
which only ever scanned @astryxdesign/core. A project's configured
integrations were never part of the pool, so an integration-only component
(no core equivalent, no name collision) was invisible to `astryx search`
and `astryx build`, even though `component --list` and `component <Name>`
already resolve it via the same loadedIntegrations data. The two discovery
paths silently disagreed.

Split gatherComponents into gatherCoreComponents (unchanged) and
gatherIntegrationComponents, which reuses loadIntegrationsSafely +
discoverIntegrationComponents — the same functions component/list.mjs
already uses to make integration components show up in `component --list`.
gatherComponents now merges both, and its call site passes cwd alongside
coreDir so the integration lookup has a project root to resolve from.

New tests stand up a temp consumer with a stub core and an installed
integration (same harness as template-integration.test.mjs), and assert the
integration's component appears in search results with the integration
package as its import hint.
@andrskr
andrskr requested a review from josephfarina as a code owner August 20, 2026 17:46
@vercel

vercel Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview Aug 20, 2026 5:49pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 20, 2026
@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Aug 20, 2026

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — search and build finally agreeing with component --list is the right fix, and the test fails without it. Merging as is; one optional nit inline.

[Reviewed by Robohands]

name: rec.name,
keywords: doc && Array.isArray(doc.keywords) ? doc.keywords : [],
description: doc ? doc.usage?.description || doc.description || '' : '',
_import: rec.package,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

component <Name> resolves the exports subpath (_adapter.mjs:405) — this hint stays at package level.

@cixzhang
cixzhang enabled auto-merge (squash) August 24, 2026 13:35
@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Aug 24, 2026
@cixzhang
cixzhang merged commit 32d41f6 into meta:main Aug 24, 2026
18 of 20 checks passed
cixzhang added a commit that referenced this pull request Aug 24, 2026
- add the PR reference to all 45 pending changesets, in prose rather than
  on the handle line (a bare @handle line is what check-changesets requires)
- credit @rubyycheung, not @RubyCheung, for the Dialog responsive work in
  #5352; those are two different real GitHub accounts
- add two missing changesets for merged work that changes published
  behaviour: #4605 (Breadcrumbs current-item weight) and #5259 (CLI unified
  search includes integration components)
cixzhang added a commit that referenced this pull request Aug 24, 2026
- add the PR reference to all 45 pending changesets, in prose rather than
  on the handle line (a bare @handle line is what check-changesets requires)
- credit @rubyycheung, not @RubyCheung, for the Dialog responsive work in
  #5352; those are two different real GitHub accounts
- add two missing changesets for merged work that changes published
  behaviour: #4605 (Breadcrumbs current-item weight) and #5259 (CLI unified
  search includes integration components)
cixzhang added a commit that referenced this pull request Aug 24, 2026
* docs: consolidate + credit changesets for v0.5.0

- add the PR reference to all 45 pending changesets, in prose rather than
  on the handle line (a bare @handle line is what check-changesets requires)
- credit @rubyycheung, not @RubyCheung, for the Dialog responsive work in
  #5352; those are two different real GitHub accounts
- add two missing changesets for merged work that changes published
  behaviour: #4605 (Breadcrumbs current-item weight) and #5259 (CLI unified
  search includes integration components)

* docs: add the PR reference to the PowerSearch operator-menu changeset

#5242 landed while this PR was open.

* docs: add the PR reference to the merged-refs stability changeset

#5429 landed while this PR was open.
josephfarina pushed a commit that referenced this pull request Sep 2, 2026
…in kit

Rebased onto main, which landed integration search (#5259) and the
scorer-level false-direct-match fix (#5614) while this was open. Both are
main's implementations and are untouched: this branch no longer rewrites
gatherComponents, so the two regressions that rewrite caused go with it — an
integration result reports its own package again, and a broken config no
longer turns a Core `button` search into an empty success.

What is left is the part that did not land. A page template's keywords include
every component its source renders, so `build "actionable warning banner"`
returned login, contact-form and documentation-design at 95 apiece on an exact
hit for "banner" alone. Coverage now gates the pages group instead of
garnishing the score, and a thin kit names the browse commands rather than
reading as "the package has nothing".

scoreQuery reports the coverage it already computed as matchedTerms /
queryTerms, because a single strong hit and a broad weak one land on the same
score and the gate cannot tell them apart otherwise.

The guidance-tier indexing goes up separately, as asked.
josephfarina pushed a commit that referenced this pull request Sep 3, 2026
…in kit

Rebased onto main, which landed integration search (#5259) and the
scorer-level false-direct-match fix (#5614) while this was open. Both are
main's implementations and are untouched: this branch no longer rewrites
gatherComponents, so the two regressions that rewrite caused go with it — an
integration result reports its own package again, and a broken config no
longer turns a Core `button` search into an empty success.

What is left is the part that did not land. A page template's keywords include
every component its source renders, so `build "actionable warning banner"`
returned login, contact-form and documentation-design at 95 apiece on an exact
hit for "banner" alone. Coverage now gates the pages group instead of
garnishing the score, and a thin kit names the browse commands rather than
reading as "the package has nothing".

scoreQuery reports the coverage it already computed as matchedTerms /
queryTerms, because a single strong hit and a broad weak one land on the same
score and the gate cannot tell them apart otherwise.

The guidance-tier indexing goes up separately, as asked.
josephfarina added a commit that referenced this pull request Sep 3, 2026
… word a match (#5320)

* fix(cli): gate the build pages group on query coverage, and hint a thin kit

Rebased onto main, which landed integration search (#5259) and the
scorer-level false-direct-match fix (#5614) while this was open. Both are
main's implementations and are untouched: this branch no longer rewrites
gatherComponents, so the two regressions that rewrite caused go with it — an
integration result reports its own package again, and a broken config no
longer turns a Core `button` search into an empty success.

What is left is the part that did not land. A page template's keywords include
every component its source renders, so `build "actionable warning banner"`
returned login, contact-form and documentation-design at 95 apiece on an exact
hit for "banner" alone. Coverage now gates the pages group instead of
garnishing the score, and a thin kit names the browse commands rather than
reading as "the package has nothing".

scoreQuery reports the coverage it already computed as matchedTerms /
queryTerms, because a single strong hit and a broad weak one land on the same
score and the gate cannot tell them apart otherwise.

The guidance-tier indexing goes up separately, as asked.

* refactor(cli): move the thin-kit hint out to its own PR

Review asked for the guidance indexing and the thin-kit hint as separate small
PRs. The hint is now #5938 and the guidance tier is #5937, so this branch keeps
only the coverage gate on the build pages group and the matchedTerms/queryTerms
plumbing that gate needs.

No behaviour change to the gate itself.

---------

Co-authored-by: Joey Farina <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — a091dde4 Deployed Aug 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

search/build never see integration-contributed components

2 participants