taptapship / wiredep

Wire Bower dependencies to your source code.
MIT License
1.15k stars 142 forks source link

using npm package management #173

Closed joshikeerti closed 8 years ago

joshikeerti commented 9 years ago

If I am using some packages from bower and some others from npm. Is it still possible to use wiredep in that case? I don't see any examples of pulling from npm dependencies.

CWSpear commented 9 years ago

It may be really hard to resolve dependencies across npm and bower packages (which, may need to happen).

But it would be pretty powerful if we could pull it off! I see a trend as package creators start planning for ES6 modules, they seem to shy away from bower, as the path from ES6 modules to commonJS is a lot cleaner, and that plays very well in the npm ecosystem.

stephenplusplus commented 9 years ago

Let's start thinking about this more! :)

eddiemonge commented 9 years ago

Would still need to think about things likes html/css/font/image handling but yes!

CWSpear commented 9 years ago

I want to add to my comment from March: it looks like Bower has been taking some steps to better plan for ES6 modules. And again, make sure it's clear that I don't think Bower is going anywhere any time soon!

Sparticuz commented 9 years ago

:+1: Why use bower when npm can do the same things? It wouldn't hurt to support both. I've been able to do some hackey things to get it to work, but would prefer it native.

Grawl commented 8 years ago

:+1: appreciate to

I think it would be good to use bundledDependencies:

Array of package names that will be bundled when publishing the package.

stephenplusplus commented 8 years ago

I've been spending some more time thinking about this, and I think the biggest challenge we are going to have is with dependency conflicts. Our solution will likely have to be the same as Bower: having a prompt in the CLI help select between versions, and then persisting those preferences in package.json.

The specific scenario requiring that would be:

$ npm install --save aye bee
|_ node_modules/aye/node_modules/bee[@1.0]/index.js
|_ node_modules/aye/index.js
|
|_ node_modules/bee[@2.0]/index.js
<!-- bower:js -->
<script src="node_modules/aye/node_modules/bee[@1.0]/index.js"></script>
<script src="node_modules/aye/index.js"></script>
<script src="node_modules/bee[@2.0]/index.js"></script>
<!-- endbower -->

Since this is browser-land, we'd have to force the user to choose between bee@1 or bee@2. They might be able to get away with that, but it could also break the app.

My questions are:

  1. Is there a better way to do this?
  2. If a user is running an npm without default deduping, when they run wiredep, should we do this for them?
  3. Is wiredep + npm a good combination, or destined for doom? Is there another tool or workflow we should recommend instead?
Grawl commented 8 years ago

@stephenplusplus I found gulp-npm-files package and already started some issues to get similar behavior to wiredep: “Select target array of dependencies” and “Documentation?” with general discussion on it.

sindresorhus commented 8 years ago

If a user is running an npm without default deduping, when they run wiredep, should we do this for them?

Just force the user to use npm@3. Example message: https://github.com/yeoman/doctor/blob/master/lib/messages/npm-version.twig

Grawl commented 8 years ago

@Sparticuz do you have any progress on this?

eddiemonge commented 8 years ago

related to #234

eddiemonge commented 8 years ago

Closing in favor of #234