shama / napa

:wine_glass: A helper for installing stuff without a package.json with npm.
MIT License
412 stars 34 forks source link

Add the ability to add a branch or tag #2

Closed steffenmllr closed 10 years ago

steffenmllr commented 10 years ago

Would be great if I cloud do:

{
 "napa": {
    "angular": "angular/bower-angular#v1.2.3",
    "ui-router": "angular-ui/ui-router#master",
    "angular-mocks": "angular/angular-mocks"
  }
}
colinkahn commented 10 years ago

I was just looking for this ability too. Seems like you couldn't do this just with git due to security reasons (http://stackoverflow.com/questions/7196682/is-it-possible-to-clone-only-certain-commit-from-a-git-repo-with-depth-1). I would guess if you're looking for a tag you could get the zipped archive for the repo instead though (of course napa would have to be updated to do that, probably via #1).

gingermusketeer commented 10 years ago

+1

Napa has been great so far. But it just updated all my angular dependencies and broke everything :(

DjebbZ commented 10 years ago

+1. This is the only thing that bothers me with napa. With this single feature I'll be able to ditch completely Bower (which really is just an inferior npm).

bcherny commented 10 years ago

+1

shama commented 10 years ago

As of 0.3.0 you can now download arbitrary urls or from github tagged releases:

{
  "scripts": {
    "install": "napa"
  },
  "napa": {
    "foo": "username/repo#v1.2.3",
    "bar": "https://example.com/downloads/release.tar.gz"
  }
}

Currently for a lot of github releases, it will download and extract into a sub folder, node_modules/module/release-1.2.3/actualContents. Let me know if that's an issue and I'll add some logic to detect and correct that.

DjebbZ commented 10 years ago

This is hot !

The path may not be a problem for me, since I need to use the full path to use the lib downloaded with napa. Whether I include it directly in the browser or 'browserify' it, at first glance it's not a problem. Maybe for consistency's sake only.

Khalid aka DjebbZ @Dj3bbZ

Le 24 janv. 2014 à 18:52, Kyle Robinson Young notifications@github.com a écrit :

As of 0.3.0 you can now download arbitrary urls or from github tagged releases:

{ "scripts": { "install": "napa" }, "napa": { "foo": "username/repo#v1.2.3", "bar": "https://example.com/downloads/release.tar.gz" } } Currently for a lot of github releases, it will download and extract into a sub folder, node_modules/module/release-1.2.3/actualContents. Let me know if that's an issue and I'll add some logic to detect and correct that.

— Reply to this email directly or view it on GitHub.

DjebbZ commented 10 years ago

Next step is branch and commit id.

Khalid aka DjebbZ @Dj3bbZ

Le 24 janv. 2014 à 18:52, Kyle Robinson Young notifications@github.com a écrit :

As of 0.3.0 you can now download arbitrary urls or from github tagged releases:

{ "scripts": { "install": "napa" }, "napa": { "foo": "username/repo#v1.2.3", "bar": "https://example.com/downloads/release.tar.gz" } } Currently for a lot of github releases, it will download and extract into a sub folder, node_modules/module/release-1.2.3/actualContents. Let me know if that's an issue and I'll add some logic to detect and correct that.

— Reply to this email directly or view it on GitHub.

shama commented 10 years ago

@DjebbZ You should be able to reference a branch or commit with: user/repo#branch and user/repo#347259472813400c7a982690acaa516292a8be40.

Or just explicitly set the url: https://github.com/user/repo/archive/347259472813400c7a982690acaa516292a8be40.zip

DjebbZ commented 10 years ago

Awesome. If these examples could end up in the README... PR may be coming soon ;)

Khalid aka DjebbZ @Dj3bbZ

Le 24 janv. 2014 à 20:14, Kyle Robinson Young notifications@github.com a écrit :

@DjebbZ You should be able to reference a branch or commit with: user/repo#branch and user/repo#347259472813400c7a982690acaa516292a8be40.

Or just explicitly set the url: https://github.com/user/repo/archive/347259472813400c7a982690acaa516292a8be40.zip

— Reply to this email directly or view it on GitHub.

shama commented 10 years ago

Totally, patches welcome. :)