Skip to content
Browse files

On npm install or publish, compile coffeescript files in to lib/ (if …

…src/ exists).

Don't publish coffescripts files (src/).
When publishing, compile coffeescripts files.
When installing from published package will not compile coffeescript, as src/ directory will not be present (as it is present in .npmignore).
When installing from github (or other non-published source) coffeescript will be compiled.

This should, hopefully satisfy everyone and everything. Installing a published package will have no dependency on coffeescript. Installing from github (either a user application or travis-ci) will compile coffeescript files in to lib/

Issue #23
  • Loading branch information...
1 parent 8e5847e commit 2a733254f2240963839709a97527012c1ff974ad @pekim committed Apr 30, 2012
Showing with 7 additions and 10 deletions.
  1. +1 −0 .npmignore
  2. +2 −1 package.json
  3. +4 −6 scripts/build
  4. +0 −3 scripts/compile-coffee
View
1 .npmignore
@@ -1,3 +1,4 @@
+src/
todo
.git*
.project
View
3 package.json
@@ -35,6 +35,7 @@
},
"scripts": {
"test": "scripts/tests-unit",
- "postinstall": "scripts/build"
+ "postinstall": "scripts/build",
+ "publish": "scripts/build"
}
}
View
10 scripts/build
@@ -1,8 +1,6 @@
#!/bin/sh
-npm install coffee-script@1.3.1
-
-rm -fr lib/
-node_modules/.bin/coffee -b -c -o lib/ src/
-
-npm uninstall coffee-script
+if [ -d "src/" ]; then
+ rm -fr lib/
+ node_modules/.bin/coffee -b -c -o lib/ src/
+fi
View
3 scripts/compile-coffee
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-node_modules/.bin/coffee -b -w -o coffee .

0 comments on commit 2a73325

Please sign in to comment.
Something went wrong with that request. Please try again.