Skip to content

Add some symlink support #382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 25, 2025
Merged

Add some symlink support #382

merged 11 commits into from
Feb 25, 2025

Conversation

jakebailey
Copy link
Member

This unbreaks @types auto loading when @types/* are symlinks to dirs, which is what pnpm does.

I think this probably completes symlink support outside of testing; getAccessibleFileSystemEntries appears to be the only thing that actually checked in the old codebase.

I am not 100% happy with the callback-y nature of this, but I can't yet think of a better way to handle this code without repetition.

if entryType&fs.ModeIrregular != 0 && vfs.Realpath != nil {
// Could be a Windows junction. Try Realpath.
fullPath := path + "/" + entry.Name()
if realpath := vfs.Realpath(fullPath); fullPath != realpath {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is not the fastest way to do this at all; but the code to do this correctly on Windows is pretty funky (see the intermediate state in #186, which I will bring back). Something I want to address in a follow-up PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reference: 8998046

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(realpath however, is very very reliable!)

@jakebailey jakebailey merged commit b49d2d6 into main Feb 25, 2025
16 checks passed
@jakebailey jakebailey deleted the jabaile/symlinks branch February 25, 2025 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants