cytoscape / cytoscape.js-dagre

The Dagre layout for DAGs and trees for Cytoscape.js
MIT License
250 stars 83 forks source link

Properly formed bower.json with proper dependency’s #11

Closed obender closed 8 years ago

obender commented 8 years ago

Properly formed bower.json with proper dependency’s

I had spent around 40 minutes to understand that more lib required after bower installation ... so you need to include them

maxkfranz commented 8 years ago

For true dependencies (like Dagre), that may be OK. For Cytoscape itself, it's not.

The issue is that bower has no concept of plugin/peer dependencies. We could add that for npm, but bower has no concept of peer dependencies.

I would be hesitant to add the dagre dependency, because to do that consistently would mean having it as a dependency in npm. That means a require() call would be needed and it would mean dropping support for bower...

In general, your project itself should depend on Cytoscape. The peer dependency only helps with conflicts -- not installation.

obender commented 8 years ago

There is a problem with that approach, packing an final script from bower.json won't work correctly, for example we are using injector to inject the proper dependencies and if dependency of Cytoscape is not specified this plugin file can be injected before the Cytoscape.js library that will break the code...

Also I don't qute get your concern ... Cytoscape will be used once in bower ...

obender commented 8 years ago

https://github.com/bower/bower/issues/292

maxkfranz commented 8 years ago

@obender I don't think bower has proper support for JS bundling and dependency trees. If you're looking for a reliable solution for that, you really should consider browserify and npm.

On further reading, it looks like the intent of the npm guys for peerDependencies is not for direct require()s, so peerDependencies can be added to package.json and the analogue for bower.json (without breaking changes). It's nice to have warnings on npm install and bower install, so I'll make these additions.

I'm guessing this will work for your bower bundling usecase, but you may want to consider npm for future projects.