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.json #461

Closed
timmywil opened this issue Jul 10, 2013 · 15 comments
Closed

Add bower.json #461

timmywil opened this issue Jul 10, 2013 · 15 comments

Comments

@timmywil
Copy link
Contributor

Install bower globally and use bower init to create a bower.json.

See sizzle's for an example.

@jzaefferer
Copy link
Member

We already have the version numbers in the two source files, so tags installed via bower should work just fine. We just need to make sure that we tag from a branch with the same files once #378 is done.

@Krinkle
Copy link
Member

Krinkle commented Jul 11, 2013

Bower has no concept of which file the entry point is? btw, who/how pushes to bower? I assume we're not going to be required for the js file to end up in exactly the path qunit/qunit.js.

@timmywil
Copy link
Contributor Author

@Krinkle : There is no pushing/publishing to bower. Once we have qunit registered, pushing tags to github will automatically update bower. Also, qunit.js can be wherever you want. As you can see in Jörn's bower.json, you can specify its location through the use of the main property.

@jzaefferer
Copy link
Member

After installing the current qunit package locally, I suspect there's actually nothing happening when you push a tag. When you bower install, it just uses git to clone the repo (maybe a shallow clone) and checks out the right tag, then copies file into your bower_components folder according to the ignore list.

@timmywil
Copy link
Contributor Author

Perhaps I misunderstood the question. bower install is not the same as git clone. A package installed with bower is not a git repo (nor should it be). QUnit developers will push their tags and the new tag will be available when users bower install or bower update.

@jzaefferer
Copy link
Member

Right, but it looks like bower is quite different in its implementation, compared to npm (and some other comparable tools). Bower's registry seems to be just a list of modules, while npm actually stores file. Npm install modules by downloading those files, but bower just accesses the original git repository.

@timmywil
Copy link
Contributor Author

@jzaefferer This is true. The end result is that there is no bower publish, which is good, right?

@Krinkle
Copy link
Member

Krinkle commented Jul 12, 2013

So how do we allow bower to use files that need building (e.g. jquery, and soon qunit).

In NPM this is trivial using pre-publish (static building) or install hooks (local building). Though for NPM it is actually less common because using require() can include different modules from 1 entry point using node (e.g. index.js can then subsequently require other files).

Whereas for bower (which is from what I understand, primarily targeted at browser javascript) I imagine building will be a much more common requirement.

@timmywil
Copy link
Contributor Author

@scottgonzalez suggested that when we tag projects, we include built files in the tag, but not in our branches. I think that's the best solution I've heard so far as it doesn't require the user to build anything after they bower install.

@Krinkle
Copy link
Member

Krinkle commented Jul 12, 2013

Sounds to me like bower is lacking a pretty obvious feature, especially as it is aimed at browser scripts (for which libraries are generally developed in multiple files).

I don't feel like tacking all these files in git tags. What's the advantage for bower over npm for us in this case anyway? We've been using it from npm for a few qunit projects now and it works like a charm (e.g. here). I'd rather let bower sit on the shelf for a while. They have a rewrite in the works and a good roadmap with registry/publish. It seems like we best wait for that to be ready (for us it would only do git clone and checking out a tag right now).

Granted NPM is meant for node modules, not browser scripts, but if bower is (for our purposes) not yet ideal, why should be bother going through hoops?

@scottgonzalez
Copy link
Contributor

We've already made a project wide decision that Bower will be supported by all jQuery projects. This isn't just about internal usage.

@timmywil
Copy link
Contributor Author

OK, I've talked to the bower folks and it seems that they are moving towards having their own registry, where we could choose to publish packages to bower rather than point bower to our github endpoint. @danheberden is actually helping with that. That sounds like our best option. We can publish whatever files make the most sense for each project. However, I don't think there's any harm in including a bower.json now, especially since the currently registered package for QUnit is pointed somewhere else.

https://github.com/bower/bower/wiki/Rewrite-state

@Krinkle
Copy link
Member

Krinkle commented Jul 13, 2013

👍

1 similar comment
@JamesMGreene
Copy link
Member

👍

@jzaefferer
Copy link
Member

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

5 participants