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: non-production dependency checking #22
Conversation
Add support for adjusting the default of checking production dependencies only
Thanks for the PR! I'll look into this soon. |
src/index.ts
Outdated
@@ -21,16 +21,39 @@ program | |||
.version(pkg.version, "-v, --version") | |||
.option("--summary", "Prints a summary report") | |||
.option("-i, --interactive", "Runs in interactive mode.") | |||
.option( | |||
"--environment [environment]", | |||
"Which dependencies to check. (production, development, all)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should just simplify this to either production
or both
. Is there a use case for checking only development dependencies? The reason to do only prod is because a lot of licenses has legal language around distribution and only the prod deps should be getting published to npm or packaged (for example in a container).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable to me, I only added development in for completeness of API compatibility with license-checker.
].join("\n") | ||
let { stdout } = spawnSync("ts-node", ["./src/index.ts", "--summary", "--environment=all"], {}) | ||
expect(stdout.toString("utf8")).to.equal(expectedResult) | ||
}).timeout(20000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding a test!
Thanks for your patience on this, we actually put someone on it, but they were/are running a windows environment which caused some complications so we got sidetracked with that. It's still on my list! |
I needed to merge in the latest master so I did that on a branch in this repo then merged. Thanks for your contribution! |
Add support for not passing the
--production
flag through to the license-checker library.The default behaviour has not changed, but the command now optionally supports
--environment=all
and--environment=development
to pass the relevant flags to license-checker.I went with this flag because if we were to mirror the flags of license-checker it would change the default behaviour.
Open to suggestions for other naming, alternatively we could add a
--no-production
flag.