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

postinstall script #558

Closed dawee closed 10 years ago

dawee commented 10 years ago

Today, the component that build the site (the main if I can say), choose to use transpilers or not.

I think it should be defined by the interrested component itself. Example, I have a mysite-component and a myview-component.

mysite-component depends on myview-component. myview-component written its styles files in stylus format.

It would be great to define something like this in myview-component's component.json :

{
 /* ... */
 "postinstall": "make css"
 /* ... */
}
jonathanong commented 10 years ago

naw if you want postinstall scripts use npm or something. we're trying to get away from compilation steps with component!

timaschew commented 10 years ago

what is best practice to provide components which are written in coffeescript or something else which needed to build before another component can use it. maybe include both the source and build into the repo?

jonathanong commented 10 years ago

Best practice is "don't". Lol

timaschew commented 10 years ago

Haha, and the alternative?

dominicbarnes commented 10 years ago

You can use compilation steps in local components, the app I work on heavily uses LESS and Handlebars, so that's not a problem.

However, anything that's meant to be consumed publicly should be only JS/CSS/HTML, which means if you're using CoffeeScript, TypeScript or whatever in your public components, you'll need to store those output JS/CSS files in your repos.

timaschew commented 10 years ago

Okay

And can I use npm as component repo? So if I do the build via npm prepublish script?

jonathanong commented 10 years ago

what i would do is build them only for tags, but not for dev commits. it's a little annoying to do that though. not sure if you could use releases for this because component doesn't specifically support them.

timaschew commented 10 years ago

yeah, sounds good with the tags.

but what's about my question with npm?

And can I use the npm registry as a component repo? So if I do the build via npm prepublish script?

In other words: can I add npmjs.org as a remote?