-
Notifications
You must be signed in to change notification settings - Fork 250
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
#291: Save dependencies to clib manifest by default #299
Conversation
command_option(&program, "-D", "--save-dev", | ||
"save development dependency in clib.json or package.json", | ||
setopt_savedev); | ||
command_option(&program, "-N", "--no-save", |
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.
Not super sure about the shorthand flag. If commander
supports passing NULL
here, maybe we just allow the long option only?
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 think -N
is okay!
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 opened a PR long time ago on commander to omit the short version. clibs/commander#25
I'll see if it still valid...
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.
@jwerle Cool, sounds good.
What's the standard procedure for clib - I push a tag (for this I'd bump the minor version) and merge? Thanks for the reviews!
Looks good! |
This PR modifies the behavior of
clib-install
such that dependencies are saved to the clib manifest (clib.json/package.json) by default, mirroring the behavior of npm >= 5. It accomplishes this by deprecating the--save
option and adding an additional flag--no-save
which can be passed to prevent the dependency from being written to the clib manifest.Note I've retained the
--save-dev
option so users can specify they want the dependency to save under dev dependencies. This is also aligned with the behavior of npm >= 5.Changes:
--save
option and add a logger warning. Behavior when this flag is passed is effectively the same to prevent backward compatibility issues.--no-save
flag, which changes the install behavior such that the dependency is not added to the clib manifest.make
target for the binaries as a dependency of thetest
target. I noticed that if you runmake test
without having runmake
first, the tests will fail.--no-save
. Also updated existing test cases where necessary with--no-save
just to maintain parity with what was there before. We could probably refactor the--save
and--no-save
tests to use a common function, but I wanted to keep the PR small, and having separate test files lets us fine-tune the behavior for one without clobbering the other.Resolves #291.
When we're good, I can push a tag to bump the version or however you prefer. Happy to make any suggested changes.