Skip to content
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 bower update --save functionality #2062

Merged
merged 2 commits into from
Nov 28, 2015
Merged

Conversation

contolini
Copy link
Member

This PR lets bower update update bower.json via a --save flag. It mimics npm's update behavior.

Current behavior:

  • bower update updates components in bower_components/ while respecting components' semver in bower.json. For example, if bootstrap is listed as ~2.2.0 in bower.json, running bower update will update bower_components/bootstrap to 2.2.2 because 2.2.2 is the latest version greater than 2.2.0 but less than 3.0.0.
  • bower.json is not modified.
  • Here are steps to test this behavior locally.

New behavior proposed by this PR:

  • bower update --save does the same stuff above but it also edits bower.json. In the above example, bootstrap would now be listed in bower.json as ~2.2.2.
  • bower update --save-dev works the same but for dev dependencies.
  • Extraneous dependencies (components that exist in bower_components/ but aren't listed in bower.json) are ignored.

See #2035 and #1468.

@bower/contributors please review. Feedback is appreciated.

@sheerun
Copy link
Contributor

sheerun commented Nov 28, 2015

Looks promising :) Could you squash the commits and force-push them?

@contolini
Copy link
Member Author

@sheerun Definitely. Is AppVeyor failing because of this PR? Or is it just having a bad day?

@sheerun
Copy link
Contributor

sheerun commented Nov 28, 2015

Yes, appveyor is failing because of timeout on one test. Maybe you need to use nock to mock some connection or something (optionally increase maximum timeout for this test).

Don't look at node 0.10 on appveyor because it's failing for unrelated issues..

@contolini
Copy link
Member Author

Cool, for now I just increased the timeout for that test file. I'll look into properly mocking the http requests when I get some more time. There are other update issues I'd like to tackle (esp. #256) that involve the same files.

@sheerun
Copy link
Contributor

sheerun commented Nov 28, 2015

Should I wait until you add tests for updating a single package?

@colinodell
Copy link
Member

+1

@contolini
Copy link
Member Author

@sheerun No, unfortunately that bug (#256) is a complicated one. If y'all are okay with the code in this PR, I think it's ready to be merged.

sheerun added a commit that referenced this pull request Nov 28, 2015
Add `bower update --save` functionality
@sheerun sheerun merged commit 8fcbd36 into bower:master Nov 28, 2015
@sheerun
Copy link
Contributor

sheerun commented Nov 28, 2015

Thank you

@jonathansolorzn
Copy link

I've just runned npm install bower - & bower update --save and the depencies are updated, but bower.json isn't updated, I mean the depency version doesn't change

@sheerun
Copy link
Contributor

sheerun commented Nov 29, 2015

It will be released as bower 1.6.9

@jonathansolorzn
Copy link

Oh, ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants