-
Notifications
You must be signed in to change notification settings - Fork 59
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: add -p flag to dependency-check to only check prod deps #672
Conversation
Adds a convenience flag to only check for missing production deps. Also allows the user to pass files to check instead of always using the defaults. Also, also fixes the spinner when dep-checks fail so the formatting of the error message isn't all kinds of messed up. Would have caught ipfs/js-ipfs#3393
de08f3a
to
8cf33dc
Compare
src/dependency-check.js
Outdated
let input = argv.input | ||
|
||
if (argv.productionOnly) { | ||
if (!hasPassedFileArgs(processArgs)) { |
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.
yargs can't handle this ?
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.
No, from what I can see, there's no way to tell if a value came from a passed argument or if it came from the defaults.
You could compare the input to the defaults, but if they entered the defaults you'd end up throwing them away. 😞
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.
the defaults are only used below so input should be empty right ?
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.
input
won't be empty - it's either the default value passed by yargs, or the input passed by the user
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.
ahhhh ok got it
src/dependency-check.js
Outdated
let input = argv.input | ||
|
||
if (argv.productionOnly) { | ||
if (!hasPassedFileArgs(processArgs)) { |
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.
the defaults are only used below so input should be empty right ?
This is running against js-ipfs here: ipfs/js-ipfs#3395 |
This is broken on windows at the moment because of the issue noticed here. It's not due to this PR though, we just weren't testing this codepath on Windows before.. |
I've forked dependency-check to fix the windows breakage, PR here: dependency-check-team/dependency-check#127 |
I've created a temporary fork of dependency-check so we can move forward while dependency-check-team/dependency-check#127 is resolved. |
Adds a convenience flag to only check for missing production deps.
Also fixes the spinner when dep-checks fail so the formatting of the error message isn't all kinds of messed up.
Also, also adds
--ignore
options to the dep check so we can pass options to aegir and to the underlying dependency-check binary.Would have caught ipfs/js-ipfs#3393