-
Notifications
You must be signed in to change notification settings - Fork 370
Candy should have an easier way to install and use via package management #432
Comments
We explicitly do not do this because it is not a sensible approach to distributing software. Something along the lines of "subgrunt" or preferably a standard approach for packaging Javascript modules, is consistent with the requirements of developing, building and distributing software. Unfortunately Javascript has a very immature ecosystem, so these things are still being (re-)invented. For now, I would recommend contributing the above as documentation. |
have a look at other packages needs to build. such as bootstrap. just don't directly point at github repo. but a pre-compiled one. and could you don't specific jquery version in dependence? many websites already using jquery 2.x, and will cause problem. again, look at other packages, such as bootstrap, it says "jquery": ">= 1.9.1" |
We do not bundle any jQuery, @zh99998, you can use whatever version you like. |
just release a compiled tar.gz format package here will help a lot. |
Like the tarballs at https://github.com/candy-chat/candy/releases, @zh99998? |
@benlangfeld yes I'm talking about here now only released COMPILED package in zip format, no tar.gz |
The release config is at https://github.com/candy-chat/candy/blob/master/Gruntfile.js#L215-L259. Would you be able to prep a PR which releases compiled tarballs too, @zh99998? |
sorry I tried several times but can't build it..... |
I have an existing web application which uses npm+bower+grunt, I and would like to add Candy to it. I found that this was not easy, and I believe this process could be greatly simplified.
If you want to include Candy in an existing node+grunt app, you have to something like the following:
1. Add Candy to your package.json
Add
"candy": "candy-chat/candy#3bad2bc2ca"
to yourpackage.json
. This will cause npm to download the github repo whennpm install
is performed. I used commit#3bad2bc2ca
as a tag.2. Install Candy's node modules and run Candy's
grunt build
Because there are no dist assets in the github repo, you have to run
npm install
andgrunt build
on behalf of Candy inside./node_modules/candy
. For the npm install, you can use grunt-auto-install, and for the grunt build, you can use grunt-subgrunt.After you add and configure grunt-auto-install, whenever you run
npm install
at your root application's scope,npm install
will also be run inside the./node_modules/candy
folder for you. This will install the node modules required by Candy in preparation for the grunt build.After you add and configure sub-grunt, you can configure a grunt task at your root application's scope to trigger grunt jobs in the
./node_modules/candy
folder. This will build all of the JS bundles that Candy needs.2.1 Install and configure grunt-auto-install
Install the package
Configure your Gruntfile.js
Then, at your application root, you can test this by invoking the grunt command
grunt auto_install:run
. Candy's node modules should then be installed in ./node_modules/candy/node_modules2.2 Install and configure grunt-auto-install
Install the package
Configure your Gruntfile.js
Then, at your application root, you can test this by invoking the grunt command
grunt subgrunt:run
. Candy's JS files will then be generated.Conclusion & Recommendation
This is probably more complex than it should be. Step 2, 2.1, and 2.2 above could be completely removed if Candy would include pre-built or "dist" assets in it's repo. I recommend that Candy publish pre-built assets as a part of each build pushed to Github.
The text was updated successfully, but these errors were encountered: