Cleaned up build & test system.
authorGoalSmashers <jakub@goalsmashers.com>
Sat, 22 Dec 2012 17:49:23 +0000 (18:49 +0100)
committerGoalSmashers <jakub@goalsmashers.com>
Sat, 22 Dec 2012 17:49:23 +0000 (18:49 +0100)
* Moved Makefile tasks to npm scripts.
* Use `npm run bench` to run benchmarks.
* Use `npm run check` to run JSHint checks.
* Use `npm test` to run tests on all platforms.
* JSHint is being run every time before publishing code to npm repository.
* Updated docs.

Makefile [deleted file]
README.md
package.json
test.bat [deleted file]

diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index 6092b98..0000000
--- a/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-TEST_DIR = test
-VOWS = ./node_modules/.bin/vows
-JSHINT = ./node_modules/.bin/jshint
-
-all: test
-
-test:
-       @@echo "Running all tests via vows..."
-       @@${VOWS} ${TEST_DIR}/*-test.js
-
-bench:
-       @@echo "Running benchmark on big.css file..."
-       @@node test/bench.js
-
-check:
-       @@echo "Running JSHint on all project files..."
-       @@${JSHINT} .
-
-.PHONY: all test bench check
\ No newline at end of file
index 4795d19..e3c7c2a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ Clean-css is a node.js library for minifying CSS files. It does the same job as
 
     npm install clean-css
 
-### How to use clean-css? ###
+### How to use clean-css CLI? ###
 
 To minify a **public.css** file into **public-min.css** do:
 
@@ -37,17 +37,27 @@ Or even gzip the result at once:
     cat one.css two.css three.css | cleancss | gzip -9 -c > merged-minified-and-gzipped.css.gz
 
 ### How to use clean-css programmatically? ###
+
 ```javascript
     var cleanCSS = require('clean-css');
     var source = "a{font-weight:bold;}";
     var minimized = cleanCSS.process(source);
 ```
+
 Process method accepts a hash as a second parameter (i.e. `cleanCSS.process(source, options)`), with the following options available:
 
 * `keepSpecialComments` - `*` for keeping all (default), `1` for keeping first one, `0` for removing all
 * `keepBreaks` - whether to keep line breaks (default is false)
 * `removeEmpty` - whether to remove empty elements (default is false)
-* `debug` - turns on debug mode (measuring time spent on cleaning up - run `make bench` to see example)
+* `debug` - turns on debug mode (measuring time spent on cleaning up - run `npm run bench` to see example)
+
+### What are the clean-css' dev commands? ###
+
+First clone the source, then run:
+
+* `npm run bench` for clean-css benchmarks (see test/bench,js for details)
+* `npm run check` to check JS sources with JSHint
+* `npm test` for the test suite
 
 ### How do you preserve a comment block? ###
 
@@ -57,15 +67,6 @@ Use `/*!` notation instead of standard one (i.e. `/*`):
       Important comments included in minified output.
     */
 
-### How to run clean-css tests? ###
-
-First clone the source, then run:
-
-    npm test
-
-on *nix systems. If you are under Windows then run:
-
-    test.bat
 
 ## Acknowledgments ##
 
index 692ecf4..937a0f2 100644 (file)
     "cleancss": "./bin/cleancss"
   },
   "scripts": {
-    "test": "node_modules/.bin/vows test/*-test.js"
+    "bench": "node test/bench.js",
+    "check": "jshint .",
+    "prepublish": "jshint .",
+    "test": "vows"
   },
   "dependencies": {
     "optimist": "0.3.x"
diff --git a/test.bat b/test.bat
deleted file mode 100644 (file)
index a1770b6..0000000
--- a/test.bat
+++ /dev/null
@@ -1,9 +0,0 @@
-@echo off
-
-pushd %~dp0
-
-node .\node_modules\vows\bin\vows test\batch-test.js test\binary-test.js test\custom-test.js test\unit-test.js
-
-popd
-
-pause