componentjs / component

frontend package manager and build tool for modular web applications
https://github.com/componentjs/guide
MIT License
4.55k stars 305 forks source link

Can I use non-component based libraries? #624

Open shobhitg opened 9 years ago

shobhitg commented 9 years ago

This is super basic question.

I am new to component and trying to use dc-js/dc.js.

From what I understand is that it isn't registered in the component's registry. What would it take for me to be able to use it as a component.

Would you guys recommend to use it directly from CDN locations? http://cdnjs.cloudflare.com/ajax/libs/dc/1.7.0/dc.js http://cdnjs.cloudflare.com/ajax/libs/dc/1.7.0/dc.css

Or what steps should one take to make this library registered into component's registry?

Thanks for help.

timaschew commented 9 years ago

there is no real component registry, all the components are just on github. the important thing is that the repository needs to include a component.json file. If your project you're looking for has no component.json you can fork it and add the file (and send a pull request)

shobhitg commented 9 years ago

Thanks a lot for explaining.

I forked and added component.json file.

Can you please glance and see if it looks right before I make a pull request: https://github.com/shobhitg/dc.js/blob/develop/component.json

Also I have a question, is there a way I can tell component to use "dc.js" for development mode and "dc.min.js" for production mode?

timaschew commented 9 years ago

You can test it just by run component install shobhitg/dc.js Am 14.02.2015 01:05 schrieb "Shobhit Gupta" notifications@github.com:

Thanks a lot for explaining.

I forked and added component.json file.

Can you please glance and see if it looks right before I make a pull request: https://github.com/shobhitg/dc.js/blob/develop/component.json

Also I have a question, is there a way I can tell component to use "dc.js" for development mode and "dc.min.js" for production mode?

— Reply to this email directly or view it on GitHub https://github.com/componentjs/component/issues/624#issuecomment-74349168 .

timaschew commented 9 years ago

Also I have a question, is there a way I can tell component to use "dc.js" for development mode and "dc.min.js" for production mode?

component have two main features:

If you define dependencies via the copmonent.json you using it as a package manager. In this scope you should never provide minified files.

To distinguish between your enviroments: dev and prod you can use component as a build tool. In you process flow this step is after the part of managing the dependencies.

Component has no built-in minify features if you using it via the CLI (,yet) If you're using component via the API resolver and build(er) you can use this one for instance: https://github.com/ianstormtaylor/minify