Closed ericlathrop closed 10 years ago
Just a few more example discussions I found on the proper way to setup a CoffeeScript node module: https://stackoverflow.com/questions/13645824/can-i-write-npm-package-in-coffeescript https://stackoverflow.com/questions/8913672/standard-way-of-developing-a-node-module-using-coffeescript http://nickdesaulniers.github.io/blog/2013/08/28/making-great-node-dot-js-modules-with-coffeescript/
Recently I made some of these changes on my other repo and I planning to do them also in others.
But for some reason I don't like the idea of js files in .gitignore and test directory in .npmignore.
What if someone will want to install package directly from git and not from npm? For example because this person needs different branch? Truth is that this happens to me just once and other day I could install it again from npm. But I don't know. Just let me thing about it for some time please.
And test directory not in npm... Hm.. People probably don't run tests on installed packages, so after all it should not be problem.
Okay. You've probably done more CoffeeScript in Node than I have. I just googled it, and saw how other people do it. I'm happy to split it up any way you like.
I don't know that and definitely I wouldn't say that. But when I'm thinking about it, you're probably right.
Btw I will merge it to develop branch which I choose now as default branch here on github.
7cbbe7eb8e9dd6c3d381bd33b8cd42d7e6b859b9
I added coffee-script as a devDependency, which makes it so anyone trying to work on the module gets coffee-script. I also added a prepublish script to automatically build the .coffee files when you go to publish the package. I also added a build script so you can use "npm run-script build" to regenerate the .js files.
Since the .js files are really build artifacts, they shouldn't be checked in to git. I deleted the .js files, and added them to .gitignore. Also, I set up a .npmignore so the .coffee files and the tests don't get included in the npm module.
From what I've googled, this seems to be the current best practice. I took the examples from the zombie module, which seems to be a popular node module written in CoffeeScript.