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

bower version doesn't update bower.json in 1.8.0 #2389

Closed
simonauner opened this issue Nov 9, 2016 · 5 comments
Closed

bower version doesn't update bower.json in 1.8.0 #2389

simonauner opened this issue Nov 9, 2016 · 5 comments

Comments

@simonauner
Copy link

simonauner commented Nov 9, 2016

Output of bower -v && npm -v && node -v:

bower: 1.8.0
npm: 3.10.7
node: v6.6.0

Additional environment details (proxy, private registry, etc.):

Steps to reproduce the issue:

  1. Be in a repository that is a bower component
  2. Run bower version major/minor/patch

Describe the results you received:
Git tag is updated as expected to correct version

Describe the results you expected:
Git tag is updated.
bower.json is updated

Additional information:
I see that #2232 (Make bower version behavior consistent with spec) now calculates version based on git tags to which I have no objection. However, this PR also removed updating the bower.json file. This breaks bower for users not running 1.8.0 since bower.json and git tags will be inconsistent.

From looking at the commit, these two lines should perhaps have been left intact?
3fbca6d#diff-83bf2b02cc098876be2d25091d8f66cbL33
3fbca6d#diff-83bf2b02cc098876be2d25091d8f66cbL35
(that is, "old" line 33 and 35 before the commit 3fbca6d)

My suggestion is to still use the git tag for calculating the new version and create a new git tag, but still also update the bower.json file to keep bower non-breaking for pre-1.8.0 users.

@sheerun
Copy link
Contributor

sheerun commented Nov 9, 2016

This is correct behavior. Bower completely ignores version in bower.json, even prior 1.8.0

Please remove "version" field from bower.json

@sheerun sheerun closed this as completed Nov 9, 2016
@simonauner
Copy link
Author

Cheers, thanks for clarification.

@simonauner
Copy link
Author

simonauner commented Nov 10, 2016

@sheerun Kept on thinking about this as we use bower quite heavily at work to work with web components shared between different projects.

So, this change means that if user A works on a bower component with version 1.0.0 and, using bower 1.8.0, runs bower version minor and checks it in and publishes, it will publish the component as 1.1.0 and create a git tag, but not update the bower.json file.

Later, person B, using bower 1.7.9 works on the same component and now git tags say latest is 1.1.0 but bower.json says 1.0.0. After working on the component person B runs bower version minor.

→ bower version minor
bower 128           Command failed: git tag v1.1.0 -am v1.1.0 fatal: tag 'v1.1.0' already exists

Seems like this could create some confusion? Perhaps this change should have been put in a major update to bower?

@sheerun
Copy link
Contributor

sheerun commented Nov 10, 2016

The solution is again to remove version from bower.json, isn't it?

@PIR3M
Copy link

PIR3M commented Jan 31, 2017

The idea to remove "version" field from bower.json in favor of git tags is a really good idea. BUT, It should have been released as a Major version because it's a breaking and dangerous change. Or at least you should warn users about the fact that version field is deprecated and the use of "bower version" won't update anything...

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

No branches or pull requests

3 participants