Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Conversation

karlhorky
Copy link
Contributor

Hi there, thanks for depcheck, really great!

Just a quick PR to also support the builtin module specifiers with the new node: prefix introduced in Node v16 (will be backported to v14 soon)

Ref: https://twitter.com/jasnell/status/1385238402149150721

@karlhorky karlhorky changed the title Support node: prefix Support node: prefix for builtin modules May 5, 2021
@kevinoid
Copy link

I'd also like to see node: supported. Thanks for working on it @karlhorky!

Also wanted to add a quick note that you may want to consider using is-core-module (which was split from resolve in browserify/resolve@7c26483) so that you don't have to maintain your own list of core modules.

@kevinoid
Copy link

node: prefix introduced in Node v16 (will be backported to v14 soon)

Also, a quick note that node: support was backported to v14.13.1 and v12.20.0.

@karlhorky
Copy link
Contributor Author

@kevinoid Wow, really cool, thanks for the heads up!

I've commented about this also over at DefinitelyTyped on the PR to @types/node where they reverted the node: prefix feature:

DefinitelyTyped/DefinitelyTyped#52595 (comment)

@karlhorky
Copy link
Contributor Author

Also wanted to add a quick note that you may want to consider using is-core-module (which was split from resolve in browserify/resolve@7c26483) so that you don't have to maintain your own list of core modules.

Yeah @rumpl, I agree here - if you would prefer that I switched it out for this other well-maintained module instead, happy to give that a shot.

@karlhorky
Copy link
Contributor Author

Ah, maybe require / CommonJS support is not quite there yet for v14 and v12:

In Node 16 require('node:fs') works, but it looks like it still doesn't in 14.17.0.

DefinitelyTyped/DefinitelyTyped#52595 (comment)

@kevinoid
Copy link

Good catch @karlhorky, I had missed that!

Looks like require() support is being held for a bit before backporting: nodejs/node#37246 (comment)

@codecov
Copy link

codecov bot commented May 31, 2021

Codecov Report

Merging #635 (fba121b) into main (843f46d) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #635   +/-   ##
=======================================
  Coverage   98.63%   98.63%           
=======================================
  Files          48       48           
  Lines        1017     1017           
=======================================
  Hits         1003     1003           
  Misses         14       14           
Impacted Files Coverage Δ
src/check.js 100.00% <100.00%> (ø)
src/utils/typescript.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3da0d6f...fba121b. Read the comment docs.

@rumpl
Copy link
Member

rumpl commented May 31, 2021

Also wanted to add a quick note that you may want to consider using is-core-module (which was split from resolve in browserify/resolve@7c26483) so that you don't have to maintain your own list of core modules.

Yeah @rumpl, I agree here - if you would prefer that I switched it out for this other well-maintained module instead, happy to give that a shot.

@karlhorky that would be awesome, we used to use punycode but had to remove it, I'll be happy to merge a PR that would use is-core-module :)

@karlhorky
Copy link
Contributor Author

@rumpl ok done in 91ec86f

@rumpl
Copy link
Member

rumpl commented May 31, 2021

Thanks! Could you squash your three commits and then we can merge?

@karlhorky
Copy link
Contributor Author

karlhorky commented May 31, 2021

Ok, squashed - as long as the tests pass, I think this is good to go!

@karlhorky
Copy link
Contributor Author

Oops, forgot one of the imports, removed it.

@rumpl rumpl merged commit fdaa7bc into depcheck:main May 31, 2021
@rumpl
Copy link
Member

rumpl commented May 31, 2021

Thanks!

@karlhorky
Copy link
Contributor Author

Glad to help, thanks for the merge! Will this be published in a new minor version (1.5.0)?

@karlhorky karlhorky deleted the patch-1 branch May 31, 2021 14:10
@rumpl
Copy link
Member

rumpl commented May 31, 2021

It will yes, I'll push a new version later in the day (after I finish my real job 😅)

@karlhorky
Copy link
Contributor Author

No rush, big thanks for all of your work on this project!

@karlhorky
Copy link
Contributor Author

@rumpl any news on a new version?

@rumpl
Copy link
Member

rumpl commented Jun 25, 2021

I just pushed the 1.4.2 tag, it should be available on npm soon, sorry about that

Screenshot 2021-06-25 at 14 27 42

@rumpl
Copy link
Member

rumpl commented Jun 25, 2021

Oh no... travis actually doesn't work any more 😭

@rumpl
Copy link
Member

rumpl commented Jun 25, 2021

@karlhorky
Copy link
Contributor Author

Thanks! hehe meme game on point

karlhorky added a commit to upleveled/preflight that referenced this pull request Jun 25, 2021
gruvector pushed a commit to gruvector/preflight that referenced this pull request Feb 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants