componentjs / component

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

package.json fallback if no component.json exist for remote deps #613

Open timaschew opened 9 years ago

timaschew commented 9 years ago

because of reactions like this: https://github.com/domenic/sinon-chai/pull/26#issuecomment-21229356

So my idea is to fetch the data from github, not npm. Because the files which are used are implicit via require calls from the entry point (main property of the package.json) we need to download the archive and not single files.

Then we need to do the same as browserify and duo are doing: parse the require calls, transitively and collect them and maybe generate a component.json from it, put it to the components directory where alll the remote files exist. Then we need to do the same for each dependency, at this point we need a mapping from the npm repo names to the github url and for each dependency we need to do the same, transitively.

Then we're done, so we don't need to change something for the build process. Because we have all the component.json files. We only need to extend the install process for remotes.