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

Added local node_module check for NodePackageAnalyzer #4753

Merged
merged 3 commits into from Aug 19, 2022

Conversation

yarisvt
Copy link

@yarisvt yarisvt commented Aug 15, 2022

Fixes Issue #4752

Description of Change

Ignore packages that start with "./", since those are local packages

Have test cases been added to cover the new functionality?

no

@boring-cyborg boring-cyborg bot added the core changes to core label Aug 15, 2022
@jeremylong
Copy link
Owner

Do you have an example where version.matches("^[.~]*/.*") indicates a local node module is being used?

@yarisvt
Copy link
Author

yarisvt commented Aug 17, 2022

@jeremylong

I am using vaadin to build a web app and it automatically generates js files in the node_modules folder. It then puts the following local path in the package.json (without prefixing it with file:)
image

According to the npm docs, local paths can use four forms:

../foo/bar
~/foo/bar
./foo/bar
/foo/bar

Therefore, the regex ^[.~]*/.* matches all four of them:
image

@jeremylong jeremylong added this to the 7.1.2 milestone Aug 18, 2022
@jeremylong
Copy link
Owner

Thanks for the detailed response! I made one very minor change to the regex (s/*/{0,2}/).

@yarisvt
Copy link
Author

yarisvt commented Aug 18, 2022

Great!

@jeremylong jeremylong merged commit 1e25e18 into jeremylong:main Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core changes to core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants