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

Awkwardness with components that don't have built versions in repo #150

Closed
markmarkoh opened this issue Nov 19, 2012 · 34 comments
Closed

Awkwardness with components that don't have built versions in repo #150

markmarkoh opened this issue Nov 19, 2012 · 34 comments

Comments

@markmarkoh
Copy link

I tried using zepto installed through bower and had a strange experience, everything else installed and worked great right out of the box (d3, backbone/_).

Here was my process, problems I found and the fix:

  1. bower install zepto
  2. realize zepto doesn't include a built version of the library in the repo
  3. cd to zepto in components, run rake
  4. now everything works locally
  5. CI tests fail (and deployment fails)
  6. realize zepto includes it's own .gitignore which was ignoring "dist" from my app's repo
  7. edit .gitignore and recommit/redeploy

Am I missing something here? or is the zepto repo in a not-so-bower-friendly state?

edit: This might be something I should take up with the fine folks behind zepto, I just imagine this would be a problem for any library repo that requires a make/npm install/rake build process before it's use.

@satazor
Copy link
Member

satazor commented Nov 19, 2012

@markmarkoh as you said, zepto does not include the built version.
Bower will support post-install scripts in the future so devs can integrate with bower.

Anyway why not use URL directly?

bower install --save http://zeptojs.com/zepto.js should work out of the box

@paulirish
Copy link
Member

I think the solution here is that the zepto package for bower has the built
zepto.
This is how we do the jQuery package, while the jQuery repo has no built
version..

I think this should be policy for bower packages. No build step required.
Tests recommended to be excluded.

On Mon, Nov 19, 2012 at 2:57 PM, André Cruz notifications@github.comwrote:

@markmarkoh https://github.com/markmarkoh as you said, zepto does not
include the built version.
Bower will support post-install scripts in the future so devs can
integrate with bower.

Anyway why not use URL directly?

bower install --save http://zeptojs.com/zepto.js should work out of the
box


Reply to this email directly or view it on GitHubhttps://github.com//issues/150#issuecomment-10535112.

@paulirish
Copy link
Member

bower install --save http://zeptojs.com/zepto.js should work out of the box

One of the top reasons I use bower is so I don't have to find this URL. We
want installing zepto to be as easy to bower install zepto

@markmarkoh
Copy link
Author

jQuery's solution puts a shim built version in https://github.com/components/jquery, along with handlebars, ember and a few other common js libraries.

Would it be practical to get zepto added to components (knowing full well that this won't scale for all packages without built versions), and then get the bower package for zepto redirected to that repo?

Or wait for bower's post-install script support (which would also have to install some ruby gems for zepto's case, but at least that scales)?

@satazor
Copy link
Member

satazor commented Nov 20, 2012

so for now someone has to create and maintain zepto in components.
@paulirish do you know who is responsible for such things?

@paulirish
Copy link
Member

Yup I wil add both of you to the components org. It's the place we're maintaining these "shim" repos for projects where it makes sense to not include the actual base repo.

@paulirish
Copy link
Member

added. @markmarkoh can you fire up a zepto repo there? I think this is far preferable to a post-install script that also requires all the build tools for each project.

@markmarkoh
Copy link
Author

Sure thing, thanks.

@satazor
Copy link
Member

satazor commented Nov 27, 2012

Ok guys, since the postinstall script is mentioned in the roadmap, I will close this.
@markmarkoh is zepto registered in the bower registry? Want me to remove it so you can register it as the new repo?

@markmarkoh
Copy link
Author

It is in the registry, please take it out.

@satazor
Copy link
Member

satazor commented Nov 27, 2012

Ok will do as soon as I got home in a couple of minutes.

@satazor
Copy link
Member

satazor commented Nov 27, 2012

@markmarkoh done.

@markmarkoh
Copy link
Author

Great, I'll add the repo when I get back to the office. This ticket can be
closed.
On Nov 27, 2012 12:35 PM, "André Cruz" notifications@github.com wrote:

@markmarkoh https://github.com/markmarkoh done.


Reply to this email directly or view it on GitHubhttps://github.com//issues/150#issuecomment-10770406.

@satazor satazor closed this as completed Nov 27, 2012
@markmarkoh
Copy link
Author

(added zepto shim to components and registered module with bower)

@kud
Copy link
Contributor

kud commented Dec 13, 2012

You sure about naming components/zepto as "zepto" is a great idea? madrobby/zepto#578 (comment)

@mislav
Copy link

mislav commented Dec 13, 2012

Hello; main maintainter of Zepto here.

I was the one that registered the original URL for "zepto" in Bower, which was now taken away from me. To be honest, I didn't have a good idea how to make Bower support Zepto, but I registered the name to be able to figure it out later.

I don't like the fact that there's an unofficial project that's the main source of Zepto for people who install it through Bower. What if that project is not maintained anymore? Then Zepto can have as many updates, but nobody will be able to obtain them.

I would like to have control over how people download Zepto through Bower. Until it supports a build step, I would like to be able to simply point it to our website and it download zepto.js from there. After that, I just have to keep our version on the website updated often enough.

@kud
Copy link
Contributor

kud commented Dec 13, 2012

I agree with @mislav. When I do $ bower search zepto I'd like to have:

- zepto (git://github.com/madrobby/zepto.git or maybe the compiled one on the official website (I do not like min one though, I prefer to minify it myself))
- zepto-component (git://github.com/components/zepto.git)

To me, it's a priority that the official name must be the official repo too. Even if they do not support bower.

For people who do not support bower, I often ask them to manage correctly tags, what they mostly do just after.

Either the project supports bower and it's cool, either bower should/would work as homebrew and you've got a script that it compiles the project for you.

It makes more sense for me.

What do you think?

@vendethiel
Copy link

Project in components/ have multiple maintainers so that they're always gonna have a maintainer.

@kud
Copy link
Contributor

kud commented Dec 13, 2012

It's really a constant I'm not sure. Plus, my proposition does not interfere with your point.

@mislav
Copy link

mislav commented Dec 13, 2012

I don't know how "components/" is organized but I don't care. (I don't even understand what it is, but that's another story.) I don't want the canonical source of Zepto to be a fork.

I also don't want registered names on Bower to be taken away from me.

@kud
Copy link
Contributor

kud commented Dec 13, 2012

In other words, please standardize names.

  • projectName (official repo)
  • projectName-component (repo that supports bower if the official one doesn't do it)

@kud
Copy link
Contributor

kud commented Dec 13, 2012

@mislav components/ only supports compiled files which allows user to simply do $ bower install myProject and links index.js to its app / website.

The more I use bower, and the more I'd like to have an autoload that in fact creates a shim for requirejs or another AMD project.

$ bower install zepto

I've got:

require.config({
    deps: ['app'],
    baseUrl: 'js',
    paths: {
        zepto:          'components/zepto/zepto',     

@satazor
Copy link
Member

satazor commented Dec 13, 2012

@mislav it was removed because zepto does not include built sources in the repo and bower does not yet support post install scripts. Therefore we replaced it with our own mirror of zepto that works 100%. As soon as bower supports the post-script I will post in this issue and let you register zepto again.

@satazor
Copy link
Member

satazor commented Dec 13, 2012

About the post install script please follow up: #145

@mislav
Copy link

mislav commented Dec 13, 2012

I would be happy that "zepto" is simply registered to "http://zeptojs.com/zepto.js" for now, if that would work for Bower. Is it a problem if the endpoint doesn't have a component.js?

@satazor
Copy link
Member

satazor commented Dec 13, 2012

@mislav No, bower works without a component.js. The component.js is only needed if your project has dependencies and you must declared them there.

About zepto associated with a URL:
For now the bower-server only accepts git endpoints (it sucks, I know..).
Anyway the bower-server will be rewritten in node and will have all of these things sorted out:

  • validation of packages at registration
  • continuous validation of packages
  • allow other endpoints other than git ones
  • and many other things

@kud
Copy link
Contributor

kud commented Dec 13, 2012

Great @satazor, can't wait.

@stevenvachon
Copy link

uh, so after a year we still need to use "https://github.com/components/zepto"? The "zepto" and "zeptojs" references point to a git with no usable files. Unless I am mistaken about the requirements, this is pretty stupid.

@edi9999
Copy link

edi9999 commented Aug 9, 2014

Are they any news on the subject ? I would like to let people install my library with bower, however I don't want my built library to be in the repository

@benschwarz
Copy link
Member

@edi9999 Its up to the taste of the component author. Bower as a project cannot dictate how authors build / distribute their libraries.

In my opinion, built libraries should be apart of the repository (and managed by semver). Having to install / manage / build sass/styl/compass/less/coffee based components is a bad user experience.


@stevenvachon thats up to the zepto project, and nothing to do with bower.

@sheerun
Copy link
Contributor

sheerun commented Aug 9, 2014

I think for now it's best to:

  1. Create distribution repository and put compiled versions there
  2. In source repository create git submodule named dist pointing to distribution repository

I think in the future we'll replace distribution repositories with distribution servers.

So if your library is foobar, create foobar-component repo and add it as dist submodule.

Of course another way to deal with releases is to update dist in original repo before bumping version.

@stevenvachon
Copy link

@benschwarz The registered "zepto" Bower component did not work at the time of writing my above comment. I still use "https://github.com/components/zepto" instead because it works. Has the "zepto" component been corrected so that it works?

@evanshortiss
Copy link

Previously I followed the pattern of including a dist folder for my project that contains the built JS/CSS, but when I heard Bower now allowed use of hooks I thought "great!". After reading about the scripts though I was disappointed to see they only run in a parent project meaning I still need to check in built files which is disappointing. Supporting an npm style publish rather than register would be great, or simply support the postinstall hooks being run for the installed repo. In my case this would be as simple as npm install && npm run-script bundle.

What is the plan of action here? Using a separate repo and/or using a dist folder in the original repo both seem like awkward solutions as does expecting the end user to add a post install script if I choose not to go with the previous two options.

@sheerun
Copy link
Contributor

sheerun commented Jun 5, 2015

@evanshortiss Woulnd't adding such hooks would be a security issue? I agree bower should standardize build configuration, but I'm not sure they should be run automatically. Probably bower could add a field to bower.json that points to pre-built release that could be automatically downloaded instead of source release. Something like:

{
  "releases": [{
    "url": "https://uploads.github.com/repos/foo/bar/releases/:version/assets/component.tar.gz",
    "build": "npm install && gulp build"
  }]
}

The only question is how to achieve backward compatibility when people stop adding dist folders to repositories?

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