Skip to content

feat(cli): swizzle integration-owned components + config-routed feedback#3267

Merged
ejhammond merged 1 commit into
xds-unprefix-integrationfrom
astryx/swizzle-integration-routing
Jun 30, 2026
Merged

feat(cli): swizzle integration-owned components + config-routed feedback#3267
ejhammond merged 1 commit into
xds-unprefix-integrationfrom
astryx/swizzle-integration-routing

Conversation

@ejhammond

Copy link
Copy Markdown
Contributor

What

Generalize astryx swizzle so it can copy integration-owned components, not just core, route escaping-import rewrites and the maintainer feedback note to the owning package, and route the core feedback URL through app config.

Changes

  • Component resolution via ownership. Adds a --package <pkg> option. The requested component is resolved against owner packages (core + configured integrations). If a name is owned by multiple packages and no --package is given, the command errors with the candidate packages listed (new ERR_AMBIGUOUS_COMPONENT code) instead of silently preferring core. Core-only names behave exactly as before.
  • Owner-package import rewrites. rewriteImports(content, ownerPackage?) now rewrites escaping relative imports (../x) to ${ownerPackage}/<topDir>. ownerPackage defaults to @astryxdesign/core, so existing core behavior is unchanged. Relative imports within the copied directory are preserved.
  • Copy excludes docs. The swizzle copy now also excludes *.doc.* files (in addition to *.test.* and README.md) so integration docs aren't copied.
  • Config- and ownership-routed feedback. Core feedback routes through config.issuesUrl (falling back to the default issues URL); integration components use their manifest issuesUrl. When an owner has no issues URL, the feedback note is omitted entirely. The GitHub "new issue" matcher now accepts any github.com/<owner>/<repo>/issues(/new)? form.
  • JSON envelope. swizzle.copy gains an owner package field; feedback is omitted for integration components without an issues URL.

Testing

  • New swizzle.routing.test.mjs (hermetic, spawns the CLI bin against fixtures under node_modules): core feedback routing via config, default fallback, integration-owned copy (excludes test/doc, rewrites escaping import to the owner package, routes feedback to the integration issues URL), integration without issues URL omits feedback, ambiguous name errors, and --package resolution to both core and the integration.
  • Existing swizzle.test.mjs and swizzle.path-safety.test.mjs remain green (rewriteImports default param keeps the old signature working).
Generalize `astryx swizzle` so it can copy integration-owned components,
not just core. Component resolution now goes through package ownership
(core + configured integrations); --package scopes the lookup and an
ambiguous name across packages errors with the candidate list instead of
silently preferring core.

Escaping relative imports are rewritten to the OWNING package's subpaths
(rewriteImports gains an optional ownerPackage param defaulting to core).
The copy now also excludes *.doc.* files. Maintainer feedback is routed
through config: core uses config.issuesUrl (falling back to the default),
integration components use their manifest issuesUrl, and the note is
omitted entirely when no issues URL is available. The swizzle.copy JSON
envelope gains an owner `package` field.
@vercel

vercel Bot commented Jun 30, 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, Comment Jun 30, 2026 3:02am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.6KB 0B

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

github-actions Bot added a commit that referenced this pull request Jun 30, 2026
@ejhammond ejhammond merged commit a61bd35 into xds-unprefix-integration Jun 30, 2026
12 checks passed
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.

1 participant