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

feat: Support for Generic FS for Node Compatibility #27464

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

theswerd
Copy link
Contributor

Added Trait Generics to allow Deno Node Compatibility to support other Fs environments.

@theswerd theswerd changed the title feat(doc): Support for Generic FS for Node Compatibility feat: Support for Generic FS for Node Compatibility Dec 24, 2024
@theswerd theswerd marked this pull request as draft December 24, 2024 09:30
@theswerd theswerd marked this pull request as ready for review December 24, 2024 09:40
@theswerd theswerd marked this pull request as draft December 24, 2024 09:40
@theswerd
Copy link
Contributor Author

No longer sure this is possible with current setup — cc @denoteam any thoughts?

@dsherret
Copy link
Member

Added Trait Generics to allow Deno Node Compatibility to support other Fs environments.

I'm currently doing a big refactor to get the CLI and all the resolver code to not use ext::fs's FileSystem trait: #27480 (after this PR, I'm going to follow-up with another one so that an ext::fs FileSystem is only used in ext::fs)

That said, you can currently support whatever file system you want by implementing a custom ext::fs::FileSystem. For example, this is what deno compile does:

impl FileSystem for DenoCompileFileSystem {
(though, I'm not sure if it's worth it to implement this for your situation atm given I'm about to do this big refactor)

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