Repository navigation
test(swizzle): cover destination symlinks - #10484
Conversation
Carries the destination-symlink tests from #5101 over to the merged swizzle code: an output folder, component folder, nested folder or file linked outside the project is refused before anything is written, with or without --overwrite, and a folder linked elsewhere inside the project is written through, nested folders included. The fixtures import the nested file, since the copy follows imports. Refs #5101 Co-authored-by: jiunshinn <[email protected]>
Only the destination-symlink block is added; the rest of the file is as on main.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is a draft. It runs once the pull request is marked ready for review.
The six new destination-symlink cases pin the swizzle confinement rule. A destination linked outside the project is refused with ERR_PATH_TRAVERSAL before anything is written, with or without --overwrite, and a folder linked inside the project is written through. They pass, and disabling the symlink check in assertWithin makes all five refusal cases fail, so they guard the right code. No changes are needed.
[Automated review]
Who this helps
People who run
astryx swizzleinto an output folder that is, or contains, a symlink. These tests pin what the merged swizzle code already does, so it can't regress:--overwrite. That covers the output folder, the component folder, a nested folder, or a nested file (live or dangling); the file outside is untouched.components→src/components) is written through, nested folders included.What changed
Test-only.
packages/cli/api/swizzle/copy/copy.test.mjsgains the "destination symlinks" suite (spec:AST-017FR1, FR5) from #5101 by jiunshinn, credited as co-author. It's adapted to the merged code in one way: the fixture'sTable.tsximports the nested file, because the copy follows imports. The rest of the file is unchanged.Refs #5101
Verification
No changeset (test-only).