Skip to content

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

Open
andrskr wants to merge 1 commit into
facebook:mainfrom
andrskr:cli-search-integration-components
Open

cli: include integration-contributed components in unified search/build#5259
andrskr wants to merge 1 commit into
facebook:mainfrom
andrskr:cli-search-integration-components

Conversation

@andrskr

@andrskr andrskr commented Aug 20, 2026

Copy link
Copy Markdown

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
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) needs:code-review High-risk change (new package/component/API) — needs human code review before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

search/build never see integration-contributed components

1 participant