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

Latest version unavailable through Bower #84

Closed
cmalven opened this issue Oct 4, 2015 · 4 comments
Closed

Latest version unavailable through Bower #84

cmalven opened this issue Oct 4, 2015 · 4 comments
Labels

Comments

@cmalven
Copy link

cmalven commented Oct 4, 2015

I use npm for package management when I can, but I work on many projects that exclusively use Bower for front-end packages.

It's impossible to use the current version of Popmotion through Bower because a few things are missing:

  • The bower.json file needs a "version": "3.1.3", so Bower can find the latest version
  • The project needs a git tag of 3.1.3 added so Bower knows where to find the latest version.
  • The main in bower.json is currently pointing to the wrong place. It should probably be "main": "popmotion.global.js" so various front-end tooling setups know where to find the main .js file.

If you add the 3.1.3 git tag I'm happy to create a PR for the rest. What do you think?

@mattgperry
Copy link
Collaborator

Yeah I am definitely up for this, just a couple things I'm confused about though.

The entry point - is Bower used then, largely to concatenate JavaScript rather than manage modules in an npm, modular fashion? Because with npm the entry point is set to module.js so you have to explicitly import it into your packages, whereas with global you're adding it to the global namespace. So I'm asking this because they're two very different ways of using it and I'm wondering if I change the entry point I break it for people who use it in a modular fashion?

The git tags - if I run, in my project root, git tag, I see every version tag listed. If I go to the tags section of GitHub I only see up to 0.30.0. Is there something in particular I need to do to get these tags up on GitHub?

Thanks for your help.

@cmalven
Copy link
Author

cmalven commented Oct 6, 2015

The Bower main property is complicated and confusing. The maintainers of Bower can't even decide among themselves how it should be used (see this conversation that went on for multiple years), but the most popular modules that pull in bower dependencies (like wiredep and main-bower-files) work by looking at the main for every installed package and every packaged in the dependency tree for every installed package. They don't actually (as far as I'm aware) follow any dependencies specified in the code, like require statements, so they don't work nearly as reliably as npm/CommonJS for building dependencies.

And package authors are so inconsistent with how they use main doesn't seem like it could be used reliably as an npm-style package management system. That's all a long-winded way of saying you're right, I can't guarantee that changing your main wouldn't break the way some people are using Bower, I just know that the current way its being used won't work with the most popular bower-centric build tools I know of.

But even if you leave it the way it is (which is totally cool), you should still update the tag, which you can do with:

git push origin master && git push --tags

In the future, if you want, you can automatically update your bower.json file version and create a new tag with bower version 1.x.x, then run the above command to push the tags to github.

If the tags are at least correct, someone can bower install popmotion then update their bower.json file like so to get it working:

  "overrides": {
    "popmotion": {
      "main": "popmotion.global.js"
    }
    …

@cmalven
Copy link
Author

cmalven commented Oct 6, 2015

BTW, I like Popmotion. Nice work!

@mattgperry
Copy link
Collaborator

Ah great explanation! I'm convinced we should change it, in fact I already have. When I got to my current job they were using Bower simply to concatenate files and the previous entry point wouldn't have worked in that instance either.

Thanks for the tag tip - I've push all my tags now so hopefully that'll work for you.

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

No branches or pull requests

2 participants