Add depth and isDevDependency CSV columns / module info; recurse direct dependencies#139
Open
laurence-myers wants to merge 1 commit intoRSeidelsohn:masterfrom
Open
Conversation
Author
|
Needs some work; recursion doesn't work how I expected, so the depth and dev values are incorrect. I also need to add tests. |
…direct dependencies per module
ac05e04 to
ddab259
Compare
depth and isDevDependency CSV columns / module infodepth and isDevDependency CSV columns / module info; recurse direct dependencies
Author
|
I was unable to run the unit tests, they do not run in NodeJS v24, because the unit tests are written as CommonJS modules, but NodeJS tries to load them as ECMAScript modules, due to the presence of As such, I have not added a unit test. Fixing the existing unit test execution was out of scope for this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the option to include the columns
depthandisDevDependencywhen outputting CSV files. This allows you to easily filter the data later - e.g. you can produce a single file containing all dev dependencies, and dependencies from any depth, and then filter the data later to only show the direct dependencies (depth = 1) or Prod dependenciesisDevDependency = false.I found that the tool was iterating
dependencies, which seems to be a flat array of all dependencies. I changed it to iterate_dependencies, which only includes the direct dependencies. This gives proper values ofdepthandisDevDependencybased on whether the parent was a dev dependency. I haven't fully tested the consequences of this (the unit tests do not run in NodeJS v24, because it tries to load CommonJS modules as ECMAScript modules).There might be a better name for these new columns.
I based this off tag
v4.4.2, becausemasterhad an issue (the bin does not work because it tries to call the functionparse(), but it was renamed toparseArgs()), so I didn't know what the current state of development was.