Skip to content

Commit 7f740ff

Browse files
committed
Remove Jake dependency. No CSSOM doesn't have any dependencies!
1 parent fe4d0cd commit 7f740ff

File tree

4 files changed

+44
-53
lines changed

4 files changed

+44
-53
lines changed

Jakefile.js

-36
This file was deleted.

README.mdown

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CSSOM
22

3-
CSSOM.js is a CSS parser written in pure JavaScript. It also a partial implementation of [CSS Object Model](http://dev.w3.org/csswg/cssom/).
3+
CSSOM.js is a CSS parser written in pure JavaScript. It is also a partial implementation of [CSS Object Model](http://dev.w3.org/csswg/cssom/).
44

55
CSSOM.parse("body {color: black}")
66
-> {
@@ -22,12 +22,11 @@ CSSOM.js is a CSS parser written in pure JavaScript. It also a partial implement
2222
Works well in Google Chrome 6+, Safari 5+, Firefox 3.6+, Opera 10.63+.
2323
Doesn't work in IE < 9 because of unsupported getters/setters.
2424

25-
To use CSSOM.js in the browser you might want to build a one-file version that exposes CSSOM global variable:
25+
To use CSSOM.js in the browser you might want to build a one-file version that exposes a single `CSSOM` global variable:
2626

2727
➤ git clone https://github.com/NV/CSSOM.git
2828
➤ cd CSSOM
29-
➤ npm install -d
30-
➤ ./node_modules/.bin/jake
29+
➤ node build.js
3130
build/CSSOM.js is done
3231

3332
To use it with Node.js or any other CommonJS loader:
@@ -36,7 +35,7 @@ To use it with Node.js or any other CommonJS loader:
3635

3736
## Don’t use it if...
3837

39-
You parse CSS to mungle, minify or reformat the following code:
38+
You parse CSS to mungle, minify or reformat code like this:
4039

4140
```css
4241
div {
@@ -47,8 +46,7 @@ div {
4746

4847
This pattern is often used to give browsers that don’t understand linear gradients a fallback solution (e.g. gray color in the example).
4948
In CSSOM, `background: gray` [gets overwritten](http://nv.github.io/CSSOM/docs/parse.html#css=div%20%7B%0A%20%20%20%20%20%20background%3A%20gray%3B%0A%20%20%20%20background%3A%20linear-gradient(to%20bottom%2C%20white%200%25%2C%20black%20100%25)%3B%0A%7D).
50-
The last same-name property always overwrites all the previous ones.
51-
49+
It doesn't get preserved.
5250

5351
If you do CSS mungling, minification, image inlining, and such, CSSOM.js is no good for you, considere using one of the following:
5452

@@ -58,9 +56,9 @@ If you do CSS mungling, minification, image inlining, and such, CSSOM.js is no g
5856
* [mensch](https://github.com/brettstimmerman/mensch)
5957

6058

61-
## [Specs](http://nv.github.com/CSSOM/spec/)
59+
## [Tests](http://nv.github.com/CSSOM/spec/)
6260

63-
To run specs locally:
61+
To run tests locally:
6462

6563
➤ git submodule init
6664
➤ git submodule update

build.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
var PATH = require("path");
2+
var FS = require("fs");
3+
4+
var build_dir = PATH.join(__dirname, "build");
5+
6+
function readFile(path) {
7+
var abs_path = PATH.join(__dirname, "lib", path);
8+
return FS.readFileSync(abs_path, "utf8");
9+
}
10+
11+
function stripCommonJS(text) {
12+
return text.replace(/\/\/\.CommonJS(?:.|\n)*?\/\/\/CommonJS/g, "");
13+
}
14+
15+
var files = [readFile("CSSOM.js")];
16+
var index_file = readFile("index.js");
17+
18+
(function(){
19+
var exports = {};
20+
function require(path) {
21+
var text = readFile(path + ".js");
22+
files.push(stripCommonJS(text).trimLeft());
23+
return {};
24+
}
25+
eval(index_file);
26+
})();
27+
28+
try {
29+
FS.statSync(build_dir);
30+
} catch(e) {
31+
FS.mkdirSync(build_dir, 0755);
32+
}
33+
var build_path = PATH.join(build_dir, "CSSOM.js");
34+
FS.writeFileSync(build_path, files.join(""));
35+
process.stdout.write("build/CSSOM.js is done\n");

package.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,12 @@
77
"parser",
88
"styleSheet"
99
],
10-
"version": "0.3.6",
10+
"version": "0.3.7",
1111
"author": "Nikita Vasilyev <[email protected]>",
1212
"repository": "NV/CSSOM",
1313
"files": [
1414
"lib/"
1515
],
1616
"main": "./lib/index.js",
17-
"devDependencies": {
18-
"jake": "~0.7.3"
19-
},
20-
"license": "MIT",
21-
"scripts": {
22-
"prepublish": "jake lib/index.js"
23-
}
17+
"license": "MIT"
2418
}

0 commit comments

Comments
 (0)