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

refactor(npm): create general use NpmPackageResolver #15882

Merged

Conversation

dsherret
Copy link
Member

This is preparation for a local node_modules folder resolver.

  1. DenoDirNpmResolver -> RequireNpmResolver
  2. Hide GlobalNpmPackageResolver
  3. Create general use NpmPackageResolver that has an internal implementation that can be swapped out.

}

#[derive(Clone, Debug)]
pub struct NpmPackageResolverSnapshot {
Copy link
Member Author

Choose a reason for hiding this comment

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

In the interest of time, I completely removed this for now and will add it back in the future when we actually go to implement lsp support.

pub folder_path: PathBuf,
}

pub trait InnerNpmPackageResolver: Send + Sync {
Copy link
Member

Choose a reason for hiding this comment

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

Why "Inner" ? Usually I wouldn't expect that name exposed from a module

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 about a name. It's exposed from this module, but private to cli/npm/resolvers (not exported from there).

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

@dsherret dsherret merged commit 73efed2 into denoland:main Sep 13, 2022
@dsherret dsherret deleted the refactor_general_npm_package_resolver branch September 13, 2022 15:59
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