Open chenglou opened 10 years ago
We need to check regular .js files into npm I think. The coffeescript people went through this battle and npm pretty firmly says to do this.
With that said I think that this package should encourage jsx. One thing we could do: have people write .jsx files in src/
that compile to .js files along side them (also in /src
)
Oh... Yeah I've gotten this before with CoffeeScript. An npm postinstall
won't do?
https://npmjs.org/doc/misc/npm-scripts.html
"NOTE: INSTALL SCRIPTS ARE AN ANTIPATTERN"
How about npm prepublish
, compile inside src/ like you said, and npmignore .jsx?
sounds great!
@sdawson @petehunt one thing I forgot to talk about yesterday is how the folders look like here. I need feedback on this one (related to #13). I was testing a simpler folder structure:
I removed lib/ because in all use cases they've been only an intermediate step. There's an argument to be made for not requiring people to use JSX when they include our lib, but really, the odds that every single lib that person uses doesn't ship JSX is rather small (or maybe I shouldn't be talking about JSX at all since this is framework-agnostic? I'll start by making sharing React components easy though). Also moved the spec and entrypoint into test/, so that they can be npmignored. Build is generated of course. When a person installs the lib, he sees only this:
which is as small a component can get.