Skip to content
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

Implements the readdir recursive flag #5514

Merged
merged 5 commits into from
Jun 24, 2023
Merged

Conversation

arcanis
Copy link
Member

@arcanis arcanis commented Jun 22, 2023

What's the problem this PR addresses?
The ZipFS implementation doesn't support the recursive flag.

Fixes part of #5423

How did you fix it?
I implemented the recursive flag and updated the types to account for it. However I didn't make ZipOpenFS automatically traverse through zip archives ... My line of thinking was:

  • on one hand, tools implementing their own readdir-based recursive traversal don't currently dig into zip archives
  • on the other hand, it can be argued that the other recursive Node.js native operations also apply to the zip archives' content (cp / rm)

But I tend to think the first point is more important ... I feel like the recursive flag should just be an optimization, so it should have the same behaviour as a manual traversal ...

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

Comment on lines +517 to +518
if (opts?.recursive)
throw new Error(`Unsupported option 'recursive' for NodeModulesFS.readdirPromise`);
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure how to implement it in this FakeFS

packages/plugin-pnpm/sources/PnpmLinker.ts Outdated Show resolved Hide resolved
@arcanis arcanis merged commit 69ecb99 into master Jun 24, 2023
@arcanis arcanis deleted the mael/readdir-recursive-support branch June 24, 2023 06:09
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