feat(cli): strict config + integration v1 schema and /integration export#3261
Merged
ejhammond merged 1 commit intoJun 30, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Replace the loose passthrough config and integration API with a locked,
strict v1 surface.
AstryxConfig is now { integrations?: string[]; issuesUrl?: string;
hooks?: { postCodemod?: PostCodemodHook[] } } and validates with a strict
Zod schema — unknown keys are hard errors. AstryxIntegration is now
{ components?; templates?; codemods?; issuesUrl? }, also strict.
- New @astryxdesign/cli/integration subpath export with createIntegration;
createConfig stays on @astryxdesign/cli/config.
- Integrations resolve by package name only. Each package declares a single
conventional root manifest (astryx.integration.{ts,mjs,js}) sibling to its
package.json; identity (name/version) comes from package.json. .ts manifests
load via jiti.
- App config loads from astryx.config.{ts,mjs,js} sibling to the nearest
package.json (no upward closest-config walk); multiple configs is an error,
missing yields an empty config.
- Post-codemod hooks now come from app config (hooks.postCodemod) and run via
execFile; dry-run previews, apply executes in order and fails on nonzero exit.
Clean breaking change — the prior config/integration API was not in real use.
0290516 to
03ea484
Compare
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
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 free
to 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.
Replaces the loose/passthrough config and integration API with a locked, strict v1 surface. This is a clean breaking change — the prior config/integration API was not in real use (no real
astryx.config.*files or integration packages exist), so there is no migration path to preserve.Config (
@astryxdesign/cli/config)AstryxConfigis now exactly:Validated by a strict Zod schema — unknown keys are hard errors,
issuesUrlmust be a URL, andintegrationsmust be an array of strings.createConfigstays on@astryxdesign/cli/config.Integration (
@astryxdesign/cli/integration)New subpath export.
AstryxIntegrationis now:createIntegrationmoves out ofconfig.mjsinto its own module behind the new/integrationexport. Also strict.Package-only resolution + sibling config loading
astryx.integration.{ts,mjs,js}— sibling to itspackage.json(multiple present is an error, missing is an error). Identity (name/version) comes frompackage.json, not the manifest. Contribution roots (components/templates/codemods) are normalized to absolute paths.astryx.config.{ts,mjs,js}sibling to the nearestpackage.json(no upward closest-config walk). Multiple configs at that root is an error; a missing config yields an empty config..tsconfig/manifests load viajiti.Post-codemod hooks
Hooks now come from app config (
hooks.postCodemod) rather than integrations. Each hook'sbuildCommand({ packageDir, files })returns a command run viaexecFile: dry-run previews only, apply executes in order and fails the upgrade on a nonzero exit (or abuildCommandthrow). Hooks are skipped entirely when no files changed.Folded out the now-unused surfaces:
packages/gapReport/template.getconfig, integrationname/version/displayName/description/docs/category/blocks/postCodemod,AstryxIntegrationCodemod, the oldAstryxPostCodemodContext, thetemplate getcommand and itstemplate.getresponse type, and theERR_TEMPLATE_CONFIG/ERR_TEMPLATE_GETcodes.File-based codemod discovery, static templates, the validate-integration command, component ownership, and swizzle config-routing are deliberately left for follow-up changes.