feat: implement -D, -O options for add command#12
Conversation
| value: Value, | ||
| } | ||
|
|
||
| pub enum DependencyType { |
There was a problem hiding this comment.
Should this be called DependencyGroup instead? Should I add peer dependencies, bundled dependencies in this PR?
There was a problem hiding this comment.
I like dependencygroup better, but I'm ok with dependencytype as well. I think we can split the PRs. That's ok
| } else if self.optional { | ||
| DependencyType::Optional | ||
| } else { | ||
| DependencyType::Normal |
There was a problem hiding this comment.
What do you think about naming this as Default?
| value: Value, | ||
| } | ||
|
|
||
| pub enum DependencyType { |
There was a problem hiding this comment.
I like dependencygroup better, but I'm ok with dependencytype as well. I think we can split the PRs. That's ok
| Optional, | ||
| } | ||
|
|
||
| impl Into<&str> for DependencyType { |
There was a problem hiding this comment.
Can you also add From trait as well?
| #[arg(short = 'D', group = "dependency_type")] | ||
| dev: bool, | ||
| /// Add the package as a optional dependency | ||
| #[arg(short = 'O', group = "dependency_type")] |
There was a problem hiding this comment.
long value should be added as save-optional
| /// Name of the package | ||
| pub package: String, | ||
| /// Add the package as a dev dependency | ||
| #[arg(short = 'D', group = "dependency_type")] |
There was a problem hiding this comment.
long value should be added as save-dev
Can you add a TODO in the code so we don't forget? |
Sure |
|
Is this PR ready to get merged? |
|
@anonrig Yes! |
One caveat is if a package already exists in another dependecy group, we don't remove the existing entry. Can we fix it in another PR?