bower icon indicating copy to clipboard operation
bower copied to clipboard

`--save` by default

Open sindresorhus opened this issue 12 years ago • 34 comments

Since most people would want to save a dependency to bower.json when doing bower install <package> I suggest we make --save the default and introduce a --no-save flag. The default will only have an effect if there is a bower.json.

sindresorhus avatar Jan 08 '14 18:01 sindresorhus

:+1:

addyosmani avatar Jan 08 '14 18:01 addyosmani

Upvote :+1:

xen avatar Jan 09 '14 02:01 xen

:+1:

svnlto avatar Jan 09 '14 08:01 svnlto

:+1:

Anahkiasen avatar Jan 10 '14 17:01 Anahkiasen

Of course this is 2.x feature as it breaks api.

sheerun avatar Jan 10 '14 20:01 sheerun

:+1:

helmus avatar Jan 18 '14 11:01 helmus

:+1:

hemanth avatar Jan 18 '14 15:01 hemanth

We could add a .bowerrc flag like save-by-default. Default to false now and flip to true for 2.x?

wibblymat avatar Jan 21 '14 14:01 wibblymat

@wibblymat :+1:

sindresorhus avatar Jan 21 '14 22:01 sindresorhus

+1

Would it possible to set this to --save to the <head> tag inside a given file? (index.html for example)

ghost avatar Jan 22 '14 21:01 ghost

@gh-naylor no, that's a task for another tool.

sindresorhus avatar Jan 22 '14 23:01 sindresorhus

:+1: To @wibblymat's proposal. Flip to true for 2.x and then deprecate the .bowerrc option.

benschwarz avatar Jan 23 '14 02:01 benschwarz

PRs welcome ;)

wibblymat avatar Jan 27 '14 18:01 wibblymat

I disagree. The --save option is consistent with other package managers (e.g. npm). Probably this change will be confusing to users.

ninjatronic avatar Mar 05 '14 21:03 ninjatronic

@ninjatronic, component for example is using --saveby default, and that's probably the intended behaviour in most cases, even though npm is not using it.

kevva avatar Mar 05 '14 21:03 kevva

Yeah, I think this is a solid change and we should move in that direction. I don't care what other package managers do in this instance.

benschwarz avatar Mar 05 '14 22:03 benschwarz

Composer saves packages by default, for the note.

Anahkiasen avatar Mar 05 '14 22:03 Anahkiasen

Worth noting then that uninstall should then also be expected to remove entries from the bower.json file

ninjatronic avatar Mar 05 '14 22:03 ninjatronic

:+1:

fmalk avatar Mar 20 '14 04:03 fmalk

:+1: (always annoyed that other package managers don't do the same)

apfelbox avatar Apr 15 '14 20:04 apfelbox