Repository navigation
Conversation
`astryx swizzle <Name>` copied only a component's top-level files and silently skipped nested subdirectories. `swizzle Table` wrote 17 files and dropped `plugins/`, so the ejected `index.ts` still re-exported `./plugins/*` paths that were never created — the eject failed module resolution while the CLI reported success. The copy now walks the component tree recursively (47 files for `Table`). One `collectSourceFiles()` walk backs the pre-flight collision check, the copy loop and the reported file list, so the three cannot drift apart, and paths are reported posix-separated. `rewriteImports` resolves each `../` specifier from the importing file's own directory instead of assuming the file sits at the component root: - `../../types` from `plugins/tree/` stays untouched — structure is preserved, so it still resolves inside the eject. - `../../../theme/tokens.stylex` still becomes `@astryxdesign/core/theme`. - `../..`, the component's own entry reached from a nested file, stays untouched rather than becoming `@astryxdesign/core/<Name>`, which would point the eject back at the library it forked. - A specifier reaching past the package source root is left alone rather than rewritten to `@astryxdesign/core/..`, which resolves to nothing. Test scaffolding directories (`__tests__`, `__snapshots__`, `__mocks__`, `__fixtures__`) are skipped — their contents carry no `.test.` marker for the filename filter to catch — and symlinks are not followed. Verified end to end: the ejected `Table` has all 12 plugin directories and all 138 relative specifiers resolve on disk. Fixes meta#3506
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
`packages/cli` typechecks its `.mjs` sources under `checkJs` via `tsconfig.strict.json`, so an untyped parameter is an error, not a warning. `isInside` and `isAtOrInside` shipped without JSDoc and tripped TS7006 four times in CI. Local `vitest` and `eslint` both pass without them — `pnpm -F @astryxdesign/cli typecheck:strict` is the gate that catches this.
Contributor
PR Analysis ReportNo new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | View full report |
This was referenced Aug 16, 2026
This branch was successfully deployed
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.
Summary
Fixes #3506.
astryx swizzle <Name>copied only a component's top-level files and silently skipped nested subdirectories.swizzle Tablereported success after writing 17 files while droppingplugins/entirely, so the ejectedindex.tsstill re-exported./plugins/selection,./plugins/sortableand 15 more paths that were never created. The eject failed module resolution; the CLI called it a success.After this change
swizzle Tablewrites 47 files, all 12 plugin directories land, and all 138 relative specifiers in the output resolve on disk.Changes
Recursive copy. A new
collectSourceFiles()walks the component tree and returns posix-relative paths. It is the single source of truth for the pre-flight collision check, the copy loop and the reported file list, so those three can no longer disagree — previously all three applied the same top-levelisFile()filter, which is why nested files were invisible even in the success count.Location-aware import rewriting.
rewriteImportsgained an optional{componentDir, fromDir}. Each../specifier is resolved from the importing file's own directory rather than assumed to sit at the component root:Table/index.ts../theme/tokens.stylex@astryxdesign/core/themeTable/plugins/tree/x.ts../../types@astryxdesign/core/..Table/plugins/tree/x.ts../../../theme/tokens.stylex@astryxdesign/core/..@astryxdesign/core/themeTable/plugins/tree/x.ts../..(own entry)@astryxdesign/core/..@astryxdesign/core/..The old rule mapped every
../seg/…to<owner>/seg, so the 29'../../types'imports insideTable/pluginswould each have become@astryxdesign/core/..— a specifier that resolves to nothing. Making the copy recursive without this would have swapped one broken eject for another.Test scaffolding is skipped.
__tests__,__snapshots__,__mocks__and__fixtures__are excluded as directories. The existing filename filter only catches.test.,.doc.andREADME.md, so a.snapor a.spec.tsxwould otherwise have been copied into a consumer's source once recursion was on. Symlinks are not followed.Tests
packages/cli/api/swizzle/swizzle.recursive.test.mjs— 21 new tests over synthetic core fixtures underos.tmpdir(), so nothing is written insideprocess.cwd()and the existing suite's isolation is untouched. Coverage: structure preservation, posix path reporting,filesCopiedmatching disk, nested exclusions, the two directory-only exclusions, per-location rewriting, nested collision detection,--overwriteon nested files,usesStyleXfrom a nested file only, the flat-component path, symlink refusal, and a walk asserting every./-relative specifier in the output resolves.Full
packages/clisuite: 120 files, 2100 tests, green.pnpm check:repoand eslint clean.