├── .npmrc ├── test ├── fixtures │ ├── css │ │ ├── entry-multi.css │ │ ├── a.css │ │ ├── c.css │ │ ├── entry.css │ │ ├── bundle-compressed.css │ │ ├── entry-for-prefixing.css │ │ ├── a-with-var.css │ │ ├── varBundle.css │ │ ├── b.css │ │ ├── node_modules │ │ │ ├── foo │ │ │ │ ├── package.json │ │ │ │ └── index.scss │ │ │ ├── child │ │ │ │ ├── other.css │ │ │ │ ├── node_modules │ │ │ │ │ ├── rework-default-unit │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ └── rework-visit │ │ │ │ │ │ │ │ └── index.js │ │ │ │ │ │ └── index.js │ │ │ │ │ └── grandchild │ │ │ │ │ │ ├── index.css │ │ │ │ │ │ ├── nested │ │ │ │ │ │ └── thing.css │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ └── rework-math │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ └── rework-visit │ │ │ │ │ │ │ │ └── index.js │ │ │ │ │ │ │ └── index.js │ │ │ │ │ │ └── package.json │ │ │ │ ├── index.css │ │ │ │ └── package.json │ │ │ └── rework-clone │ │ │ │ ├── node_modules │ │ │ │ └── rework │ │ │ │ │ ├── node_modules │ │ │ │ │ ├── rework-visit │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── hsb2rgb │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ └── src │ │ │ │ │ │ │ └── hsb2rgb.js │ │ │ │ │ ├── rework-inherit │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ └── component.json │ │ │ │ │ ├── css │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ ├── css-stringify │ │ │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ │ │ └── source-map │ │ │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ │ │ │ │ ├── build │ │ │ │ │ │ │ │ │ │ ├── test-suffix.js │ │ │ │ │ │ │ │ │ │ ├── test-prefix.js │ │ │ │ │ │ │ │ │ │ ├── suffix-source-map.jsm │ │ │ │ │ │ │ │ │ │ ├── suffix-browser.js │ │ │ │ │ │ │ │ │ │ ├── prefix-utils.jsm │ │ │ │ │ │ │ │ │ │ ├── suffix-utils.jsm │ │ │ │ │ │ │ │ │ │ ├── prefix-source-map.jsm │ │ │ │ │ │ │ │ │ │ └── assert-shim.js │ │ │ │ │ │ │ │ │ │ ├── lib │ │ │ │ │ │ │ │ │ │ ├── source-map.js │ │ │ │ │ │ │ │ │ │ └── source-map │ │ │ │ │ │ │ │ │ │ │ ├── base64.js │ │ │ │ │ │ │ │ │ │ │ ├── array-set.js │ │ │ │ │ │ │ │ │ │ │ └── binary-search.js │ │ │ │ │ │ │ │ │ │ ├── test │ │ │ │ │ │ │ │ │ │ ├── source-map │ │ │ │ │ │ │ │ │ │ │ ├── test-base64-vlq.js │ │ │ │ │ │ │ │ │ │ │ ├── test-api.js │ │ │ │ │ │ │ │ │ │ │ ├── test-base64.js │ │ │ │ │ │ │ │ │ │ │ ├── test-binary-search.js │ │ │ │ │ │ │ │ │ │ │ ├── test-dog-fooding.js │ │ │ │ │ │ │ │ │ │ │ └── test-array-set.js │ │ │ │ │ │ │ │ │ │ └── run-tests.js │ │ │ │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ │ │ │ └── amdefine │ │ │ │ │ │ │ │ │ │ │ ├── intercept.js │ │ │ │ │ │ │ │ │ │ │ └── LICENSE │ │ │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ │ │ └── CHANGELOG.md │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ │ │ ├── lib │ │ │ │ │ │ │ │ │ ├── compiler.js │ │ │ │ │ │ │ │ │ ├── source-map-support.js │ │ │ │ │ │ │ │ │ └── compress.js │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ └── css-parse │ │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── test.js │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ ├── benchmark.js │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── color-parser │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ ├── test │ │ │ │ │ │ │ └── index.js │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── commander │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ └── keypress │ │ │ │ │ │ │ │ ├── test.js │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── History.md │ │ │ │ │ ├── convert-source-map │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── test │ │ │ │ │ │ │ ├── fixtures │ │ │ │ │ │ │ │ ├── map-file-comment.css │ │ │ │ │ │ │ │ ├── map-file-comment-double-slash.css │ │ │ │ │ │ │ │ └── map-file-comment.css.map │ │ │ │ │ │ │ ├── map-file-comment.js │ │ │ │ │ │ │ └── comment-regex.js │ │ │ │ │ │ ├── example │ │ │ │ │ │ │ └── comment-to-json.js │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── debug │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── lib │ │ │ │ │ │ │ └── debug.js │ │ │ │ │ │ └── debug.js │ │ │ │ │ └── mime │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── types │ │ │ │ │ │ └── node.types │ │ │ │ │ │ ├── test.js │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ └── mime.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── .travis.yml │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── lib │ │ │ │ │ ├── visit.js │ │ │ │ │ ├── utils.js │ │ │ │ │ ├── plugins │ │ │ │ │ │ ├── url.js │ │ │ │ │ │ ├── prefix-selectors.js │ │ │ │ │ │ ├── inline.js │ │ │ │ │ │ ├── references.js │ │ │ │ │ │ ├── mixin.js │ │ │ │ │ │ ├── colors.js │ │ │ │ │ │ ├── function.js │ │ │ │ │ │ ├── ease.js │ │ │ │ │ │ └── at2x.js │ │ │ │ │ └── rework.js │ │ │ │ │ ├── Makefile │ │ │ │ │ └── component.json │ │ │ │ ├── .npmignore │ │ │ │ ├── package.json │ │ │ │ └── index.js │ │ ├── entry-with-asset.css │ │ ├── entry-with-var.css │ │ ├── bundle-transformed.css │ │ ├── bundle.css │ │ ├── entry-with-inline.css │ │ ├── img.png │ │ ├── import-missing.css │ │ ├── variables.json │ │ ├── bundle-gen.css │ │ ├── variables-malformed.json │ │ ├── b-with-var.css │ │ ├── bundle-with-var.css │ │ ├── new-dir │ │ │ └── bundle-new-dir.css │ │ ├── bundle-with-asset.css │ │ ├── vars.css │ │ ├── bundle-multi.css │ │ ├── bundle-with-prefixes.css │ │ ├── some │ │ │ └── other │ │ │ │ └── parent │ │ │ │ └── styles.css │ │ ├── entry-with-deep-custom-plugins.css │ │ ├── bundle-compressed-with-sourcemap.css │ │ ├── bundle-with-sourcemap.css │ │ ├── bundle-with-deep-custom-plugins.css │ │ └── bundle-with-inline.css │ └── less │ │ ├── entry.less │ │ ├── foo.less │ │ ├── external_root │ │ └── external.less │ │ ├── a.less │ │ ├── needs-external-root.less │ │ ├── node_modules │ │ └── foo │ │ │ └── index.less │ │ ├── entry-with-named-module.less │ │ ├── img │ │ ├── logo.png │ │ └── dir │ │ │ └── info.png │ │ ├── bundle-with-external-root.css │ │ ├── a-with-asset.less │ │ ├── entry-with-asset.less │ │ ├── b.less │ │ ├── bundle.css │ │ ├── b-with-asset.less │ │ ├── bundle-with-named-module.css │ │ └── bundle-with-asset.css └── bundle.css ├── .npmignore ├── .travis.yml ├── .gitignore ├── .editorconfig ├── .jshintrc ├── CHANGELOG.md ├── LICENSE ├── less.js ├── package.json ├── .jscsrc ├── index.js ├── CONTRIBUTING.md └── css.js /.npmrc: -------------------------------------------------------------------------------- 1 | save-prefix=^ 2 | save=true 3 | -------------------------------------------------------------------------------- /test/fixtures/css/entry-multi.css: -------------------------------------------------------------------------------- 1 | @import "./c.css"; -------------------------------------------------------------------------------- /test/fixtures/css/a.css: -------------------------------------------------------------------------------- 1 | .a { 2 | background: blue; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/css/c.css: -------------------------------------------------------------------------------- 1 | .c { 2 | background: green; 3 | } -------------------------------------------------------------------------------- /test/fixtures/less/entry.less: -------------------------------------------------------------------------------- 1 | @import "./a"; 2 | @import "./b"; 3 | -------------------------------------------------------------------------------- /test/fixtures/less/foo.less: -------------------------------------------------------------------------------- 1 | .red { 2 | color: #FF0000; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/css/entry.css: -------------------------------------------------------------------------------- 1 | @import "./a.css"; 2 | @import "./b.css"; 3 | -------------------------------------------------------------------------------- /test/fixtures/css/bundle-compressed.css: -------------------------------------------------------------------------------- 1 | .a{background:blue;}.b{background:red;} -------------------------------------------------------------------------------- /test/fixtures/css/entry-for-prefixing.css: -------------------------------------------------------------------------------- 1 | div { 2 | display: flex; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/css/a-with-var.css: -------------------------------------------------------------------------------- 1 | .a { 2 | background: var(mainColor); 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/css/varBundle.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | body { 4 | background: red; 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/less/external_root/external.less: -------------------------------------------------------------------------------- 1 | .external { 2 | color: black; 3 | } -------------------------------------------------------------------------------- /test/fixtures/css/b.css: -------------------------------------------------------------------------------- 1 | @import "./a.css"; 2 | 3 | .b { 4 | background: red; 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/foo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "style": "index.scss" 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/less/a.less: -------------------------------------------------------------------------------- 1 | @color: #4D926F; 2 | 3 | .a { 4 | color: @color; 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/less/needs-external-root.less: -------------------------------------------------------------------------------- 1 | @import "./a"; 2 | @import "external"; 3 | -------------------------------------------------------------------------------- /test/fixtures/less/node_modules/foo/index.less: -------------------------------------------------------------------------------- 1 | .red { 2 | color: #FF0000; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/child/other.css: -------------------------------------------------------------------------------- 1 | .other-child { 2 | height: 66; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/child/node_modules/rework-default-unit/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/rework-visit/Makefile: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/css/entry-with-asset.css: -------------------------------------------------------------------------------- 1 | .asset-style { 2 | background-image: url(img.png); 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/css/entry-with-var.css: -------------------------------------------------------------------------------- 1 | @import "./a-with-var.css"; 2 | @import "./b-with-var.css"; 3 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/.npmignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | test 4 | .travis.yml 5 | -------------------------------------------------------------------------------- /test/fixtures/css/bundle-transformed.css: -------------------------------------------------------------------------------- 1 | .a { 2 | color: blue; 3 | } 4 | 5 | .b { 6 | color: red; 7 | } -------------------------------------------------------------------------------- /test/fixtures/css/bundle.css: -------------------------------------------------------------------------------- 1 | .a { 2 | background: blue; 3 | } 4 | 5 | .b { 6 | background: red; 7 | } -------------------------------------------------------------------------------- /test/fixtures/css/entry-with-inline.css: -------------------------------------------------------------------------------- 1 | .foo { 2 | background: inline(/fixtures/css/img.png) 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/css/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomify/atomify-css/HEAD/test/fixtures/css/img.png -------------------------------------------------------------------------------- /test/fixtures/css/import-missing.css: -------------------------------------------------------------------------------- 1 | /* try to import a missing file */ 2 | @import "./file-does-not-exist"; -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/foo/index.scss: -------------------------------------------------------------------------------- 1 | $rojo: #f00; 2 | 3 | .red { 4 | color: $rojo; 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/hsb2rgb/.npmignore: -------------------------------------------------------------------------------- 1 | test/ 2 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/rework-inherit/.npmignore: -------------------------------------------------------------------------------- 1 | test/ -------------------------------------------------------------------------------- /test/fixtures/css/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "mainColor": "#4170BB", 3 | "headerColor": "#4170CC" 4 | } -------------------------------------------------------------------------------- /test/fixtures/less/entry-with-named-module.less: -------------------------------------------------------------------------------- 1 | @import "./a"; 2 | @import "./b"; 3 | @import "foo"; 4 | -------------------------------------------------------------------------------- /test/fixtures/css/bundle-gen.css: -------------------------------------------------------------------------------- 1 | .a { 2 | background: blue; 3 | } 4 | 5 | .b { 6 | background: red; 7 | } -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/rework'); -------------------------------------------------------------------------------- /test/fixtures/css/variables-malformed.json: -------------------------------------------------------------------------------- 1 | { 2 | "mainColor": '#4170BB', 3 | "headerColor": "#4170CC" 4 | } -------------------------------------------------------------------------------- /test/fixtures/less/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomify/atomify-css/HEAD/test/fixtures/less/img/logo.png -------------------------------------------------------------------------------- /test/fixtures/css/b-with-var.css: -------------------------------------------------------------------------------- 1 | @import "./a-with-var.css"; 2 | 3 | .b { 4 | background: var(headerColor); 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/css/bundle-with-var.css: -------------------------------------------------------------------------------- 1 | .a { 2 | background: #4170BB; 3 | } 4 | 5 | .b { 6 | background: #4170CC; 7 | } -------------------------------------------------------------------------------- /test/fixtures/css/new-dir/bundle-new-dir.css: -------------------------------------------------------------------------------- 1 | .a { 2 | background: blue; 3 | } 4 | 5 | .b { 6 | background: red; 7 | } -------------------------------------------------------------------------------- /test/fixtures/less/bundle-with-external-root.css: -------------------------------------------------------------------------------- 1 | .a { 2 | color: #4d926f; 3 | } 4 | .external { 5 | color: black; 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/less/img/dir/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomify/atomify-css/HEAD/test/fixtures/less/img/dir/info.png -------------------------------------------------------------------------------- /test/fixtures/css/bundle-with-asset.css: -------------------------------------------------------------------------------- 1 | .asset-style { 2 | background-image: url(assets/images/53c17288b9723c1d.png); 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/css/vars.css: -------------------------------------------------------------------------------- 1 | :root{ 2 | --color-danger: red; 3 | } 4 | 5 | body { 6 | background: var(--color-danger); 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/child/node_modules/rework-default-unit/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | - 0.10 5 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.8" 4 | - "0.10" 5 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/color-parser/.npmignore: -------------------------------------------------------------------------------- 1 | components 2 | build 3 | node_modules 4 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/commander/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/child/index.css: -------------------------------------------------------------------------------- 1 | .child { 2 | width: 100; 3 | } 4 | 5 | @import "./other.css"; 6 | 7 | @import "grandchild"; 8 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/commander/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/commander'); -------------------------------------------------------------------------------- /test/fixtures/less/a-with-asset.less: -------------------------------------------------------------------------------- 1 | @color: #4D926F; 2 | 3 | .a { 4 | color: @color; 5 | background-image: url("img/dir/info.png"); 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/.npmignore: -------------------------------------------------------------------------------- 1 | components 2 | support 3 | test 4 | examples 5 | /rework.js 6 | *.sock 7 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/commander/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.4 4 | - 0.6 5 | -------------------------------------------------------------------------------- /test/fixtures/css/bundle-multi.css: -------------------------------------------------------------------------------- 1 | .a { 2 | background: blue; 3 | } 4 | 5 | .b { 6 | background: red; 7 | } 8 | .c { 9 | background: green; 10 | } -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/child/node_modules/grandchild/index.css: -------------------------------------------------------------------------------- 1 | .grandchild { 2 | width: math(5 * 5px); 3 | } 4 | 5 | @import "./nested/thing.css"; 6 | -------------------------------------------------------------------------------- /test/fixtures/css/bundle-with-prefixes.css: -------------------------------------------------------------------------------- 1 | div { 2 | display: -webkit-box; 3 | display: -webkit-flex; 4 | display: -ms-flexbox; 5 | display: flex; 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/child/node_modules/grandchild/nested/thing.css: -------------------------------------------------------------------------------- 1 | .nested-grandchild-style { 2 | color: lightpink; 3 | width: math(5 * 20em); 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/convert-source-map/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/rework-inherit/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.8" 4 | - "0.10" 5 | -------------------------------------------------------------------------------- /test/fixtures/less/entry-with-asset.less: -------------------------------------------------------------------------------- 1 | @import "./a-with-asset"; 2 | @import "./b-with-asset"; 3 | 4 | body { 5 | background-image: url("img/logo.png"); 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/.npmignore: -------------------------------------------------------------------------------- 1 | dist/* 2 | node_modules/* 3 | -------------------------------------------------------------------------------- /test/fixtures/css/some/other/parent/styles.css: -------------------------------------------------------------------------------- 1 | .some-other-parent-style { 2 | color: seagreen; 3 | } 4 | 5 | .other-clone { 6 | clone: .some-other-parent-style; 7 | } 8 | -------------------------------------------------------------------------------- /test/bundle.css: -------------------------------------------------------------------------------- 1 | .a { 2 | color: #4d926f; 3 | } 4 | .nav > li > a { 5 | border: 1px solid #f5f5f5; 6 | } 7 | .nav > li > a:hover { 8 | border-color: #00ff00; 9 | } 10 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/lib/visit.js: -------------------------------------------------------------------------------- 1 | 2 | // TODO: require() directly in plugins... 3 | exports.declarations = require('rework-visit'); 4 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/rework-inherit/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @node test 3 | 4 | install: 5 | @npm install 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @node test 4 | 5 | benchmark: 6 | @node benchmark 7 | 8 | .PHONY: test benchmark -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/index.js: -------------------------------------------------------------------------------- 1 | 2 | exports.parse = require('css-parse'); 3 | exports.stringify = require('css-stringify'); 4 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | test.css 6 | test.js 7 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/color-parser/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.1.0 / 2012-12-11 3 | ================== 4 | 5 | * add named color support 6 | -------------------------------------------------------------------------------- /test/fixtures/less/b.less: -------------------------------------------------------------------------------- 1 | @import "./a"; 2 | 3 | @color2: #0f0; 4 | 5 | .nav > li > a { 6 | border: 1px solid #f5f5f5; 7 | &:hover { 8 | border-color: @color2; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/fixtures/less/bundle.css: -------------------------------------------------------------------------------- 1 | .a { 2 | color: #4d926f; 3 | } 4 | .nav > li > a { 5 | border: 1px solid #f5f5f5; 6 | } 7 | .nav > li > a:hover { 8 | border-color: #00ff00; 9 | } 10 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/commander/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TESTS = $(shell find test/test.*.js) 3 | 4 | test: 5 | @./test/run $(TESTS) 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | - "0.10" -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | 3 | 4 | .git* 5 | .npmignore 6 | .travis.yml 7 | test.js 8 | 9 | .editorconfig 10 | .jscsrc 11 | .jshint* 12 | CHANGELOG.* 13 | CONTRIBUTING.* 14 | 15 | .DS_Store -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.12" 4 | - "0.10" 5 | - iojs 6 | 7 | script: 8 | - "npm test" 9 | 10 | notifications: 11 | email: false 12 | 13 | sudo: false 14 | 15 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/test.js: -------------------------------------------------------------------------------- 1 | 2 | var css = require('./') 3 | , assert = require('assert'); 4 | 5 | assert(css.parse); 6 | assert(css.stringify); 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/* 2 | !test/node_modules 3 | .idea 4 | test/fixtures/css/assets/ 5 | test/fixtures/less/assets/ 6 | test/fixtures/css/bower_components 7 | test/fixtures/less/bower_components 8 | .DS_Store 9 | -------------------------------------------------------------------------------- /test/fixtures/less/b-with-asset.less: -------------------------------------------------------------------------------- 1 | @import "./a-with-asset"; 2 | 3 | @color2: #0f0; 4 | 5 | .nav > li > a { 6 | border: 1px solid #f5f5f5; 7 | &:hover { 8 | border-color: @color2; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/fixtures/css/entry-with-deep-custom-plugins.css: -------------------------------------------------------------------------------- 1 | .app { 2 | color: "red"; 3 | } 4 | 5 | .app-clone { 6 | clone: .app; 7 | } 8 | 9 | @import "./some/other/parent/styles.css"; 10 | 11 | @import "child"; 12 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/rework-visit/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # rework-visit 3 | 4 | Rework declaration visitor for plugins (and rework core). 5 | 6 | # License 7 | 8 | MIT 9 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/build/test-suffix.js: -------------------------------------------------------------------------------- 1 | function run_test() { 2 | runSourceMapTests('{THIS_MODULE}', do_throw); 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/debug/index.js: -------------------------------------------------------------------------------- 1 | if ('undefined' == typeof window) { 2 | module.exports = require('./lib/debug'); 3 | } else { 4 | module.exports = require('./debug'); 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --require should \ 5 | --reporter spec \ 6 | --bail 7 | 8 | .PHONY: test 9 | -------------------------------------------------------------------------------- /test/fixtures/less/bundle-with-named-module.css: -------------------------------------------------------------------------------- 1 | .a { 2 | color: #4d926f; 3 | } 4 | .nav > li > a { 5 | border: 1px solid #f5f5f5; 6 | } 7 | .nav > li > a:hover { 8 | border-color: #00ff00; 9 | } 10 | .red { 11 | color: #FF0000; 12 | } 13 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/child/node_modules/grandchild/node_modules/rework-math/.npmignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | 10 | pids 11 | logs 12 | results 13 | 14 | npm-debug.log 15 | node_modules 16 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/convert-source-map/.npmignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | 10 | pids 11 | logs 12 | results 13 | 14 | node_modules 15 | npm-debug.log 16 | tmp 17 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | ; This file is for unifying the coding style for different editors and IDEs. 2 | ; More information at http://EditorConfig.org 3 | root = true 4 | 5 | [*] 6 | indent_style = space 7 | indent_size = 2 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true 12 | 13 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/lib/utils.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Strip `str` quotes. 4 | * 5 | * @param {String} str 6 | * @return {String} 7 | * @api private 8 | */ 9 | 10 | exports.stripQuotes = function(str) { 11 | if ('"' == str[0] || "'" == str[0]) return str.slice(1, -1); 12 | return str; 13 | }; -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/Makefile: -------------------------------------------------------------------------------- 1 | 2 | rework.js: 3 | @component install 4 | @component build --standalone rework --out . --name rework 5 | 6 | test: 7 | @./node_modules/.bin/mocha \ 8 | --require should 9 | 10 | clean: 11 | rm -f rework.js 12 | rm -fr components 13 | 14 | .PHONY: test rework.js clean 15 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/build/test-prefix.js: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING! 3 | * 4 | * Do not edit this file directly, it is built from the sources at 5 | * https://github.com/mozilla/source-map/ 6 | */ 7 | 8 | Components.utils.import('resource://test/Utils.jsm'); 9 | -------------------------------------------------------------------------------- /test/fixtures/less/bundle-with-asset.css: -------------------------------------------------------------------------------- 1 | .a { 2 | color: #4d926f; 3 | background-image: url("assets/images/info-5696a30597face4e.png"); 4 | } 5 | .nav > li > a { 6 | border: 1px solid #f5f5f5; 7 | } 8 | .nav > li > a:hover { 9 | border-color: #00ff00; 10 | } 11 | body { 12 | background-image: url("assets/images/logo-212cb105d360a9ec.png"); 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/rework-visit/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rework-visit", 3 | "repo": "visionmedia/rework-visit", 4 | "version": "1.0.0", 5 | "description": "Rework declaration visitor utility", 6 | "keywords": ["css", "rework"], 7 | "license": "MIT", 8 | "scripts": ["index.js"] 9 | } 10 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/child/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "child", 3 | "version": "0.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "dependencies": { 7 | "rework-default-unit": "~0.0.1" 8 | }, 9 | "atomify": { 10 | "css": { 11 | "entry": "index.css", 12 | "plugins": [ 13 | "rework-default-unit" 14 | ] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/color-parser/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: components index.js 3 | @component build --dev 4 | 5 | components: 6 | @component install --dev 7 | 8 | clean: 9 | rm -fr build components template.js 10 | 11 | test: 12 | @./node_modules/.bin/mocha \ 13 | --require should \ 14 | --reporter spec 15 | 16 | .PHONY: clean test 17 | -------------------------------------------------------------------------------- /test/fixtures/css/bundle-compressed-with-sourcemap.css: -------------------------------------------------------------------------------- 1 | .a{background:blue;}.b{background:red;} 2 | /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImEuY3NzIiwiYi5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsR0FDQyxpQkNDRCxHQUNDIiwic291cmNlc0NvbnRlbnQiOlsiLmEge1xuXHRiYWNrZ3JvdW5kOiBibHVlO1xufVxuIiwiQGltcG9ydCBcIi4vYS5jc3NcIjtcblxuLmIge1xuXHRiYWNrZ3JvdW5kOiByZWQ7XG59XG4iXX0= */ 3 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/child/node_modules/grandchild/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "grandchild", 3 | "version": "0.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "dependencies": { 7 | "rework-math": "~1.0.1" 8 | }, 9 | "atomify": { 10 | "css": { 11 | "entry": "index.css", 12 | "plugins": [ 13 | ["rework-math"] 14 | ] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/fixtures/css/bundle-with-sourcemap.css: -------------------------------------------------------------------------------- 1 | .a { 2 | background: blue; 3 | } 4 | 5 | .b { 6 | background: red; 7 | } 8 | /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImEuY3NzIiwiYi5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDQzs7O0FDQ0Q7RUFDQyIsInNvdXJjZXNDb250ZW50IjpbIi5hIHtcblx0YmFja2dyb3VuZDogYmx1ZTtcbn1cbiIsIkBpbXBvcnQgXCIuL2EuY3NzXCI7XG5cbi5iIHtcblx0YmFja2dyb3VuZDogcmVkO1xufVxuIl19 */ 9 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/color-parser/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "color-parser", 3 | "repo": "component/color-parser", 4 | "description": "CSS color string parser", 5 | "version": "0.1.0", 6 | "keywords": ["css", "color", "parser", "colors"], 7 | "dependencies": {}, 8 | "development": {}, 9 | "scripts": [ 10 | "index.js", 11 | "colors.js" 12 | ] 13 | } -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/convert-source-map/test/fixtures/map-file-comment.css: -------------------------------------------------------------------------------- 1 | .header { 2 | background: #444; 3 | border: solid; 4 | padding: 10px; 5 | border-radius: 10px 5px 10px 5px; 6 | color: #b4b472; } 7 | 8 | #main li { 9 | color: green; 10 | margin: 10px; 11 | padding: 10px; 12 | font-size: 18px; } 13 | 14 | /*# sourceMappingURL=map-file-comment.css.map */ 15 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/hsb2rgb/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hsb2rgb", 3 | "version": "1.0.2", 4 | "repo": "jankuca/hsb2rgb", 5 | "description": "HSV (HSB) to RGB color converter", 6 | "main": "src/hsb2rgb.js", 7 | "keywords": ["color", "conversion", "rgb", "hsv", "hsb"], 8 | "scripts": ["src/hsb2rgb.js"], 9 | "main": "src/hsb2rgb.js", 10 | "license": "MIT" 11 | } 12 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/rework-inherit/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rework-inherit", 3 | "description": "Inherit rules from other selectors", 4 | "repo": "reworkcss/rework-inherit", 5 | "version": "0.2.1", 6 | "dependencies": { 7 | "visionmedia/debug": "*" 8 | }, 9 | "main": "index.js", 10 | "scripts": [ 11 | "index.js" 12 | ], 13 | "license": "MIT" 14 | } 15 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/convert-source-map/test/fixtures/map-file-comment-double-slash.css: -------------------------------------------------------------------------------- 1 | .header { 2 | background: #444; 3 | border: solid; 4 | padding: 10px; 5 | border-radius: 10px 5px 10px 5px; 6 | color: #b4b472; } 7 | 8 | #main li { 9 | color: green; 10 | margin: 10px; 11 | padding: 10px; 12 | font-size: 18px; } 13 | 14 | //# sourceMappingURL=map-file-comment.css.map 15 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "css", 3 | "version": "1.6.0", 4 | "description": "CSS parser / stringifier using css-parse and css-stringify", 5 | "keywords": ["css", "parser", "stylesheet"], 6 | "dependencies": { 7 | "visionmedia/css-parse": "1.7.0", 8 | "visionmedia/css-stringify": "1.4.1" 9 | }, 10 | "scripts": [ 11 | "index.js" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "css-stringify", 3 | "repo": "visionmedia/css-stringify", 4 | "version": "1.4.1", 5 | "description": "CSS compiler", 6 | "keywords": ["css", "stringify", "stylesheet"], 7 | "scripts": [ 8 | "index.js", 9 | "lib/compress.js", 10 | "lib/identity.js", 11 | "lib/compiler.js", 12 | "lib/source-map-support.js" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /test/fixtures/css/bundle-with-deep-custom-plugins.css: -------------------------------------------------------------------------------- 1 | .app { 2 | color: "red"; 3 | } 4 | 5 | .app-clone { 6 | color: "red"; 7 | } 8 | 9 | .some-other-parent-style { 10 | color: seagreen; 11 | } 12 | 13 | .other-clone { 14 | color: seagreen; 15 | } 16 | 17 | .child { 18 | width: 100px; 19 | } 20 | 21 | .other-child { 22 | height: 66px; 23 | } 24 | 25 | .grandchild { 26 | width: 25px; 27 | } 28 | 29 | .nested-grandchild-style { 30 | color: lightpink; 31 | width: 100em; 32 | } -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/build/suffix-source-map.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /////////////////////////////////////////////////////////////////////////////// 3 | 4 | this.SourceMapConsumer = require('source-map/source-map-consumer').SourceMapConsumer; 5 | this.SourceMapGenerator = require('source-map/source-map-generator').SourceMapGenerator; 6 | this.SourceNode = require('source-map/source-node').SourceNode; 7 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/build/suffix-browser.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /////////////////////////////////////////////////////////////////////////////// 3 | 4 | this.sourceMap = { 5 | SourceMapConsumer: require('source-map/source-map-consumer').SourceMapConsumer, 6 | SourceMapGenerator: require('source-map/source-map-generator').SourceMapGenerator, 7 | SourceNode: require('source-map/source-node').SourceNode 8 | }; 9 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/rework-visit/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rework-visit", 3 | "version": "1.0.0", 4 | "description": "Rework declaration visitor utility", 5 | "keywords": [ 6 | "css", 7 | "rework" 8 | ], 9 | "license": "MIT", 10 | "readme": "\n# rework-visit\n\n Rework declaration visitor for plugins (and rework core).\n\n# License\n\n MIT\n", 11 | "readmeFilename": "Readme.md", 12 | "_id": "rework-visit@1.0.0", 13 | "_from": "rework-visit@1.0.0" 14 | } 15 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/hsb2rgb/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hsb2rgb", 3 | "version": "1.0.2", 4 | "description": "HSV (HSB) to RGB color converter", 5 | "author": { 6 | "name": "Jan Kuča", 7 | "email": "http://jankuca.com" 8 | }, 9 | "main": "src/hsb2rgb.js", 10 | "scripts": { 11 | "test": "mocha -R spec" 12 | }, 13 | "devDependencies": { 14 | "mocha": "*" 15 | }, 16 | "readme": "ERROR: No README data found!", 17 | "_id": "hsb2rgb@1.0.2", 18 | "_from": "hsb2rgb@1.0.2" 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/lib/source-map.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009-2011 Mozilla Foundation and contributors 3 | * Licensed under the New BSD license. See LICENSE.txt or: 4 | * http://opensource.org/licenses/BSD-3-Clause 5 | */ 6 | exports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator; 7 | exports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer; 8 | exports.SourceNode = require('./source-map/source-node').SourceNode; 9 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/lib/plugins/url.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var func = require('./function'); 7 | 8 | /** 9 | * Map `url()` calls. 10 | * 11 | * body { 12 | * background: url(/images/bg.png); 13 | * } 14 | * 15 | * yields: 16 | * 17 | * body { 18 | * background: url(http://example.com/images/bg.png); 19 | * } 20 | * 21 | */ 22 | 23 | module.exports = function(fn) { 24 | return func({ 25 | url: function(path){ 26 | return 'url("' + fn(path) + '")'; 27 | } 28 | }, false); 29 | }; 30 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": true 3 | , "camelcase": true 4 | , "eqeqeq": true 5 | , "immed": true 6 | 7 | , "latedef": true 8 | , "newcap": true 9 | , "noarg": true 10 | , "quotmark": "single" 11 | , "freeze": true 12 | 13 | , "regexp": false 14 | , "undef": true 15 | , "unused": true 16 | , "trailing": true 17 | , "strict": true 18 | 19 | , "asi" : true 20 | , "boss" : false 21 | , "eqnull" : true 22 | , "expr" : true 23 | , "laxbreak" : true 24 | , "laxcomma" : true 25 | , "regexdash" : false 26 | , "smarttabs" : false 27 | 28 | , "browser": true 29 | , "node": true 30 | } 31 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/color-parser/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # color-parser 3 | 4 | CSS color string parser 5 | 6 | ## Installation 7 | 8 | $ component install component/color-parser 9 | 10 | ### Example 11 | 12 | ```js 13 | var parse = require('color-parser'); 14 | 15 | parse('#fc0') 16 | // => { r: 255, g: 204, b: 0, a: 1 } 17 | 18 | parse('#ffcc00') 19 | // => { r: 255, g: 204, b: 0, a: 1 } 20 | 21 | parse('rgb(255, 204, 0)') 22 | // => { r: 255, g: 204, b: 0, a: 1 } 23 | 24 | parse('rgba(255, 204, 0, 1)') 25 | // => { r: 255, g: 204, b: 0, a: 1 } 26 | ``` 27 | 28 | # License 29 | 30 | MIT 31 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/History.md: -------------------------------------------------------------------------------- 1 | 1.6.0 / 2013-12-21 2 | ================== 3 | 4 | * update deps 5 | 6 | 1.5.0 / 2013-12-03 7 | ================== 8 | 9 | * update deps 10 | 11 | 1.1.0 / 2013-04-04 12 | ================== 13 | 14 | * update deps 15 | 16 | 1.0.7 / 2012-11-21 17 | ================== 18 | 19 | * fix component.json 20 | 21 | 1.0.4 / 2012-11-15 22 | ================== 23 | 24 | * update css-stringify 25 | 26 | 1.0.3 / 2012-09-01 27 | ================== 28 | 29 | * add component support 30 | 31 | 0.0.1 / 2010-01-03 32 | ================== 33 | 34 | * Initial release 35 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/convert-source-map/test/fixtures/map-file-comment.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": "3", 3 | "mappings": "AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI", 4 | "sources": ["./client/sass/core.scss","./client/sass/main.scss"], 5 | "file": "map-file-comment.css" 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/lib/plugins/prefix-selectors.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Prefix selectors with `str`. 4 | * 5 | * button { 6 | * color: red; 7 | * } 8 | * 9 | * yields: 10 | * 11 | * #dialog button { 12 | * color: red; 13 | * } 14 | * 15 | */ 16 | 17 | module.exports = function(str) { 18 | return function(style){ 19 | style.rules = style.rules.map(function(rule){ 20 | if (!rule.selectors) return rule; 21 | rule.selectors = rule.selectors.map(function(selector){ 22 | if (':root' == selector) return str; 23 | selector = selector.replace(/^\:root\s?/, ''); 24 | return str + ' ' + selector; 25 | }); 26 | return rule; 27 | }); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/build/prefix-utils.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | /* 9 | * WARNING! 10 | * 11 | * Do not edit this file directly, it is built from the sources at 12 | * https://github.com/mozilla/source-map/ 13 | */ 14 | 15 | Components.utils.import('resource://gre/modules/devtools/Require.jsm'); 16 | Components.utils.import('resource://gre/modules/devtools/SourceMap.jsm'); 17 | 18 | this.EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ]; 19 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/build/suffix-utils.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | function runSourceMapTests(modName, do_throw) { 8 | let mod = require(modName); 9 | let assert = require('test/source-map/assert'); 10 | let util = require('test/source-map/util'); 11 | 12 | assert.init(do_throw); 13 | 14 | for (let k in mod) { 15 | if (/^test/.test(k)) { 16 | mod[k](assert, util); 17 | } 18 | } 19 | 20 | } 21 | this.runSourceMapTests = runSourceMapTests; 22 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/convert-source-map/example/comment-to-json.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var convert = require('..'); 4 | 5 | var json = convert 6 | .fromComment('//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') 7 | .toJSON(); 8 | 9 | var modified = convert 10 | .fromComment('//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') 11 | .setProperty('sources', [ 'CONSOLE.LOG("HI");' ]) 12 | .toJSON(); 13 | 14 | console.log(json); 15 | console.log(modified); 16 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/build/prefix-source-map.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | /* 9 | * WARNING! 10 | * 11 | * Do not edit this file directly, it is built from the sources at 12 | * https://github.com/mozilla/source-map/ 13 | */ 14 | 15 | /////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | this.EXPORTED_SYMBOLS = [ "SourceMapConsumer", "SourceMapGenerator", "SourceNode" ]; 19 | 20 | Components.utils.import('resource://gre/modules/devtools/Require.jsm'); 21 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/commander/node_modules/keypress/test.js: -------------------------------------------------------------------------------- 1 | 2 | var keypress = require('./') 3 | keypress(process.stdin) 4 | 5 | if (process.stdin.setRawMode) 6 | process.stdin.setRawMode(true) 7 | else 8 | require('tty').setRawMode(true) 9 | 10 | process.stdin.on('keypress', function (c, key) { 11 | console.log(0, c, key) 12 | if (key && key.ctrl && key.name == 'c') { 13 | process.stdin.pause() 14 | } 15 | }) 16 | process.stdin.on('mousepress', function (mouse) { 17 | console.log(mouse) 18 | }) 19 | 20 | keypress.enableMouse(process.stdout) 21 | process.on('exit', function () { 22 | //disable mouse on exit, so that the state is back to normal 23 | //for the terminal. 24 | keypress.disableMouse(process.stdout) 25 | }) 26 | 27 | process.stdin.resume() 28 | 29 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/rework-visit/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Expose `visit()`. 4 | */ 5 | 6 | module.exports = visit; 7 | 8 | /** 9 | * Visit `node`'s declarations recursively and 10 | * invoke `fn(declarations, node)`. 11 | * 12 | * @param {Object} node 13 | * @param {Function} fn 14 | * @api private 15 | */ 16 | 17 | function visit(node, fn){ 18 | node.rules.forEach(function(rule){ 19 | // @media etc 20 | if (rule.rules) { 21 | visit(rule, fn); 22 | return; 23 | } 24 | 25 | // keyframes 26 | if (rule.keyframes) { 27 | rule.keyframes.forEach(function(keyframe){ 28 | fn(keyframe.declarations, rule); 29 | }); 30 | return; 31 | } 32 | 33 | // @charset, @import etc 34 | if (!rule.declarations) return; 35 | 36 | fn(rule.declarations, node); 37 | }); 38 | }; 39 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/child/node_modules/rework-default-unit/node_modules/rework-visit/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Expose `visit()`. 4 | */ 5 | 6 | module.exports = visit; 7 | 8 | /** 9 | * Visit `node`'s declarations recursively and 10 | * invoke `fn(declarations, node)`. 11 | * 12 | * @param {Object} node 13 | * @param {Function} fn 14 | * @api private 15 | */ 16 | 17 | function visit(node, fn){ 18 | node.rules.forEach(function(rule){ 19 | // @media etc 20 | if (rule.rules) { 21 | visit(rule, fn); 22 | return; 23 | } 24 | 25 | // keyframes 26 | if (rule.keyframes) { 27 | rule.keyframes.forEach(function(keyframe){ 28 | fn(keyframe.declarations, rule); 29 | }); 30 | return; 31 | } 32 | 33 | // @charset, @import etc 34 | if (!rule.declarations) return; 35 | 36 | fn(rule.declarations, node); 37 | }); 38 | }; 39 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/child/node_modules/grandchild/node_modules/rework-math/node_modules/rework-visit/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Expose `visit()`. 4 | */ 5 | 6 | module.exports = visit; 7 | 8 | /** 9 | * Visit `node`'s declarations recursively and 10 | * invoke `fn(declarations, node)`. 11 | * 12 | * @param {Object} node 13 | * @param {Function} fn 14 | * @api private 15 | */ 16 | 17 | function visit(node, fn){ 18 | node.rules.forEach(function(rule){ 19 | // @media etc 20 | if (rule.rules) { 21 | visit(rule, fn); 22 | return; 23 | } 24 | 25 | // keyframes 26 | if (rule.keyframes) { 27 | rule.keyframes.forEach(function(keyframe){ 28 | fn(keyframe.declarations, rule); 29 | }); 30 | return; 31 | } 32 | 33 | // @charset, @import etc 34 | if (!rule.declarations) return; 35 | 36 | fn(rule.declarations, node); 37 | }); 38 | }; 39 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/child/node_modules/rework-default-unit/index.js: -------------------------------------------------------------------------------- 1 | var visit = require('rework-visit') 2 | 3 | module.exports = exports = function(unit) { 4 | 5 | function defaultUnit(style) { 6 | visit(style, function(declarations) { 7 | declarations.forEach(function(d) { 8 | if (!isNaN(d.value)) 9 | d.value += !d.value || exports.numeric[d.property] ? '' : unit 10 | }) 11 | }) 12 | } 13 | 14 | // Called as factory function 15 | if (typeof unit == 'string') return defaultUnit 16 | 17 | // Invoked directly, use 'px' as default 18 | var style = unit 19 | unit = 'px' 20 | defaultUnit(style) 21 | } 22 | 23 | exports.numeric = { 24 | "column-count": true, 25 | "fill-opacity": true, 26 | "font-weight": true, 27 | "line-height": true, 28 | "opacity": true, 29 | "orphans": true, 30 | "widows": true, 31 | "z-index": true, 32 | "zoom": true 33 | } 34 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rework", 3 | "version": "0.20.2", 4 | "description": "CSS manipulations built on CSSOM", 5 | "keywords": ["css", "manipulation", "preprocess", "transform"], 6 | "dependencies": { 7 | "reworkcss/css": "1.6.1", 8 | "reworkcss/rework-visit": "1.0.0", 9 | "reworkcss/rework-inherit": "0.2.1", 10 | "visionmedia/debug": "*", 11 | "component/color-parser": "0.1.0", 12 | "component/path": "1.0.0", 13 | "jankuca/hsb2rgb": "1.0.2" 14 | }, 15 | "scripts": [ 16 | "index.js", 17 | "lib/rework.js", 18 | "lib/utils.js", 19 | "lib/visit.js", 20 | "lib/plugins/function.js", 21 | "lib/plugins/url.js", 22 | "lib/plugins/ease.js", 23 | "lib/plugins/at2x.js", 24 | "lib/plugins/colors.js", 25 | "lib/plugins/mixin.js", 26 | "lib/plugins/references.js", 27 | "lib/plugins/prefix-selectors.js" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/test/source-map/test-base64-vlq.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var base64VLQ = require('../../lib/source-map/base64-vlq'); 13 | 14 | exports['test normal encoding and decoding'] = function (assert, util) { 15 | var result; 16 | for (var i = -255; i < 256; i++) { 17 | result = base64VLQ.decode(base64VLQ.encode(i)); 18 | assert.ok(result); 19 | assert.equal(result.value, i); 20 | assert.equal(result.rest, ""); 21 | } 22 | }; 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/benchmark.js: -------------------------------------------------------------------------------- 1 | 2 | var css = require('./') 3 | , fs = require('fs') 4 | , read = fs.readFileSync 5 | , str = read('examples/ui.css', 'utf8'); 6 | 7 | var n = 5000; 8 | var ops = 200; 9 | var t = process.hrtime(t); 10 | var results = []; 11 | 12 | while (n--) { 13 | css.stringify(css.parse(str)); 14 | if (n % ops == 0) { 15 | t = process.hrtime(t); 16 | var ms = t[1] / 1000 / 1000; 17 | var persec = (ops * (1000 / ms) | 0); 18 | results.push(persec); 19 | process.stdout.write('\r [' + persec + ' ops/s] [' + n + ']'); 20 | t = process.hrtime(); 21 | } 22 | } 23 | 24 | function sum(arr) { 25 | return arr.reduce(function(sum, n){ 26 | return sum + n; 27 | }); 28 | } 29 | 30 | function mean(arr) { 31 | return sum(arr) / arr.length | 0; 32 | } 33 | 34 | console.log(); 35 | console.log(' avg: %d ops/s', mean(results)); 36 | console.log(' size: %d kb', (str.length / 1024).toFixed(2)); -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/lib/compiler.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Expose `Compiler`. 4 | */ 5 | 6 | module.exports = Compiler; 7 | 8 | /** 9 | * Initialize a compiler. 10 | * 11 | * @param {Type} name 12 | * @return {Type} 13 | * @api public 14 | */ 15 | 16 | function Compiler(opts) { 17 | this.options = opts || {}; 18 | } 19 | 20 | /** 21 | * Emit `str` 22 | */ 23 | 24 | Compiler.prototype.emit = function(str) { 25 | return str; 26 | }; 27 | 28 | /** 29 | * Visit `node`. 30 | */ 31 | 32 | Compiler.prototype.visit = function(node){ 33 | return this[node.type](node); 34 | }; 35 | 36 | /** 37 | * Map visit over array of `nodes`, optionally using a `delim` 38 | */ 39 | 40 | Compiler.prototype.mapVisit = function(nodes, delim){ 41 | var buf = ''; 42 | delim = delim || ''; 43 | 44 | for (var i = 0, length = nodes.length; i < length; i++) { 45 | buf += this.visit(nodes[i]); 46 | if (delim && i < length - 1) buf += this.emit(delim); 47 | } 48 | 49 | return buf; 50 | }; 51 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 3.3.5 4 | * fix: LESS options can now take additional roots. #47 5 | 6 | ## 3.3.4 7 | * internal: removed undocumented resourcePaths feature. #46 8 | 9 | ## 3.3.3 10 | * fix: use postscss to process autoprefixer. This fixes a deprecation warning from autoprefixer. 11 | * internal: move test file into test dir 12 | * internal: add eslint 13 | 14 | 15 | ## 3.3.2 16 | * fix: don't run autoprefixer if there's an error. This makes error output more clear. 17 | 18 | ## 3.3.0 19 | * add css & assets watch mode for livereload (@serapath) 20 | * add autoprefixer (@serapath) 21 | * code style cleanup 22 | * now testing on iojs and node 0.12 23 | 24 | ## 3.2.1 25 | * update dependencies 26 | * fix some wonky tests 27 | * tests now error if the callback throws an error 28 | 29 | ## 3.2.0 30 | * Adds support for multiple entry files. 31 | * Adds support for specifying variables with a JSON file 32 | 33 | ## 3.1.0 34 | * Adds support for bower. 35 | 36 | ## 3.0.0 37 | * adds support for the new css var syntax (`--color: red` vs. the old `var-color: red`) 38 | 39 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/test/source-map/test-api.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2012 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var sourceMap; 13 | try { 14 | sourceMap = require('../../lib/source-map'); 15 | } catch (e) { 16 | sourceMap = {}; 17 | Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap); 18 | } 19 | 20 | exports['test that the api is properly exposed in the top level'] = function (assert, util) { 21 | assert.equal(typeof sourceMap.SourceMapGenerator, "function"); 22 | assert.equal(typeof sourceMap.SourceMapConsumer, "function"); 23 | assert.equal(typeof sourceMap.SourceNode, "function"); 24 | }; 25 | 26 | }); 27 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Compressed = require('./lib/compress'); 7 | var Identity = require('./lib/identity'); 8 | 9 | /** 10 | * Stringfy the given AST `node`. 11 | * 12 | * Options: 13 | * 14 | * - `compress` space-optimized output 15 | * - `sourcemap` return an object with `.code` and `.map` 16 | * 17 | * @param {Object} node 18 | * @param {Object} [options] 19 | * @return {String} 20 | * @api public 21 | */ 22 | 23 | module.exports = function(node, options){ 24 | options = options || {}; 25 | 26 | var compiler = options.compress 27 | ? new Compressed(options) 28 | : new Identity(options); 29 | 30 | // source maps 31 | if (options.sourcemap) { 32 | var sourcemaps = require('./lib/source-map-support'); 33 | sourcemaps(compiler); 34 | 35 | var code = compiler.compile(node); 36 | return { code: code, map: compiler.map.toJSON() }; 37 | } 38 | 39 | var code = compiler.compile(node); 40 | return code; 41 | }; 42 | 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Daniel Erickson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/color-parser/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "color-parser", 3 | "repo": "component/color-parser", 4 | "description": "CSS color string parser", 5 | "version": "0.1.0", 6 | "keywords": [ 7 | "color", 8 | "parse", 9 | "parser", 10 | "css" 11 | ], 12 | "dependencies": {}, 13 | "devDependencies": { 14 | "mocha": "*", 15 | "should": "*" 16 | }, 17 | "component": { 18 | "scripts": { 19 | "color-parser/index.js": "index.js", 20 | "color-parser/colors.js": "colors.js" 21 | } 22 | }, 23 | "readme": "\n# color-parser\n\n CSS color string parser\n\n## Installation\n\n $ component install component/color-parser\n\n### Example\n\n```js\nvar parse = require('color-parser');\n\nparse('#fc0')\n// => { r: 255, g: 204, b: 0, a: 1 }\n\nparse('#ffcc00')\n// => { r: 255, g: 204, b: 0, a: 1 }\n\nparse('rgb(255, 204, 0)')\n// => { r: 255, g: 204, b: 0, a: 1 }\n\nparse('rgba(255, 204, 0, 1)')\n// => { r: 255, g: 204, b: 0, a: 1 }\n```\n\n# License\n\n MIT\n", 24 | "readmeFilename": "Readme.md", 25 | "_id": "color-parser@0.1.0", 26 | "_from": "color-parser@0.1.0" 27 | } 28 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012 TJ Holowaychuk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/lib/plugins/inline.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var func = require('./function'); 7 | var path = require('path'); 8 | var mime = require('mime'); 9 | var fs = require('fs'); 10 | var read = fs.readFileSync; 11 | var exists = fs.existsSync; 12 | 13 | /** 14 | * Inline images and fonts. 15 | * 16 | * .logo { 17 | * background: inline(icons/logo.png); 18 | * } 19 | * 20 | * yields: 21 | * 22 | * .logo { 23 | * background: url("data:image/png;base64,iVBORw0…"); 24 | * } 25 | * 26 | */ 27 | 28 | module.exports = function(dirs) { 29 | if (!Array.isArray(dirs)) { 30 | dirs = Array.prototype.slice.call(arguments); 31 | } 32 | 33 | function inline(filename){ 34 | var file = dirs.map(function(dir) { 35 | return path.join(dir, filename); 36 | }).filter(exists)[0]; 37 | 38 | if (!file) throw new Error('inline(): failed to find "' + filename + '"'); 39 | 40 | var type = mime.lookup(file); 41 | var base64 = new Buffer(read(file)).toString('base64'); 42 | return 'url("data:' + type + ';base64,' + base64 + '")'; 43 | } 44 | 45 | return func({ inline: inline }); 46 | }; 47 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012 TJ Holowaychuk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/mime/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Benjamin Thomas, Robert Kieffer 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/test/source-map/test-base64.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var base64 = require('../../lib/source-map/base64'); 13 | 14 | exports['test out of range encoding'] = function (assert, util) { 15 | assert.throws(function () { 16 | base64.encode(-1); 17 | }); 18 | assert.throws(function () { 19 | base64.encode(64); 20 | }); 21 | }; 22 | 23 | exports['test out of range decoding'] = function (assert, util) { 24 | assert.throws(function () { 25 | base64.decode('='); 26 | }); 27 | }; 28 | 29 | exports['test normal encoding and decoding'] = function (assert, util) { 30 | for (var i = 0; i < 64; i++) { 31 | assert.equal(base64.decode(base64.encode(i)), i); 32 | } 33 | }; 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/convert-source-map/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013 Thorsten Lorenz. 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /less.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | , events = require('events') 3 | , resrc = require('resrcify/custom').resrc 4 | , regexp = /url\([\"\'](.*?)[\"\']\)/g 5 | , res 6 | , assetsConfig 7 | 8 | var ctor = module.exports = function (opts, cb) { 9 | assetsConfig = opts.assets 10 | if (assetsConfig) { 11 | // Add default error handler 12 | assetsConfig.onError = assetsConfig.onError || onError 13 | } 14 | 15 | if(opts.bower) { 16 | less = require('bower-less/less') 17 | } else { 18 | less = require('npm-less/less') 19 | } 20 | 21 | less(path.resolve(process.cwd(), opts.entry), {preprocess: preprocess, paths: opts.paths}, function (err, output) { 22 | if (err) return process.nextTick(function () { cb(err) }) 23 | 24 | process.nextTick(function() { cb(null, output.toCSS(opts)) }) 25 | }) 26 | } 27 | 28 | ctor.emitter = new events.EventEmitter() 29 | 30 | function preprocess (file, src) { 31 | ctor.emitter.emit('file', file) 32 | 33 | if (!assetsConfig) return src 34 | 35 | while ((res = regexp.exec(src)) !== null) { 36 | src = src.replace(res[1], resrc(res[1], file, assetsConfig)) 37 | } 38 | 39 | return src 40 | } 41 | 42 | function onError(err) { 43 | console.error('asset not copied:', err.path) 44 | } 45 | 46 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/child/node_modules/grandchild/node_modules/rework-math/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var visit = require('rework-visit'); 6 | 7 | module.exports = function() { 8 | function substitute(decl) { 9 | // grab math(...) value 10 | var math = decl.value.split('math(')[1]; 11 | // find the closing bracket 12 | math = math.slice(0, math.lastIndexOf(')')); 13 | // get the trailing unit or just add nothing 14 | var unit = (math.match(/%|in|cm|mm|em|ex|pt|pc|px/g, '')) ? math.match(/%|in|cm|mm|em|ex|pt|pc|px/g, '')[0] : ''; 15 | 16 | math = math.replace(/%|in|cm|mm|em|ex|pt|pc|px/g, ''); 17 | // do some ev[i|a]l 18 | var sum = eval(math); 19 | if (sum) { 20 | return sum + unit; 21 | } else { 22 | // log the error 23 | var error = { 24 | "declaration": decl, 25 | "preEval": math, 26 | "postEval": sum, 27 | "unit": unit 28 | }; 29 | throw new Error('error'); 30 | } 31 | } 32 | 33 | return function math(style) { 34 | visit(style, function(declarations, node) { 35 | declarations.forEach(function(decl) { 36 | if (!decl.value || !decl.value.match(/\bmath\(/)) { 37 | return; 38 | } 39 | decl.value = substitute(decl); 40 | }); 41 | }); 42 | }; 43 | }; 44 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/node_modules/amdefine/intercept.js: -------------------------------------------------------------------------------- 1 | /*jshint node: true */ 2 | var inserted, 3 | Module = require('module'), 4 | fs = require('fs'), 5 | existingExtFn = Module._extensions['.js'], 6 | amdefineRegExp = /amdefine\.js/; 7 | 8 | inserted = "if (typeof define !== 'function') {var define = require('amdefine')(module)}"; 9 | 10 | //From the node/lib/module.js source: 11 | function stripBOM(content) { 12 | // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) 13 | // because the buffer-to-string conversion in `fs.readFileSync()` 14 | // translates it to FEFF, the UTF-16 BOM. 15 | if (content.charCodeAt(0) === 0xFEFF) { 16 | content = content.slice(1); 17 | } 18 | return content; 19 | } 20 | 21 | //Also adapted from the node/lib/module.js source: 22 | function intercept(module, filename) { 23 | var content = stripBOM(fs.readFileSync(filename, 'utf8')); 24 | 25 | if (!amdefineRegExp.test(module.id)) { 26 | content = inserted + content; 27 | } 28 | 29 | module._compile(content, filename); 30 | } 31 | 32 | intercept._id = 'amdefine/intercept'; 33 | 34 | if (!existingExtFn._id || existingExtFn._id !== intercept._id) { 35 | Module._extensions['.js'] = intercept; 36 | } 37 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/lib/plugins/references.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var visit = require('../visit'); 7 | 8 | /** 9 | * Provide property reference support. 10 | * 11 | * button { 12 | * width: 50px; 13 | * height: @width; 14 | * line-height: @height; 15 | * } 16 | * 17 | * yields: 18 | * 19 | * button { 20 | * width: 50px; 21 | * height: 50px; 22 | * line-height: 50px; 23 | * } 24 | * 25 | */ 26 | 27 | module.exports = function() { 28 | return function(style){ 29 | visit.declarations(style, substitute); 30 | } 31 | }; 32 | 33 | /** 34 | * Substitute easing functions. 35 | * 36 | * @api private 37 | */ 38 | 39 | function substitute(declarations) { 40 | var map = {}; 41 | 42 | for (var i = 0, len = declarations.length; i < len; ++i) { 43 | var decl = declarations[i]; 44 | var key = decl.property; 45 | var val = decl.value; 46 | 47 | if ('comment' == decl.type) continue; 48 | 49 | decl.value = val.replace(/@([-\w]+)/g, function(_, name){ 50 | // TODO: fix this problem for real with visionmedia/css-value 51 | if ('2x' == name) return '@' + name; 52 | if (null == map[name]) throw new Error('@' + name + ' is not defined in this scope'); 53 | return map[name]; 54 | }); 55 | 56 | map[key] = decl.value; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/lib/source-map/base64.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var charToIntMap = {}; 13 | var intToCharMap = {}; 14 | 15 | 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' 16 | .split('') 17 | .forEach(function (ch, index) { 18 | charToIntMap[ch] = index; 19 | intToCharMap[index] = ch; 20 | }); 21 | 22 | /** 23 | * Encode an integer in the range of 0 to 63 to a single base 64 digit. 24 | */ 25 | exports.encode = function base64_encode(aNumber) { 26 | if (aNumber in intToCharMap) { 27 | return intToCharMap[aNumber]; 28 | } 29 | throw new TypeError("Must be between 0 and 63: " + aNumber); 30 | }; 31 | 32 | /** 33 | * Decode a single base 64 digit to an integer. 34 | */ 35 | exports.decode = function base64_decode(aChar) { 36 | if (aChar in charToIntMap) { 37 | return charToIntMap[aChar]; 38 | } 39 | throw new TypeError("Not a valid base 64 digit: " + aChar); 40 | }; 41 | 42 | }); 43 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/hsb2rgb/src/hsb2rgb.js: -------------------------------------------------------------------------------- 1 | 2 | function hsb2rgb(hue, saturation, value) { 3 | hue = (parseInt(hue, 10) || 0) % 360; 4 | 5 | saturation = /%/.test(saturation) 6 | ? parseInt(saturation, 10) / 100 7 | : parseFloat(saturation, 10); 8 | 9 | value = /%/.test(value) 10 | ? parseInt(value, 10) / 100 11 | : parseFloat(value, 10); 12 | 13 | saturation = Math.max(0, Math.min(saturation, 1)); 14 | value = Math.max(0, Math.min(value, 1)); 15 | 16 | var rgb; 17 | if (saturation === 0) { 18 | return [ 19 | Math.round(255 * value), 20 | Math.round(255 * value), 21 | Math.round(255 * value) 22 | ]; 23 | } 24 | 25 | var side = hue / 60; 26 | var chroma = value * saturation; 27 | var x = chroma * (1 - Math.abs(side % 2 - 1)); 28 | var match = value - chroma; 29 | 30 | switch (Math.floor(side)) { 31 | case 0: rgb = [ chroma, x, 0 ]; break; 32 | case 1: rgb = [ x, chroma, 0 ]; break; 33 | case 2: rgb = [ 0, chroma, x ]; break; 34 | case 3: rgb = [ 0, x, chroma ]; break; 35 | case 4: rgb = [ x, 0, chroma ]; break; 36 | case 5: rgb = [ chroma, 0, x ]; break; 37 | default: rgb = [ 0, 0, 0 ]; 38 | } 39 | 40 | rgb[0] = Math.round(255 * (rgb[0] + match)); 41 | rgb[1] = Math.round(255 * (rgb[1] + match)); 42 | rgb[2] = Math.round(255 * (rgb[2] + match)); 43 | 44 | return rgb; 45 | } 46 | 47 | 48 | module.exports = hsb2rgb; 49 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "atomify-css", 3 | "version": "3.3.6", 4 | "description": "Atomic CSS - Reusable front-end styling using Rework, plugins, and Node's resolve algorithm", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "tape test/*.js | tspec", 8 | "tdd": "nodemon -x npm -i node_modules/ -i test/fixtures/ -- test" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/atomify/atomify-css.git" 13 | }, 14 | "keywords": [ 15 | "atomic", 16 | "atomify", 17 | "browser", 18 | "css", 19 | "less", 20 | "rework" 21 | ], 22 | "contributors": [ 23 | "Daniel Erickson (http://techwraith.com/)", 24 | "Ben Clinkinbeard (http://benclinkinbeard.com/)" 25 | ], 26 | "license": "MIT", 27 | "dependencies": { 28 | "autoprefixer-core": "^5.1.7", 29 | "bower-less": "^0.0.1", 30 | "mkdirp": "^0.5.0", 31 | "npm-less": "^1.0.0", 32 | "package-lookup": "^0.1.2", 33 | "postcss": "^4.1.11", 34 | "resolve": "^1.1.0", 35 | "resrcify": "^1.0.1", 36 | "rework": "^1.0.0", 37 | "rework-assets": "^1.1.0", 38 | "rework-bower": "^0.0.1", 39 | "rework-npm": "^1.0.0", 40 | "rework-vars": "^3.1.1", 41 | "write-to-path": "^1.0.0" 42 | }, 43 | "devDependencies": { 44 | "eslint": "^0.21.2", 45 | "nodemon": "^1.3.7", 46 | "rework-plugin-inline": "^1.0.1", 47 | "sane-scaffold": "^1.0.5", 48 | "tap-spec": "^0.1.5", 49 | "tape": "^2.5.0" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/build/assert-shim.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | define('test/source-map/assert', ['exports'], function (exports) { 8 | 9 | let do_throw = function (msg) { 10 | throw new Error(msg); 11 | }; 12 | 13 | exports.init = function (throw_fn) { 14 | do_throw = throw_fn; 15 | }; 16 | 17 | exports.doesNotThrow = function (fn) { 18 | try { 19 | fn(); 20 | } 21 | catch (e) { 22 | do_throw(e.message); 23 | } 24 | }; 25 | 26 | exports.equal = function (actual, expected, msg) { 27 | msg = msg || String(actual) + ' != ' + String(expected); 28 | if (actual != expected) { 29 | do_throw(msg); 30 | } 31 | }; 32 | 33 | exports.ok = function (val, msg) { 34 | msg = msg || String(val) + ' is falsey'; 35 | if (!Boolean(val)) { 36 | do_throw(msg); 37 | } 38 | }; 39 | 40 | exports.strictEqual = function (actual, expected, msg) { 41 | msg = msg || String(actual) + ' !== ' + String(expected); 42 | if (actual !== expected) { 43 | do_throw(msg); 44 | } 45 | }; 46 | 47 | exports.throws = function (fn) { 48 | try { 49 | fn(); 50 | do_throw('Expected an error to be thrown, but it wasn\'t.'); 51 | } 52 | catch (e) { 53 | } 54 | }; 55 | 56 | }); 57 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/lib/plugins/mixin.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var visit = require('../visit'); 7 | 8 | /** 9 | * Define custom mixins. 10 | */ 11 | 12 | module.exports = function(mixins) { 13 | if (!mixins) throw new Error('mixins object required'); 14 | return function(style, rework){ 15 | visit.declarations(style, function(declarations){ 16 | mixin(rework, declarations, mixins); 17 | }); 18 | } 19 | }; 20 | 21 | /** 22 | * Visit declarations and apply mixins. 23 | * 24 | * @param {Rework} rework 25 | * @param {Array} declarations 26 | * @param {Object} mixins 27 | * @api private 28 | */ 29 | 30 | function mixin(rework, declarations, mixins) { 31 | for (var i = 0; i < declarations.length; ++i) { 32 | var decl = declarations[i]; 33 | if ('comment' == decl.type) continue; 34 | 35 | var key = decl.property; 36 | var val = decl.value; 37 | var fn = mixins[key]; 38 | if (!fn) continue; 39 | 40 | // invoke mixin 41 | var ret = fn.call(rework, val); 42 | 43 | // apply properties 44 | for (var key in ret) { 45 | var val = ret[key]; 46 | if (Array.isArray(val)) { 47 | val.forEach(function(val){ 48 | declarations.splice(i++, 0, { 49 | type: 'declaration', 50 | property: key, 51 | value: val 52 | }); 53 | }); 54 | } else { 55 | declarations.splice(i++, 0, { 56 | type: 'declaration', 57 | property: key, 58 | value: val 59 | }); 60 | } 61 | } 62 | 63 | // remove original 64 | declarations.splice(i--, 1); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2009-2011, Mozilla Foundation and contributors 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | * Neither the names of the Mozilla Foundation nor the names of project 16 | contributors may be used to endorse or promote products derived from this 17 | software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/test/run-tests.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /* -*- Mode: js; js-indent-level: 2; -*- */ 3 | /* 4 | * Copyright 2011 Mozilla Foundation and contributors 5 | * Licensed under the New BSD license. See LICENSE or: 6 | * http://opensource.org/licenses/BSD-3-Clause 7 | */ 8 | var assert = require('assert'); 9 | var fs = require('fs'); 10 | var path = require('path'); 11 | var util = require('./source-map/util'); 12 | 13 | function run(tests) { 14 | var total = 0; 15 | var passed = 0; 16 | 17 | for (var i = 0; i < tests.length; i++) { 18 | for (var k in tests[i].testCase) { 19 | if (/^test/.test(k)) { 20 | total++; 21 | try { 22 | tests[i].testCase[k](assert, util); 23 | passed++; 24 | } 25 | catch (e) { 26 | console.log('FAILED ' + tests[i].name + ': ' + k + '!'); 27 | console.log(e.stack); 28 | } 29 | } 30 | } 31 | } 32 | 33 | console.log(''); 34 | console.log(passed + ' / ' + total + ' tests passed.'); 35 | console.log(''); 36 | 37 | return total - passed; 38 | } 39 | 40 | function isTestFile(f) { 41 | var testToRun = process.argv[2]; 42 | return testToRun 43 | ? path.basename(testToRun) === f 44 | : /^test\-.*?\.js/.test(f); 45 | } 46 | 47 | function toModule(f) { 48 | return './source-map/' + f.replace(/\.js$/, ''); 49 | } 50 | 51 | var requires = fs.readdirSync(path.join(__dirname, 'source-map')) 52 | .filter(isTestFile) 53 | .map(toModule); 54 | 55 | var code = run(requires.map(require).map(function (mod, i) { 56 | return { 57 | name: requires[i], 58 | testCase: mod 59 | }; 60 | })); 61 | 62 | process.exit(code); 63 | -------------------------------------------------------------------------------- /.jscsrc: -------------------------------------------------------------------------------- 1 | { 2 | "requireCurlyBraces": ["for", "while", "do", "try", "catch"], 3 | "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return"], 4 | "requireParenthesesAroundIIFE": true, 5 | "disallowSpacesInFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, 6 | "requireMultipleVarDecl": true, 7 | "disallowSpacesInsideObjectBrackets": true, 8 | "disallowSpacesInsideArrayBrackets": true, 9 | "disallowSpacesInsideParentheses": true, 10 | "disallowSpaceAfterObjectKeys": true, 11 | "disallowCommaBeforeLineBreak": true, 12 | "disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], 13 | "requireRightStickedOperators": ["!"], 14 | "disallowRightStickedOperators": ["?", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], 15 | "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], 16 | "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], 17 | "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~"], 18 | "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], 19 | "requireCamelCaseOrUpperCaseIdentifiers": true, 20 | "disallowKeywords": ["with"], 21 | "disallowMultipleLineBreaks": true, 22 | "validateLineBreaks": "LF", 23 | "validateQuoteMarks": "'", 24 | "disallowTrailingWhitespace": true, 25 | "disallowKeywordsOnNewLine": [], 26 | "requireKeywordsOnNewLine": ["else"], 27 | "requireLineFeedAtFileEnd": true, 28 | "maximumLineLength": 120, 29 | "requireDotNotation": true, 30 | "safeContextKeyword": "self", 31 | "excludeFiles": ["node_modules/**", "bower_components/**"] 32 | } 33 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.4.1 / 2013-12-09 3 | ================== 4 | 5 | * add missing files to component.json 6 | 7 | 1.4.0 / 2013-XX-XX 8 | ================== 9 | 10 | * add source map generation 11 | 12 | 1.3.2 / 2013-10-18 13 | ================== 14 | 15 | * fix whitespace and indentation in the Compressed compiler. 16 | * add @namespace support 17 | * add .stylesheet(node) 18 | 19 | 1.3.1 / 2013-06-02 20 | ================== 21 | 22 | * fix output of rules with no declarations for Identity compiler 23 | * fix defaulting of options 24 | 25 | 1.3.0 / 2013-05-28 26 | ================== 27 | 28 | * add ignoring of empty rulesets. Closes #7 29 | * add separate compilers 30 | * add @supports support 31 | * add @page compilation support 32 | * fix comment output. Closes #16 33 | * fix trailing ; with comments within rules 34 | * fix comment indentation 35 | 36 | 1.2.0 / 2013-05-21 37 | ================== 38 | 39 | * add @document compilation. Closes #82 40 | 41 | 1.1.0 / 2013-03-19 42 | ================== 43 | 44 | * add omission of comments when compressed 45 | * add comment support 46 | 47 | 1.0.5 / 2013-03-15 48 | ================== 49 | 50 | * fix indentation of multiple selectors in @media. Closes #11 51 | 52 | 1.0.4 / 2012-11-15 53 | ================== 54 | 55 | * fix indentation 56 | 57 | 1.0.3 / 2012-09-04 58 | ================== 59 | 60 | * add __@charset__ support [rstacruz] 61 | 62 | 1.0.2 / 2012-09-01 63 | ================== 64 | 65 | * add component support 66 | 67 | 1.0.1 / 2012-07-26 68 | ================== 69 | 70 | * add "selectors" array support 71 | 72 | 0.0.1 / 2010-01-03 73 | ================== 74 | 75 | * Initial release 76 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/test/source-map/test-binary-search.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var binarySearch = require('../../lib/source-map/binary-search'); 13 | 14 | function numberCompare(a, b) { 15 | return a - b; 16 | } 17 | 18 | exports['test too high'] = function (assert, util) { 19 | var needle = 30; 20 | var haystack = [2,4,6,8,10,12,14,16,18,20]; 21 | 22 | assert.doesNotThrow(function () { 23 | binarySearch.search(needle, haystack, numberCompare); 24 | }); 25 | 26 | assert.equal(binarySearch.search(needle, haystack, numberCompare), 20); 27 | }; 28 | 29 | exports['test too low'] = function (assert, util) { 30 | var needle = 1; 31 | var haystack = [2,4,6,8,10,12,14,16,18,20]; 32 | 33 | assert.doesNotThrow(function () { 34 | binarySearch.search(needle, haystack, numberCompare); 35 | }); 36 | 37 | assert.equal(binarySearch.search(needle, haystack, numberCompare), null); 38 | }; 39 | 40 | exports['test exact search'] = function (assert, util) { 41 | var needle = 4; 42 | var haystack = [2,4,6,8,10,12,14,16,18,20]; 43 | 44 | assert.equal(binarySearch.search(needle, haystack, numberCompare), 4); 45 | }; 46 | 47 | exports['test fuzzy search'] = function (assert, util) { 48 | var needle = 19; 49 | var haystack = [2,4,6,8,10,12,14,16,18,20]; 50 | 51 | assert.equal(binarySearch.search(needle, haystack, numberCompare), 18); 52 | }; 53 | 54 | }); 55 | -------------------------------------------------------------------------------- /test/fixtures/css/bundle-with-inline.css: -------------------------------------------------------------------------------- 1 | .foo { 2 | background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAASCAYAAADMgVnKAAAFSElEQVR4nO1Ya0wUVxg9c2f2JYvI7goUaEBdrO4WWWQpb8HI1oLBSklKRGtbrNiQ/rLFV6xJk/qjsWmINWlJlS4Uq020JtVQ30AVWSNpRQ0Biq20JFVhocI+ZufZHwRTYF0hYsTE82vud0++7+Tk3DuZofLz82XMEORtuf+0JUwZ5GkLeNbx3MDHxHMDHxPTaqBarZ7Odk8UCkYzLX0eaqDVaoXdbp90I4ZhUFdX92B9/Phxvzy73Q6r1Tp5hU8AhDAozfhpeno9bINlWTfHcexkG/E8L0dGRtaPriVJEv3xOI7zsSzrnprM6YUg8PLCJeH1j2Y+GkygzdDQUEVNTQ2USiVcLhc2b94Mm82GoqIilJWVARhJ1P79+9Ha2krdvXs3v7CwcEwPQgiqqqqg1WrB8zw0Gg0DQJiMuBhDGmymjyFKPjC0Giw/hEOOdZAkAUXWrxCiiQZFUeAEN767XIwYfQpWmHZBknkwRIXGjs/Bi54Jte57DdTvN/vyv25YgRhDGl417QYvsaCJAqLIobblTeiDjCiw7AUvuhGiicLt/ss42bZtgsaAdyAhBAkJCY1Go/Gc2+32lJSUyB6Px+Xz+byjnP8nyl/q1q5dK7Ms6zUajWctFksTTdPUZMwDgH/7fG4iq6WcvPim+OQXTw8P8mxy7DsyAJR+sPrXlGzjeWvm/HOUMEuYG7wQUUHLuFvdfw7lFiRdXJoee7ap5eSAvxoACJwsjs6gZKW0PD/hF2vm/HMel+ibZ8iSTWFvCI2NF+6sLExqvt3T4z70Q/Vf/jQGTKDT6eQsFksOAHR2djojIiKonp6eMRyKCuxHZGQk297e7k5OTrbJsiz39/dP+loAAOdAn2/DTuMyigLV1X2jPzQsWtYFxWqOVB1ZKskiJFnELE2w7HPRbOWxHb3r8z8JPX/itywvN4iTbVtReWBH9/iay9c3Zka/s8/31vZ5WYRQlMs17PYOKoQfm2oHtm06GJWa7ohghwnLB7eHAPQEfQETaDAYVISMUMxmc3BHR4fb4/FIQUFBNDCSUL1erwjUo6ury7148eLZAEDTNKXX61VTMVCnM6homqEAwGxKmN39R7v7lZj3pba2mwMFxaktJaW2q5IoyZIgy8k23YKaEzsHMnIXNVxva3dmL9wq+atNMIFQhJCRJBAaRBRkOcqo0judA741JemONRusV3URZLY/fQETODw8LNjtdqVCoYDT6ZRqa2tZtVpNysvL5bq6OoiiCI/H4/dlMYrq6mpvXl6e9vDhw+A4Dl6vNyB/PCRRlN9OPwqaKNHX5xQb2g6wHbeSej98b1/06WM30kSJh5f18ACQumAjVbqnIE6WpTiBJ8KX31b8/VrBxpjxtVAzYsYM8XOI5s6JYQyGuczZY12phDDovHMGjR17J/AeaqDD4RBMJlMLTdOMKIqCSqXSxMfHpwNAYmJikyRJEiGE8DzPmc3mFK1Wi/Dw8PrMzMwCAA+edTpddFpa2iWO43wMwyg4jvON8ieDgUEnt6o48YrPK/IhBuWsdR/Fpd/rvT60JCX6jDZEoVYoCX3fyXnWV8RlOK5e7nWcquimaYrieUl8fVNs0sHvr0yoARoYXzbUb6+yFHT1NguVeyyt7+56KRsA1pdnX0tdGWb8tKw5KDF1wSkJHjrZkhWyr/KbJH9+UTP5Z0KIvNRtW7KNOXqjeErHfjowj9/yT87yZS+IEgeaUsuffbG7Myzl2qLxvBn9KdfV2yysKrY4nsbs2p8rhjJyFzXkrrZcTMkxXvDOuWTwx5vRCXwWMKMT+CzguYGPif8AIYRtNxfgH5EAAAAASUVORK5CYIIK"); 3 | } 4 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var css = require('./css') 4 | , less = require('./less') 5 | , fs = require('fs') 6 | , path = require('path') 7 | , mkdirp = require('mkdirp') 8 | , writer = require('write-to-path') 9 | , autoprefixer = require('autoprefixer-core') 10 | , postcss = require('postcss') 11 | 12 | module.exports = function atomifyCSS (opts, cb) { 13 | if (typeof opts === 'string') opts = {entry: opts} 14 | if (typeof cb === 'string') opts.output = cb 15 | if (opts.entry) opts.entries = [opts.entry] 16 | 17 | if (opts.entry && opts.entry.substr(-4) === 'less') { 18 | less(opts, complete) 19 | } 20 | else { 21 | css(opts, complete) 22 | } 23 | 24 | function complete (err, src) { 25 | var outputPath 26 | , outputDir 27 | , writeFile 28 | , _cb 29 | 30 | if (opts.transform && !err) src = opts.transform(src) 31 | if (opts.autoprefixer && !err) { 32 | try { 33 | src = postcss([autoprefixer(typeof opts.autoprefixer === 'object' ? opts.autoprefixer : null)]) 34 | .process(src).css 35 | } 36 | catch (e){ 37 | err = e 38 | } 39 | } 40 | if (opts.output) { 41 | // we definitely have to write the file 42 | outputPath = path.resolve(process.cwd(), opts.output) 43 | outputDir = path.dirname(outputPath) 44 | writeFile = writer(outputPath, {debug: opts.debug}) 45 | 46 | if (!fs.existsSync(outputDir)) mkdirp.sync(outputDir) 47 | 48 | // we might need to call a callback also 49 | if (typeof cb === 'function') { 50 | _cb = cb 51 | cb = function callbackWrapper (wrapperErr, wrapperSrc) { 52 | if (wrapperErr) return _cb(wrapperErr) 53 | 54 | writeFile(null, wrapperSrc) 55 | _cb(null, wrapperSrc) 56 | } 57 | } 58 | else { 59 | cb = writeFile 60 | } 61 | } 62 | 63 | cb(err, src) 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/color-parser/test/index.js: -------------------------------------------------------------------------------- 1 | 2 | var parse = require('..'); 3 | 4 | describe('named', function(){ 5 | it('should parse', function(){ 6 | parse('blue').r.should.equal(0); 7 | parse('blue').g.should.equal(0); 8 | parse('blue').b.should.equal(255); 9 | }) 10 | 11 | it('should parse case insensitive', function(){ 12 | parse('Blue').r.should.equal(0); 13 | parse('BLUE').g.should.equal(0); 14 | parse('Blue').b.should.equal(255); 15 | }) 16 | }) 17 | 18 | describe('#RGB', function(){ 19 | it('should parse', function(){ 20 | parse('#fc0').r.should.equal(255); 21 | parse('#fc0').g.should.equal(204); 22 | parse('#fc0').b.should.equal(0); 23 | parse('#fc0').a.should.equal(1); 24 | }) 25 | }) 26 | 27 | describe('#RRGGBB', function(){ 28 | it('should parse', function(){ 29 | parse('#ffcc00').r.should.equal(255); 30 | parse('#ffcc00').g.should.equal(204); 31 | parse('#ffcc00').b.should.equal(0); 32 | parse('#ffcc00').a.should.equal(1); 33 | }) 34 | }) 35 | 36 | describe('rgb(n, n, n)', function(){ 37 | it('should parse', function(){ 38 | parse('rgb(255, 204, 0)').r.should.equal(255); 39 | parse('rgb(255, 204, 0)').g.should.equal(204); 40 | parse('rgb(255, 204, 0)').b.should.equal(0); 41 | parse('rgb(255, 204, 0)').a.should.equal(1); 42 | }) 43 | }) 44 | 45 | describe('rgba(n, n, n, n)', function(){ 46 | it('should parse', function(){ 47 | parse('rgba(255, 204, 0, 1)').r.should.equal(255); 48 | parse('rgba(255, 204, 0, 1)').g.should.equal(204); 49 | parse('rgba(255, 204, 0, 1)').b.should.equal(0); 50 | parse('rgba(255, 204, 0, 1)').a.should.equal(1); 51 | }) 52 | 53 | it('should support floats', function(){ 54 | parse('rgba(0,0,0,0.5)').a.should.equal(0.5); 55 | parse('rgba(0,0,0,.5)').a.should.equal(0.5); 56 | parse('rgba(0,0,0,.75)').a.should.equal(0.75); 57 | }) 58 | }) -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/lib/plugins/colors.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var parse = require('color-parser'); 7 | var hsb2rgb = require('hsb2rgb'); 8 | var functions = require('./function'); 9 | 10 | /** 11 | * Provide color manipulation helpers. 12 | */ 13 | 14 | module.exports = function() { 15 | return functions({ 16 | 17 | /** 18 | * Converts RGBA(color, alpha) to the corrosponding RGBA(r, g, b, a) equivalent. 19 | * 20 | * background: rgba(#eee, .5) 21 | * background: rgba(white, .2) 22 | * 23 | */ 24 | 25 | rgba: function(color, alpha){ 26 | var args; 27 | if (2 == arguments.length) { 28 | var c = parse(color.trim()); 29 | args = [c.r, c.g, c.b, alpha]; 30 | } else { 31 | args = [].slice.call(arguments); 32 | } 33 | 34 | return 'rgba(' + args.join(', ') + ')'; 35 | }, 36 | 37 | /** 38 | * Converts HSV (HSB) color values to RGB. 39 | * Saturation and brightness can be expressed as floats or percentages. 40 | * 41 | * color: hsb(220, 45%, .3); 42 | * color: hsb(220deg, 0.45, 30%); 43 | * 44 | */ 45 | 46 | hsb: function (hue, saturation, value) { 47 | var rgb = hsb2rgb(hue, saturation, value); 48 | return 'rgb(' + rgb.join(', ') + ')'; 49 | }, 50 | 51 | 52 | /** 53 | * Converts HSV (HSB) color values with alpha specified to RGBa. 54 | * Saturation, brightness and alpha can be expressed as floats or 55 | * percentages. 56 | * 57 | * color: hsba(220, 45%, .3, .4); 58 | * color: hsba(220deg, 0.45, 30%, 40%); 59 | * 60 | */ 61 | 62 | hsba: function (hue, saturation, value, alpha) { 63 | alpha = /%/.test(alpha) 64 | ? parseInt(alpha, 10) / 100 65 | : parseFloat(alpha, 10); 66 | 67 | alpha = String(alpha).replace(/^0+\./, '.'); 68 | 69 | var rgb = hsb2rgb(hue, saturation, value); 70 | return 'rgba(' + rgb.join(', ') + ', ' + alpha + ')'; 71 | } 72 | }); 73 | }; 74 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rework-clone", 3 | "version": "0.1.0", 4 | "description": "Clone module for Rework", 5 | "main": "index.js", 6 | "peerDependencies": { 7 | "rework": ">= 0.18.x" 8 | }, 9 | "devDependencies": { 10 | "rework": ">= 0.18.x" 11 | }, 12 | "scripts": { 13 | "test": "node test" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git://github.com/isquariel/rework-clone.git" 18 | }, 19 | "keywords": [ 20 | "rework", 21 | "css", 22 | "clone", 23 | "copy", 24 | "inherit" 25 | ], 26 | "author": { 27 | "name": "isquariel", 28 | "email": "tavsophi@gmail.com", 29 | "url": "https://github.com/isquariel" 30 | }, 31 | "license": "MIT", 32 | "bugs": { 33 | "url": "https://github.com/isquariel/rework-clone/issues" 34 | }, 35 | "readme": "# rework-clone\n\n[![Build Status](https://travis-ci.org/Isquariel/rework-clone.png?branch=master)](https://travis-ci.org/Isquariel/rework-clone)\n\nThis module clones properties from one rule set to another, unlike\n[rework-inherit](https://github.com/reworkcss/rework-inherit) (rework.extend())\nwhich concatenates the selectors.\n\nDon’t copy anything and everything! Think when you need to inherit and when to\nclone.\n\n## Example\n\n```css\n.a {\n background: red\n}\n.b {\n clone: .a;\n}\n```\n\nyields:\n\n```css\n.a {\n background: red;\n}\n.b {\n background: red;\n}\n```\n\n## Usage\n\n```js\nvar clone = require('rework-clone');\n\nvar css = rework(inputCSS)\n .use(clone(options))\n .toString();\n```\n\n### Options\n\nThis is only one option: `regexp` to replace.\n\n```js\nvar css = rework(inputCSS)\n .use(clone({regexp: /^foo?$/}))\n .toString();\n```\n\nIt will work with all `foo` properties.\n\n## License\n\nMIT\n", 36 | "readmeFilename": "README.md", 37 | "homepage": "https://github.com/isquariel/rework-clone", 38 | "_id": "rework-clone@0.1.0", 39 | "dist": { 40 | "shasum": "62b399dbbb0302281ddbb74f59a218a51df43e85" 41 | }, 42 | "_from": "rework-clone@", 43 | "_resolved": "https://registry.npmjs.org/rework-clone/-/rework-clone-0.1.0.tgz" 44 | } 45 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/lib/source-map-support.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var SourceMap = require('source-map').SourceMapGenerator; 7 | 8 | /** 9 | * Expose `mixin()`. 10 | */ 11 | 12 | module.exports = mixin; 13 | 14 | /** 15 | * Mixin source map support into `compiler`. 16 | * 17 | * @param {Compiler} compiler 18 | * @api public 19 | */ 20 | 21 | function mixin(compiler) { 22 | var file = compiler.options.filename || 'generated.css'; 23 | compiler.map = new SourceMap({ file: file }); 24 | compiler.position = { line: 1, column: 1 }; 25 | for (var k in exports) compiler[k] = exports[k]; 26 | } 27 | 28 | /** 29 | * Update position. 30 | * 31 | * @param {String} str 32 | * @api private 33 | */ 34 | 35 | exports.updatePosition = function(str) { 36 | var lines = str.match(/\n/g); 37 | if (lines) this.position.line += lines.length; 38 | var i = str.lastIndexOf('\n'); 39 | this.position.column = ~i ? str.length - i : this.position.column + str.length; 40 | }; 41 | 42 | /** 43 | * Emit `str`. 44 | * 45 | * @param {String} str 46 | * @param {Number} [pos] 47 | * @param {Boolean} [startOnly] 48 | * @return {String} 49 | * @api private 50 | */ 51 | 52 | exports.emit = function(str, pos, startOnly) { 53 | if (pos && pos.start) { 54 | this.map.addMapping({ 55 | source: pos.source || 'source.css', 56 | generated: { 57 | line: this.position.line, 58 | column: Math.max(this.position.column - 1, 0) 59 | }, 60 | original: { 61 | line: pos.start.line, 62 | column: pos.start.column - 1 63 | } 64 | }); 65 | } 66 | 67 | this.updatePosition(str); 68 | 69 | if (!startOnly && pos && pos.end) { 70 | this.map.addMapping({ 71 | source: pos.source || 'source.css', 72 | generated: { 73 | line: this.position.line, 74 | column: Math.max(this.position.column - 1, 0) 75 | }, 76 | original: { 77 | line: pos.end.line, 78 | column: pos.end.column - 1 79 | } 80 | }); 81 | } 82 | 83 | return str; 84 | }; 85 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # css 3 | 4 | CSS parser / stringifier using [css-parse](https://github.com/visionmedia/css-parse) and [css-stringify](https://github.com/visionmedia/css-stringify). 5 | 6 | ## Installation 7 | 8 | $ npm install css 9 | 10 | ## Example 11 | 12 | js: 13 | 14 | ```js 15 | var css = require('css') 16 | var obj = css.parse('tobi { name: "tobi" }') 17 | css.stringify(obj); 18 | ``` 19 | 20 | object returned by `.parse()`: 21 | 22 | ```json 23 | { 24 | "stylesheet": { 25 | "rules": [ 26 | { 27 | "selector": "tobi", 28 | "declarations": [ 29 | { 30 | "property": "name", 31 | "value": "tobi" 32 | } 33 | ] 34 | } 35 | ] 36 | } 37 | } 38 | ``` 39 | 40 | string returned by `.stringify(ast)`: 41 | 42 | ```css 43 | tobi { 44 | name: tobi; 45 | } 46 | ``` 47 | 48 | string returned by `.stringify(ast, { compress: true })`: 49 | 50 | ```css 51 | tobi{name:tobi} 52 | ``` 53 | 54 | ## License 55 | 56 | (The MIT License) 57 | 58 | Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> 59 | 60 | Permission is hereby granted, free of charge, to any person obtaining 61 | a copy of this software and associated documentation files (the 62 | 'Software'), to deal in the Software without restriction, including 63 | without limitation the rights to use, copy, modify, merge, publish, 64 | distribute, sublicense, and/or sell copies of the Software, and to 65 | permit persons to whom the Software is furnished to do so, subject to 66 | the following conditions: 67 | 68 | The above copyright notice and this permission notice shall be 69 | included in all copies or substantial portions of the Software. 70 | 71 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 72 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 73 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 74 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 75 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 76 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 77 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 78 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/Readme.md: -------------------------------------------------------------------------------- 1 | # css-stringify [![Build Status](https://travis-ci.org/visionmedia/css-stringify.png)](https://travis-ci.org/visionmedia/css-stringify) 2 | 3 | CSS compiler using the AST provided by [css-parse](https://github.com/visionmedia/css-parse). 4 | 5 | ## API 6 | 7 | ### stringify(object, [options]) 8 | 9 | Accepts an AST `object` from css-parse and returns a CSS string. 10 | 11 | ```js 12 | var stringify = require('css-stringify'); 13 | var parse = require('css-parse'); 14 | 15 | var ast = parse('body { font-size: 12px; }'); 16 | var css = stringify(ast); 17 | ``` 18 | 19 | Optionally you may `compress` the output: 20 | 21 | ```js 22 | var css = stringify(ast, { compress: true }); 23 | ``` 24 | 25 | Or return a `sourcemap` along with the CSS output, 26 | which requires the use of the css-parse `position` option. 27 | 28 | ```js 29 | var ast = parse('body { font-size: 12px; }', { position: true }); 30 | var result = stringify(ast, { sourcemap: true }); 31 | 32 | result.code // string with CSS 33 | result.map // source map 34 | ``` 35 | 36 | ## Performance 37 | 38 | Formats 15,000 lines of CSS (2mb) in 23ms on my macbook air. 39 | 40 | ## License 41 | 42 | (The MIT License) 43 | 44 | Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> 45 | 46 | Permission is hereby granted, free of charge, to any person obtaining 47 | a copy of this software and associated documentation files (the 48 | 'Software'), to deal in the Software without restriction, including 49 | without limitation the rights to use, copy, modify, merge, publish, 50 | distribute, sublicense, and/or sell copies of the Software, and to 51 | permit persons to whom the Software is furnished to do so, subject to 52 | the following conditions: 53 | 54 | The above copyright notice and this permission notice shall be 55 | included in all copies or substantial portions of the Software. 56 | 57 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 58 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 59 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 60 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 61 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 62 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 63 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 64 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/mime/README.md: -------------------------------------------------------------------------------- 1 | # mime 2 | 3 | Comprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community. 4 | 5 | ## Install 6 | 7 | Install with [npm](http://github.com/isaacs/npm): 8 | 9 | npm install mime 10 | 11 | ## API - Queries 12 | 13 | ### mime.lookup(path) 14 | Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. 15 | 16 | var mime = require('mime'); 17 | 18 | mime.lookup('/path/to/file.txt'); // => 'text/plain' 19 | mime.lookup('file.txt'); // => 'text/plain' 20 | mime.lookup('.TXT'); // => 'text/plain' 21 | mime.lookup('htm'); // => 'text/html' 22 | 23 | ### mime.default_type 24 | Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) 25 | 26 | ### mime.extension(type) 27 | Get the default extension for `type` 28 | 29 | mime.extension('text/html'); // => 'html' 30 | mime.extension('application/octet-stream'); // => 'bin' 31 | 32 | ### mime.charsets.lookup() 33 | 34 | Map mime-type to charset 35 | 36 | mime.charsets.lookup('text/plain'); // => 'UTF-8' 37 | 38 | (The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) 39 | 40 | ## API - Defining Custom Types 41 | 42 | The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types). 43 | 44 | ### mime.define() 45 | 46 | Add custom mime/extension mappings 47 | 48 | mime.define({ 49 | 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], 50 | 'application/x-my-type': ['x-mt', 'x-mtt'], 51 | // etc ... 52 | }); 53 | 54 | mime.lookup('x-sft'); // => 'text/x-some-format' 55 | 56 | The first entry in the extensions array is returned by `mime.extension()`. E.g. 57 | 58 | mime.extension('text/x-some-format'); // => 'x-sf' 59 | 60 | ### mime.load(filepath) 61 | 62 | Load mappings from an Apache ".types" format file 63 | 64 | mime.load('./my_project.types'); 65 | 66 | The .types file format is simple - See the `types` dir for examples. 67 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/convert-source-map/test/map-file-comment.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | /*jshint asi: true */ 3 | 4 | var test = require('tap').test 5 | , rx = require('..') 6 | , fs = require('fs') 7 | , convert = require('..') 8 | 9 | test('\nresolving a "/*# sourceMappingURL=map-file-comment.css.map*/" style comment inside a given css content', function (t) { 10 | var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment.css', 'utf8') 11 | var conv = convert.fromMapFileSource(css, __dirname + '/fixtures'); 12 | var sm = conv.toObject(); 13 | 14 | t.deepEqual( 15 | sm.sources 16 | , [ './client/sass/core.scss', 17 | './client/sass/main.scss' ] 18 | , 'resolves paths of original sources' 19 | ) 20 | 21 | t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file') 22 | t.equal( 23 | sm.mappings 24 | , 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI' 25 | , 'includes mappings' 26 | ) 27 | t.end() 28 | }) 29 | 30 | test('\nresolving a "//# sourceMappingURL=map-file-comment.css.map" style comment inside a given css content', function (t) { 31 | var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment-double-slash.css', 'utf8') 32 | var conv = convert.fromMapFileSource(css, __dirname + '/fixtures'); 33 | var sm = conv.toObject(); 34 | 35 | t.deepEqual( 36 | sm.sources 37 | , [ './client/sass/core.scss', 38 | './client/sass/main.scss' ] 39 | , 'resolves paths of original sources' 40 | ) 41 | 42 | t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file') 43 | t.equal( 44 | sm.mappings 45 | , 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI' 46 | , 'includes mappings' 47 | ) 48 | t.end() 49 | }) 50 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/color-parser/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var colors = require('./colors'); 7 | 8 | /** 9 | * Expose `parse`. 10 | */ 11 | 12 | module.exports = parse; 13 | 14 | /** 15 | * Parse `str`. 16 | * 17 | * @param {String} str 18 | * @return {Object} 19 | * @api public 20 | */ 21 | 22 | function parse(str) { 23 | return named(str) 24 | || hex3(str) 25 | || hex6(str) 26 | || rgb(str) 27 | || rgba(str); 28 | } 29 | 30 | /** 31 | * Parse named css color `str`. 32 | * 33 | * @param {String} str 34 | * @return {Object} 35 | * @api private 36 | */ 37 | 38 | function named(str) { 39 | var c = colors[str.toLowerCase()]; 40 | if (!c) return; 41 | return { 42 | r: c[0], 43 | g: c[1], 44 | b: c[2] 45 | } 46 | } 47 | 48 | /** 49 | * Parse rgb(n, n, n) 50 | * 51 | * @param {String} str 52 | * @return {Object} 53 | * @api private 54 | */ 55 | 56 | function rgb(str) { 57 | if (0 == str.indexOf('rgb(')) { 58 | str = str.match(/rgb\(([^)]+)\)/)[1]; 59 | var parts = str.split(/ *, */).map(Number); 60 | return { 61 | r: parts[0], 62 | g: parts[1], 63 | b: parts[2], 64 | a: 1 65 | } 66 | } 67 | } 68 | 69 | /** 70 | * Parse rgba(n, n, n, n) 71 | * 72 | * @param {String} str 73 | * @return {Object} 74 | * @api private 75 | */ 76 | 77 | function rgba(str) { 78 | if (0 == str.indexOf('rgba(')) { 79 | str = str.match(/rgba\(([^)]+)\)/)[1]; 80 | var parts = str.split(/ *, */).map(Number); 81 | return { 82 | r: parts[0], 83 | g: parts[1], 84 | b: parts[2], 85 | a: parts[3] 86 | } 87 | } 88 | } 89 | 90 | /** 91 | * Parse #nnnnnn 92 | * 93 | * @param {String} str 94 | * @return {Object} 95 | * @api private 96 | */ 97 | 98 | function hex6(str) { 99 | if ('#' == str[0] && 7 == str.length) { 100 | return { 101 | r: parseInt(str.slice(1, 3), 16), 102 | g: parseInt(str.slice(3, 5), 16), 103 | b: parseInt(str.slice(5, 7), 16), 104 | a: 1 105 | } 106 | } 107 | } 108 | 109 | /** 110 | * Parse #nnn 111 | * 112 | * @param {String} str 113 | * @return {Object} 114 | * @api private 115 | */ 116 | 117 | function hex3(str) { 118 | if ('#' == str[0] && 4 == str.length) { 119 | return { 120 | r: parseInt(str[1] + str[1], 16), 121 | g: parseInt(str[2] + str[2], 16), 122 | b: parseInt(str[3] + str[3], 16), 123 | a: 1 124 | } 125 | } 126 | } 127 | 128 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/index.js: -------------------------------------------------------------------------------- 1 | exports = module.exports = function (options) { 2 | return function clone(style) { 3 | return Clone(style, options || {}); 4 | }; 5 | }; 6 | 7 | function Clone (style, options) { 8 | var regexp = options.regexp || /^(clone|copy)?$/i, 9 | rules = style.rules, 10 | doProcess = function(rule) { 11 | return process(rules, regexp, rule); 12 | }; 13 | rules = rules.map(function (rule) { 14 | if (rule.type === 'media') { 15 | rule.rules = rule.rules.map(doProcess); 16 | return rule; 17 | } 18 | if (rule.type === 'rule') { 19 | return doProcess(rule); 20 | } 21 | }); 22 | } 23 | 24 | function process (rules, regexp, rule) { 25 | var clones = getClones(regexp, rule.declarations); 26 | rule.declarations = getProperties(rules, clones) 27 | .concat(rule.declarations) 28 | .filter(function (dec) { 29 | return !regexp.test(dec.property); 30 | }); 31 | return rule; 32 | } 33 | 34 | function getClones (regexp, declarations) { 35 | return declarations.filter(function (dec) { 36 | return regexp.test(dec.property); 37 | }).map(function (dec) { 38 | return dec.value; 39 | }); 40 | } 41 | 42 | function cloneObject (obj) { 43 | var isArray = Array.isArray(obj), 44 | newObj = isArray ? [] : {}; 45 | if (isArray) { 46 | obj.forEach(function(item, index) { 47 | newObj[index] = item; 48 | }); 49 | } else { 50 | for (key in obj) { 51 | if (Object.prototype.hasOwnProperty.call(obj, key)) { 52 | if (Object.prototype.toString.call(obj[key]) === "[object Object]") { 53 | newObj[key] = cloneObject(obj[key]); 54 | } else { 55 | newObj[key] = obj[key]; 56 | } 57 | } 58 | } 59 | } 60 | return newObj; 61 | } 62 | 63 | function getProperties (rules, selectors) { 64 | var declarations = [], 65 | reg = /\s*\!important\s*$/; 66 | rules.filter(function (rule) { 67 | return rule.selectors && rule.selectors.length > 0; 68 | }).forEach(function (rule) { 69 | selectors.forEach(function (selector) { 70 | var important = false; 71 | if (reg.test(selector)) { 72 | important = true; 73 | selector = selector.replace(reg, ''); 74 | } 75 | if (rule.selectors.indexOf(selector) !== -1) { 76 | declarations = declarations.concat(rule.declarations.map(function (declaration) { 77 | declaration = cloneObject(declaration); 78 | if (important) { 79 | declaration.value = declaration.value + ' !important'; 80 | } 81 | return declaration; 82 | })); 83 | } 84 | }); 85 | }); 86 | return declarations; 87 | } 88 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/lib/plugins/function.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var visit = require('../visit'); 7 | var utils = require('../utils'); 8 | var strip = utils.stripQuotes; 9 | 10 | /** 11 | * Define custom function. 12 | */ 13 | 14 | module.exports = function(functions, args) { 15 | if (!functions) throw new Error('functions object required'); 16 | return function(style){ 17 | var functionMatcher = functionMatcherBuilder(Object.keys(functions).join('|')); 18 | 19 | visit.declarations(style, function(declarations){ 20 | func(declarations, functions, functionMatcher, args); 21 | }); 22 | } 23 | }; 24 | 25 | /** 26 | * Visit declarations and apply functions. 27 | * 28 | * @param {Array} declarations 29 | * @param {Object} functions 30 | * @param {RegExp} functionMatcher 31 | * @param {Boolean} [parseArgs] 32 | * @api private 33 | */ 34 | 35 | function func(declarations, functions, functionMatcher, parseArgs) { 36 | if (false !== parseArgs) parseArgs = true; 37 | 38 | declarations.forEach(function(decl){ 39 | if ('comment' == decl.type) return; 40 | var generatedFuncs = [], result, generatedFunc; 41 | 42 | while (decl.value.match(functionMatcher)) { 43 | decl.value = decl.value.replace(functionMatcher, function(_, name, args){ 44 | if (parseArgs) { 45 | args = args.split(/\s*,\s*/).map(strip); 46 | } else { 47 | args = [strip(args)]; 48 | } 49 | // Ensure result is string 50 | result = '' + functions[name].apply(decl, args); 51 | 52 | // Prevent fall into infinite loop like this: 53 | // 54 | // { 55 | // url: function(path) { 56 | // return 'url(' + '/some/prefix' + path + ')' 57 | // } 58 | // } 59 | // 60 | generatedFunc = {from: name, to: name + getRandomString()}; 61 | result = result.replace(functionMatcherBuilder(name), generatedFunc.to + '($2)'); 62 | generatedFuncs.push(generatedFunc); 63 | return result; 64 | }); 65 | } 66 | 67 | generatedFuncs.forEach(function(func) { 68 | decl.value = decl.value.replace(func.to, func.from); 69 | }) 70 | }); 71 | } 72 | 73 | /** 74 | * Build function regexp 75 | * 76 | * @param {String} name 77 | * @api private 78 | */ 79 | 80 | function functionMatcherBuilder(name) { 81 | // /(?!\W+)(\w+)\(([^()]+)\)/ 82 | return new RegExp("(?!\\W+)(" + name + ")\\(([^\(\)]+)\\)"); 83 | } 84 | 85 | /** 86 | * get random string 87 | * 88 | * @api private 89 | */ 90 | 91 | function getRandomString() { 92 | return Math.random().toString(36).slice(2); 93 | } 94 | 95 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "css", 3 | "version": "1.6.0", 4 | "description": "CSS parser / stringifier using css-parse and css-stringify", 5 | "keywords": [ 6 | "css", 7 | "parser", 8 | "stylesheet" 9 | ], 10 | "author": { 11 | "name": "TJ Holowaychuk", 12 | "email": "tj@vision-media.ca" 13 | }, 14 | "dependencies": { 15 | "css-parse": "1.7.0", 16 | "css-stringify": "1.4.1" 17 | }, 18 | "main": "index", 19 | "repository": { 20 | "type": "git", 21 | "url": "https://github.com/visionmedia/css.git" 22 | }, 23 | "scripts": { 24 | "test": "make test" 25 | }, 26 | "readme": "\n# css\n\n CSS parser / stringifier using [css-parse](https://github.com/visionmedia/css-parse) and [css-stringify](https://github.com/visionmedia/css-stringify).\n\n## Installation\n\n $ npm install css\n\n## Example\n\njs:\n\n```js\nvar css = require('css')\nvar obj = css.parse('tobi { name: \"tobi\" }')\ncss.stringify(obj);\n```\n\nobject returned by `.parse()`:\n\n```json\n{\n \"stylesheet\": {\n \"rules\": [\n {\n \"selector\": \"tobi\",\n \"declarations\": [\n {\n \"property\": \"name\",\n \"value\": \"tobi\"\n }\n ]\n }\n ]\n }\n}\n```\n\nstring returned by `.stringify(ast)`:\n\n```css\ntobi {\n name: tobi;\n}\n```\n\nstring returned by `.stringify(ast, { compress: true })`:\n\n```css\ntobi{name:tobi}\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", 27 | "readmeFilename": "Readme.md", 28 | "bugs": { 29 | "url": "https://github.com/visionmedia/css/issues" 30 | }, 31 | "homepage": "https://github.com/visionmedia/css", 32 | "_id": "css@1.6.0", 33 | "_from": "css@1.6.0" 34 | } 35 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/lib/plugins/ease.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var visit = require('../visit'); 7 | 8 | /** 9 | * Easing functions. 10 | */ 11 | 12 | var ease = { 13 | 'ease-in-out-back': 'cubic-bezier(0.680, -0.550, 0.265, 1.550)', 14 | 'ease-in-out-circ': 'cubic-bezier(0.785, 0.135, 0.150, 0.860)', 15 | 'ease-in-out-expo': 'cubic-bezier(1.000, 0.000, 0.000, 1.000)', 16 | 'ease-in-out-sine': 'cubic-bezier(0.445, 0.050, 0.550, 0.950)', 17 | 'ease-in-out-quint': 'cubic-bezier(0.860, 0.000, 0.070, 1.000)', 18 | 'ease-in-out-quart': 'cubic-bezier(0.770, 0.000, 0.175, 1.000)', 19 | 'ease-in-out-cubic': 'cubic-bezier(0.645, 0.045, 0.355, 1.000)', 20 | 'ease-in-out-quad': 'cubic-bezier(0.455, 0.030, 0.515, 0.955)', 21 | 'ease-out-back': 'cubic-bezier(0.175, 0.885, 0.320, 1.275)', 22 | 'ease-out-circ': 'cubic-bezier(0.075, 0.820, 0.165, 1.000)', 23 | 'ease-out-expo': 'cubic-bezier(0.190, 1.000, 0.220, 1.000)', 24 | 'ease-out-sine': 'cubic-bezier(0.390, 0.575, 0.565, 1.000)', 25 | 'ease-out-quint': 'cubic-bezier(0.230, 1.000, 0.320, 1.000)', 26 | 'ease-out-quart': 'cubic-bezier(0.165, 0.840, 0.440, 1.000)', 27 | 'ease-out-cubic': 'cubic-bezier(0.215, 0.610, 0.355, 1.000)', 28 | 'ease-out-quad': 'cubic-bezier(0.250, 0.460, 0.450, 0.940)', 29 | 'ease-in-back': 'cubic-bezier(0.600, -0.280, 0.735, 0.045)', 30 | 'ease-in-circ': 'cubic-bezier(0.600, 0.040, 0.980, 0.335)', 31 | 'ease-in-expo': 'cubic-bezier(0.950, 0.050, 0.795, 0.035)', 32 | 'ease-in-sine': 'cubic-bezier(0.470, 0.000, 0.745, 0.715)', 33 | 'ease-in-quint': 'cubic-bezier(0.755, 0.050, 0.855, 0.060)', 34 | 'ease-in-quart': 'cubic-bezier(0.895, 0.030, 0.685, 0.220)', 35 | 'ease-in-cubic': 'cubic-bezier(0.550, 0.055, 0.675, 0.190)', 36 | 'ease-in-quad': 'cubic-bezier(0.550, 0.085, 0.680, 0.530)' 37 | }; 38 | 39 | /** 40 | * Keys. 41 | */ 42 | 43 | var keys = Object.keys(ease); 44 | 45 | /** 46 | * Provide additional easing functions: 47 | * 48 | * #logo { 49 | * transition: all 500ms ease-out-back; 50 | * } 51 | * 52 | * yields: 53 | * 54 | * #logo { 55 | * transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275) 56 | * } 57 | * 58 | */ 59 | 60 | module.exports = function() { 61 | return function(style){ 62 | visit.declarations(style, substitute); 63 | } 64 | }; 65 | 66 | /** 67 | * Substitute easing functions. 68 | * 69 | * @api private 70 | */ 71 | 72 | function substitute(declarations) { 73 | for (var i = 0, len = declarations.length; i < len; ++i) { 74 | var decl = declarations[i]; 75 | if ('comment' == decl.type) continue; 76 | if (!decl.property.match(/transition|animation|timing/)) continue; 77 | for (var k = 0; k < keys.length; ++k) { 78 | var key = keys[k]; 79 | if (~decl.value.indexOf(key)) { 80 | decl.value = decl.value.replace(key, ease[key]); 81 | break; 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/mime/types/node.types: -------------------------------------------------------------------------------- 1 | # What: WebVTT 2 | # Why: To allow formats intended for marking up external text track resources. 3 | # http://dev.w3.org/html5/webvtt/ 4 | # Added by: niftylettuce 5 | text/vtt vtt 6 | 7 | # What: Google Chrome Extension 8 | # Why: To allow apps to (work) be served with the right content type header. 9 | # http://codereview.chromium.org/2830017 10 | # Added by: niftylettuce 11 | application/x-chrome-extension crx 12 | 13 | # What: HTC support 14 | # Why: To properly render .htc files such as CSS3PIE 15 | # Added by: niftylettuce 16 | text/x-component htc 17 | 18 | # What: HTML5 application cache manifes ('.manifest' extension) 19 | # Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps 20 | # per https://developer.mozilla.org/en/offline_resources_in_firefox 21 | # Added by: louisremi 22 | text/cache-manifest manifest 23 | 24 | # What: node binary buffer format 25 | # Why: semi-standard extension w/in the node community 26 | # Added by: tootallnate 27 | application/octet-stream buffer 28 | 29 | # What: The "protected" MP-4 formats used by iTunes. 30 | # Why: Required for streaming music to browsers (?) 31 | # Added by: broofa 32 | application/mp4 m4p 33 | audio/mp4 m4a 34 | 35 | # What: Video format, Part of RFC1890 36 | # Why: See https://github.com/bentomas/node-mime/pull/6 37 | # Added by: mjrusso 38 | video/MP2T ts 39 | 40 | # What: EventSource mime type 41 | # Why: mime type of Server-Sent Events stream 42 | # http://www.w3.org/TR/eventsource/#text-event-stream 43 | # Added by: francois2metz 44 | text/event-stream event-stream 45 | 46 | # What: Mozilla App manifest mime type 47 | # Why: https://developer.mozilla.org/en/Apps/Manifest#Serving_manifests 48 | # Added by: ednapiranha 49 | application/x-web-app-manifest+json webapp 50 | 51 | # What: Lua file types 52 | # Why: Googling around shows de-facto consensus on these 53 | # Added by: creationix (Issue #45) 54 | text/x-lua lua 55 | application/x-lua-bytecode luac 56 | 57 | # What: Markdown files, as per http://daringfireball.net/projects/markdown/syntax 58 | # Why: http://stackoverflow.com/questions/10701983/what-is-the-mime-type-for-markdown 59 | # Added by: avoidwork 60 | text/x-markdown markdown md mkd 61 | 62 | # What: ini files 63 | # Why: because they're just text files 64 | # Added by: Matthew Kastor 65 | text/plain ini 66 | 67 | # What: DASH Adaptive Streaming manifest 68 | # Why: https://developer.mozilla.org/en-US/docs/DASH_Adaptive_Streaming_for_HTML_5_Video 69 | # Added by: eelcocramer 70 | application/dash+xml mdp 71 | 72 | # What: OpenType font files - http://www.microsoft.com/typography/otspec/ 73 | # Why: Browsers usually ignore the font MIME types and sniff the content, 74 | # but Chrome, shows a warning if OpenType fonts aren't served with 75 | # the `font/opentype` MIME type: http://i.imgur.com/8c5RN8M.png. 76 | # Added by: alrra 77 | font/opentype otf 78 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/mime/test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Usage: node test.js 3 | */ 4 | 5 | var mime = require('./mime'); 6 | var assert = require('assert'); 7 | var path = require('path'); 8 | 9 | function eq(a, b) { 10 | console.log('Test: ' + a + ' === ' + b); 11 | assert.strictEqual.apply(null, arguments); 12 | } 13 | 14 | console.log(Object.keys(mime.extensions).length + ' types'); 15 | console.log(Object.keys(mime.types).length + ' extensions\n'); 16 | 17 | // 18 | // Test mime lookups 19 | // 20 | 21 | eq('text/plain', mime.lookup('text.txt')); // normal file 22 | eq('text/plain', mime.lookup('TEXT.TXT')); // uppercase 23 | eq('text/plain', mime.lookup('dir/text.txt')); // dir + file 24 | eq('text/plain', mime.lookup('.text.txt')); // hidden file 25 | eq('text/plain', mime.lookup('.txt')); // nameless 26 | eq('text/plain', mime.lookup('txt')); // extension-only 27 | eq('text/plain', mime.lookup('/txt')); // extension-less () 28 | eq('text/plain', mime.lookup('\\txt')); // Windows, extension-less 29 | eq('application/octet-stream', mime.lookup('text.nope')); // unrecognized 30 | eq('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default 31 | 32 | // 33 | // Test extensions 34 | // 35 | 36 | eq('txt', mime.extension(mime.types.text)); 37 | eq('html', mime.extension(mime.types.htm)); 38 | eq('bin', mime.extension('application/octet-stream')); 39 | eq('bin', mime.extension('application/octet-stream ')); 40 | eq('html', mime.extension(' text/html; charset=UTF-8')); 41 | eq('html', mime.extension('text/html; charset=UTF-8 ')); 42 | eq('html', mime.extension('text/html; charset=UTF-8')); 43 | eq('html', mime.extension('text/html ; charset=UTF-8')); 44 | eq('html', mime.extension('text/html;charset=UTF-8')); 45 | eq('html', mime.extension('text/Html;charset=UTF-8')); 46 | eq(undefined, mime.extension('unrecognized')); 47 | 48 | // 49 | // Test node.types lookups 50 | // 51 | 52 | eq('application/font-woff', mime.lookup('file.woff')); 53 | eq('application/octet-stream', mime.lookup('file.buffer')); 54 | eq('audio/mp4', mime.lookup('file.m4a')); 55 | eq('font/opentype', mime.lookup('file.otf')); 56 | 57 | // 58 | // Test charsets 59 | // 60 | 61 | eq('UTF-8', mime.charsets.lookup('text/plain')); 62 | eq(undefined, mime.charsets.lookup(mime.types.js)); 63 | eq('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); 64 | 65 | // 66 | // Test for overlaps between mime.types and node.types 67 | // 68 | 69 | var apacheTypes = new mime.Mime(), nodeTypes = new mime.Mime(); 70 | apacheTypes.load(path.join(__dirname, 'types/mime.types')); 71 | nodeTypes.load(path.join(__dirname, 'types/node.types')); 72 | 73 | var keys = [].concat(Object.keys(apacheTypes.types)) 74 | .concat(Object.keys(nodeTypes.types)); 75 | keys.sort(); 76 | for (var i = 1; i < keys.length; i++) { 77 | if (keys[i] == keys[i-1]) { 78 | console.warn('Warning: ' + 79 | 'node.types defines ' + keys[i] + '->' + nodeTypes.types[keys[i]] + 80 | ', mime.types defines ' + keys[i] + '->' + apacheTypes.types[keys[i]]); 81 | } 82 | } 83 | 84 | console.log('\nOK'); 85 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/node_modules/amdefine/LICENSE: -------------------------------------------------------------------------------- 1 | amdefine is released under two licenses: new BSD, and MIT. You may pick the 2 | license that best suits your development needs. The text of both licenses are 3 | provided below. 4 | 5 | 6 | The "New" BSD License: 7 | ---------------------- 8 | 9 | Copyright (c) 2011, The Dojo Foundation 10 | All rights reserved. 11 | 12 | Redistribution and use in source and binary forms, with or without 13 | modification, are permitted provided that the following conditions are met: 14 | 15 | * Redistributions of source code must retain the above copyright notice, this 16 | list of conditions and the following disclaimer. 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | * Neither the name of the Dojo Foundation nor the names of its contributors 21 | may be used to endorse or promote products derived from this software 22 | without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 25 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 28 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | 36 | 37 | MIT License 38 | ----------- 39 | 40 | Copyright (c) 2011, The Dojo Foundation 41 | 42 | Permission is hereby granted, free of charge, to any person obtaining a copy 43 | of this software and associated documentation files (the "Software"), to deal 44 | in the Software without restriction, including without limitation the rights 45 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 46 | copies of the Software, and to permit persons to whom the Software is 47 | furnished to do so, subject to the following conditions: 48 | 49 | The above copyright notice and this permission notice shall be included in 50 | all copies or substantial portions of the Software. 51 | 52 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 53 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 54 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 55 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 56 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 57 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 58 | THE SOFTWARE. 59 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "css-stringify", 3 | "version": "1.4.1", 4 | "description": "CSS compiler", 5 | "keywords": [ 6 | "css", 7 | "stringify", 8 | "stylesheet" 9 | ], 10 | "author": { 11 | "name": "TJ Holowaychuk", 12 | "email": "tj@vision-media.ca" 13 | }, 14 | "devDependencies": { 15 | "mocha": "*", 16 | "should": "*", 17 | "css-parse": "1.6.0" 18 | }, 19 | "main": "index", 20 | "repository": { 21 | "type": "git", 22 | "url": "https://github.com/visionmedia/css-stringify.git" 23 | }, 24 | "scripts": { 25 | "test": "make test" 26 | }, 27 | "dependencies": { 28 | "source-map": "~0.1.31" 29 | }, 30 | "readme": "# css-stringify [![Build Status](https://travis-ci.org/visionmedia/css-stringify.png)](https://travis-ci.org/visionmedia/css-stringify)\n\n CSS compiler using the AST provided by [css-parse](https://github.com/visionmedia/css-parse).\n\n## API\n\n### stringify(object, [options])\n\n Accepts an AST `object` from css-parse and returns a CSS string.\n\n```js\nvar stringify = require('css-stringify');\nvar parse = require('css-parse');\n\nvar ast = parse('body { font-size: 12px; }');\nvar css = stringify(ast);\n```\n\n Optionally you may `compress` the output:\n\n```js\nvar css = stringify(ast, { compress: true });\n```\n\n Or return a `sourcemap` along with the CSS output,\n which requires the use of the css-parse `position` option.\n\n```js\nvar ast = parse('body { font-size: 12px; }', { position: true });\nvar result = stringify(ast, { sourcemap: true });\n\nresult.code // string with CSS\nresult.map // source map\n```\n\n## Performance\n\n Formats 15,000 lines of CSS (2mb) in 23ms on my macbook air.\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", 31 | "readmeFilename": "Readme.md", 32 | "bugs": { 33 | "url": "https://github.com/visionmedia/css-stringify/issues" 34 | }, 35 | "homepage": "https://github.com/visionmedia/css-stringify", 36 | "_id": "css-stringify@1.4.1", 37 | "_from": "css-stringify@1.4.1" 38 | } 39 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/lib/source-map/array-set.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var util = require('./util'); 13 | 14 | /** 15 | * A data structure which is a combination of an array and a set. Adding a new 16 | * member is O(1), testing for membership is O(1), and finding the index of an 17 | * element is O(1). Removing elements from the set is not supported. Only 18 | * strings are supported for membership. 19 | */ 20 | function ArraySet() { 21 | this._array = []; 22 | this._set = {}; 23 | } 24 | 25 | /** 26 | * Static method for creating ArraySet instances from an existing array. 27 | */ 28 | ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { 29 | var set = new ArraySet(); 30 | for (var i = 0, len = aArray.length; i < len; i++) { 31 | set.add(aArray[i], aAllowDuplicates); 32 | } 33 | return set; 34 | }; 35 | 36 | /** 37 | * Add the given string to this set. 38 | * 39 | * @param String aStr 40 | */ 41 | ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { 42 | var isDuplicate = this.has(aStr); 43 | var idx = this._array.length; 44 | if (!isDuplicate || aAllowDuplicates) { 45 | this._array.push(aStr); 46 | } 47 | if (!isDuplicate) { 48 | this._set[util.toSetString(aStr)] = idx; 49 | } 50 | }; 51 | 52 | /** 53 | * Is the given string a member of this set? 54 | * 55 | * @param String aStr 56 | */ 57 | ArraySet.prototype.has = function ArraySet_has(aStr) { 58 | return Object.prototype.hasOwnProperty.call(this._set, 59 | util.toSetString(aStr)); 60 | }; 61 | 62 | /** 63 | * What is the index of the given string in the array? 64 | * 65 | * @param String aStr 66 | */ 67 | ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { 68 | if (this.has(aStr)) { 69 | return this._set[util.toSetString(aStr)]; 70 | } 71 | throw new Error('"' + aStr + '" is not in the set.'); 72 | }; 73 | 74 | /** 75 | * What is the element at the given index? 76 | * 77 | * @param Number aIdx 78 | */ 79 | ArraySet.prototype.at = function ArraySet_at(aIdx) { 80 | if (aIdx >= 0 && aIdx < this._array.length) { 81 | return this._array[aIdx]; 82 | } 83 | throw new Error('No element indexed by ' + aIdx); 84 | }; 85 | 86 | /** 87 | * Returns the array representation of this set (which has the proper indices 88 | * indicated by indexOf). Note that this is a copy of the internal array used 89 | * for storing the members so that no one can mess with internal state. 90 | */ 91 | ArraySet.prototype.toArray = function ArraySet_toArray() { 92 | return this._array.slice(); 93 | }; 94 | 95 | exports.ArraySet = ArraySet; 96 | 97 | }); 98 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/debug/lib/debug.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var tty = require('tty'); 6 | 7 | /** 8 | * Expose `debug()` as the module. 9 | */ 10 | 11 | module.exports = debug; 12 | 13 | /** 14 | * Enabled debuggers. 15 | */ 16 | 17 | var names = [] 18 | , skips = []; 19 | 20 | (process.env.DEBUG || '') 21 | .split(/[\s,]+/) 22 | .forEach(function(name){ 23 | name = name.replace('*', '.*?'); 24 | if (name[0] === '-') { 25 | skips.push(new RegExp('^' + name.substr(1) + '$')); 26 | } else { 27 | names.push(new RegExp('^' + name + '$')); 28 | } 29 | }); 30 | 31 | /** 32 | * Colors. 33 | */ 34 | 35 | var colors = [6, 2, 3, 4, 5, 1]; 36 | 37 | /** 38 | * Previous debug() call. 39 | */ 40 | 41 | var prev = {}; 42 | 43 | /** 44 | * Previously assigned color. 45 | */ 46 | 47 | var prevColor = 0; 48 | 49 | /** 50 | * Is stdout a TTY? Colored output is disabled when `true`. 51 | */ 52 | 53 | var isatty = tty.isatty(2); 54 | 55 | /** 56 | * Select a color. 57 | * 58 | * @return {Number} 59 | * @api private 60 | */ 61 | 62 | function color() { 63 | return colors[prevColor++ % colors.length]; 64 | } 65 | 66 | /** 67 | * Humanize the given `ms`. 68 | * 69 | * @param {Number} m 70 | * @return {String} 71 | * @api private 72 | */ 73 | 74 | function humanize(ms) { 75 | var sec = 1000 76 | , min = 60 * 1000 77 | , hour = 60 * min; 78 | 79 | if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; 80 | if (ms >= min) return (ms / min).toFixed(1) + 'm'; 81 | if (ms >= sec) return (ms / sec | 0) + 's'; 82 | return ms + 'ms'; 83 | } 84 | 85 | /** 86 | * Create a debugger with the given `name`. 87 | * 88 | * @param {String} name 89 | * @return {Type} 90 | * @api public 91 | */ 92 | 93 | function debug(name) { 94 | function disabled(){} 95 | disabled.enabled = false; 96 | 97 | var match = skips.some(function(re){ 98 | return re.test(name); 99 | }); 100 | 101 | if (match) return disabled; 102 | 103 | match = names.some(function(re){ 104 | return re.test(name); 105 | }); 106 | 107 | if (!match) return disabled; 108 | var c = color(); 109 | 110 | function colored(fmt) { 111 | fmt = coerce(fmt); 112 | 113 | var curr = new Date; 114 | var ms = curr - (prev[name] || curr); 115 | prev[name] = curr; 116 | 117 | fmt = ' \u001b[9' + c + 'm' + name + ' ' 118 | + '\u001b[3' + c + 'm\u001b[90m' 119 | + fmt + '\u001b[3' + c + 'm' 120 | + ' +' + humanize(ms) + '\u001b[0m'; 121 | 122 | console.error.apply(this, arguments); 123 | } 124 | 125 | function plain(fmt) { 126 | fmt = coerce(fmt); 127 | 128 | fmt = new Date().toUTCString() 129 | + ' ' + name + ' ' + fmt; 130 | console.error.apply(this, arguments); 131 | } 132 | 133 | colored.enabled = plain.enabled = true; 134 | 135 | return isatty || process.env.DEBUG_COLORS 136 | ? colored 137 | : plain; 138 | } 139 | 140 | /** 141 | * Coerce `val`. 142 | */ 143 | 144 | function coerce(val) { 145 | if (val instanceof Error) return val.stack || val.message; 146 | return val; 147 | } 148 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/debug/debug.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Expose `debug()` as the module. 4 | */ 5 | 6 | module.exports = debug; 7 | 8 | /** 9 | * Create a debugger with the given `name`. 10 | * 11 | * @param {String} name 12 | * @return {Type} 13 | * @api public 14 | */ 15 | 16 | function debug(name) { 17 | if (!debug.enabled(name)) return function(){}; 18 | 19 | return function(fmt){ 20 | fmt = coerce(fmt); 21 | 22 | var curr = new Date; 23 | var ms = curr - (debug[name] || curr); 24 | debug[name] = curr; 25 | 26 | fmt = name 27 | + ' ' 28 | + fmt 29 | + ' +' + debug.humanize(ms); 30 | 31 | // This hackery is required for IE8 32 | // where `console.log` doesn't have 'apply' 33 | window.console 34 | && console.log 35 | && Function.prototype.apply.call(console.log, console, arguments); 36 | } 37 | } 38 | 39 | /** 40 | * The currently active debug mode names. 41 | */ 42 | 43 | debug.names = []; 44 | debug.skips = []; 45 | 46 | /** 47 | * Enables a debug mode by name. This can include modes 48 | * separated by a colon and wildcards. 49 | * 50 | * @param {String} name 51 | * @api public 52 | */ 53 | 54 | debug.enable = function(name) { 55 | try { 56 | localStorage.debug = name; 57 | } catch(e){} 58 | 59 | var split = (name || '').split(/[\s,]+/) 60 | , len = split.length; 61 | 62 | for (var i = 0; i < len; i++) { 63 | name = split[i].replace('*', '.*?'); 64 | if (name[0] === '-') { 65 | debug.skips.push(new RegExp('^' + name.substr(1) + '$')); 66 | } 67 | else { 68 | debug.names.push(new RegExp('^' + name + '$')); 69 | } 70 | } 71 | }; 72 | 73 | /** 74 | * Disable debug output. 75 | * 76 | * @api public 77 | */ 78 | 79 | debug.disable = function(){ 80 | debug.enable(''); 81 | }; 82 | 83 | /** 84 | * Humanize the given `ms`. 85 | * 86 | * @param {Number} m 87 | * @return {String} 88 | * @api private 89 | */ 90 | 91 | debug.humanize = function(ms) { 92 | var sec = 1000 93 | , min = 60 * 1000 94 | , hour = 60 * min; 95 | 96 | if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; 97 | if (ms >= min) return (ms / min).toFixed(1) + 'm'; 98 | if (ms >= sec) return (ms / sec | 0) + 's'; 99 | return ms + 'ms'; 100 | }; 101 | 102 | /** 103 | * Returns true if the given mode name is enabled, false otherwise. 104 | * 105 | * @param {String} name 106 | * @return {Boolean} 107 | * @api public 108 | */ 109 | 110 | debug.enabled = function(name) { 111 | for (var i = 0, len = debug.skips.length; i < len; i++) { 112 | if (debug.skips[i].test(name)) { 113 | return false; 114 | } 115 | } 116 | for (var i = 0, len = debug.names.length; i < len; i++) { 117 | if (debug.names[i].test(name)) { 118 | return true; 119 | } 120 | } 121 | return false; 122 | }; 123 | 124 | /** 125 | * Coerce `val`. 126 | */ 127 | 128 | function coerce(val) { 129 | if (val instanceof Error) return val.stack || val.message; 130 | return val; 131 | } 132 | 133 | // persist 134 | 135 | try { 136 | if (window.localStorage) debug.enable(localStorage.debug); 137 | } catch(e){} 138 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/mime/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Robert Kieffer", 4 | "email": "robert@broofa.com", 5 | "url": "http://github.com/broofa" 6 | }, 7 | "contributors": [ 8 | { 9 | "name": "Benjamin Thomas", 10 | "email": "benjamin@benjaminthomas.org", 11 | "url": "http://github.com/bentomas" 12 | } 13 | ], 14 | "dependencies": {}, 15 | "description": "A comprehensive library for mime-type mapping", 16 | "devDependencies": {}, 17 | "keywords": [ 18 | "util", 19 | "mime" 20 | ], 21 | "main": "mime.js", 22 | "name": "mime", 23 | "repository": { 24 | "url": "https://github.com/broofa/node-mime", 25 | "type": "git" 26 | }, 27 | "version": "1.2.11", 28 | "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n var mime = require('mime');\n\n mime.lookup('/path/to/file.txt'); // => 'text/plain'\n mime.lookup('file.txt'); // => 'text/plain'\n mime.lookup('.TXT'); // => 'text/plain'\n mime.lookup('htm'); // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n mime.extension('text/html'); // => 'html'\n mime.extension('application/octet-stream'); // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n mime.charsets.lookup('text/plain'); // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n mime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n });\n\n mime.lookup('x-sft'); // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n mime.load('./my_project.types');\n\nThe .types file format is simple - See the `types` dir for examples.\n", 29 | "readmeFilename": "README.md", 30 | "bugs": { 31 | "url": "https://github.com/broofa/node-mime/issues" 32 | }, 33 | "homepage": "https://github.com/broofa/node-mime", 34 | "_id": "mime@1.2.11", 35 | "_from": "mime@1.2.11" 36 | } 37 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/lib/plugins/at2x.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var utils = require('../utils'); 7 | var path = require('path'); 8 | var stripQuotes = utils.stripQuotes; 9 | 10 | /** 11 | * Vendor crap. 12 | */ 13 | 14 | var query = [ 15 | '(min--moz-device-pixel-ratio: 1.5)', 16 | '(-o-min-device-pixel-ratio: 3/2)', 17 | '(-webkit-min-device-pixel-ratio: 1.5)', 18 | '(min-device-pixel-ratio: 1.5)', 19 | '(min-resolution: 144dpi)', 20 | '(min-resolution: 1.5dppx)' 21 | ].join(', '); 22 | 23 | /** 24 | * Translate 25 | * 26 | * .logo { 27 | * background-image: url('/public/images/logo.png') 28 | * } 29 | * 30 | * yields: 31 | * 32 | * .logo { 33 | * background-image: url('/public/images/logo.png') 34 | * } 35 | * 36 | * @media all and (-webkit-min-device-pixel-ratio : 1.5) { 37 | * .logo { 38 | * background-image: url("/public/images/logo@2x.png"); 39 | * background-size: contain 40 | * } 41 | * } 42 | * 43 | */ 44 | 45 | module.exports = function() { 46 | return function(style){ 47 | style.rules.forEach(function(rule){ 48 | if (!rule.declarations) return; 49 | 50 | var backgroundSize = rule.declarations.filter(backgroundWithSize).map(value)[0] || 'contain'; 51 | 52 | rule.declarations.filter(backgroundWithHiResURL).forEach(function(decl){ 53 | if ('comment' == decl.type) return; 54 | 55 | // parse url 56 | var val = decl.value.replace(/\s+(at-2x)\s*(;|$)/, '$2'); 57 | decl.value = val; 58 | var i = val.indexOf('url('); 59 | var url = stripQuotes(val.slice(i + 4, val.indexOf(')', i))); 60 | var ext = path.extname(url); 61 | 62 | // ignore .svg 63 | if ('.svg' == ext) return; 64 | 65 | // @2x value 66 | url = path.join(path.dirname(url), path.basename(url, ext) + '@2x' + ext); 67 | 68 | // wrap in @media 69 | style.rules.push({ 70 | type: 'media', 71 | media: query, 72 | rules: [ 73 | { 74 | type: 'rule', 75 | selectors: rule.selectors, 76 | declarations: [ 77 | { 78 | type: 'declaration', 79 | property: 'background-image', 80 | value: 'url("' + url + '")' 81 | }, 82 | { 83 | type: 'declaration', 84 | property: 'background-size', 85 | value: backgroundSize 86 | } 87 | ] 88 | } 89 | ] 90 | }); 91 | }); 92 | }); 93 | }; 94 | }; 95 | 96 | /** 97 | * Filter background[-image] with url(). 98 | */ 99 | 100 | function backgroundWithHiResURL(decl) { 101 | return ('background' == decl.property 102 | || 'background-image' == decl.property) 103 | && ~decl.value.indexOf('url(') 104 | && ~decl.value.indexOf('at-2x'); 105 | } 106 | 107 | /** 108 | * Predicate on background-size property. 109 | */ 110 | 111 | function backgroundWithSize(decl) { 112 | return 'background-size' == decl.property; 113 | } 114 | 115 | /** 116 | * Return value atribute of a declaration. 117 | */ 118 | 119 | function value(decl) { 120 | return decl.value; 121 | } 122 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/convert-source-map/test/comment-regex.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | /*jshint asi: true */ 3 | 4 | var test = require('tap').test 5 | , generator = require('inline-source-map') 6 | , rx = require('..').commentRegex 7 | , mapFileRx = require('..').mapFileCommentRegex 8 | 9 | function comment(s) { 10 | rx.lastIndex = 0; 11 | return rx.test(s + 'sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9') 12 | } 13 | 14 | test('comment regex old spec - @', function (t) { 15 | [ '//@ ' 16 | , ' //@ ' 17 | , '\t//@ ' 18 | ].forEach(function (x) { t.ok(comment(x), 'matches ' + x) }); 19 | 20 | [ '///@ ' 21 | , '}}//@ ' 22 | , ' @// @' 23 | ].forEach(function (x) { t.ok(!comment(x), 'does not match ' + x) }) 24 | t.end() 25 | }) 26 | 27 | test('comment regex new spec - #', function (t) { 28 | [ '//# ' 29 | , ' //# ' 30 | , '\t//# ' 31 | ].forEach(function (x) { t.ok(comment(x), 'matches ' + x) }); 32 | 33 | [ '///# ' 34 | , '}}//# ' 35 | , ' #// #' 36 | ].forEach(function (x) { t.ok(!comment(x), 'does not match ' + x) }) 37 | t.end() 38 | }) 39 | 40 | function mapFileComment(s) { 41 | mapFileRx.lastIndex = 0; 42 | return mapFileRx.test(s + 'sourceMappingURL=foo.js.map') 43 | } 44 | 45 | test('mapFileComment regex old spec - @', function (t) { 46 | [ '//@ ' 47 | , ' //@ ' 48 | , '\t//@ ' 49 | ].forEach(function (x) { t.ok(mapFileComment(x), 'matches ' + x) }); 50 | 51 | [ '///@ ' 52 | , '}}//@ ' 53 | , ' @// @' 54 | ].forEach(function (x) { t.ok(!mapFileComment(x), 'does not match ' + x) }) 55 | t.end() 56 | }) 57 | 58 | test('mapFileComment regex new spec - #', function (t) { 59 | [ '//# ' 60 | , ' //# ' 61 | , '\t//# ' 62 | ].forEach(function (x) { t.ok(mapFileComment(x), 'matches ' + x) }); 63 | 64 | [ '///# ' 65 | , '}}//# ' 66 | , ' #// #' 67 | ].forEach(function (x) { t.ok(!mapFileComment(x), 'does not match ' + x) }) 68 | t.end() 69 | }) 70 | 71 | function mapFileCommentWrap(s1, s2) { 72 | mapFileRx.lastIndex = 0; 73 | return mapFileRx.test(s1 + 'sourceMappingURL=foo.js.map' + s2) 74 | } 75 | 76 | test('mapFileComment regex /* */ old spec - @', function (t) { 77 | [ [ '/*@ ', '*/' ] 78 | , [' /*@ ', ' */ ' ] 79 | , [ '\t/*@ ', ' \t*/\t '] 80 | ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); 81 | 82 | [ [ '/*/*@ ', '*/' ] 83 | , ['}}/*@ ', ' */ ' ] 84 | , [ ' @/*@ ', ' \t*/\t '] 85 | ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }); 86 | t.end() 87 | }) 88 | 89 | test('mapFileComment regex /* */ new spec - #', function (t) { 90 | [ [ '/*# ', '*/' ] 91 | , [' /*# ', ' */ ' ] 92 | , [ '\t/*# ', ' \t*/\t '] 93 | ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); 94 | 95 | [ [ '/*/*# ', '*/' ] 96 | , ['}}/*# ', ' */ ' ] 97 | , [ ' #/*# ', ' \t*/\t '] 98 | ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }); 99 | t.end() 100 | }) 101 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We're open source! We love contributions! An ordered list of helpful things: 4 | 5 | 1. failing tests 6 | 2. patches with tests 7 | 3. bare patches 8 | 4. bug reports 9 | 5. problem statements 10 | 6. feature requests 11 | 12 | [via](https://twitter.com/othiym23/status/515619157287526400) 13 | 14 | 15 | 16 | - [Creating issues](#creating-issues) 17 | - [Bug Issues](#bug-issues) 18 | - [Feature Issues](#feature-issues) 19 | - [Assignees](#assignees) 20 | - [Milestones](#milestones) 21 | - [Labels](#labels) 22 | - [Developing](#developing) 23 | 24 | 25 | 26 | ## Creating issues 27 | GitHub issues can be treated like a massive, communal todo list. If you notice something wrong, toss an issue in and we'll get to it! 28 | 29 | **TL;DR Put issues into the right milestone if avaliable. Don't create new milestones or labels. Talk to the responsible person on a milestone before adding issues to a milestone that have a due date.** 30 | 31 | ### Bug Issues 32 | * mark with the "bug" label 33 | * The following things are helpful 34 | * screenshots with a description showing the problem. 35 | * js console or server logs 36 | * contact information of users who experienced this request 37 | * the time of the bug so that relevant logs can be found 38 | * The following things should always be included 39 | * the steps it would take to reproduce the issue 40 | * what happened when you followed those steps 41 | * what you expected to happen that didn't 42 | 43 | ### Feature Issues 44 | * should be marked with the "enhancement" label 45 | 46 | ### Assignees 47 | * assignees are responsible for completing an issue. Do not assign a person to an issue unless they agree to it. Generally, people should assign themselves. 48 | 49 | ### Milestones 50 | * If your issue fits into a milestone please add it there. Issues with no milestone are fine – they'll be gone through periodically and assigned. 51 | * Creation of new milestones is by group consensus only. Don't do it on your own. 52 | * A milestone with a due date should have a "responsible person" listed in the description. That doesn't mean that person is the sole person to work on it, just that they're the one responsible for coordinating efforts around that chunk of work. 53 | * → Once a milestone has a due date, only issues okay'd by the responsible person can be added. This ensures that a chunk of work can be delivered by the promised due date. 54 | 55 | ### Labels 56 | * issues don't get a "prioritize this!" or "CRITICAL" label unless they really apply. "I want this new feature now" does not qualify as important. Generally, these labels should only be applied by people setting up a batch of work. Abuse these labels and they'll become meaningless. 57 | * Creation of new labels is by group consensus. Don't do it on your own! 58 | 59 | Some good ways to make sure it's not missed: 60 | * try to add any appropriate labels. 61 | * If this is a browser bug, add the "browser" label, and prefix your issue title with the browser version and the URL you encountered the problem on. e.g. `IE 9: /wisps/xxx can't click on the search input` 62 | * screenshots are always handy 63 | * If your issue is urgent, there's probably a milestone that it belongs in. 64 | 65 | ## Developing 66 | 67 | * Please follow our styleguide: https://github.com/Getable/styleguide-js 68 | * Please add tests, we'd like to hit 100% code coverage 69 | * Thank you for contributing! 70 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-parse/Readme.md: -------------------------------------------------------------------------------- 1 | # css-parse [![Build Status](https://travis-ci.org/visionmedia/css-parse.png)](https://travis-ci.org/visionmedia/css-parse) 2 | 3 | JavaScript CSS parser for nodejs and the browser. 4 | 5 | ## Installation 6 | 7 | $ npm install css-parse 8 | 9 | ## Usage 10 | 11 | ````javascript 12 | var parse = require('css-parse'); 13 | 14 | // CSS input string 15 | var css = "body { \n background-color: #fff;\n }"; 16 | 17 | var output_obj = parse(css); 18 | 19 | // Position and Source parameters 20 | var output_obj_pos = parse(css, { position: true, source: 'file.css' }); 21 | 22 | // Print parsed object as CSS string 23 | console.log(JSON.stringify(output_obj, null, 2)); 24 | 25 | ```` 26 | 27 | ## Example 28 | 29 | css: 30 | 31 | ```css 32 | body { 33 | background: #eee; 34 | color: #888; 35 | } 36 | ``` 37 | 38 | parse tree: 39 | 40 | ```json 41 | { 42 | "type": "stylesheet", 43 | "stylesheet": { 44 | "rules": [ 45 | { 46 | "type": "rule", 47 | "selectors": [ 48 | "body" 49 | ], 50 | "declarations": [ 51 | { 52 | "type": "declaration", 53 | "property": "background", 54 | "value": "#eee" 55 | }, 56 | { 57 | "type": "declaration", 58 | "property": "color", 59 | "value": "#888" 60 | } 61 | ] 62 | } 63 | ] 64 | } 65 | } 66 | ``` 67 | 68 | parse tree with `.position` enabled: 69 | 70 | ```json 71 | { 72 | "type": "stylesheet", 73 | "stylesheet": { 74 | "rules": [ 75 | { 76 | "type": "rule", 77 | "selectors": [ 78 | "body" 79 | ], 80 | "declarations": [ 81 | { 82 | "type": "declaration", 83 | "property": "background", 84 | "value": "#eee", 85 | "position": { 86 | "start": { 87 | "line": 3, 88 | "column": 3 89 | }, 90 | "end": { 91 | "line": 3, 92 | "column": 19 93 | } 94 | } 95 | }, 96 | { 97 | "type": "declaration", 98 | "property": "color", 99 | "value": "#888", 100 | "position": { 101 | "start": { 102 | "line": 4, 103 | "column": 3 104 | }, 105 | "end": { 106 | "line": 4, 107 | "column": 14 108 | } 109 | } 110 | } 111 | ], 112 | "position": { 113 | "start": { 114 | "line": 2, 115 | "column": 1 116 | }, 117 | "end": { 118 | "line": 5, 119 | "column": 2 120 | } 121 | } 122 | } 123 | ] 124 | } 125 | } 126 | ``` 127 | 128 | If you also pass in `source: 'path/to/original.css'`, that will be set 129 | on `node.position.source`. 130 | 131 | ## Performance 132 | 133 | Parsed 15,000 lines of CSS (2mb) in 40ms on my macbook air. 134 | 135 | ## Related 136 | 137 | [css-stringify](https://github.com/visionmedia/css-stringify "CSS-Stringify") 138 | [css-value](https://github.com/visionmedia/css-value "CSS-Value") 139 | 140 | ## License 141 | 142 | MIT 143 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/mime/mime.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var fs = require('fs'); 3 | 4 | function Mime() { 5 | // Map of extension -> mime type 6 | this.types = Object.create(null); 7 | 8 | // Map of mime type -> extension 9 | this.extensions = Object.create(null); 10 | } 11 | 12 | /** 13 | * Define mimetype -> extension mappings. Each key is a mime-type that maps 14 | * to an array of extensions associated with the type. The first extension is 15 | * used as the default extension for the type. 16 | * 17 | * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); 18 | * 19 | * @param map (Object) type definitions 20 | */ 21 | Mime.prototype.define = function (map) { 22 | for (var type in map) { 23 | var exts = map[type]; 24 | 25 | for (var i = 0; i < exts.length; i++) { 26 | if (process.env.DEBUG_MIME && this.types[exts]) { 27 | console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + 28 | this.types[exts] + ' to ' + type); 29 | } 30 | 31 | this.types[exts[i]] = type; 32 | } 33 | 34 | // Default extension is the first one we encounter 35 | if (!this.extensions[type]) { 36 | this.extensions[type] = exts[0]; 37 | } 38 | } 39 | }; 40 | 41 | /** 42 | * Load an Apache2-style ".types" file 43 | * 44 | * This may be called multiple times (it's expected). Where files declare 45 | * overlapping types/extensions, the last file wins. 46 | * 47 | * @param file (String) path of file to load. 48 | */ 49 | Mime.prototype.load = function(file) { 50 | 51 | this._loading = file; 52 | // Read file and split into lines 53 | var map = {}, 54 | content = fs.readFileSync(file, 'ascii'), 55 | lines = content.split(/[\r\n]+/); 56 | 57 | lines.forEach(function(line) { 58 | // Clean up whitespace/comments, and split into fields 59 | var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); 60 | map[fields.shift()] = fields; 61 | }); 62 | 63 | this.define(map); 64 | 65 | this._loading = null; 66 | }; 67 | 68 | /** 69 | * Lookup a mime type based on extension 70 | */ 71 | Mime.prototype.lookup = function(path, fallback) { 72 | var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase(); 73 | 74 | return this.types[ext] || fallback || this.default_type; 75 | }; 76 | 77 | /** 78 | * Return file extension associated with a mime type 79 | */ 80 | Mime.prototype.extension = function(mimeType) { 81 | var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); 82 | return this.extensions[type]; 83 | }; 84 | 85 | // Default instance 86 | var mime = new Mime(); 87 | 88 | // Load local copy of 89 | // http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types 90 | mime.load(path.join(__dirname, 'types/mime.types')); 91 | 92 | // Load additional types from node.js community 93 | mime.load(path.join(__dirname, 'types/node.types')); 94 | 95 | // Default type 96 | mime.default_type = mime.lookup('bin'); 97 | 98 | // 99 | // Additional API specific to the default instance 100 | // 101 | 102 | mime.Mime = Mime; 103 | 104 | /** 105 | * Lookup a charset based on mime type. 106 | */ 107 | mime.charsets = { 108 | lookup: function(mimeType, fallback) { 109 | // Assume text types are utf8 110 | return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; 111 | } 112 | }; 113 | 114 | module.exports = mime; 115 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/commander/node_modules/keypress/README.md: -------------------------------------------------------------------------------- 1 | keypress 2 | ======== 3 | ### Make any Node ReadableStream emit "keypress" events 4 | 5 | 6 | Previous to Node `v0.8.x`, there was an undocumented `"keypress"` event that 7 | `process.stdin` would emit when it was a TTY. Some people discovered this hidden 8 | gem, and started using it in their own code. 9 | 10 | Now in Node `v0.8.x`, this `"keypress"` event does not get emitted by default, 11 | but rather only when it is being used in conjuction with the `readline` (or by 12 | extension, the `repl`) module. 13 | 14 | This module is the exact logic from the node `v0.8.x` releases ripped out into its 15 | own module. 16 | 17 | __Bonus:__ Now with mouse support! 18 | 19 | Installation 20 | ------------ 21 | 22 | Install with `npm`: 23 | 24 | ``` bash 25 | $ npm install keypress 26 | ``` 27 | 28 | Or add it to the `"dependencies"` section of your _package.json_ file. 29 | 30 | 31 | Example 32 | ------- 33 | 34 | #### Listening for "keypress" events 35 | 36 | ``` js 37 | var keypress = require('keypress'); 38 | 39 | // make `process.stdin` begin emitting "keypress" events 40 | keypress(process.stdin); 41 | 42 | // listen for the "keypress" event 43 | process.stdin.on('keypress', function (ch, key) { 44 | console.log('got "keypress"', key); 45 | if (key && key.ctrl && key.name == 'c') { 46 | process.stdin.pause(); 47 | } 48 | }); 49 | 50 | process.stdin.setRawMode(true); 51 | process.stdin.resume(); 52 | ``` 53 | 54 | #### Listening for "mousepress" events 55 | 56 | ``` js 57 | var keypress = require('keypress'); 58 | 59 | // make `process.stdin` begin emitting "mousepress" (and "keypress") events 60 | keypress(process.stdin); 61 | 62 | // you must enable the mouse events before they will begin firing 63 | keypress.enableMouse(process.stdout); 64 | 65 | process.stdin.on('mousepress', function (info) { 66 | console.log('got "mousepress" event at %d x %d', info.x, info.y); 67 | }); 68 | 69 | process.on('exit', function () { 70 | // disable mouse on exit, so that the state 71 | // is back to normal for the terminal 72 | keypress.disableMouse(process.stdout); 73 | }); 74 | ``` 75 | 76 | 77 | License 78 | ------- 79 | 80 | (The MIT License) 81 | 82 | Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> 83 | 84 | Permission is hereby granted, free of charge, to any person obtaining 85 | a copy of this software and associated documentation files (the 86 | 'Software'), to deal in the Software without restriction, including 87 | without limitation the rights to use, copy, modify, merge, publish, 88 | distribute, sublicense, and/or sell copies of the Software, and to 89 | permit persons to whom the Software is furnished to do so, subject to 90 | the following conditions: 91 | 92 | The above copyright notice and this permission notice shall be 93 | included in all copies or substantial portions of the Software. 94 | 95 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 96 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 97 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 98 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 99 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 100 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 101 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 102 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## 0.1.33 4 | 5 | * Fix some edge cases surrounding path joining and URL resolution. 6 | 7 | * Add a third parameter for relative path to 8 | `SourceMapGenerator.prototype.applySourceMap`. 9 | 10 | * Fix issues with mappings and EOLs. 11 | 12 | ## 0.1.32 13 | 14 | * Fixed a bug where SourceMapConsumer couldn't handle negative relative columns 15 | (issue 92). 16 | 17 | * Fixed test runner to actually report number of failed tests as its process 18 | exit code. 19 | 20 | * Fixed a typo when reporting bad mappings (issue 87). 21 | 22 | ## 0.1.31 23 | 24 | * Delay parsing the mappings in SourceMapConsumer until queried for a source 25 | location. 26 | 27 | * Support Sass source maps (which at the time of writing deviate from the spec 28 | in small ways) in SourceMapConsumer. 29 | 30 | ## 0.1.30 31 | 32 | * Do not join source root with a source, when the source is a data URI. 33 | 34 | * Extend the test runner to allow running single specific test files at a time. 35 | 36 | * Performance improvements in `SourceNode.prototype.walk` and 37 | `SourceMapConsumer.prototype.eachMapping`. 38 | 39 | * Source map browser builds will now work inside Workers. 40 | 41 | * Better error messages when attempting to add an invalid mapping to a 42 | `SourceMapGenerator`. 43 | 44 | ## 0.1.29 45 | 46 | * Allow duplicate entries in the `names` and `sources` arrays of source maps 47 | (usually from TypeScript) we are parsing. Fixes github isse 72. 48 | 49 | ## 0.1.28 50 | 51 | * Skip duplicate mappings when creating source maps from SourceNode; github 52 | issue 75. 53 | 54 | ## 0.1.27 55 | 56 | * Don't throw an error when the `file` property is missing in SourceMapConsumer, 57 | we don't use it anyway. 58 | 59 | ## 0.1.26 60 | 61 | * Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. 62 | 63 | ## 0.1.25 64 | 65 | * Make compatible with browserify 66 | 67 | ## 0.1.24 68 | 69 | * Fix issue with absolute paths and `file://` URIs. See 70 | https://bugzilla.mozilla.org/show_bug.cgi?id=885597 71 | 72 | ## 0.1.23 73 | 74 | * Fix issue with absolute paths and sourcesContent, github issue 64. 75 | 76 | ## 0.1.22 77 | 78 | * Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21. 79 | 80 | ## 0.1.21 81 | 82 | * Fixed handling of sources that start with a slash so that they are relative to 83 | the source root's host. 84 | 85 | ## 0.1.20 86 | 87 | * Fixed github issue #43: absolute URLs aren't joined with the source root 88 | anymore. 89 | 90 | ## 0.1.19 91 | 92 | * Using Travis CI to run tests. 93 | 94 | ## 0.1.18 95 | 96 | * Fixed a bug in the handling of sourceRoot. 97 | 98 | ## 0.1.17 99 | 100 | * Added SourceNode.fromStringWithSourceMap. 101 | 102 | ## 0.1.16 103 | 104 | * Added missing documentation. 105 | 106 | * Fixed the generating of empty mappings in SourceNode. 107 | 108 | ## 0.1.15 109 | 110 | * Added SourceMapGenerator.applySourceMap. 111 | 112 | ## 0.1.14 113 | 114 | * The sourceRoot is now handled consistently. 115 | 116 | ## 0.1.13 117 | 118 | * Added SourceMapGenerator.fromSourceMap. 119 | 120 | ## 0.1.12 121 | 122 | * SourceNode now generates empty mappings too. 123 | 124 | ## 0.1.11 125 | 126 | * Added name support to SourceNode. 127 | 128 | ## 0.1.10 129 | 130 | * Added sourcesContent support to the customer and generator. 131 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/commander/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.0.4 / 2012-09-03 3 | ================== 4 | 5 | * add `outputHelp()` method. 6 | 7 | 1.0.3 / 2012-08-30 8 | ================== 9 | 10 | * remove invalid .version() defaulting 11 | 12 | 1.0.2 / 2012-08-24 13 | ================== 14 | 15 | * add `--foo=bar` support [arv] 16 | * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus] 17 | 18 | 1.0.1 / 2012-08-03 19 | ================== 20 | 21 | * fix issue #56 22 | * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode()) 23 | 24 | 1.0.0 / 2012-07-05 25 | ================== 26 | 27 | * add support for optional option descriptions 28 | * add defaulting of `.version()` to package.json's version 29 | 30 | 0.6.1 / 2012-06-01 31 | ================== 32 | 33 | * Added: append (yes or no) on confirmation 34 | * Added: allow node.js v0.7.x 35 | 36 | 0.6.0 / 2012-04-10 37 | ================== 38 | 39 | * Added `.prompt(obj, callback)` support. Closes #49 40 | * Added default support to .choose(). Closes #41 41 | * Fixed the choice example 42 | 43 | 0.5.1 / 2011-12-20 44 | ================== 45 | 46 | * Fixed `password()` for recent nodes. Closes #36 47 | 48 | 0.5.0 / 2011-12-04 49 | ================== 50 | 51 | * Added sub-command option support [itay] 52 | 53 | 0.4.3 / 2011-12-04 54 | ================== 55 | 56 | * Fixed custom help ordering. Closes #32 57 | 58 | 0.4.2 / 2011-11-24 59 | ================== 60 | 61 | * Added travis support 62 | * Fixed: line-buffered input automatically trimmed. Closes #31 63 | 64 | 0.4.1 / 2011-11-18 65 | ================== 66 | 67 | * Removed listening for "close" on --help 68 | 69 | 0.4.0 / 2011-11-15 70 | ================== 71 | 72 | * Added support for `--`. Closes #24 73 | 74 | 0.3.3 / 2011-11-14 75 | ================== 76 | 77 | * Fixed: wait for close event when writing help info [Jerry Hamlet] 78 | 79 | 0.3.2 / 2011-11-01 80 | ================== 81 | 82 | * Fixed long flag definitions with values [felixge] 83 | 84 | 0.3.1 / 2011-10-31 85 | ================== 86 | 87 | * Changed `--version` short flag to `-V` from `-v` 88 | * Changed `.version()` so it's configurable [felixge] 89 | 90 | 0.3.0 / 2011-10-31 91 | ================== 92 | 93 | * Added support for long flags only. Closes #18 94 | 95 | 0.2.1 / 2011-10-24 96 | ================== 97 | 98 | * "node": ">= 0.4.x < 0.7.0". Closes #20 99 | 100 | 0.2.0 / 2011-09-26 101 | ================== 102 | 103 | * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] 104 | 105 | 0.1.0 / 2011-08-24 106 | ================== 107 | 108 | * Added support for custom `--help` output 109 | 110 | 0.0.5 / 2011-08-18 111 | ================== 112 | 113 | * Changed: when the user enters nothing prompt for password again 114 | * Fixed issue with passwords beginning with numbers [NuckChorris] 115 | 116 | 0.0.4 / 2011-08-15 117 | ================== 118 | 119 | * Fixed `Commander#args` 120 | 121 | 0.0.3 / 2011-08-15 122 | ================== 123 | 124 | * Added default option value support 125 | 126 | 0.0.2 / 2011-08-15 127 | ================== 128 | 129 | * Added mask support to `Command#password(str[, mask], fn)` 130 | * Added `Command#password(str, fn)` 131 | 132 | 0.0.1 / 2010-01-03 133 | ================== 134 | 135 | * Initial release 136 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/lib/source-map/binary-search.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | /** 13 | * Recursive implementation of binary search. 14 | * 15 | * @param aLow Indices here and lower do not contain the needle. 16 | * @param aHigh Indices here and higher do not contain the needle. 17 | * @param aNeedle The element being searched for. 18 | * @param aHaystack The non-empty array being searched. 19 | * @param aCompare Function which takes two elements and returns -1, 0, or 1. 20 | */ 21 | function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) { 22 | // This function terminates when one of the following is true: 23 | // 24 | // 1. We find the exact element we are looking for. 25 | // 26 | // 2. We did not find the exact element, but we can return the next 27 | // closest element that is less than that element. 28 | // 29 | // 3. We did not find the exact element, and there is no next-closest 30 | // element which is less than the one we are searching for, so we 31 | // return null. 32 | var mid = Math.floor((aHigh - aLow) / 2) + aLow; 33 | var cmp = aCompare(aNeedle, aHaystack[mid], true); 34 | if (cmp === 0) { 35 | // Found the element we are looking for. 36 | return aHaystack[mid]; 37 | } 38 | else if (cmp > 0) { 39 | // aHaystack[mid] is greater than our needle. 40 | if (aHigh - mid > 1) { 41 | // The element is in the upper half. 42 | return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare); 43 | } 44 | // We did not find an exact match, return the next closest one 45 | // (termination case 2). 46 | return aHaystack[mid]; 47 | } 48 | else { 49 | // aHaystack[mid] is less than our needle. 50 | if (mid - aLow > 1) { 51 | // The element is in the lower half. 52 | return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare); 53 | } 54 | // The exact needle element was not found in this haystack. Determine if 55 | // we are in termination case (2) or (3) and return the appropriate thing. 56 | return aLow < 0 57 | ? null 58 | : aHaystack[aLow]; 59 | } 60 | } 61 | 62 | /** 63 | * This is an implementation of binary search which will always try and return 64 | * the next lowest value checked if there is no exact hit. This is because 65 | * mappings between original and generated line/col pairs are single points, 66 | * and there is an implicit region between each of them, so a miss just means 67 | * that you aren't on the very start of a region. 68 | * 69 | * @param aNeedle The element you are looking for. 70 | * @param aHaystack The array that is being searched. 71 | * @param aCompare A function which takes the needle and an element in the 72 | * array and returns -1, 0, or 1 depending on whether the needle is less 73 | * than, equal to, or greater than the element, respectively. 74 | */ 75 | exports.search = function search(aNeedle, aHaystack, aCompare) { 76 | return aHaystack.length > 0 77 | ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) 78 | : null; 79 | }; 80 | 81 | }); 82 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/test/source-map/test-dog-fooding.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer; 13 | var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator; 14 | 15 | exports['test eating our own dog food'] = function (assert, util) { 16 | var smg = new SourceMapGenerator({ 17 | file: 'testing.js', 18 | sourceRoot: '/wu/tang' 19 | }); 20 | 21 | smg.addMapping({ 22 | source: 'gza.coffee', 23 | original: { line: 1, column: 0 }, 24 | generated: { line: 2, column: 2 } 25 | }); 26 | 27 | smg.addMapping({ 28 | source: 'gza.coffee', 29 | original: { line: 2, column: 0 }, 30 | generated: { line: 3, column: 2 } 31 | }); 32 | 33 | smg.addMapping({ 34 | source: 'gza.coffee', 35 | original: { line: 3, column: 0 }, 36 | generated: { line: 4, column: 2 } 37 | }); 38 | 39 | smg.addMapping({ 40 | source: 'gza.coffee', 41 | original: { line: 4, column: 0 }, 42 | generated: { line: 5, column: 2 } 43 | }); 44 | 45 | smg.addMapping({ 46 | source: 'gza.coffee', 47 | original: { line: 5, column: 10 }, 48 | generated: { line: 6, column: 12 } 49 | }); 50 | 51 | var smc = new SourceMapConsumer(smg.toString()); 52 | 53 | // Exact 54 | util.assertMapping(2, 2, '/wu/tang/gza.coffee', 1, 0, null, smc, assert); 55 | util.assertMapping(3, 2, '/wu/tang/gza.coffee', 2, 0, null, smc, assert); 56 | util.assertMapping(4, 2, '/wu/tang/gza.coffee', 3, 0, null, smc, assert); 57 | util.assertMapping(5, 2, '/wu/tang/gza.coffee', 4, 0, null, smc, assert); 58 | util.assertMapping(6, 12, '/wu/tang/gza.coffee', 5, 10, null, smc, assert); 59 | 60 | // Fuzzy 61 | 62 | // Generated to original 63 | util.assertMapping(2, 0, null, null, null, null, smc, assert, true); 64 | util.assertMapping(2, 9, '/wu/tang/gza.coffee', 1, 0, null, smc, assert, true); 65 | util.assertMapping(3, 0, null, null, null, null, smc, assert, true); 66 | util.assertMapping(3, 9, '/wu/tang/gza.coffee', 2, 0, null, smc, assert, true); 67 | util.assertMapping(4, 0, null, null, null, null, smc, assert, true); 68 | util.assertMapping(4, 9, '/wu/tang/gza.coffee', 3, 0, null, smc, assert, true); 69 | util.assertMapping(5, 0, null, null, null, null, smc, assert, true); 70 | util.assertMapping(5, 9, '/wu/tang/gza.coffee', 4, 0, null, smc, assert, true); 71 | util.assertMapping(6, 0, null, null, null, null, smc, assert, true); 72 | util.assertMapping(6, 9, null, null, null, null, smc, assert, true); 73 | util.assertMapping(6, 13, '/wu/tang/gza.coffee', 5, 10, null, smc, assert, true); 74 | 75 | // Original to generated 76 | util.assertMapping(2, 2, '/wu/tang/gza.coffee', 1, 1, null, smc, assert, null, true); 77 | util.assertMapping(3, 2, '/wu/tang/gza.coffee', 2, 3, null, smc, assert, null, true); 78 | util.assertMapping(4, 2, '/wu/tang/gza.coffee', 3, 6, null, smc, assert, null, true); 79 | util.assertMapping(5, 2, '/wu/tang/gza.coffee', 4, 9, null, smc, assert, null, true); 80 | util.assertMapping(5, 2, '/wu/tang/gza.coffee', 5, 9, null, smc, assert, null, true); 81 | util.assertMapping(6, 12, '/wu/tang/gza.coffee', 6, 19, null, smc, assert, null, true); 82 | }; 83 | 84 | }); 85 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/node_modules/source-map/test/source-map/test-array-set.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var ArraySet = require('../../lib/source-map/array-set').ArraySet; 13 | 14 | function makeTestSet() { 15 | var set = new ArraySet(); 16 | for (var i = 0; i < 100; i++) { 17 | set.add(String(i)); 18 | } 19 | return set; 20 | } 21 | 22 | exports['test .has() membership'] = function (assert, util) { 23 | var set = makeTestSet(); 24 | for (var i = 0; i < 100; i++) { 25 | assert.ok(set.has(String(i))); 26 | } 27 | }; 28 | 29 | exports['test .indexOf() elements'] = function (assert, util) { 30 | var set = makeTestSet(); 31 | for (var i = 0; i < 100; i++) { 32 | assert.strictEqual(set.indexOf(String(i)), i); 33 | } 34 | }; 35 | 36 | exports['test .at() indexing'] = function (assert, util) { 37 | var set = makeTestSet(); 38 | for (var i = 0; i < 100; i++) { 39 | assert.strictEqual(set.at(i), String(i)); 40 | } 41 | }; 42 | 43 | exports['test creating from an array'] = function (assert, util) { 44 | var set = ArraySet.fromArray(['foo', 'bar', 'baz', 'quux', 'hasOwnProperty']); 45 | 46 | assert.ok(set.has('foo')); 47 | assert.ok(set.has('bar')); 48 | assert.ok(set.has('baz')); 49 | assert.ok(set.has('quux')); 50 | assert.ok(set.has('hasOwnProperty')); 51 | 52 | assert.strictEqual(set.indexOf('foo'), 0); 53 | assert.strictEqual(set.indexOf('bar'), 1); 54 | assert.strictEqual(set.indexOf('baz'), 2); 55 | assert.strictEqual(set.indexOf('quux'), 3); 56 | 57 | assert.strictEqual(set.at(0), 'foo'); 58 | assert.strictEqual(set.at(1), 'bar'); 59 | assert.strictEqual(set.at(2), 'baz'); 60 | assert.strictEqual(set.at(3), 'quux'); 61 | }; 62 | 63 | exports['test that you can add __proto__; see github issue #30'] = function (assert, util) { 64 | var set = new ArraySet(); 65 | set.add('__proto__'); 66 | assert.ok(set.has('__proto__')); 67 | assert.strictEqual(set.at(0), '__proto__'); 68 | assert.strictEqual(set.indexOf('__proto__'), 0); 69 | }; 70 | 71 | exports['test .fromArray() with duplicates'] = function (assert, util) { 72 | var set = ArraySet.fromArray(['foo', 'foo']); 73 | assert.ok(set.has('foo')); 74 | assert.strictEqual(set.at(0), 'foo'); 75 | assert.strictEqual(set.indexOf('foo'), 0); 76 | assert.strictEqual(set.toArray().length, 1); 77 | 78 | set = ArraySet.fromArray(['foo', 'foo'], true); 79 | assert.ok(set.has('foo')); 80 | assert.strictEqual(set.at(0), 'foo'); 81 | assert.strictEqual(set.at(1), 'foo'); 82 | assert.strictEqual(set.indexOf('foo'), 0); 83 | assert.strictEqual(set.toArray().length, 2); 84 | }; 85 | 86 | exports['test .add() with duplicates'] = function (assert, util) { 87 | var set = new ArraySet(); 88 | set.add('foo'); 89 | 90 | set.add('foo'); 91 | assert.ok(set.has('foo')); 92 | assert.strictEqual(set.at(0), 'foo'); 93 | assert.strictEqual(set.indexOf('foo'), 0); 94 | assert.strictEqual(set.toArray().length, 1); 95 | 96 | set.add('foo', true); 97 | assert.ok(set.has('foo')); 98 | assert.strictEqual(set.at(0), 'foo'); 99 | assert.strictEqual(set.at(1), 'foo'); 100 | assert.strictEqual(set.indexOf('foo'), 0); 101 | assert.strictEqual(set.toArray().length, 2); 102 | }; 103 | 104 | }); 105 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-parse/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "css-parse", 3 | "version": "1.7.0", 4 | "description": "CSS parser", 5 | "keywords": [ 6 | "css", 7 | "parser", 8 | "stylesheet" 9 | ], 10 | "author": { 11 | "name": "TJ Holowaychuk", 12 | "email": "tj@vision-media.ca" 13 | }, 14 | "license": "MIT", 15 | "devDependencies": { 16 | "mocha": "*", 17 | "should": "*", 18 | "matcha": "~0.4.0", 19 | "bytes": "~0.2.1" 20 | }, 21 | "main": "index", 22 | "repository": { 23 | "type": "git", 24 | "url": "https://github.com/visionmedia/css-parse.git" 25 | }, 26 | "scripts": { 27 | "test": "make test" 28 | }, 29 | "files": [ 30 | "index.js" 31 | ], 32 | "readme": "# css-parse [![Build Status](https://travis-ci.org/visionmedia/css-parse.png)](https://travis-ci.org/visionmedia/css-parse)\n\n JavaScript CSS parser for nodejs and the browser.\n\n## Installation\n\n $ npm install css-parse\n\n## Usage\n\n````javascript\nvar parse = require('css-parse');\n\n// CSS input string\nvar css = \"body { \\n background-color: #fff;\\n }\";\n\nvar output_obj = parse(css);\n\n// Position and Source parameters\nvar output_obj_pos = parse(css, { position: true, source: 'file.css' });\n\n// Print parsed object as CSS string\nconsole.log(JSON.stringify(output_obj, null, 2));\n\n````\n\n## Example\n\ncss:\n\n```css\nbody {\n background: #eee;\n color: #888;\n}\n```\n\nparse tree:\n\n```json\n{\n \"type\": \"stylesheet\",\n \"stylesheet\": {\n \"rules\": [\n {\n \"type\": \"rule\",\n \"selectors\": [\n \"body\"\n ],\n \"declarations\": [\n {\n \"type\": \"declaration\",\n \"property\": \"background\",\n \"value\": \"#eee\"\n },\n {\n \"type\": \"declaration\",\n \"property\": \"color\",\n \"value\": \"#888\"\n }\n ]\n }\n ]\n }\n}\n```\n\nparse tree with `.position` enabled:\n\n```json\n{\n \"type\": \"stylesheet\",\n \"stylesheet\": {\n \"rules\": [\n {\n \"type\": \"rule\",\n \"selectors\": [\n \"body\"\n ],\n \"declarations\": [\n {\n \"type\": \"declaration\",\n \"property\": \"background\",\n \"value\": \"#eee\",\n \"position\": {\n \"start\": {\n \"line\": 3,\n \"column\": 3\n },\n \"end\": {\n \"line\": 3,\n \"column\": 19\n }\n }\n },\n {\n \"type\": \"declaration\",\n \"property\": \"color\",\n \"value\": \"#888\",\n \"position\": {\n \"start\": {\n \"line\": 4,\n \"column\": 3\n },\n \"end\": {\n \"line\": 4,\n \"column\": 14\n }\n }\n }\n ],\n \"position\": {\n \"start\": {\n \"line\": 2,\n \"column\": 1\n },\n \"end\": {\n \"line\": 5,\n \"column\": 2\n }\n }\n }\n ]\n }\n}\n```\n\nIf you also pass in `source: 'path/to/original.css'`, that will be set\non `node.position.source`.\n\n## Performance\n\n Parsed 15,000 lines of CSS (2mb) in 40ms on my macbook air.\n\n## Related\n \n [css-stringify](https://github.com/visionmedia/css-stringify \"CSS-Stringify\") \n [css-value](https://github.com/visionmedia/css-value \"CSS-Value\") \n\n## License\n\n MIT\n", 33 | "readmeFilename": "Readme.md", 34 | "bugs": { 35 | "url": "https://github.com/visionmedia/css-parse/issues" 36 | }, 37 | "homepage": "https://github.com/visionmedia/css-parse", 38 | "_id": "css-parse@1.7.0", 39 | "_from": "css-parse@1.7.0" 40 | } 41 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/commander/node_modules/keypress/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "keypress", 3 | "version": "0.1.0", 4 | "description": "Make any Node ReadableStream emit \"keypress\" events", 5 | "author": { 6 | "name": "Nathan Rajlich", 7 | "email": "nathan@tootallnate.net", 8 | "url": "http://tootallnate.net" 9 | }, 10 | "main": "index.js", 11 | "scripts": { 12 | "test": "echo \"Error: no test specified\" && exit 1" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git://github.com/TooTallNate/keypress.git" 17 | }, 18 | "keywords": [ 19 | "keypress", 20 | "readline", 21 | "core" 22 | ], 23 | "license": "MIT", 24 | "readme": "keypress\n========\n### Make any Node ReadableStream emit \"keypress\" events\n\n\nPrevious to Node `v0.8.x`, there was an undocumented `\"keypress\"` event that\n`process.stdin` would emit when it was a TTY. Some people discovered this hidden\ngem, and started using it in their own code.\n\nNow in Node `v0.8.x`, this `\"keypress\"` event does not get emitted by default,\nbut rather only when it is being used in conjuction with the `readline` (or by\nextension, the `repl`) module.\n\nThis module is the exact logic from the node `v0.8.x` releases ripped out into its\nown module.\n\n__Bonus:__ Now with mouse support!\n\nInstallation\n------------\n\nInstall with `npm`:\n\n``` bash\n$ npm install keypress\n```\n\nOr add it to the `\"dependencies\"` section of your _package.json_ file.\n\n\nExample\n-------\n\n#### Listening for \"keypress\" events\n\n``` js\nvar keypress = require('keypress');\n\n// make `process.stdin` begin emitting \"keypress\" events\nkeypress(process.stdin);\n\n// listen for the \"keypress\" event\nprocess.stdin.on('keypress', function (ch, key) {\n console.log('got \"keypress\"', key);\n if (key && key.ctrl && key.name == 'c') {\n process.stdin.pause();\n }\n});\n\nprocess.stdin.setRawMode(true);\nprocess.stdin.resume();\n```\n\n#### Listening for \"mousepress\" events\n\n``` js\nvar keypress = require('keypress');\n\n// make `process.stdin` begin emitting \"mousepress\" (and \"keypress\") events\nkeypress(process.stdin);\n\n// you must enable the mouse events before they will begin firing\nkeypress.enableMouse(process.stdout);\n\nprocess.stdin.on('mousepress', function (info) {\n console.log('got \"mousepress\" event at %d x %d', info.x, info.y);\n});\n\nprocess.on('exit', function () {\n // disable mouse on exit, so that the state\n // is back to normal for the terminal\n keypress.disableMouse(process.stdout);\n});\n```\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", 25 | "readmeFilename": "README.md", 26 | "bugs": { 27 | "url": "https://github.com/TooTallNate/keypress/issues" 28 | }, 29 | "homepage": "https://github.com/TooTallNate/keypress", 30 | "_id": "keypress@0.1.0", 31 | "_from": "keypress@0.1.x" 32 | } 33 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/css/node_modules/css-stringify/lib/compress.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Base = require('./compiler'); 7 | 8 | /** 9 | * Expose compiler. 10 | */ 11 | 12 | module.exports = Compiler; 13 | 14 | /** 15 | * Initialize a new `Compiler`. 16 | */ 17 | 18 | function Compiler(options) { 19 | Base.call(this, options); 20 | } 21 | 22 | /** 23 | * Inherit from `Base.prototype`. 24 | */ 25 | 26 | Compiler.prototype.__proto__ = Base.prototype; 27 | 28 | /** 29 | * Compile `node`. 30 | */ 31 | 32 | Compiler.prototype.compile = function(node){ 33 | return node.stylesheet 34 | .rules.map(this.visit, this) 35 | .join(''); 36 | }; 37 | 38 | /** 39 | * Visit comment node. 40 | */ 41 | 42 | Compiler.prototype.comment = function(node){ 43 | return this.emit('', node.position); 44 | }; 45 | 46 | /** 47 | * Visit import node. 48 | */ 49 | 50 | Compiler.prototype.import = function(node){ 51 | return this.emit('@import ' + node.import + ';', node.position); 52 | }; 53 | 54 | /** 55 | * Visit media node. 56 | */ 57 | 58 | Compiler.prototype.media = function(node){ 59 | return this.emit('@media ' + node.media, node.position, true) 60 | + this.emit('{') 61 | + this.mapVisit(node.rules) 62 | + this.emit('}'); 63 | }; 64 | 65 | /** 66 | * Visit document node. 67 | */ 68 | 69 | Compiler.prototype.document = function(node){ 70 | var doc = '@' + (node.vendor || '') + 'document ' + node.document; 71 | 72 | return this.emit(doc, node.position, true) 73 | + this.emit('{') 74 | + this.mapVisit(node.rules) 75 | + this.emit('}'); 76 | }; 77 | 78 | /** 79 | * Visit charset node. 80 | */ 81 | 82 | Compiler.prototype.charset = function(node){ 83 | return this.emit('@charset ' + node.charset + ';', node.position); 84 | }; 85 | 86 | /** 87 | * Visit namespace node. 88 | */ 89 | 90 | Compiler.prototype.namespace = function(node){ 91 | return this.emit('@namespace ' + node.namespace + ';', node.position); 92 | }; 93 | 94 | /** 95 | * Visit supports node. 96 | */ 97 | 98 | Compiler.prototype.supports = function(node){ 99 | return this.emit('@supports ' + node.supports, node.position, true) 100 | + this.emit('{') 101 | + this.mapVisit(node.rules) 102 | + this.emit('}'); 103 | }; 104 | 105 | /** 106 | * Visit keyframes node. 107 | */ 108 | 109 | Compiler.prototype.keyframes = function(node){ 110 | return this.emit('@' 111 | + (node.vendor || '') 112 | + 'keyframes ' 113 | + node.name, node.position, true) 114 | + this.emit('{') 115 | + this.mapVisit(node.keyframes) 116 | + this.emit('}'); 117 | }; 118 | 119 | /** 120 | * Visit keyframe node. 121 | */ 122 | 123 | Compiler.prototype.keyframe = function(node){ 124 | var decls = node.declarations; 125 | 126 | return this.emit(node.values.join(','), node.position, true) 127 | + this.emit('{') 128 | + this.mapVisit(decls) 129 | + this.emit('}'); 130 | }; 131 | 132 | /** 133 | * Visit page node. 134 | */ 135 | 136 | Compiler.prototype.page = function(node){ 137 | var sel = node.selectors.length 138 | ? node.selectors.join(', ') 139 | : ''; 140 | 141 | return this.emit('@page ' + sel, node.position, true) 142 | + this.emit('{') 143 | + this.mapVisit(node.declarations) 144 | + this.emit('}'); 145 | }; 146 | 147 | /** 148 | * Visit rule node. 149 | */ 150 | 151 | Compiler.prototype.rule = function(node){ 152 | var decls = node.declarations; 153 | if (!decls.length) return ''; 154 | 155 | return this.emit(node.selectors.join(','), node.position, true) 156 | + this.emit('{') 157 | + this.mapVisit(decls) 158 | + this.emit('}'); 159 | }; 160 | 161 | /** 162 | * Visit declaration node. 163 | */ 164 | 165 | Compiler.prototype.declaration = function(node){ 166 | return this.emit(node.property + ':' + node.value, node.position) + this.emit(';'); 167 | }; 168 | 169 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/lib/rework.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var css = require('css'); 7 | 8 | /** 9 | * Expose `rework`. 10 | */ 11 | 12 | exports = module.exports = rework; 13 | 14 | /** 15 | * Expose `visit` helpers. 16 | */ 17 | 18 | exports.visit = require('./visit'); 19 | 20 | /** 21 | * Expose prefix properties. 22 | */ 23 | 24 | exports.__defineGetter__('properties', function () { 25 | console.warn('rework.properties has been removed.'); 26 | return []; 27 | }) 28 | 29 | /** 30 | * Initialize a new stylesheet `Rework` with `str`. 31 | * 32 | * @param {String} str 33 | * @param {Object} options 34 | * @return {Rework} 35 | * @api public 36 | */ 37 | 38 | function rework(str, options) { 39 | options = options || {}; 40 | options.position = true; // we need this for sourcemaps 41 | return new Rework(css.parse(str, options)); 42 | } 43 | 44 | /** 45 | * Initialize a new stylesheet `Rework` with `obj`. 46 | * 47 | * @param {Object} obj 48 | * @api private 49 | */ 50 | 51 | function Rework(obj) { 52 | this.obj = obj; 53 | } 54 | 55 | /** 56 | * Use the given plugin `fn(style, rework)`. 57 | * 58 | * @param {Function} fn 59 | * @return {Rework} 60 | * @api public 61 | */ 62 | 63 | Rework.prototype.use = function(fn){ 64 | fn(this.obj.stylesheet, this); 65 | return this; 66 | }; 67 | 68 | /** 69 | * Specify global vendor `prefixes`, 70 | * explicit ones may still be passed 71 | * to most plugins. 72 | * 73 | * Deprecated as of https://github.com/visionmedia/rework/issues/126. 74 | * 75 | * @param {Array} prefixes 76 | * @return {Rework} 77 | * @api public 78 | */ 79 | 80 | Rework.prototype.vendors = function(prefixes){ 81 | console.warn('rework.vendors() is deprecated. Please see: https://github.com/visionmedia/rework/issues/126.'); 82 | this.prefixes = prefixes; 83 | return this; 84 | }; 85 | 86 | /** 87 | * Stringify the stylesheet. 88 | * 89 | * @param {Object} options 90 | * @return {String} 91 | * @api public 92 | */ 93 | 94 | Rework.prototype.toString = function(options){ 95 | options = options || {}; 96 | var result = css.stringify(this.obj, options); 97 | if (options.sourcemap && !options.sourcemapAsObject) { 98 | result = result.code + '\n' + sourcemapToComment(result.map); 99 | } 100 | return result; 101 | }; 102 | 103 | /** 104 | * Convert sourcemap to base64-encoded comment 105 | * 106 | * @param {Object} map 107 | * @return {String} 108 | * @api private 109 | */ 110 | 111 | function sourcemapToComment(map) { 112 | var convertSourceMap = require('convert-source-map'); 113 | var content = convertSourceMap.fromObject(map).toBase64(); 114 | return '/*# sourceMappingURL=data:application/json;base64,' + content + ' */'; 115 | } 116 | 117 | /** 118 | * Expose plugins. 119 | */ 120 | 121 | exports.mixin = exports.mixins = require('./plugins/mixin'); 122 | exports.function = exports.functions = require('./plugins/function'); 123 | exports.colors = require('./plugins/colors'); 124 | exports.extend = require('rework-inherit'); 125 | exports.references = require('./plugins/references'); 126 | exports.prefixSelectors = require('./plugins/prefix-selectors'); 127 | exports.at2x = require('./plugins/at2x'); 128 | exports.url = require('./plugins/url'); 129 | exports.ease = require('./plugins/ease'); 130 | 131 | /** 132 | * Warn if users try to use removed components. 133 | * This will be removed in v1. 134 | */ 135 | 136 | [ 137 | 'vars', 138 | 'keyframes', 139 | 'prefix', 140 | 'prefixValue', 141 | ].forEach(function (plugin) { 142 | exports[plugin] = function () { 143 | console.warn('rework.' + plugin + '() has been removed from rework core. Please view https://github.com/visionmedia/rework or https://github.com/visionmedia/rework/wiki/Plugins-and-Utilities.'); 144 | return noop; 145 | }; 146 | }); 147 | 148 | /** 149 | * Try/catch plugins unavailable in component. 150 | */ 151 | 152 | try { 153 | exports.inline = require('./plugins/inline'); 154 | } catch (err) {} 155 | 156 | function noop(){} 157 | -------------------------------------------------------------------------------- /css.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var rework = require('rework') 4 | , npm = require('rework-npm') 5 | , bower = require('rework-bower') 6 | , vars = require('rework-vars') 7 | , assets = require('rework-assets') 8 | , path = require('path') 9 | , fs = require('fs') 10 | , events = require('events') 11 | , resolve = require('resolve') 12 | , pkg = require('package-lookup') 13 | , read = function read(f) { 14 | return fs.readFileSync(f, 'utf8') 15 | } 16 | , ctor 17 | 18 | ctor = module.exports = function useRework(opts, cb) { 19 | var src 20 | 21 | opts = opts || {} 22 | 23 | try { 24 | src = bundle(opts) 25 | } 26 | catch (err) { 27 | return void setImmediate(function asyncifyErrorCallback() { 28 | cb(err) 29 | }) 30 | } 31 | 32 | setImmediate(function asyncifySuccessCallback() { 33 | cb(null, src) 34 | }) 35 | } 36 | 37 | ctor.emitter = new events.EventEmitter() 38 | 39 | function resolveFilePath(filePath) { 40 | return path.resolve(process.cwd(), filePath) 41 | } 42 | 43 | function getPlugin(plugin, basedir) { 44 | var pluginName 45 | , pluginArgs 46 | , pluginPath 47 | 48 | if (typeof plugin === 'string') pluginName = plugin 49 | 50 | if (Array.isArray(plugin)) { 51 | pluginName = plugin[0] 52 | pluginArgs = plugin.slice(1) 53 | } 54 | 55 | pluginPath = resolve.sync(pluginName, {basedir: basedir}) 56 | 57 | if (pluginArgs) { 58 | return require(pluginPath).apply(null, pluginArgs) 59 | } 60 | else { 61 | return require(pluginPath) 62 | } 63 | } 64 | 65 | function applyReworkAssets(css, opts, dirName) { 66 | if (opts.assets) { 67 | css.use(assets({ 68 | src: dirName 69 | , dest: opts.assets.dest || '' 70 | , prefix: opts.assets.prefix || '' 71 | , retainName: opts.assets.retainName || '' 72 | })) 73 | } 74 | } 75 | 76 | function applyReworkPlugins(css, opts, dirName) { 77 | if (opts.plugins) { 78 | opts.plugins.forEach(function useOptionPlugins(plugin) { 79 | css.use(getPlugin(plugin, dirName)) 80 | }) 81 | } 82 | } 83 | 84 | function applyReworkVars(css, opts) { 85 | if (typeof opts.variables === 'string') { 86 | var variablesFilePath = resolveFilePath(opts.variables) 87 | opts.variables = readJSON(variablesFilePath) 88 | } 89 | // even if variables were not provided 90 | // use rework-vars to process default values 91 | css.use(vars({map: opts.variables})) 92 | } 93 | 94 | function prefilter(src, filename) { 95 | var config = pkg.resolve(filename) 96 | , css 97 | 98 | ctor.emitter.emit('file', filename) 99 | 100 | if (config && config.atomify && config.atomify.css && config.atomify.css.plugins) { 101 | css = rework(src) 102 | config.atomify.css.plugins.forEach(function usePlugins(plugin) { 103 | css.use(getPlugin(plugin, path.dirname(filename))) 104 | }) 105 | return css.toString() 106 | } 107 | 108 | return src 109 | } 110 | 111 | function applyRework(opts, resolvedEntry) { 112 | var css = rework(read(resolvedEntry), {source: resolvedEntry}) 113 | , dirName = path.dirname(resolvedEntry) 114 | , pkgmgr = opts.bower ? bower : npm 115 | 116 | css.use(pkgmgr({ 117 | root: dirName 118 | , prefilter: prefilter 119 | })) 120 | 121 | applyReworkVars(css, opts) 122 | applyReworkAssets(css, opts, dirName) 123 | applyReworkPlugins(css, opts, dirName) 124 | 125 | return css.toString({ 126 | sourcemap: opts.debug || opts.sourcemap 127 | , compress: opts.compress 128 | }) 129 | } 130 | 131 | function bundle(opts) { 132 | var entries = [] 133 | 134 | opts.entries.forEach(function resolveEntries(entry) { 135 | var resolvedEntry = resolveFilePath(entry) 136 | 137 | entries.push(applyRework(opts, resolvedEntry)) 138 | }) 139 | 140 | return entries.join(opts.compress ? '' : '\n') 141 | } 142 | 143 | function readJSON(filepath) { 144 | var src = read(filepath) 145 | 146 | try { 147 | return JSON.parse(src) 148 | } 149 | catch(e) { 150 | throw new Error('Unable to parse "' + filepath + '" file (' + e.message + ').', e) 151 | } 152 | } 153 | 154 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/convert-source-map/README.md: -------------------------------------------------------------------------------- 1 | # convert-source-map [![build status](https://secure.travis-ci.org/thlorenz/convert-source-map.png)](http://travis-ci.org/thlorenz/convert-source-map) 2 | 3 | [![NPM](https://nodei.co/npm/convert-source-map.png?downloads=true&stars=true)](https://nodei.co/npm/convert-source-map/) 4 | 5 | Converts a source-map from/to different formats and allows adding/changing properties. 6 | 7 | ```js 8 | var convert = require('convert-source-map'); 9 | 10 | var json = convert 11 | .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') 12 | .toJSON(); 13 | 14 | var modified = convert 15 | .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') 16 | .setProperty('sources', [ 'CONSOLE.LOG("HI");' ]) 17 | .toJSON(); 18 | 19 | console.log(json); 20 | console.log(modified); 21 | ``` 22 | 23 | ```json 24 | {"version":3,"file":"foo.js","sources":["console.log(\"hi\");"],"names":[],"mappings":"AAAA","sourceRoot":"/"} 25 | {"version":3,"file":"foo.js","sources":["CONSOLE.LOG(\"HI\");"],"names":[],"mappings":"AAAA","sourceRoot":"/"} 26 | ``` 27 | 28 | ## API 29 | 30 | ### fromObject(obj) 31 | 32 | Returns source map converter from given object. 33 | 34 | ### fromJSON(json) 35 | 36 | Returns source map converter from given json string. 37 | 38 | ### fromBase64(base64) 39 | 40 | Returns source map converter from given base64 encoded json string. 41 | 42 | ### fromComment(comment) 43 | 44 | Returns source map converter from given base64 encoded json string prefixed with `//# sourceMappingURL=...`. 45 | 46 | ### fromMapFileComment(comment, mapFileDir) 47 | 48 | Returns source map converter from given `filename` by parsing `//# sourceMappingURL=filename`. 49 | 50 | `filename` must point to a file that is found inside the `mapFileDir`. Most tools store this file right next to the 51 | generated file, i.e. the one containing the source map. 52 | 53 | ### fromSource(source) 54 | 55 | Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was 56 | found. 57 | 58 | ### fromMapFileSource(source, mapFileDir) 59 | 60 | Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was 61 | found. 62 | 63 | The sourcemap will be read from the map file found by parsing `# sourceMappingURL=file` comment. For more info see 64 | fromMapFileComment. 65 | 66 | ### toObject() 67 | 68 | Returns a copy of the underlying source map. 69 | 70 | ### toJSON([space]) 71 | 72 | Converts source map to json string. If `space` is given (optional), this will be passed to 73 | [JSON.stringify](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) when the 74 | JSON string is generated. 75 | 76 | ### toBase64() 77 | 78 | Converts source map to base64 encoded json string. 79 | 80 | ### toComment() 81 | 82 | Converts source map to base64 encoded json string prefixed with `//# sourceMappingURL=...`. 83 | 84 | ### addProperty(key, value) 85 | 86 | Adds given property to the source map. Throws an error if property already exists. 87 | 88 | ### setProperty(key, value) 89 | 90 | Sets given property to the source map. If property doesn't exist it is added, otherwise its value is updated. 91 | 92 | ### getProperty(key) 93 | 94 | Gets given property of the source map. 95 | 96 | ### removeComments(src) 97 | 98 | Returns `src` with all source map comments removed 99 | 100 | ### removeMapFileComments(src) 101 | 102 | Returns `src` with all source map comments pointing to map files removed. 103 | 104 | ### commentRegex 105 | 106 | Returns the regex used to find source map comments. 107 | 108 | ### mapFileCommentRegex 109 | 110 | Returns the regex used to find source map comments pointing to map files. 111 | 112 | 113 | [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/thlorenz/convert-source-map/trend.png)](https://bitdeli.com/free "Bitdeli Badge") 114 | 115 | -------------------------------------------------------------------------------- /test/fixtures/css/node_modules/rework-clone/node_modules/rework/node_modules/convert-source-map/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var fs = require('fs'); 3 | var path = require('path'); 4 | 5 | var commentRx = /^[ \t]*\/\/[@#][ \t]+sourceMappingURL=data:(?:application|text)\/json;base64,(.+)/mg; 6 | var mapFileCommentRx = 7 | // //# sourceMappingURL=foo.js.map /*# sourceMappingURL=foo.js.map */ 8 | /(?:^[ \t]*\/\/[@|#][ \t]+sourceMappingURL=(.+?)[ \t]*$)|(?:^[ \t]*\/\*[@#][ \t]+sourceMappingURL=(.+?)[ \t]*\*\/[ \t]*$)/mg 9 | 10 | function decodeBase64(base64) { 11 | return new Buffer(base64, 'base64').toString(); 12 | } 13 | 14 | function stripComment(sm) { 15 | return sm.split(',').pop(); 16 | } 17 | 18 | function readFromFileMap(sm, dir) { 19 | // NOTE: this will only work on the server since it attempts to read the map file 20 | 21 | var r = mapFileCommentRx.exec(sm); 22 | mapFileCommentRx.lastIndex = 0; 23 | 24 | // for some odd reason //# .. captures in 1 and /* .. */ in 2 25 | var filename = r[1] || r[2]; 26 | var filepath = path.join(dir, filename); 27 | 28 | try { 29 | return fs.readFileSync(filepath, 'utf8'); 30 | } catch (e) { 31 | throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e); 32 | } 33 | } 34 | 35 | function Converter (sm, opts) { 36 | opts = opts || {}; 37 | try { 38 | if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir); 39 | if (opts.hasComment) sm = stripComment(sm); 40 | if (opts.isEncoded) sm = decodeBase64(sm); 41 | if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm); 42 | 43 | this.sourcemap = sm; 44 | } catch(e) { 45 | console.error(e); 46 | return null; 47 | } 48 | } 49 | 50 | Converter.prototype.toJSON = function (space) { 51 | return JSON.stringify(this.sourcemap, null, space); 52 | }; 53 | 54 | Converter.prototype.toBase64 = function () { 55 | var json = this.toJSON(); 56 | return new Buffer(json).toString('base64'); 57 | }; 58 | 59 | Converter.prototype.toComment = function () { 60 | var base64 = this.toBase64(); 61 | return '//# sourceMappingURL=data:application/json;base64,' + base64; 62 | }; 63 | 64 | // returns copy instead of original 65 | Converter.prototype.toObject = function () { 66 | return JSON.parse(this.toJSON()); 67 | }; 68 | 69 | Converter.prototype.addProperty = function (key, value) { 70 | if (this.sourcemap.hasOwnProperty(key)) throw new Error('property %s already exists on the sourcemap, use set property instead'); 71 | return this.setProperty(key, value); 72 | }; 73 | 74 | Converter.prototype.setProperty = function (key, value) { 75 | this.sourcemap[key] = value; 76 | return this; 77 | }; 78 | 79 | Converter.prototype.getProperty = function (key) { 80 | return this.sourcemap[key]; 81 | }; 82 | 83 | exports.fromObject = function (obj) { 84 | return new Converter(obj); 85 | }; 86 | 87 | exports.fromJSON = function (json) { 88 | return new Converter(json, { isJSON: true }); 89 | }; 90 | 91 | exports.fromBase64 = function (base64) { 92 | return new Converter(base64, { isEncoded: true }); 93 | }; 94 | 95 | exports.fromComment = function (comment) { 96 | return new Converter(comment, { isEncoded: true, hasComment: true }); 97 | }; 98 | 99 | exports.fromMapFileComment = function (comment, dir) { 100 | return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true }); 101 | }; 102 | 103 | // Finds last sourcemap comment in file or returns null if none was found 104 | exports.fromSource = function (content) { 105 | var m = content.match(commentRx); 106 | commentRx.lastIndex = 0; 107 | return m ? exports.fromComment(m.pop()) : null; 108 | }; 109 | 110 | // Finds last sourcemap comment in file or returns null if none was found 111 | exports.fromMapFileSource = function (content, dir) { 112 | var m = content.match(mapFileCommentRx); 113 | mapFileCommentRx.lastIndex = 0; 114 | return m ? exports.fromMapFileComment(m.pop(), dir) : null; 115 | }; 116 | 117 | exports.removeComments = function (src) { 118 | commentRx.lastIndex = 0; 119 | return src.replace(commentRx, ''); 120 | }; 121 | 122 | exports.removeMapFileComments = function (src) { 123 | mapFileCommentRx.lastIndex = 0; 124 | return src.replace(mapFileCommentRx, ''); 125 | }; 126 | 127 | exports.__defineGetter__('commentRegex', function () { 128 | commentRx.lastIndex = 0; 129 | return commentRx; 130 | }); 131 | 132 | exports.__defineGetter__('mapFileCommentRegex', function () { 133 | mapFileCommentRx.lastIndex = 0; 134 | return mapFileCommentRx; 135 | }); 136 | --------------------------------------------------------------------------------