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

Should Bower tools use .bower.json rather than bower.json? #1174

Closed
donaldpipowitch opened this issue Mar 14, 2014 · 16 comments
Closed

Should Bower tools use .bower.json rather than bower.json? #1174

donaldpipowitch opened this issue Mar 14, 2014 · 16 comments

Comments

@donaldpipowitch
Copy link

Or: Should I ignore the bower.json?

It seems .bower.json is always generated if I install a Bower package, so I ignore my bower.json in some of my packages. (It seems bad to duplicate this data - unnecessarily ?)  This obviously breaks tools which rely only on bower.json.

Should Bower tools depend solely on bower.json or should they at least depend on .bower.json? (E.g. should I make a pull request for such tools? :))

@sheerun
Copy link
Contributor

sheerun commented Apr 12, 2014

@sindresorhus ?

@sindresorhus
Copy link
Contributor

I agree. That's confusing and unnecessary. Could probably do it like npm and just have .bower.json as bower.json. Though not sure about the reasoning behind the current way.

@benschwarz
Copy link
Member

I have no idea why both are used.

@sheerun
Copy link
Contributor

sheerun commented Apr 12, 2014

Do they always have the same format? (I see .bower.json has some additional info).

@satazor
Copy link
Member

satazor commented Apr 12, 2014

.bower.json is a clone of bower.json with additional properties used internally. The reasioning behind it was not to modify the original fil so that people are not induced in error

@stephenplusplus
Copy link
Member

@donaldpipowitch didn't you have a case where information wasn't copied over to .bower.json?

@sheerun
Copy link
Contributor

sheerun commented Apr 12, 2014

Also for non-registry packages there will be .bower.json, but no bower.json (in cache too).

@sindresorhus
Copy link
Contributor

@satazor i don't see the problem with modifying the bower.json file. npm does it without problems.

@satazor
Copy link
Member

satazor commented Apr 12, 2014

There might be problems, for instance, bower corrects the 'version' property if it mismatches the tag in git. That could cause confusion if users would inspect bower.json and see different results compared to its remote counterpart.

@sheerun
Copy link
Contributor

sheerun commented Apr 12, 2014

Shouldn't bwerr fix _release part of .bower.json, not version?

@satazor
Copy link
Member

satazor commented Apr 12, 2014

_release is not the same as version, they are different things internally. It just happens that sometimes they are the same, but not always.

@sheerun
Copy link
Contributor

sheerun commented Apr 12, 2014

I think it's not that much of surprise that version has been corrected. I'd be more surprised that file contains new keys, but that could be documented behavior. I'm on no side though.

Also, users are not confused that ignored files are removed from component dir? :)

I think users are confused by both .bower.json and bower.json.

@donaldpipowitch
Copy link
Author

Hi @stephenplusplus, no, .bower.json always worked fine for me. I only had problems with build tools which relied solely on bower.json, but not .bower.json, because I ignored out my bower.json.

@nicksrandall
Copy link

@sheerun you mentioned
Also for non-registry packages there will be .bower.json, but no bower.json (in cache too).
Why is that? I've also noticed that the .bower.json file for non registry items doesn't include the dependencies part of the bower.json file.

@sheerun
Copy link
Contributor

sheerun commented Apr 29, 2014

Currently .bower.json is generated by bower for all dependencies, regardless their source.

I don't think it's something we want to change. Do you have any problems with it?

@sheerun
Copy link
Contributor

sheerun commented Jun 9, 2014

So yeah. The ultimate answer is: use .bower.json.

If you have any issues with it, please open new issue :)

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

7 participants