darsain / tooltip

JavaScript Tooltip component.
http://darsa.in/tooltip
190 stars 15 forks source link

Publish to npm? #5

Closed tmcw closed 10 years ago

tmcw commented 10 years ago

It would be great if we could ingest this plugin via npm so it could be use in browserify? The current package.json would be great for this, and I'm happy to just use insert-css or similar to deal with assets.


Tried to npm install the tarball, looks like it's not really structured as a package, so this would take more work.

darsain commented 10 years ago

I'm really sorry :( Tooltip is not an npm package. It's a component/duo package. The only way how to make it work with browserify is to build a standalone version wrapped in UMD and publish that.

The reason why you shouldn't even want this, is that this'd mean that all the dependencies would be inlined in the built files. Event binding, object extend, .... there are currently 9 dependencies in my local dev version. None of those would be able to be reused by other packages, which would of course produce even more inefficient builds, as if npm's dependency nesting and hardly functional dedupe isn't bad enough.

The standalone builds in the readme are there mainly for the purpose of creating jsfiddles when reporting issues, and I sincerely pity anyone using them in their projects, but if you must, grab the built tooltip.js, place it into vendor directory and require('./vendor/tooltip').

My main goal is to have a good development environment and make projects that are nice to work on and maintain. Keeping them browserify and bower friendly is not compatible with that because:

And I'm sure I'm forgetting a lot of small issues, but the main one is that I just don't think either of these tools is a good solution to front-end package management, and I don't want to work with them.

cnicodeme commented 8 years ago

If you plan to offer a serious version of your project outside (meaning not an open source of what you do on your side, but a real open source project dedicated to the community), you should (read: "must") make an NPM package out of it.

My reason for this : Your Tooltip plugin is, by far, the best I've seen, not dependant of jQuery and complete. By releasing it in NPM, you will let thousands of developper use it, and I'm pretty sure you will be on the top for the best Tooltip plugin available.

But hey, that's my opinion ;)

ghost commented 8 years ago

2 Year's maybe the npm packaging process have became a bit easier now? Not sure, but either way I agree with cnicodeme, it is the best tooltip library out on the market today (that's free).