bower / bower

A package manager for the web
bower.io
MIT License
14.99k stars 1.85k forks source link

Allow Ignore For Child Dependencies #1394

Closed hdaws closed 8 years ago

hdaws commented 9 years ago

Fix for bug #927. Ignore package if name matches specified in bower.json. Permit fetch if package is explicitly declared in dependencies or devDependencies. Designed for users who need tighter control of versions due to corporate liscence restrictions or other reasons.

sheerun commented 9 years ago

See #1296 for why I don't want to allow a RegExp

hdaws commented 9 years ago

@sheerun - Removed regex, changed into a simple array since it's what you preferred as well.

Example of use: "ignoredDependencies": [ "angular", "jquery", "d3", "angular-translate", "jquery-ui", "nvd3", "angular-ui-sortable" ]

hdaws commented 9 years ago

@sheerun Could this possibly be merged/added to bower now? Or are there further objections?

cfoellmann commented 9 years ago

@SignalDancer Thanks for the work!! I cannot wait to finally be able to use bower.

hdaws commented 9 years ago

@cfoellmann you are quite welcome! I hope this gets in soon. @sheerun commas, spacing and that array initialization all fixed. Hopefully we are ready to go this time! Apologies for not noticing the spacing/array thing in the last revision.

sheerun commented 9 years ago

Thanks :) For now I'm scheduling this for 1.4.x

cfoellmann commented 9 years ago

Maybe this PR should be modified to go into the branch 1.4.0?

rosskevin commented 9 years ago

Just a note, we've been using this for several months now and it works quite well for us with no unexpected side effects.

cfoellmann commented 9 years ago

@rosskevin How are you using this patch? "Manually" using a patched version of bower? or is there an automated way to grab this version?

rosskevin commented 9 years ago

@cfoellmann

npm uninstall -g bower
npm install -g https://github.com/SignalDancer/bower/tarball/Bower-Ignore-Dependencies
benjaminallison commented 9 years ago

Looking forward to seeing this feature!

fer-ri commented 9 years ago

waiting for this feature :dancer:

drywall commented 9 years ago

Me too!

fnagel commented 9 years ago

Very useful!

cfoellmann commented 9 years ago

Does anyone know when the 1.4 release is scheduled? I am really looking forward to this.

cwperry commented 9 years ago

This just fixed one of my biggest headaches. I'm looking forward to it getting into the main line.

gotofritz commented 9 years ago

That doesn't fully work though.

For example I have

"dependencies": {
  "jquery": "^2.1.3",
  "lodash": "^3.1.0",
  "backbone": "~1.1.2"
},
"ignoredDependencies": [
  "underscore"
]

When I run bower install the first time it works as expected

bower install
bower install
bower jquery#^2.1.3             cached git://github.com/jquery/jquery.git#2.1.3
bower jquery#^2.1.3           validate 2.1.3 against git://github.com/jquery/jquery.git#^2.1.3
bower lodash#^3.1.0             cached git://github.com/lodash/lodash.git#3.1.0
bower lodash#^3.1.0           validate 3.1.0 against git://github.com/lodash/lodash.git#^3.1.0
bower backbone#~1.1.2           cached git://github.com/jashkenas/backbone.git#1.1.2
bower backbone#~1.1.2         validate 1.1.2 against git://github.com/jashkenas/backbone.git#~1.1.2
bower bootstrap-sass#~3.3.3     cached git://github.com/twbs/bootstrap-sass.git#3.3.3
bower bootstrap-sass#~3.3.3   validate 3.3.3 against git://github.com/twbs/bootstrap-sass.git#~3.3.3
bower jquery#>= 1.9.0           cached git://github.com/jquery/jquery.git#2.1.3
bower jquery#>= 1.9.0         validate 2.1.3 against git://github.com/jquery/jquery.git#>= 1.9.0
bower backbone#~1.1.2          skipped underscore
bower lodash#^3.1.0            install lodash#3.1.0
bower bootstrap-sass#~3.3.3    install bootstrap-sass#3.3.3
bower jquery#^2.1.3            install jquery#2.1.3
bower backbone#~1.1.2          install backbone#1.1.2

If I run it again, though:

bower install
bower underscore#>=1.5.0    not-cached git://github.com/jashkenas/underscore.git#>=1.5.0
bower underscore#>=1.5.0       resolve git://github.com/jashkenas/underscore.git#>=1.5.0
bower underscore#>=1.5.0      download https://github.com/jashkenas/underscore/archive/1.7.0.tar.gz
git bower underscore#>=1.5.0       extract archive.tar.gz
bower underscore#>=1.5.0      resolved git://github.com/jashkenas/underscore.git#1.7.0
bower underscore#>=1.5.0       install underscore#1.7.0

Or if you want to install something else afterwards:

bower install handlebars --save
bower underscore#>=1.5.0        cached git://github.com/jashkenas/underscore.git#1.7.0
bower underscore#>=1.5.0      validate 1.7.0 against git://github.com/jashkenas/underscore.git#>=1.5.0
bower handlebars#*          not-cached git://github.com/components/handlebars.js.git#*
bower handlebars#*             resolve git://github.com/components/handlebars.js.git#*
bower handlebars#*            download https://github.com/components/handlebars.js/archive/v3.0.0.tar.gz
bower handlebars#*             extract archive.tar.gz
bower handlebars#*        invalid-meta handlebars is missing "ignore" entry in bower.json
bower handlebars#*            resolved git://github.com/components/handlebars.js.git#3.0.0
bower underscore#>=1.5.0       install underscore#1.7.0
bower handlebars#~3.0.0        install handlebars#3.0.0

Underscore is installed even though is not in the handlebars dependencies and it's in the ignoredDependencies list

cfoellmann commented 9 years ago

This Sounds bad and I really need to check this out- finally.

quadrupleslap commented 9 years ago

So... will this ever be merged?

gad2103 commented 9 years ago

waiting for this merge to happen too!!!

giggo1604 commented 9 years ago

@rosskevin thanks using it like you suggested works as expected, waiting for this merge

Bastlynn commented 9 years ago

Guys - it's been almost a year. Can we get a merge here?

cfoellmann commented 9 years ago

I would love to see this feature but it seems to be not ready for merge. I would love to help but I can not help with JS programming

sheerun commented 9 years ago

Fix to mentioned behavior + integration tests in test/commands/install.js would be nice.

hdaws commented 9 years ago

@sheerun I will attempt to find time to work on this sometime soon. That said, why is the TravisCI build passing if integration tests are failing? Are they not covered by this as priorly that is what I had been using as the "flag" for whether it was merge-safe with all the tests after this had been flagged for commit and tested originally.

witrin commented 9 years ago

Looking forward to see this feature!

NikolayFrantsev commented 9 years ago

+1

toabi commented 9 years ago

+1

azaslavsky commented 9 years ago

+1

bbuhler commented 9 years ago

+1

cfoellmann commented 9 years ago

@sheerun maybe you should change the milestone.?

defuz commented 9 years ago

+1

shea256 commented 9 years ago

+1

frankthelen commented 9 years ago

+1

Arkh1 commented 9 years ago

+1

samccone commented 9 years ago

@SignalDancer would you mind adding some tests to this PR?

If anyone else would like this feature ( @Arkh1 , @frankthelen , @shea256 , @cfoellmann , @leafymind , @azaslavsky [and others] ) the big blocker is simply adding tests, if anyone would like to help and see this feature land, feel free to fork this commit and reopen a new commit into master with added tests.

Thanks everyone for the interest.

kavi87 commented 9 years ago

We are working with a Chinese team who can't access some dependencies with bower (due to national internet restriction). Allowing to ignore some of them in order to provide them manually would be very useful.

lowdewijk commented 9 years ago

For the love of god, accept this pull request.

krzysztofantczak commented 9 years ago

Any reason for not accepting this pull request? It's kind of old topic now but still it's not working.

tomalec commented 9 years ago

+1

bbuhler commented 9 years ago

@krzysztofantczak: see https://github.com/bower/bower/pull/1394#issuecomment-97456155

twalpole commented 8 years ago

@samccone Some high level tests added in PR #1828 , is that enough/acceptable to get this feature included?

nmccready commented 8 years ago

What is the status of this?

ahmadassaf commented 8 years ago

+1

victorhaggqvist commented 8 years ago

+1

snimavat commented 8 years ago

+1

hansgru commented 8 years ago

+1

It's quite frustrating to use Bower without such a basic functionality.

Bastlynn commented 8 years ago

Re-posting question from earlier: " @samccone Some high level tests added in PR #1828 , is that enough/acceptable to get this feature included? "

That pull request looks to include the testing you were asking for. I'm also seeing "All checks have passed" on this pull as well.

leoj3n commented 8 years ago

+1

brunodunbar commented 8 years ago

+1