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 support for twitter bower #253

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
@agrberg

agrberg commented Mar 13, 2013

the build script copies the built version of sinon to the root of the repository and includes this file

add support for twitter bower by having the build script copy the bui…
…lt version of sinon to the root of the repository and including this file
@cjohansen

This comment has been minimized.

Show comment
Hide comment
@cjohansen

cjohansen Mar 13, 2013

Contributor

Is there a way we can have bower use what's in pkg instead? Also, how does bower use this file? From master?

Contributor

cjohansen commented Mar 13, 2013

Is there a way we can have bower use what's in pkg instead? Also, how does bower use this file? From master?

@agrberg

This comment has been minimized.

Show comment
Hide comment
@agrberg

agrberg Mar 13, 2013

Bower can use what is in pkg but that would require pkg being removed from .gitignore and included in the repository.

Bower's typical behavior is to clone the repository to a specified directory on the user's machine. It also uses tags to determine the version of the repo. I don't believe there is a rule about where the built JavaScript file should live. It's almost always in the root and the one library I use where it is not, Marionette, it is found in lib.

agrberg commented Mar 13, 2013

Bower can use what is in pkg but that would require pkg being removed from .gitignore and included in the repository.

Bower's typical behavior is to clone the repository to a specified directory on the user's machine. It also uses tags to determine the version of the repo. I don't believe there is a rule about where the built JavaScript file should live. It's almost always in the root and the one library I use where it is not, Marionette, it is found in lib.

@cjohansen

This comment has been minimized.

Show comment
Hide comment
@cjohansen

cjohansen Mar 13, 2013

Contributor

I'm not overly keen on keeping generated artefacts in the source repo. Especially not if it allows people to depend on arbitrary versions from git. Is there some way we can ship builds to bower when we do our regular releases?

Contributor

cjohansen commented Mar 13, 2013

I'm not overly keen on keeping generated artefacts in the source repo. Especially not if it allows people to depend on arbitrary versions from git. Is there some way we can ship builds to bower when we do our regular releases?

@smistry-toushay

This comment has been minimized.

Show comment
Hide comment
@smistry-toushay

smistry-toushay Mar 13, 2013

bower supports installing from a URL that points to a zip or tar file. Would that be a better option?

smistry-toushay commented Mar 13, 2013

bower supports installing from a URL that points to a zip or tar file. Would that be a better option?

@cjohansen

This comment has been minimized.

Show comment
Hide comment
@cjohansen

cjohansen Mar 13, 2013

Contributor

So it can use the npm tar then I guess? Since recently it even includes a built file.

Contributor

cjohansen commented Mar 13, 2013

So it can use the npm tar then I guess? Since recently it even includes a built file.

@smistry-toushay

This comment has been minimized.

Show comment
Hide comment
@smistry-toushay

smistry-toushay Mar 13, 2013

Yes, but you have to run

bower install <tar URL>

Is there a URL I can try out?

smistry-toushay commented Mar 13, 2013

Yes, but you have to run

bower install <tar URL>

Is there a URL I can try out?

@cjohansen

This comment has been minimized.

Show comment
Hide comment
@cjohansen

cjohansen Mar 13, 2013

Contributor

I currently don't have a working node install. Do npm install sinon and it will print the URL to the tar file.

Contributor

cjohansen commented Mar 13, 2013

I currently don't have a working node install. Do npm install sinon and it will print the URL to the tar file.

@smistry-toushay

This comment has been minimized.

Show comment
Hide comment
@smistry-toushay

smistry-toushay Mar 13, 2013

Just tried:

bower install https://registry.npmjs.org/sinon/-/sinon-1.6.0.tgz

Two issues:

  • install into components/sinon-1.6.0 preferred folder would be components/sinon
  • bower only untars it, so components/sinon-1.6.0 contains components.json and index.tgz

smistry-toushay commented Mar 13, 2013

Just tried:

bower install https://registry.npmjs.org/sinon/-/sinon-1.6.0.tgz

Two issues:

  • install into components/sinon-1.6.0 preferred folder would be components/sinon
  • bower only untars it, so components/sinon-1.6.0 contains components.json and index.tgz
@cjohansen

This comment has been minimized.

Show comment
Hide comment
@cjohansen

cjohansen Mar 13, 2013

Contributor

I decided I don't want bower-specific code or generated artefacts in the source repository. If there's a way to produce something bower-consumable from the build script when we do releases I would be willing to accept a PR for that.

Contributor

cjohansen commented Mar 13, 2013

I decided I don't want bower-specific code or generated artefacts in the source repository. If there's a way to produce something bower-consumable from the build script when we do releases I would be willing to accept a PR for that.

@cjohansen cjohansen closed this Mar 13, 2013

@agrberg

This comment has been minimized.

Show comment
Hide comment
@agrberg

agrberg Mar 13, 2013

Some CI servers have problems with zips and tars.

Bower would look for the latest tag, v1.6.0 in this case, if one were to run bower install sinon.
Alternatively you can run bower install git://github.com/cjohansen/Sinon.JS.git with an optional # and version. This requires only tagged commits to contain the generated library.

In your component.json file you can specify the name of the library and either a version to get the data from bower, or the same structured git url as in the previous example.

Anyway, if it's a problem or if you don't want the built code hanging around, I can look for other solutions.

agrberg commented Mar 13, 2013

Some CI servers have problems with zips and tars.

Bower would look for the latest tag, v1.6.0 in this case, if one were to run bower install sinon.
Alternatively you can run bower install git://github.com/cjohansen/Sinon.JS.git with an optional # and version. This requires only tagged commits to contain the generated library.

In your component.json file you can specify the name of the library and either a version to get the data from bower, or the same structured git url as in the previous example.

Anyway, if it's a problem or if you don't want the built code hanging around, I can look for other solutions.

@cjohansen

This comment has been minimized.

Show comment
Hide comment
@cjohansen

cjohansen Mar 13, 2013

Contributor

As far as I understand component.json is used by two different projects, and they don't use compatible versions. Thus I don't want that flie in the repo. I also don't want to have generated code in the repo. If there's anything that can be done at build-time, I'll be happy to help.

Contributor

cjohansen commented Mar 13, 2013

As far as I understand component.json is used by two different projects, and they don't use compatible versions. Thus I don't want that flie in the repo. I also don't want to have generated code in the repo. If there's anything that can be done at build-time, I'll be happy to help.

@agrberg

This comment has been minimized.

Show comment
Hide comment
@agrberg

agrberg Mar 14, 2013

Thanks @cjohansen. For right now I'll just do what I need on my fork and maybe see if Bower has any steps to build or operate on a repo after cloning it. I'll post back if it does.

What other project uses component.json? I may have been unclear earlier, Bower doesn't require the library to have component.json, it just allows you to use one in your project to define your dependencies so you can install them all with a simple bower install.

agrberg commented Mar 14, 2013

Thanks @cjohansen. For right now I'll just do what I need on my fork and maybe see if Bower has any steps to build or operate on a repo after cloning it. I'll post back if it does.

What other project uses component.json? I may have been unclear earlier, Bower doesn't require the library to have component.json, it just allows you to use one in your project to define your dependencies so you can install them all with a simple bower install.

@mantoni

This comment has been minimized.

Show comment
Hide comment
@mantoni

mantoni Mar 14, 2013

Member

This project does also use component.json: https://github.com/component/component

Member

mantoni commented Mar 14, 2013

This project does also use component.json: https://github.com/component/component

@glyuck

This comment has been minimized.

Show comment
Hide comment
@glyuck

glyuck Apr 14, 2013

I just write in my component.json:

"sinon": "http://sinonjs.org/releases/sinon-1.6.0.js"

And after bower install i have sinon.js saved to components/sinon/index.js

glyuck commented Apr 14, 2013

I just write in my component.json:

"sinon": "http://sinonjs.org/releases/sinon-1.6.0.js"

And after bower install i have sinon.js saved to components/sinon/index.js

@mantoni

This comment has been minimized.

Show comment
Hide comment
@mantoni

mantoni Apr 14, 2013

Member

You could create a sinon-component project with sinon as a sub module and maintain it there.

Member

mantoni commented Apr 14, 2013

You could create a sinon-component project with sinon as a sub module and maintain it there.

@agrberg agrberg deleted the agrberg:bower-support branch Apr 15, 2013

@agrberg

This comment has been minimized.

Show comment
Hide comment
@agrberg

agrberg Apr 15, 2013

@glyuck Do you do that manually or is there an after install hook for bower?

@mantoni Can you elaborate on your solution?

agrberg commented Apr 15, 2013

@glyuck Do you do that manually or is there an after install hook for bower?

@mantoni Can you elaborate on your solution?

@mantoni

This comment has been minimized.

Show comment
Hide comment
@mantoni

mantoni Apr 15, 2013

Member

Just a thought since request for component and others are coming quite often now:

If anyone is willing to support component, it might be a solution to create a git repository with Sinon.JS as a sub module (see http://git-scm.com/book/en/Git-Tools-Submodules). GitHub supports sub modules.

This would allow you to pull in whatever release version you like, run the Sinon build and, if required, additional build steps. This wouldn't require you to add anything to the Sinon repository itself.

Member

mantoni commented Apr 15, 2013

Just a thought since request for component and others are coming quite often now:

If anyone is willing to support component, it might be a solution to create a git repository with Sinon.JS as a sub module (see http://git-scm.com/book/en/Git-Tools-Submodules). GitHub supports sub modules.

This would allow you to pull in whatever release version you like, run the Sinon build and, if required, additional build steps. This wouldn't require you to add anything to the Sinon repository itself.

@smistry-toushay

This comment has been minimized.

Show comment
Hide comment
@smistry-toushay

smistry-toushay Apr 15, 2013

You might want to look at this https://github.com/components

I think those component shims are maintained manually.

smistry-toushay commented Apr 15, 2013

You might want to look at this https://github.com/components

I think those component shims are maintained manually.

@agrberg

This comment has been minimized.

Show comment
Hide comment
@agrberg

agrberg Apr 15, 2013

Ah I see what you're saying. Basically sort of making my stopgap solution (including the result of build in my fork) somewhat official with the Bower folks. I'll message them and see how they prefer to handle this.

agrberg commented Apr 15, 2013

Ah I see what you're saying. Basically sort of making my stopgap solution (including the result of build in my fork) somewhat official with the Bower folks. I'll message them and see how they prefer to handle this.

@cjohansen cjohansen referenced this pull request Apr 30, 2013

Closed

Bower support #280

@davisford davisford referenced this pull request May 10, 2013

Closed

Removing bad components #119

@svnlto

This comment has been minimized.

Show comment
Hide comment
@svnlto

svnlto Aug 2, 2013

@LtCmdDudefellah @cjohansen bower now has renamed component.json to bower.json

@cjohansen would you be willing to reconsider this issue and maybe ship a distdirectory that contains the built version of sinon? The future version of the bower-registry (which I am currently working on) will support archive uploads btw.

svnlto commented Aug 2, 2013

@LtCmdDudefellah @cjohansen bower now has renamed component.json to bower.json

@cjohansen would you be willing to reconsider this issue and maybe ship a distdirectory that contains the built version of sinon? The future version of the bower-registry (which I am currently working on) will support archive uploads btw.

@cjohansen

This comment has been minimized.

Show comment
Hide comment
@cjohansen

cjohansen Aug 2, 2013

Contributor

@svnlto where do you want the dist directory? Can you use http://sinonjs.org/download/?

Contributor

cjohansen commented Aug 2, 2013

@svnlto where do you want the dist directory? Can you use http://sinonjs.org/download/?

@svnlto

This comment has been minimized.

Show comment
Hide comment
@svnlto

svnlto Aug 3, 2013

@cjohansen if you commit the pkgdirectory that is produced by your ruby build script then the following bower.json file should be all you need to add to make this work, i.e. solve this issue.

{
  "name": "sinon",
  "version": "1.7.3",
  "main": "pkg/sinon.js",
  "ignore": [
    "**/.*",
    "lib",
    "test",
    "build",
    "jsl.conf",
    "node_modules",
    "release.sh"
  ]
}

svnlto commented Aug 3, 2013

@cjohansen if you commit the pkgdirectory that is produced by your ruby build script then the following bower.json file should be all you need to add to make this work, i.e. solve this issue.

{
  "name": "sinon",
  "version": "1.7.3",
  "main": "pkg/sinon.js",
  "ignore": [
    "**/.*",
    "lib",
    "test",
    "build",
    "jsl.conf",
    "node_modules",
    "release.sh"
  ]
}
@cjohansen

This comment has been minimized.

Show comment
Hide comment
@cjohansen

cjohansen Aug 3, 2013

Contributor

I still don't want to commit generated files, as explained before. My policy for these things stays the same: If there's anything in Sinon source that keeps people from using it in a given context, I welcome patches. We recently changed our CommonJS detection code for the Component people. Additional meta information should be maintained by someone passionate about the package manager in question.

I think it will be easier for any new package manager if it supports packages as an entity separate from the source code.

Contributor

cjohansen commented Aug 3, 2013

I still don't want to commit generated files, as explained before. My policy for these things stays the same: If there's anything in Sinon source that keeps people from using it in a given context, I welcome patches. We recently changed our CommonJS detection code for the Component people. Additional meta information should be maintained by someone passionate about the package manager in question.

I think it will be easier for any new package manager if it supports packages as an entity separate from the source code.

@svnlto

This comment has been minimized.

Show comment
Hide comment
@svnlto

svnlto Aug 4, 2013

Fair enough, will create a fork and register it with the registry.

svnlto commented Aug 4, 2013

Fair enough, will create a fork and register it with the registry.

@slashdotdash

This comment has been minimized.

Show comment
Hide comment
@slashdotdash

slashdotdash Nov 8, 2013

bower install --save-dev sinon=http://sinonjs.org/releases/sinon-1.7.3.js

slashdotdash commented Nov 8, 2013

bower install --save-dev sinon=http://sinonjs.org/releases/sinon-1.7.3.js
@mikeobrien

This comment has been minimized.

Show comment
Hide comment
@mikeobrien

mikeobrien Dec 14, 2013

👍 on bower support. A few projects have gone this route to enable support for package managers like bower but not have built artifacts in their repos. There is even a grunt task to automate it. Maybe that would be a reasonable middle ground?

mikeobrien commented Dec 14, 2013

👍 on bower support. A few projects have gone this route to enable support for package managers like bower but not have built artifacts in their repos. There is even a grunt task to automate it. Maybe that would be a reasonable middle ground?

@cjohansen

This comment has been minimized.

Show comment
Hide comment
@cjohansen

cjohansen Dec 14, 2013

Contributor

If you want to maintain a bower package for Sinon, feel free to do so. I don't intend to.

Contributor

cjohansen commented Dec 14, 2013

If you want to maintain a bower package for Sinon, feel free to do so. I don't intend to.

@mikeobrien

This comment has been minimized.

Show comment
Hide comment
@mikeobrien

mikeobrien Dec 14, 2013

Thats just it, this solution doesn't require you as an author to maintain any packages. But it allows package managers to interface with your project. So its a win-win solution. Basically all you do is push a built version of sinon to a repo here, thats it. Then people can wire up whatever package manager they want to pull from there.

mikeobrien commented Dec 14, 2013

Thats just it, this solution doesn't require you as an author to maintain any packages. But it allows package managers to interface with your project. So its a win-win solution. Basically all you do is push a built version of sinon to a repo here, thats it. Then people can wire up whatever package manager they want to pull from there.

@fabiosantoscode

This comment has been minimized.

Show comment
Hide comment
@fabiosantoscode

fabiosantoscode Dec 27, 2013

@cjohansen

If you want to maintain a bower package for Sinon, feel free to do so. I don't intend to.

Don't mind if I do. This is an awesome library and I really don't want to distribute it black-boxed as a third party script in my repo.

I'm going to create a fork, and a bower package sinonjs-built containing a build of sinon for every tag.

fabiosantoscode commented Dec 27, 2013

@cjohansen

If you want to maintain a bower package for Sinon, feel free to do so. I don't intend to.

Don't mind if I do. This is an awesome library and I really don't want to distribute it black-boxed as a third party script in my repo.

I'm going to create a fork, and a bower package sinonjs-built containing a build of sinon for every tag.

@fabiosantoscode

This comment has been minimized.

Show comment
Hide comment
@fabiosantoscode

fabiosantoscode Dec 30, 2013

Package created. You can now bower install sinonjs-built.

fabiosantoscode commented Dec 30, 2013

Package created. You can now bower install sinonjs-built.

@agrberg

This comment has been minimized.

Show comment
Hide comment
@agrberg

agrberg commented Dec 30, 2013

👍

@nubz

This comment has been minimized.

Show comment
Hide comment
@nubz

nubz Jan 7, 2014

👍 bower install --save-dev sinonjs-built

nubz commented Jan 7, 2014

👍 bower install --save-dev sinonjs-built

@kazupooot

This comment has been minimized.

Show comment
Hide comment
@kazupooot

kazupooot commented Feb 22, 2016

👍

@sinonjs sinonjs locked and limited conversation to collaborators Feb 22, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.