Open bezreyhan opened 9 years ago
Would you want to change the "main" setting in package.json?
To client.js? Yea, but from my understanding we will have to compile all of the src files, as well as node_module dependencies (i.e evie and fairmont).
There's a lot that can be done with current situation:
I've tried to browserify patchboard-js but wasn't able to because
In regards to Node.js users, I think developers would appreciate not having to add an extra dependency. You also have to run Coffee.register(), which while not a big deal it's an extra step that could be avoided.
Though, I think Browserify poses a bigger problem: even if you are using the coffee-script transform when browserifying a module, the transform cannot recursively transform all dependencies (i.e evie and fairmont). At least I wasn't able to get it to work in a straightforward way.
NPM has a pre-publish script that you can configure to run before the module is published. Placing coffee -c -o /lib /src
will take care of it. Though this script will have to be placed in all coffee dependencies.
Sorry, I misspoke - Fairmont is already published as a javascript package. The latest version of Evie seems to do the same, though it has a coffescript dependency (Typely).
After compiling Evie and Patchboard, browserify worked fine.
I made a pull request where I added a prepublish scrip to Patchboard but I'm not sure what we want to do about Evie. Do we want to upgrade to the latest version but then will have to add a prepublish script to Typely as well? Or do we want to use the same version of Evie but publish it as a js package?
We can substitute vanilla EventEmitter for Evie. I'm testing this now.
@bezreyhan master
is now rid of Evie.
We are using patchboard-js in our clients, which will be used by other developers. Any developer not using coffee-script will not be able to use the patchboard-js unless they compile it ahead of time. This includes compiling all of patchboard-js's coffee-script dependencies as well.
What do you think about publishing patchboard-js in javascript? This way both coffee-script and js developers could easily use the package.
I could compile it and publish a second patchboard-js package but I wanted to run it by you first. I thought that you may want to prevent any splits and confusion that may result from it.