cocos2d / cocos2d-js

cocos2d-x for JS
http://www.cocos2d-x.org
MIT License
1.86k stars 490 forks source link

publish this project to npm? #1098

Open stevemao opened 9 years ago

stevemao commented 9 years ago

npm (Node Package Manager) is the default package manager for Node.js and is very popular among javascript developers.

pandamicro commented 9 years ago

We have analyzed the NPM package management, and in fact, we have an implementation in cocos2d-html5: https://github.com/cocos2d/cocos2d-html5/tree/NPM

The thing is, we have merged Cocos2d-x JSB and Cocos2d-html5 in v3.0, and the benefit is huge. So this is a fixed thing that both engine must be maintained together. Using NPM to manage Cocos2d-html5 may be a good choice, but for Cocos2d-JS which is much heavier, based on C++, un-dividable into modules, we don't think it's a good idea.

That's the reason we passed by the NPM solution. If you have further thought on this topic, please tell us, we are open for any suggestion.

stevemao commented 9 years ago

Thanks @pandamicro , I just thought the javascript modules could be pushed to npm and the compiled native code could be downloaded by something like Binary wrapper. This project itself doesn't have to be managed by npm though. As a node developer, I really love commonJS style and thought we should have a way to use it (at least the JavaScript part).

An example would be voxel.js. It has a core module and separate plugins published to npm.

Merging Cocos2d-x JSB and Cocos2d-html5 is really cool but they are still in separate git repos?

Thanks for the hard work.

pandamicro commented 9 years ago

They are in one repo: Cocos2d-JS now, the html5 engine is a submodule to it.

pandamicro commented 9 years ago

If you are interested, in fact we have a require.js solution here: https://github.com/pandamicro/cocos2d-js/tree/require