first commit
This commit is contained in:
70
build/node_modules/postcss-discard-comments/CHANGELOG.md
generated
vendored
Normal file
70
build/node_modules/postcss-discard-comments/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
# 2.0.4
|
||||
|
||||
* Now compiled with Babel 6.
|
||||
|
||||
# 2.0.3
|
||||
|
||||
* Fixes an issue where comments that were removed from selectors were replaced
|
||||
by a single space.
|
||||
|
||||
# 2.0.2
|
||||
|
||||
* Fixes an integration issue where comments inside values transformed by other
|
||||
processors had their values reset to their original state before the
|
||||
comments were removed.
|
||||
|
||||
# 2.0.1
|
||||
|
||||
* Replaces a dependency on node-balanced with internal comments parser.
|
||||
|
||||
# 2.0.0
|
||||
|
||||
* Upgraded to PostCSS 5 (thanks to @avanes).
|
||||
|
||||
# 1.2.1
|
||||
|
||||
* Improved performance by iterating the AST in a single pass.
|
||||
|
||||
# 1.2.0
|
||||
|
||||
* Adds support for user-directed removal of comments, with the `remove`
|
||||
option (thanks to @dmitrykiselyov).
|
||||
* `removeAllButFirst` now operates on each CSS tree, rather than the first one
|
||||
passed to the plugin.
|
||||
* Fixes to pass the PostCSS plugin guidelines.
|
||||
|
||||
# 1.1.3
|
||||
|
||||
* As PostCSS handles the source map content, there is no need to check for
|
||||
the existence of a '#' at position 0 of the comment. This patch fixes this
|
||||
behaviour.
|
||||
|
||||
# 1.1.2
|
||||
|
||||
* Fixes an issue where comment separated values were being incorrectly
|
||||
transformed to not have spaces separating them instead, in `decl.value`.
|
||||
e.g. `10px/*test*/20px` became `10px20px` in `decl.value` but not
|
||||
`decl._value.raw`.
|
||||
|
||||
# 1.1.1
|
||||
|
||||
* Fixes a bug where non-special comments, with an exclamation mark in any part
|
||||
of the text, were not being removed.
|
||||
|
||||
# 1.1.0
|
||||
|
||||
* Now uses the PostCSS `4.1` plugin API.
|
||||
* Adds support for transforming comments inside `!important` values.
|
||||
|
||||
# 1.0.2
|
||||
|
||||
* Adds a JSHint config, tidy up unnecessary lines of code.
|
||||
|
||||
# 1.0.1
|
||||
|
||||
* Fixed a bug which affected initializing the plugin with no options.
|
||||
* Stopped the plugin from trying to match comments in empty strings.
|
||||
|
||||
# 1.0.0
|
||||
|
||||
* Initial release.
|
||||
22
build/node_modules/postcss-discard-comments/LICENSE-MIT
generated
vendored
Normal file
22
build/node_modules/postcss-discard-comments/LICENSE-MIT
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info)
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
118
build/node_modules/postcss-discard-comments/README.md
generated
vendored
Normal file
118
build/node_modules/postcss-discard-comments/README.md
generated
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
# [postcss][postcss]-discard-comments [][ci] [][npm] [][deps]
|
||||
|
||||
> Discard comments in your CSS files with PostCSS.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
With [npm](https://npmjs.org/package/postcss-discard-comments) do:
|
||||
|
||||
```
|
||||
npm install postcss-discard-comments --save
|
||||
```
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
### Input
|
||||
|
||||
```css
|
||||
h1/* heading */{
|
||||
margin: 0 auto
|
||||
}
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
```css
|
||||
h1 {
|
||||
margin: 0 auto
|
||||
}
|
||||
```
|
||||
|
||||
This module discards comments from your CSS files; by default, it will remove
|
||||
all regular comments (`/* comment */`) and preserve comments marked as important
|
||||
(`/*! important */`).
|
||||
|
||||
Note that this module does not handle source map comments because they are not
|
||||
available to it; PostCSS handles this internally, so if they are removed then
|
||||
you will have to [configure source maps in PostCSS][maps].
|
||||
|
||||
[maps]: https://github.com/postcss/postcss/blob/master/docs/source-maps.md
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### comments([options])
|
||||
|
||||
#### options
|
||||
|
||||
##### remove(function)
|
||||
|
||||
Type: `function`
|
||||
Return: `boolean`
|
||||
Variable: `comment` contains a comment without `/**/`
|
||||
|
||||
For each comment, return true to remove, or false to keep the comment.
|
||||
|
||||
```js
|
||||
function(comment) {}
|
||||
```
|
||||
|
||||
```js
|
||||
var css = '/* headings *//*@ h1 */h1{margin:0 auto}/*@ h2 */h2{color:red}';
|
||||
console.log(postcss(comments({
|
||||
remove: function(comment) { return comment[0] == "@"; }
|
||||
})).process(css).css);
|
||||
//=> /* headings */h1{margin:0 auto}h2{color:red}
|
||||
```
|
||||
**NOTE:** If you use the `remove` function other options will not be available.
|
||||
|
||||
##### removeAll
|
||||
|
||||
Type: `boolean`
|
||||
Default: `false`
|
||||
|
||||
Remove all comments marked as important.
|
||||
|
||||
```js
|
||||
var css = '/*! heading */h1{margin:0 auto}/*! heading 2 */h2{color:red}';
|
||||
console.log(postcss(comments({removeAll: true})).process(css).css);
|
||||
//=> h1{margin:0 auto}h2{color:red}
|
||||
```
|
||||
|
||||
##### removeAllButFirst
|
||||
|
||||
Type: `boolean`
|
||||
Default: `false`
|
||||
|
||||
Remove all comments marked as important, but the first one.
|
||||
|
||||
```js
|
||||
var css = '/*! heading */h1{margin:0 auto}/*! heading 2 */h2{color:red}';
|
||||
console.log(postcss(comments({removeAllButFirst: true})).process(css).css);
|
||||
//=> /*! heading */h1{margin:0 auto}h2{color:red}
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
|
||||
examples for your environment.
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests are welcome. If you add functionality, then please add unit tests
|
||||
to cover it.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © Ben Briggs
|
||||
|
||||
|
||||
[ci]: https://travis-ci.org/ben-eb/postcss-discard-comments
|
||||
[deps]: https://gemnasium.com/ben-eb/postcss-discard-comments
|
||||
[npm]: http://badge.fury.io/js/postcss-discard-comments
|
||||
[postcss]: https://github.com/postcss/postcss
|
||||
98
build/node_modules/postcss-discard-comments/dist/index.js
generated
vendored
Normal file
98
build/node_modules/postcss-discard-comments/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _commentRemover = require('./lib/commentRemover');
|
||||
|
||||
var _commentRemover2 = _interopRequireDefault(_commentRemover);
|
||||
|
||||
var _commentParser = require('./lib/commentParser');
|
||||
|
||||
var _commentParser2 = _interopRequireDefault(_commentParser);
|
||||
|
||||
var _postcss = require('postcss');
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var space = _postcss.list.space;
|
||||
|
||||
exports.default = (0, _postcss.plugin)('postcss-discard-comments', function () {
|
||||
var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
||||
|
||||
var remover = new _commentRemover2.default(opts);
|
||||
|
||||
function matchesComments(source) {
|
||||
return (0, _commentParser2.default)(source).filter(function (node) {
|
||||
return node.type === 'comment';
|
||||
});
|
||||
}
|
||||
|
||||
function replaceComments(source) {
|
||||
var separator = arguments.length <= 1 || arguments[1] === undefined ? ' ' : arguments[1];
|
||||
|
||||
if (!source) {
|
||||
return source;
|
||||
}
|
||||
var parsed = (0, _commentParser2.default)(source).reduce(function (value, node) {
|
||||
if (node.type !== 'comment') {
|
||||
return value + node.value;
|
||||
}
|
||||
if (remover.canRemove(node.value)) {
|
||||
return value + separator;
|
||||
}
|
||||
return value + '/*' + node.value + '*/';
|
||||
}, '');
|
||||
|
||||
return space(parsed).join(' ');
|
||||
}
|
||||
|
||||
return function (css) {
|
||||
css.walk(function (node) {
|
||||
if (node.type === 'comment' && remover.canRemove(node.text)) {
|
||||
node.remove();
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.raws.between) {
|
||||
node.raws.between = replaceComments(node.raws.between);
|
||||
}
|
||||
|
||||
if (node.type === 'decl') {
|
||||
if (node.raws.value && node.raws.value.raw) {
|
||||
if (node.raws.value.value === node.value) {
|
||||
node.value = replaceComments(node.raws.value.raw);
|
||||
} else {
|
||||
node.value = replaceComments(node.value);
|
||||
}
|
||||
node.raws.value = null;
|
||||
}
|
||||
if (node.raws.important) {
|
||||
node.raws.important = replaceComments(node.raws.important);
|
||||
var b = matchesComments(node.raws.important);
|
||||
node.raws.important = b.length ? node.raws.important : '!important';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.type === 'rule' && node.raws.selector && node.raws.selector.raw) {
|
||||
node.raws.selector.raw = replaceComments(node.raws.selector.raw, '');
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.type === 'atrule') {
|
||||
if (node.raws.afterName) {
|
||||
var commentsReplaced = replaceComments(node.raws.afterName);
|
||||
if (!commentsReplaced.length) {
|
||||
node.raws.afterName = commentsReplaced + ' ';
|
||||
} else {
|
||||
node.raws.afterName = ' ' + commentsReplaced + ' ';
|
||||
}
|
||||
}
|
||||
if (node.raws.params && node.raws.params.raw) {
|
||||
node.raws.params.raw = replaceComments(node.raws.params.raw);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
module.exports = exports['default'];
|
||||
41
build/node_modules/postcss-discard-comments/dist/lib/commentParser.js
generated
vendored
Normal file
41
build/node_modules/postcss-discard-comments/dist/lib/commentParser.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = commentParser;
|
||||
function commentParser(input) {
|
||||
var tokens = [];
|
||||
var length = input.length;
|
||||
var pos = 0;
|
||||
var next = undefined;
|
||||
|
||||
while (pos < length) {
|
||||
next = input.indexOf('/*', pos);
|
||||
|
||||
if (~next) {
|
||||
tokens.push({
|
||||
type: 'other',
|
||||
value: input.slice(pos, next)
|
||||
});
|
||||
pos = next;
|
||||
|
||||
next = input.indexOf('*/', pos + 2);
|
||||
if (! ~next) {
|
||||
throw new Error('postcss-discard-comments: Unclosed */');
|
||||
}
|
||||
tokens.push({
|
||||
type: 'comment',
|
||||
value: input.slice(pos + 2, next)
|
||||
});
|
||||
pos = next + 2;
|
||||
} else {
|
||||
tokens.push({
|
||||
type: 'other',
|
||||
value: input.slice(pos)
|
||||
});
|
||||
pos = length;
|
||||
}
|
||||
}
|
||||
|
||||
return tokens;
|
||||
};
|
||||
module.exports = exports['default'];
|
||||
28
build/node_modules/postcss-discard-comments/dist/lib/commentRemover.js
generated
vendored
Normal file
28
build/node_modules/postcss-discard-comments/dist/lib/commentRemover.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
function CommentRemover(options) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
CommentRemover.prototype.canRemove = function (comment) {
|
||||
var remove = this.options.remove;
|
||||
if (remove) {
|
||||
return remove(comment);
|
||||
} else {
|
||||
var isImportant = comment.indexOf('!') === 0;
|
||||
if (!isImportant) {
|
||||
return true;
|
||||
} else if (isImportant) {
|
||||
if (this.options.removeAll || this._hasFirst) {
|
||||
return true;
|
||||
} else if (this.options.removeAllButFirst && !this._hasFirst) {
|
||||
this._hasFirst = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.default = CommentRemover;
|
||||
module.exports = exports['default'];
|
||||
65
build/node_modules/postcss-discard-comments/node_modules/ansi-styles/index.js
generated
vendored
Normal file
65
build/node_modules/postcss-discard-comments/node_modules/ansi-styles/index.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
'use strict';
|
||||
|
||||
function assembleStyles () {
|
||||
var styles = {
|
||||
modifiers: {
|
||||
reset: [0, 0],
|
||||
bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
|
||||
dim: [2, 22],
|
||||
italic: [3, 23],
|
||||
underline: [4, 24],
|
||||
inverse: [7, 27],
|
||||
hidden: [8, 28],
|
||||
strikethrough: [9, 29]
|
||||
},
|
||||
colors: {
|
||||
black: [30, 39],
|
||||
red: [31, 39],
|
||||
green: [32, 39],
|
||||
yellow: [33, 39],
|
||||
blue: [34, 39],
|
||||
magenta: [35, 39],
|
||||
cyan: [36, 39],
|
||||
white: [37, 39],
|
||||
gray: [90, 39]
|
||||
},
|
||||
bgColors: {
|
||||
bgBlack: [40, 49],
|
||||
bgRed: [41, 49],
|
||||
bgGreen: [42, 49],
|
||||
bgYellow: [43, 49],
|
||||
bgBlue: [44, 49],
|
||||
bgMagenta: [45, 49],
|
||||
bgCyan: [46, 49],
|
||||
bgWhite: [47, 49]
|
||||
}
|
||||
};
|
||||
|
||||
// fix humans
|
||||
styles.colors.grey = styles.colors.gray;
|
||||
|
||||
Object.keys(styles).forEach(function (groupName) {
|
||||
var group = styles[groupName];
|
||||
|
||||
Object.keys(group).forEach(function (styleName) {
|
||||
var style = group[styleName];
|
||||
|
||||
styles[styleName] = group[styleName] = {
|
||||
open: '\u001b[' + style[0] + 'm',
|
||||
close: '\u001b[' + style[1] + 'm'
|
||||
};
|
||||
});
|
||||
|
||||
Object.defineProperty(styles, groupName, {
|
||||
value: group,
|
||||
enumerable: false
|
||||
});
|
||||
});
|
||||
|
||||
return styles;
|
||||
}
|
||||
|
||||
Object.defineProperty(module, 'exports', {
|
||||
enumerable: true,
|
||||
get: assembleStyles
|
||||
});
|
||||
21
build/node_modules/postcss-discard-comments/node_modules/ansi-styles/license
generated
vendored
Normal file
21
build/node_modules/postcss-discard-comments/node_modules/ansi-styles/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
93
build/node_modules/postcss-discard-comments/node_modules/ansi-styles/package.json
generated
vendored
Normal file
93
build/node_modules/postcss-discard-comments/node_modules/ansi-styles/package.json
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"ansi-styles@2.2.1",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "ansi-styles@2.2.1",
|
||||
"_id": "ansi-styles@2.2.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
|
||||
"_location": "/postcss-discard-comments/ansi-styles",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "ansi-styles@2.2.1",
|
||||
"name": "ansi-styles",
|
||||
"escapedName": "ansi-styles",
|
||||
"rawSpec": "2.2.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.2.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/postcss-discard-comments/chalk"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
|
||||
"_spec": "2.2.1",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/chalk/ansi-styles/issues"
|
||||
},
|
||||
"description": "ANSI escape codes for styling strings in the terminal",
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/chalk/ansi-styles#readme",
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
{
|
||||
"name": "Joshua Appelman",
|
||||
"email": "jappelman@xebia.com",
|
||||
"url": "jbnicolai.com"
|
||||
}
|
||||
],
|
||||
"name": "ansi-styles",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/chalk/ansi-styles.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"version": "2.2.1"
|
||||
}
|
||||
86
build/node_modules/postcss-discard-comments/node_modules/ansi-styles/readme.md
generated
vendored
Normal file
86
build/node_modules/postcss-discard-comments/node_modules/ansi-styles/readme.md
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
# ansi-styles [](https://travis-ci.org/chalk/ansi-styles)
|
||||
|
||||
> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
|
||||
|
||||
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
|
||||
|
||||

|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save ansi-styles
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var ansi = require('ansi-styles');
|
||||
|
||||
console.log(ansi.green.open + 'Hello world!' + ansi.green.close);
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
Each style has an `open` and `close` property.
|
||||
|
||||
|
||||
## Styles
|
||||
|
||||
### Modifiers
|
||||
|
||||
- `reset`
|
||||
- `bold`
|
||||
- `dim`
|
||||
- `italic` *(not widely supported)*
|
||||
- `underline`
|
||||
- `inverse`
|
||||
- `hidden`
|
||||
- `strikethrough` *(not widely supported)*
|
||||
|
||||
### Colors
|
||||
|
||||
- `black`
|
||||
- `red`
|
||||
- `green`
|
||||
- `yellow`
|
||||
- `blue`
|
||||
- `magenta`
|
||||
- `cyan`
|
||||
- `white`
|
||||
- `gray`
|
||||
|
||||
### Background colors
|
||||
|
||||
- `bgBlack`
|
||||
- `bgRed`
|
||||
- `bgGreen`
|
||||
- `bgYellow`
|
||||
- `bgBlue`
|
||||
- `bgMagenta`
|
||||
- `bgCyan`
|
||||
- `bgWhite`
|
||||
|
||||
|
||||
## Advanced usage
|
||||
|
||||
By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
|
||||
|
||||
- `ansi.modifiers`
|
||||
- `ansi.colors`
|
||||
- `ansi.bgColors`
|
||||
|
||||
|
||||
###### Example
|
||||
|
||||
```js
|
||||
console.log(ansi.colors.green.open);
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
116
build/node_modules/postcss-discard-comments/node_modules/chalk/index.js
generated
vendored
Normal file
116
build/node_modules/postcss-discard-comments/node_modules/chalk/index.js
generated
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
'use strict';
|
||||
var escapeStringRegexp = require('escape-string-regexp');
|
||||
var ansiStyles = require('ansi-styles');
|
||||
var stripAnsi = require('strip-ansi');
|
||||
var hasAnsi = require('has-ansi');
|
||||
var supportsColor = require('supports-color');
|
||||
var defineProps = Object.defineProperties;
|
||||
var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM);
|
||||
|
||||
function Chalk(options) {
|
||||
// detect mode if not set manually
|
||||
this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled;
|
||||
}
|
||||
|
||||
// use bright blue on Windows as the normal blue color is illegible
|
||||
if (isSimpleWindowsTerm) {
|
||||
ansiStyles.blue.open = '\u001b[94m';
|
||||
}
|
||||
|
||||
var styles = (function () {
|
||||
var ret = {};
|
||||
|
||||
Object.keys(ansiStyles).forEach(function (key) {
|
||||
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
|
||||
|
||||
ret[key] = {
|
||||
get: function () {
|
||||
return build.call(this, this._styles.concat(key));
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
return ret;
|
||||
})();
|
||||
|
||||
var proto = defineProps(function chalk() {}, styles);
|
||||
|
||||
function build(_styles) {
|
||||
var builder = function () {
|
||||
return applyStyle.apply(builder, arguments);
|
||||
};
|
||||
|
||||
builder._styles = _styles;
|
||||
builder.enabled = this.enabled;
|
||||
// __proto__ is used because we must return a function, but there is
|
||||
// no way to create a function with a different prototype.
|
||||
/* eslint-disable no-proto */
|
||||
builder.__proto__ = proto;
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
function applyStyle() {
|
||||
// support varags, but simply cast to string in case there's only one arg
|
||||
var args = arguments;
|
||||
var argsLen = args.length;
|
||||
var str = argsLen !== 0 && String(arguments[0]);
|
||||
|
||||
if (argsLen > 1) {
|
||||
// don't slice `arguments`, it prevents v8 optimizations
|
||||
for (var a = 1; a < argsLen; a++) {
|
||||
str += ' ' + args[a];
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.enabled || !str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
var nestedStyles = this._styles;
|
||||
var i = nestedStyles.length;
|
||||
|
||||
// Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
|
||||
// see https://github.com/chalk/chalk/issues/58
|
||||
// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
|
||||
var originalDim = ansiStyles.dim.open;
|
||||
if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) {
|
||||
ansiStyles.dim.open = '';
|
||||
}
|
||||
|
||||
while (i--) {
|
||||
var code = ansiStyles[nestedStyles[i]];
|
||||
|
||||
// Replace any instances already present with a re-opening code
|
||||
// otherwise only the part of the string until said closing code
|
||||
// will be colored, and the rest will simply be 'plain'.
|
||||
str = code.open + str.replace(code.closeRe, code.open) + code.close;
|
||||
}
|
||||
|
||||
// Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue.
|
||||
ansiStyles.dim.open = originalDim;
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
function init() {
|
||||
var ret = {};
|
||||
|
||||
Object.keys(styles).forEach(function (name) {
|
||||
ret[name] = {
|
||||
get: function () {
|
||||
return build.call(this, [name]);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
defineProps(Chalk.prototype, init());
|
||||
|
||||
module.exports = new Chalk();
|
||||
module.exports.styles = ansiStyles;
|
||||
module.exports.hasColor = hasAnsi;
|
||||
module.exports.stripColor = stripAnsi;
|
||||
module.exports.supportsColor = supportsColor;
|
||||
21
build/node_modules/postcss-discard-comments/node_modules/chalk/license
generated
vendored
Normal file
21
build/node_modules/postcss-discard-comments/node_modules/chalk/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
50
build/node_modules/postcss-discard-comments/node_modules/chalk/node_modules/supports-color/index.js
generated
vendored
Normal file
50
build/node_modules/postcss-discard-comments/node_modules/chalk/node_modules/supports-color/index.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
var argv = process.argv;
|
||||
|
||||
var terminator = argv.indexOf('--');
|
||||
var hasFlag = function (flag) {
|
||||
flag = '--' + flag;
|
||||
var pos = argv.indexOf(flag);
|
||||
return pos !== -1 && (terminator !== -1 ? pos < terminator : true);
|
||||
};
|
||||
|
||||
module.exports = (function () {
|
||||
if ('FORCE_COLOR' in process.env) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (hasFlag('no-color') ||
|
||||
hasFlag('no-colors') ||
|
||||
hasFlag('color=false')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hasFlag('color') ||
|
||||
hasFlag('colors') ||
|
||||
hasFlag('color=true') ||
|
||||
hasFlag('color=always')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (process.stdout && !process.stdout.isTTY) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ('COLORTERM' in process.env) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (process.env.TERM === 'dumb') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
})();
|
||||
21
build/node_modules/postcss-discard-comments/node_modules/chalk/node_modules/supports-color/license
generated
vendored
Normal file
21
build/node_modules/postcss-discard-comments/node_modules/chalk/node_modules/supports-color/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
92
build/node_modules/postcss-discard-comments/node_modules/chalk/node_modules/supports-color/package.json
generated
vendored
Normal file
92
build/node_modules/postcss-discard-comments/node_modules/chalk/node_modules/supports-color/package.json
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"supports-color@2.0.0",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "supports-color@2.0.0",
|
||||
"_id": "supports-color@2.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
|
||||
"_location": "/postcss-discard-comments/chalk/supports-color",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "supports-color@2.0.0",
|
||||
"name": "supports-color",
|
||||
"escapedName": "supports-color",
|
||||
"rawSpec": "2.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/postcss-discard-comments/chalk"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
|
||||
"_spec": "2.0.0",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/chalk/supports-color/issues"
|
||||
},
|
||||
"description": "Detect whether a terminal supports color",
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"require-uncached": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/chalk/supports-color#readme",
|
||||
"keywords": [
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"ansi",
|
||||
"styles",
|
||||
"tty",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"command-line",
|
||||
"support",
|
||||
"supports",
|
||||
"capability",
|
||||
"detect"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
{
|
||||
"name": "Joshua Appelman",
|
||||
"email": "jappelman@xebia.com",
|
||||
"url": "jbnicolai.com"
|
||||
}
|
||||
],
|
||||
"name": "supports-color",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/chalk/supports-color.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"version": "2.0.0"
|
||||
}
|
||||
36
build/node_modules/postcss-discard-comments/node_modules/chalk/node_modules/supports-color/readme.md
generated
vendored
Normal file
36
build/node_modules/postcss-discard-comments/node_modules/chalk/node_modules/supports-color/readme.md
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# supports-color [](https://travis-ci.org/chalk/supports-color)
|
||||
|
||||
> Detect whether a terminal supports color
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save supports-color
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var supportsColor = require('supports-color');
|
||||
|
||||
if (supportsColor) {
|
||||
console.log('Terminal supports color');
|
||||
}
|
||||
```
|
||||
|
||||
It obeys the `--color` and `--no-color` CLI flags.
|
||||
|
||||
For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
|
||||
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
117
build/node_modules/postcss-discard-comments/node_modules/chalk/package.json
generated
vendored
Normal file
117
build/node_modules/postcss-discard-comments/node_modules/chalk/package.json
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"chalk@1.1.3",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "chalk@1.1.3",
|
||||
"_id": "chalk@1.1.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
||||
"_location": "/postcss-discard-comments/chalk",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "chalk@1.1.3",
|
||||
"name": "chalk",
|
||||
"escapedName": "chalk",
|
||||
"rawSpec": "1.1.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/postcss-discard-comments/postcss"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
||||
"_spec": "1.1.3",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"bugs": {
|
||||
"url": "https://github.com/chalk/chalk/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": "^2.2.1",
|
||||
"escape-string-regexp": "^1.0.2",
|
||||
"has-ansi": "^2.0.0",
|
||||
"strip-ansi": "^3.0.0",
|
||||
"supports-color": "^2.0.0"
|
||||
},
|
||||
"description": "Terminal string styling done right. Much color.",
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.11.2",
|
||||
"matcha": "^0.6.0",
|
||||
"mocha": "*",
|
||||
"nyc": "^3.0.0",
|
||||
"require-uncached": "^1.0.2",
|
||||
"resolve-from": "^1.0.0",
|
||||
"semver": "^4.3.3",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/chalk/chalk#readme",
|
||||
"keywords": [
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"str",
|
||||
"ansi",
|
||||
"style",
|
||||
"styles",
|
||||
"tty",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
{
|
||||
"name": "Joshua Appelman",
|
||||
"email": "jappelman@xebia.com",
|
||||
"url": "jbnicolai.com"
|
||||
},
|
||||
{
|
||||
"name": "JD Ballard",
|
||||
"email": "i.am.qix@gmail.com",
|
||||
"url": "github.com/qix-"
|
||||
}
|
||||
],
|
||||
"name": "chalk",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/chalk/chalk.git"
|
||||
},
|
||||
"scripts": {
|
||||
"bench": "matcha benchmark.js",
|
||||
"coverage": "nyc npm test && nyc report",
|
||||
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
|
||||
"test": "xo && mocha"
|
||||
},
|
||||
"version": "1.1.3",
|
||||
"xo": {
|
||||
"envs": [
|
||||
"node",
|
||||
"mocha"
|
||||
]
|
||||
}
|
||||
}
|
||||
213
build/node_modules/postcss-discard-comments/node_modules/chalk/readme.md
generated
vendored
Normal file
213
build/node_modules/postcss-discard-comments/node_modules/chalk/readme.md
generated
vendored
Normal file
@@ -0,0 +1,213 @@
|
||||
<h1 align="center">
|
||||
<br>
|
||||
<br>
|
||||
<img width="360" src="https://cdn.rawgit.com/chalk/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg" alt="chalk">
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
</h1>
|
||||
|
||||
> Terminal string styling done right
|
||||
|
||||
[](https://travis-ci.org/chalk/chalk)
|
||||
[](https://coveralls.io/r/chalk/chalk?branch=master)
|
||||
[](https://www.youtube.com/watch?v=9auOCbH5Ns4)
|
||||
|
||||
|
||||
[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.
|
||||
|
||||
**Chalk is a clean and focused alternative.**
|
||||
|
||||

|
||||
|
||||
|
||||
## Why
|
||||
|
||||
- Highly performant
|
||||
- Doesn't extend `String.prototype`
|
||||
- Expressive API
|
||||
- Ability to nest styles
|
||||
- Clean and focused
|
||||
- Auto-detects color support
|
||||
- Actively maintained
|
||||
- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save chalk
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
|
||||
|
||||
```js
|
||||
var chalk = require('chalk');
|
||||
|
||||
// style a string
|
||||
chalk.blue('Hello world!');
|
||||
|
||||
// combine styled and normal strings
|
||||
chalk.blue('Hello') + 'World' + chalk.red('!');
|
||||
|
||||
// compose multiple styles using the chainable API
|
||||
chalk.blue.bgRed.bold('Hello world!');
|
||||
|
||||
// pass in multiple arguments
|
||||
chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');
|
||||
|
||||
// nest styles
|
||||
chalk.red('Hello', chalk.underline.bgBlue('world') + '!');
|
||||
|
||||
// nest styles of the same type even (color, underline, background)
|
||||
chalk.green(
|
||||
'I am a green line ' +
|
||||
chalk.blue.underline.bold('with a blue substring') +
|
||||
' that becomes green again!'
|
||||
);
|
||||
```
|
||||
|
||||
Easily define your own themes.
|
||||
|
||||
```js
|
||||
var chalk = require('chalk');
|
||||
var error = chalk.bold.red;
|
||||
console.log(error('Error!'));
|
||||
```
|
||||
|
||||
Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data).
|
||||
|
||||
```js
|
||||
var name = 'Sindre';
|
||||
console.log(chalk.green('Hello %s'), name);
|
||||
//=> Hello Sindre
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### chalk.`<style>[.<style>...](string, [string...])`
|
||||
|
||||
Example: `chalk.red.bold.underline('Hello', 'world');`
|
||||
|
||||
Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `Chalk.red.yellow.green` is equivalent to `Chalk.green`.
|
||||
|
||||
Multiple arguments will be separated by space.
|
||||
|
||||
### chalk.enabled
|
||||
|
||||
Color support is automatically detected, but you can override it by setting the `enabled` property. You should however only do this in your own code as it applies globally to all chalk consumers.
|
||||
|
||||
If you need to change this in a reusable module create a new instance:
|
||||
|
||||
```js
|
||||
var ctx = new chalk.constructor({enabled: false});
|
||||
```
|
||||
|
||||
### chalk.supportsColor
|
||||
|
||||
Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
|
||||
|
||||
Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
|
||||
|
||||
### chalk.styles
|
||||
|
||||
Exposes the styles as [ANSI escape codes](https://github.com/chalk/ansi-styles).
|
||||
|
||||
Generally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with your own.
|
||||
|
||||
```js
|
||||
var chalk = require('chalk');
|
||||
|
||||
console.log(chalk.styles.red);
|
||||
//=> {open: '\u001b[31m', close: '\u001b[39m'}
|
||||
|
||||
console.log(chalk.styles.red.open + 'Hello' + chalk.styles.red.close);
|
||||
```
|
||||
|
||||
### chalk.hasColor(string)
|
||||
|
||||
Check whether a string [has color](https://github.com/chalk/has-ansi).
|
||||
|
||||
### chalk.stripColor(string)
|
||||
|
||||
[Strip color](https://github.com/chalk/strip-ansi) from a string.
|
||||
|
||||
Can be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported.
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
var chalk = require('chalk');
|
||||
var styledString = getText();
|
||||
|
||||
if (!chalk.supportsColor) {
|
||||
styledString = chalk.stripColor(styledString);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Styles
|
||||
|
||||
### Modifiers
|
||||
|
||||
- `reset`
|
||||
- `bold`
|
||||
- `dim`
|
||||
- `italic` *(not widely supported)*
|
||||
- `underline`
|
||||
- `inverse`
|
||||
- `hidden`
|
||||
- `strikethrough` *(not widely supported)*
|
||||
|
||||
### Colors
|
||||
|
||||
- `black`
|
||||
- `red`
|
||||
- `green`
|
||||
- `yellow`
|
||||
- `blue` *(on Windows the bright version is used as normal blue is illegible)*
|
||||
- `magenta`
|
||||
- `cyan`
|
||||
- `white`
|
||||
- `gray`
|
||||
|
||||
### Background colors
|
||||
|
||||
- `bgBlack`
|
||||
- `bgRed`
|
||||
- `bgGreen`
|
||||
- `bgYellow`
|
||||
- `bgBlue`
|
||||
- `bgMagenta`
|
||||
- `bgCyan`
|
||||
- `bgWhite`
|
||||
|
||||
|
||||
## 256-colors
|
||||
|
||||
Chalk does not support anything other than the base eight colors, which guarantees it will work on all terminals and systems. Some terminals, specifically `xterm` compliant ones, will support the full range of 8-bit colors. For this the lower level [ansi-256-colors](https://github.com/jbnicolai/ansi-256-colors) package can be used.
|
||||
|
||||
|
||||
## Windows
|
||||
|
||||
If you're on Windows, do yourself a favor and use [`cmder`](http://bliker.github.io/cmder/) instead of `cmd.exe`.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
|
||||
- [ansi-styles](https://github.com/chalk/ansi-styles/) - ANSI escape codes for styling strings in the terminal
|
||||
- [supports-color](https://github.com/chalk/supports-color/) - Detect whether a terminal supports color
|
||||
- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
|
||||
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
|
||||
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
|
||||
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
10
build/node_modules/postcss-discard-comments/node_modules/has-flag/index.js
generated
vendored
Normal file
10
build/node_modules/postcss-discard-comments/node_modules/has-flag/index.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
module.exports = function (flag, argv) {
|
||||
argv = argv || process.argv;
|
||||
|
||||
var terminatorPos = argv.indexOf('--');
|
||||
var prefix = /^--/.test(flag) ? '' : '--';
|
||||
var pos = argv.indexOf(prefix + flag);
|
||||
|
||||
return pos !== -1 && (terminatorPos !== -1 ? pos < terminatorPos : true);
|
||||
};
|
||||
21
build/node_modules/postcss-discard-comments/node_modules/has-flag/license
generated
vendored
Normal file
21
build/node_modules/postcss-discard-comments/node_modules/has-flag/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
95
build/node_modules/postcss-discard-comments/node_modules/has-flag/package.json
generated
vendored
Normal file
95
build/node_modules/postcss-discard-comments/node_modules/has-flag/package.json
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"has-flag@1.0.0",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "has-flag@1.0.0",
|
||||
"_id": "has-flag@1.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=",
|
||||
"_location": "/postcss-discard-comments/has-flag",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "has-flag@1.0.0",
|
||||
"name": "has-flag",
|
||||
"escapedName": "has-flag",
|
||||
"rawSpec": "1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/postcss-discard-comments/supports-color"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
|
||||
"_spec": "1.0.0",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/has-flag/issues"
|
||||
},
|
||||
"description": "Check if argv has a specific flag",
|
||||
"devDependencies": {
|
||||
"ava": "0.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/has-flag#readme",
|
||||
"keywords": [
|
||||
"has",
|
||||
"check",
|
||||
"detect",
|
||||
"contains",
|
||||
"find",
|
||||
"flag",
|
||||
"cli",
|
||||
"command-line",
|
||||
"argv",
|
||||
"process",
|
||||
"arg",
|
||||
"args",
|
||||
"argument",
|
||||
"arguments",
|
||||
"getopt",
|
||||
"minimist",
|
||||
"optimist"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
{
|
||||
"name": "Joshua Appelman",
|
||||
"email": "jappelman@xebia.com",
|
||||
"url": "jbnicolai.com"
|
||||
},
|
||||
{
|
||||
"name": "JD Ballard",
|
||||
"email": "i.am.qix@gmail.com",
|
||||
"url": "github.com/qix-"
|
||||
}
|
||||
],
|
||||
"name": "has-flag",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/has-flag.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
||||
64
build/node_modules/postcss-discard-comments/node_modules/has-flag/readme.md
generated
vendored
Normal file
64
build/node_modules/postcss-discard-comments/node_modules/has-flag/readme.md
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
# has-flag [](https://travis-ci.org/sindresorhus/has-flag)
|
||||
|
||||
> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
|
||||
|
||||
Correctly stops looking after an `--` argument terminator.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save has-flag
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
var hasFlag = require('has-flag');
|
||||
|
||||
hasFlag('unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('--unicorn');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo=bar');
|
||||
//=> true
|
||||
|
||||
hasFlag('foo');
|
||||
//=> false
|
||||
|
||||
hasFlag('rainbow');
|
||||
//=> false
|
||||
```
|
||||
|
||||
```
|
||||
$ node foo.js --unicorn --foo=bar -- --rainbow
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### hasFlag(flag, [argv])
|
||||
|
||||
Returns a boolean whether the flag exists.
|
||||
|
||||
#### flag
|
||||
|
||||
Type: `string`
|
||||
|
||||
CLI flag to look for. The `--` prefix is optional.
|
||||
|
||||
#### argv
|
||||
|
||||
Type: `array`
|
||||
Default: `process.argv`
|
||||
|
||||
CLI arguments.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
460
build/node_modules/postcss-discard-comments/node_modules/postcss/CHANGELOG.md
generated
vendored
Normal file
460
build/node_modules/postcss-discard-comments/node_modules/postcss/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,460 @@
|
||||
# Change Log
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## 5.1.18
|
||||
* Fix TypeScript definitions for case of multiple PostCSS versions
|
||||
in `node_modules` (by Chris Eppstein).
|
||||
|
||||
## 5.2.17
|
||||
* Add `postcss-sass` suggestion to syntax error on `.sass` input.
|
||||
|
||||
## 5.2.16
|
||||
* Better error on wrong argument in node constructor.
|
||||
|
||||
## 5.2.15
|
||||
* Fix TypeScript definitions (by bumbleblym).
|
||||
|
||||
## 5.2.14
|
||||
* Fix browser bundle building in webpack (by janschoenherr).
|
||||
|
||||
## 5.2.13
|
||||
* Do not add comment to important raws.
|
||||
* Fix JSDoc (by Dmitry Semigradsky).
|
||||
|
||||
## 5.2.12
|
||||
* Fix typo in deprecation message (by Garet McKinley).
|
||||
|
||||
## 5.2.11
|
||||
* Fix TypeScript definitions (by Jed Mao).
|
||||
|
||||
## 5.2.10
|
||||
* Fix TypeScript definitions (by Jed Mao).
|
||||
|
||||
## 5.2.9
|
||||
* Update TypeScript definitions (by Jed Mao).
|
||||
|
||||
## 5.2.8
|
||||
* Fix error message (by Ben Briggs).
|
||||
|
||||
## 5.2.7
|
||||
* Better error message on syntax object in plugins list.
|
||||
|
||||
## 5.2.6
|
||||
* Fix `postcss.vendor` for values with spaces (by 刘祺).
|
||||
|
||||
## 5.2.5
|
||||
* Better error message on unclosed string (by Ben Briggs).
|
||||
|
||||
## 5.2.4
|
||||
* Improve terminal CSS syntax highlight (by Simon Lydell).
|
||||
|
||||
## 5.2.3
|
||||
* Better color highlight in syntax error code frame.
|
||||
* Fix color highlight support in old systems.
|
||||
|
||||
## 5.2.2
|
||||
* Update `Processor#version`.
|
||||
|
||||
## 5.2.1
|
||||
* Fix source map path for CSS without `from` option (by Michele Locati).
|
||||
|
||||
## 5.2 “Duke Vapula”
|
||||
* Add syntax highlight to code frame in syntax error (by Andrey Popp).
|
||||
* Use Babel code frame style and size in syntax error.
|
||||
* Add `[` and `]` tokens to parse `[attr=;] {}` correctly.
|
||||
* Add `ignoreErrors` options to tokenizer (by Andrey Popp).
|
||||
* Fix error position on tab indent (by Simon Lydell).
|
||||
|
||||
## 5.1.2
|
||||
* Suggests SCSS/Less parsers on parse errors depends on file extension.
|
||||
|
||||
## 5.1.1
|
||||
* Fix TypeScript definitions (by Efremov Alexey).
|
||||
|
||||
## 5.1 “King and President Zagan”
|
||||
* Add URI in source map support (by Mark Finger).
|
||||
* Add `map.from` option (by Mark Finger).
|
||||
* Add `<no source>` mappings for nodes without source (by Bogdan Chadkin).
|
||||
* Add function value support to `map.prev` option (by Chris Montoro).
|
||||
* Add declaration value type check in shortcut creating (by 刘祺).
|
||||
* `Result#warn` now returns new created warning.
|
||||
* Don’t call plugin creator in `postcss.plugin` call.
|
||||
* Add source maps to PostCSS ES5 build.
|
||||
* Add JSDoc to PostCSS classes.
|
||||
* Clean npm package from unnecessary docs.
|
||||
|
||||
## 5.0.21
|
||||
* Fix support with input source mao with `utf8` encoding name.
|
||||
|
||||
## 5.0.20
|
||||
* Fix between raw value parsing (by David Clark).
|
||||
* Update TypeScript definitions (by Jed Mao).
|
||||
* Clean fake node.source after `append(string)`.
|
||||
|
||||
## 5.0.19
|
||||
* Fix indent-based syntaxes support.
|
||||
|
||||
## 5.0.18
|
||||
* Parse new lines according W3C CSS syntax specification.
|
||||
|
||||
## 5.0.17
|
||||
* Fix options argument in `Node#warn` (by Ben Briggs).
|
||||
* Fix TypeScript definitions (by Jed Mao).
|
||||
|
||||
## 5.0.16
|
||||
* Fix CSS syntax error position on unclosed quotes.
|
||||
|
||||
## 5.0.15
|
||||
* Fix `Node#clone()` on `null` value somewhere in node.
|
||||
|
||||
## 5.0.14
|
||||
* Allow to use PostCSS in webpack bundle without JSON loader.
|
||||
|
||||
## 5.0.13
|
||||
* Fix `index` and `word` options in `Warning#toString` (by Bogdan Chadkin).
|
||||
* Fix input source content loading in errors.
|
||||
* Fix map options on using `LazyResult` as input CSS.
|
||||
* 100% test coverage.
|
||||
* Use Babel 6.
|
||||
|
||||
## 5.0.12
|
||||
* Allow passing a previous map with no mappings (by Andreas Lind).
|
||||
|
||||
## 5.0.11
|
||||
* Increase plugins performance by 1.5 times.
|
||||
|
||||
## 5.0.10
|
||||
* Fix warning from nodes without source.
|
||||
|
||||
## 5.0.9
|
||||
* Fix source map type detection (by @asan).
|
||||
|
||||
## 5.0.8
|
||||
* Fixed a missed step in `5.0.7` that caused the module to be published as
|
||||
ES6 code.
|
||||
|
||||
## 5.0.7
|
||||
* PostCSS now requires that node 0.12 is installed via the engines property
|
||||
in package.json (by Howard Zuo).
|
||||
|
||||
## 5.0.6
|
||||
* Fix parsing nested at-rule without semicolon (by Matt Drake).
|
||||
* Trim `Declaration#value` (by Bogdan Chadkin).
|
||||
|
||||
## 5.0.5
|
||||
* Fix multi-tokens property parsing (by Matt Drake).
|
||||
|
||||
## 5.0.4
|
||||
* Fix start position in `Root#source`.
|
||||
* Fix source map annotation, when CSS uses `\r\n` (by Mohammad Younes).
|
||||
|
||||
## 5.0.3
|
||||
* Fix `url()` parsing.
|
||||
* Fix using `selectors` in `Rule` constructor.
|
||||
* Add start source to `Root` node.
|
||||
|
||||
## 5.0.2
|
||||
* Fix `remove(index)` to be compatible with 4.x plugin.
|
||||
|
||||
## 5.0.1
|
||||
* Fix PostCSS 4.x plugins compatibility.
|
||||
* Fix type definition loading (by Jed Mao).
|
||||
|
||||
## 5.0 “President Valac”
|
||||
* Remove `safe` option. Move Safe Parser to separate project.
|
||||
* `Node#toString` does not include `before` for root nodes.
|
||||
* Remove plugin returning `Root` API.
|
||||
* Remove Promise polyfill for node.js 0.10.
|
||||
* Deprecate `eachInside`, `eachDecl`, `eachRule`, `eachAtRule` and `eachComment`
|
||||
in favor of `walk`, `walkDecls`, `walkRules`, `walkAtRules` and `walkComments`
|
||||
(by Jed Mao).
|
||||
* Deprecate `Container#remove` and `Node#removeSelf`
|
||||
in favor of `Container#removeChild` and `Node#remove` (by Ben Briggs).
|
||||
* Deprecate `Node#replace` in favor of `replaceWith` (by Ben Briggs).
|
||||
* Deprecate raw properties in favor of `Node#raws` object.
|
||||
* Deprecate `Node#style` in favor of `raw`.
|
||||
* Deprecate `CssSyntaxError#generated` in favor of `input`.
|
||||
* Deprecate `Node#cleanStyles` in favor of `cleanRaws`.
|
||||
* Deprecate `Root#prevMap` in favor of `Root.source.input.map`.
|
||||
* Add `syntax`, `parser` and `stringifier` options for Custom Syntaxes.
|
||||
* Add stringifier option to `Node#toString`.
|
||||
* Add `Result#content` alias for non-CSS syntaxes.
|
||||
* Add `plugin.process(css)` shortcut to every plugin function (by Ben Briggs).
|
||||
* Add multiple nodes support to insert methods (by Jonathan Neal).
|
||||
* Add `Node#warn` shortcut (by Ben Briggs).
|
||||
* Add `word` and `index` options to errors and warnings (by David Clark).
|
||||
* Add `line`, `column` properties to `Warning`.
|
||||
* Use `supports-color` library to detect color support in error output.
|
||||
* Add type definitions for TypeScript plugin developers (by Jed Mao).
|
||||
* `Rule#selectors` setter detects separators.
|
||||
* Add `postcss.stringify` method.
|
||||
* Throw descriptive errors for incorrectly formatted plugins.
|
||||
* Add docs to npm release.
|
||||
* Fix `url()` parsing.
|
||||
* Fix Windows support (by Jed Mao).
|
||||
|
||||
## 4.1.16
|
||||
* Fix errors without stack trace.
|
||||
|
||||
## 4.1.15
|
||||
* Allow asynchronous plugins to change processor plugins list (by Ben Briggs).
|
||||
|
||||
## 4.1.14
|
||||
* Fix for plugins packs defined by `postcss.plugin`.
|
||||
|
||||
## 4.1.13
|
||||
* Fix input inlined source maps with UTF-8 encoding.
|
||||
|
||||
## 4.1.12
|
||||
* Update Promise polyfill.
|
||||
|
||||
## 4.1.11
|
||||
* Fix error message on wrong plugin format.
|
||||
|
||||
## 4.1.10
|
||||
* Fix Promise behavior on sync plugin errors.
|
||||
* Automatically fill `plugin` field in `CssSyntaxError`.
|
||||
* Fix warning message (by Ben Briggs).
|
||||
|
||||
## 4.1.9
|
||||
* Speed up `node.clone()`.
|
||||
|
||||
## 4.1.8
|
||||
* Accepts `Processor` instance in `postcss()` constructor too.
|
||||
|
||||
## 4.1.7
|
||||
* Speed up `postcss.list` (by Bogdan Chadkin).
|
||||
|
||||
## 4.1.6
|
||||
* Fix Promise behavior on parsing error.
|
||||
|
||||
## 4.1.5
|
||||
* Parse at-words in declaration values.
|
||||
|
||||
## 4.1.4
|
||||
* Fix Promise polyfill dependency (by Anton Yakushev and Matija Marohnić).
|
||||
|
||||
## 4.1.3
|
||||
* Add Promise polyfill for node.js 0.10 and IE.
|
||||
|
||||
## 4.1.2
|
||||
* List helpers can be accessed independently `var space = postcss.list.space`.
|
||||
|
||||
## 4.1.1
|
||||
* Show deprecated message only once.
|
||||
|
||||
## 4.1 “Marquis Andras”
|
||||
* Asynchronous plugin support.
|
||||
* Add warnings from plugins and `Result#messages`.
|
||||
* Add `postcss.plugin()` to create plugins with a standard API.
|
||||
* Insert nodes by CSS string.
|
||||
* Show version warning message on error from an outdated plugin.
|
||||
* Send `Result` instance to plugins as the second argument.
|
||||
* Add `CssSyntaxError#plugin`.
|
||||
* Add `CssSyntaxError#showSourceCode()`.
|
||||
* Add `postcss.list` and `postcss.vendor` aliases.
|
||||
* Add `Processor#version`.
|
||||
* Parse wrong closing bracket.
|
||||
* Parse `!important` statement with spaces and comments inside (by Ben Briggs).
|
||||
* Throw an error on declaration without `prop` or `value` (by Philip Peterson).
|
||||
* Fix source map mappings position.
|
||||
* Add indexed source map support.
|
||||
* Always set `error.generated`.
|
||||
* Clean all source map annotation comments.
|
||||
|
||||
## 4.0.6
|
||||
* Remove `babel` from released package dependencies (by Andres Suarez).
|
||||
|
||||
## 4.0.5
|
||||
* Fix error message on double colon in declaration.
|
||||
|
||||
## 4.0.4
|
||||
* Fix indent detection in some rare cases.
|
||||
|
||||
## 4.0.3
|
||||
* Faster API with 6to5 Loose mode.
|
||||
* Fix indexed source maps support.
|
||||
|
||||
## 4.0.2
|
||||
* Do not copy IE hacks to code style.
|
||||
|
||||
## 4.0.1
|
||||
* Add `source.input` to `Root` too.
|
||||
|
||||
## 4.0 “Duke Flauros”
|
||||
* Rename `Container#childs` to `nodes`.
|
||||
* Rename `PostCSS#processors` to `plugins`.
|
||||
* Add `Node#replaceValues()` method.
|
||||
* Add `Node#moveTo()`, `moveBefore()` and `moveAfter()` methods.
|
||||
* Add `Node#cloneBefore()` and `cloneAfter()` shortcuts.
|
||||
* Add `Node#next()`, `prev()` and `root()` shortcuts.
|
||||
* Add `Node#replaceWith()` method.
|
||||
* Add `Node#error()` method.
|
||||
* Add `Container#removeAll()` method.
|
||||
* Add filter argument to `eachDecl()` and `eachAtRule()`.
|
||||
* Add `Node#source.input` and move `source.file` or `source.id` to `input`.
|
||||
* Change code indent, when node was moved.
|
||||
* Better fix code style on `Rule`, `AtRule` and `Comment` nodes changes.
|
||||
* Allow to create rules and at-rules by hash shortcut in append methods.
|
||||
* Add class name to CSS syntax error output.
|
||||
|
||||
## 3.0.7
|
||||
* Fix IE filter parsing with multiple commands.
|
||||
* Safer way to consume PostCSS object as plugin (by Maxime Thirouin).
|
||||
|
||||
## 3.0.6
|
||||
* Fix missing semicolon when comment comes after last declaration.
|
||||
* Fix Safe Mode declaration parsing on unclosed blocks.
|
||||
|
||||
## 3.0.5
|
||||
* Fix parser to support difficult cases with backslash escape and brackets.
|
||||
* Add `CssSyntaxError#stack` (by Maxime Thirouin).
|
||||
|
||||
## 3.0.4
|
||||
* Fix Safe Mode on unknown word before declaration.
|
||||
|
||||
## 3.0.3
|
||||
* Increase tokenizer speed (by Roman Dvornov).
|
||||
|
||||
## 3.0.2
|
||||
* Fix empty comment parsing.
|
||||
* Fix `Root#normalize` in some inserts.
|
||||
|
||||
## 3.0.1
|
||||
* Fix Rhino JS runtime support.
|
||||
* Typo in deprecated warning (by Maxime Thirouin).
|
||||
|
||||
## 3.0 “Marquis Andrealphus”
|
||||
* New parser, which become the fastest ever CSS parser written in JavaScript.
|
||||
* Parser can now parse declarations and rules in one parent (like in `@page`)
|
||||
and nested declarations for plugins like `postcss-nested`.
|
||||
* Child nodes array is now in `childs` property, instead of `decls` and `rules`.
|
||||
* `map.inline` and `map.sourcesContent` options are now `true` by default.
|
||||
* Fix iterators (`each`, `insertAfter`) on children array changes.
|
||||
* Use previous source map to show origin source of CSS syntax error.
|
||||
* Use 6to5 ES6 compiler, instead of ES6 Transpiler.
|
||||
* Use code style for manually added rules from existing rules.
|
||||
* Use `from` option from previous source map `file` field.
|
||||
* Set `to` value to `from` if `to` option is missing.
|
||||
* Use better node source name when missing `from` option.
|
||||
* Show a syntax error when `;` is missed between declarations.
|
||||
* Allow to pass `PostCSS` instance or list of plugins to `use()` method.
|
||||
* Allow to pass `Result` instance to `process()` method.
|
||||
* Trim Unicode BOM on source maps parsing.
|
||||
* Parse at-rules without spaces like `@import"file"`.
|
||||
* Better previous `sourceMappingURL` annotation comment cleaning.
|
||||
* Do not remove previous `sourceMappingURL` comment on `map.annotation: false`.
|
||||
* Parse nameless at-rules in Safe Mode.
|
||||
* Fix source map generation for nodes without source.
|
||||
* Fix next child `before` if `Root` first child got removed.
|
||||
|
||||
## 2.2.6
|
||||
* Fix map generation for nodes without source (by Josiah Savary).
|
||||
|
||||
## 2.2.5
|
||||
* Fix source map with BOM marker support (by Mohammad Younes).
|
||||
* Fix source map paths (by Mohammad Younes).
|
||||
|
||||
## 2.2.4
|
||||
* Fix `prepend()` on empty `Root`.
|
||||
|
||||
## 2.2.3
|
||||
* Allow to use object shortcut in `use()` with functions like `autoprefixer`.
|
||||
|
||||
## 2.2.2
|
||||
* Add shortcut to set processors in `use()` via object with `.postcss` property.
|
||||
|
||||
## 2.2.1
|
||||
* Send `opts` from `Processor#process(css, opts)` to processors.
|
||||
|
||||
## 2.2 “Marquis Cimeies”
|
||||
* Use GNU style syntax error messages.
|
||||
* Add `Node#replace` method.
|
||||
* Add `CssSyntaxError#reason` property.
|
||||
|
||||
## 2.1.2
|
||||
* Fix UTF-8 support in inline source map.
|
||||
* Fix source map `sourcesContent` if there is no `from` and `to` options.
|
||||
|
||||
## 2.1.1
|
||||
* Allow to miss `to` and `from` options for inline source maps.
|
||||
* Add `Node#source.id` if file name is unknown.
|
||||
* Better detect splitter between rules in CSS concatenation tools.
|
||||
* Automatically clone node in insert methods.
|
||||
|
||||
## 2.1 “King Amdusias”
|
||||
* Change Traceur ES6 compiler to ES6 Transpiler.
|
||||
* Show broken CSS line in syntax error.
|
||||
|
||||
## 2.0 “King Belial”
|
||||
* Project was rewritten from CoffeeScript to ES6.
|
||||
* Add Safe Mode to works with live input or with hacks from legacy code.
|
||||
* More safer parser to pass all hacks from Browserhacks.com.
|
||||
* Use real properties instead of magic getter/setter for raw properties.
|
||||
|
||||
## 1.0 “Marquis Decarabia”
|
||||
* Save previous source map for each node to support CSS concatenation
|
||||
with multiple previous maps.
|
||||
* Add `map.sourcesContent` option to add origin content to `sourcesContent`
|
||||
inside map.
|
||||
* Allow to set different place of output map in annotation comment.
|
||||
* Allow to use arrays and `Root` in `Container#append` and same methods.
|
||||
* Add `Root#prevMap` with information about previous map.
|
||||
* Allow to use latest PostCSS from GitHub by npm.
|
||||
* `Result` now is lazy and it will generate output CSS only if you use `css`
|
||||
or `map` property.
|
||||
* Use separated `map.prev` option to set previous map.
|
||||
* Rename `inlineMap` option to `map.inline`.
|
||||
* Rename `mapAnnotation` option to `map.annotation`.
|
||||
* `Result#map` now return `SourceMapGenerator` object, instead of string.
|
||||
* Run previous map autodetect only if input CSS contains annotation comment.
|
||||
* Add `map: 'inline'` shortcut for `map: { inline: true }` option.
|
||||
* `Node#source.file` now will contains absolute path.
|
||||
* Clean `Declaration#between` style on node clone.
|
||||
|
||||
## 0.3.5
|
||||
* Allow to use `Root` or `Result` as first argument in `process()`.
|
||||
* Save parsed AST to `Result#root`.
|
||||
|
||||
## 0.3.4
|
||||
* Better space symbol detect to read UTF-8 BOM correctly.
|
||||
|
||||
## 0.3.3
|
||||
* Remove source map hacks by using new Mozilla’s `source-map` (by Simon Lydell).
|
||||
|
||||
## 0.3.2
|
||||
* Add URI encoding support for inline source maps.
|
||||
|
||||
## 0.3.1
|
||||
* Fix relative paths from previous source map.
|
||||
* Safer space split in `Rule#selectors` (by Simon Lydell).
|
||||
|
||||
## 0.3 “Prince Seere”
|
||||
* Add `Comment` node for comments between declarations or rules.
|
||||
* Add source map annotation comment to output CSS.
|
||||
* Allow to inline source map to annotation comment by data:uri.
|
||||
* Fix source maps on Windows.
|
||||
* Fix source maps for subdirectory (by Dmitry Nikitenko and Simon Lydell).
|
||||
* Autodetect previous source map.
|
||||
* Add `first` and `last` shortcuts to container nodes.
|
||||
* Parse `!important` to separated property in `Declaration`.
|
||||
* Allow to break iteration by returning `false`.
|
||||
* Copy code style to new nodes.
|
||||
* Add `eachInside` method to recursively iterate all nodes.
|
||||
* Add `selectors` shortcut to get selectors array.
|
||||
* Add `toResult` method to `Rule` to simplify work with several input files.
|
||||
* Clean declaration’s `value`, rule’s `selector` and at-rule’s `params`
|
||||
by storing spaces in `between` property.
|
||||
|
||||
## 0.2 “Duke Dantalion”
|
||||
* Add source map support.
|
||||
* Add shortcuts to create nodes.
|
||||
* Method `process()` now returns object with `css` and `map` keys.
|
||||
* Origin CSS file option was renamed from `file` to `from`.
|
||||
* Rename `Node#remove()` method to `removeSelf()` to fix name conflict.
|
||||
* Node source was moved to `source` property with origin file
|
||||
and node end position.
|
||||
* You can set own CSS generate function.
|
||||
|
||||
## 0.1 “Count Andromalius”
|
||||
* Initial release.
|
||||
20
build/node_modules/postcss-discard-comments/node_modules/postcss/LICENSE
generated
vendored
Normal file
20
build/node_modules/postcss-discard-comments/node_modules/postcss/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2013 Andrey Sitnik <andrey@sitnik.ru>
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
379
build/node_modules/postcss-discard-comments/node_modules/postcss/README.md
generated
vendored
Normal file
379
build/node_modules/postcss-discard-comments/node_modules/postcss/README.md
generated
vendored
Normal file
@@ -0,0 +1,379 @@
|
||||
# PostCSS [![Travis Build Status][travis-img]][travis] [![AppVeyor Build Status][appveyor-img]][appveyor] [![Gitter][chat-img]][chat]
|
||||
|
||||
<img align="right" width="95" height="95"
|
||||
title="Philosopher’s stone, logo of PostCSS"
|
||||
src="http://postcss.github.io/postcss/logo.svg">
|
||||
|
||||
[appveyor-img]: https://img.shields.io/appveyor/ci/ai/postcss.svg?label=windows
|
||||
[travis-img]: https://img.shields.io/travis/postcss/postcss.svg?label=unix
|
||||
[chat-img]: https://img.shields.io/badge/Gitter-Join_the_PostCSS_chat-brightgreen.svg
|
||||
[appveyor]: https://ci.appveyor.com/project/ai/postcss
|
||||
[travis]: https://travis-ci.org/postcss/postcss
|
||||
[chat]: https://gitter.im/postcss/postcss
|
||||
|
||||
PostCSS is a tool for transforming styles with JS plugins.
|
||||
These plugins can lint your CSS, support variables and mixins,
|
||||
transpile future CSS syntax, inline images, and more.
|
||||
|
||||
PostCSS is used by industry leaders including Wikipedia, Twitter, Alibaba,
|
||||
and JetBrains. The [Autoprefixer] PostCSS plugin is one of the most popular
|
||||
CSS processors.
|
||||
|
||||
Twitter account: [@postcss](https://twitter.com/postcss).
|
||||
VK.com page: [postcss](https://vk.com/postcss).
|
||||
Support / Discussion: [Gitter](https://gitter.im/postcss/postcss).
|
||||
|
||||
For PostCSS commercial support (consulting, improving the front-end culture
|
||||
of your company, PostCSS plugins), contact [Evil Martians](https://evilmartians.com/?utm_source=postcss)
|
||||
at <surrender@evilmartians.com>.
|
||||
|
||||
[Autoprefixer]: https://github.com/postcss/autoprefixer
|
||||
|
||||
<a href="https://evilmartians.com/?utm_source=postcss">
|
||||
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
|
||||
alt="Sponsored by Evil Martians" width="236" height="54">
|
||||
</a>
|
||||
|
||||
## Plugins
|
||||
|
||||
Currently, PostCSS has more than 200 plugins. You can find all of the plugins
|
||||
in the [plugins list] or in the [searchable catalog]. Below is a list
|
||||
of our favorite plugins — the best demonstrations of what can be built
|
||||
on top of PostCSS.
|
||||
|
||||
If you have any new ideas, [PostCSS plugin development] is really easy.
|
||||
|
||||
[searchable catalog]: http://postcss.parts
|
||||
[plugins list]: https://github.com/postcss/postcss/blob/master/docs/plugins.md
|
||||
|
||||
### Solve Global CSS Problem
|
||||
|
||||
* [`postcss-use`] allows you to explicitly set PostCSS plugins within CSS
|
||||
and execute them only for the current file.
|
||||
* [`postcss-modules`] and [`react-css-modules`] automatically isolate
|
||||
selectors within components.
|
||||
* [`postcss-autoreset`] is an alternative to using a global reset
|
||||
that is better for isolatable components.
|
||||
* [`postcss-initial`] adds `all: initial` support, which resets
|
||||
all inherited styles.
|
||||
* [`cq-prolyfill`] adds container query support, allowing styles that respond
|
||||
to the width of the parent.
|
||||
|
||||
### Use Future CSS, Today
|
||||
|
||||
* [`autoprefixer`] adds vendor prefixes, using data from Can I Use.
|
||||
* [`postcss-cssnext`] allows you to use future CSS features today
|
||||
(includes `autoprefixer`).
|
||||
* [`postcss-image-set-polyfill`] emulates [`image-set`] function logic for all browsers
|
||||
|
||||
### Better CSS Readability
|
||||
|
||||
* [`precss`] contains plugins for Sass-like features, like variables, nesting,
|
||||
and mixins.
|
||||
* [`postcss-sorting`] sorts the content of rules and at-rules.
|
||||
* [`postcss-utilities`] includes the most commonly used shortcuts and helpers.
|
||||
* [`short`] adds and extends numerous shorthand properties.
|
||||
|
||||
### Images and Fonts
|
||||
|
||||
* [`postcss-assets`] inserts image dimensions and inlines files.
|
||||
* [`postcss-sprites`] generates image sprites.
|
||||
* [`font-magician`] generates all the `@font-face` rules needed in CSS.
|
||||
* [`postcss-inline-svg`] allows you to inline SVG and customize its styles.
|
||||
* [`postcss-write-svg`] allows you to write simple SVG directly in your CSS.
|
||||
|
||||
### Linters
|
||||
|
||||
* [`stylelint`] is a modular stylesheet linter.
|
||||
* [`stylefmt`] is a tool that automatically formats CSS
|
||||
according `stylelint` rules.
|
||||
* [`doiuse`] lints CSS for browser support, using data from Can I Use.
|
||||
* [`colorguard`] helps you maintain a consistent color palette.
|
||||
|
||||
### Other
|
||||
|
||||
* [`postcss-rtl`] combines both-directional (left-to-right and right-to-left) styles in one CSS file.
|
||||
* [`cssnano`] is a modular CSS minifier.
|
||||
* [`lost`] is a feature-rich `calc()` grid system.
|
||||
* [`rtlcss`] mirrors styles for right-to-left locales.
|
||||
|
||||
[PostCSS plugin development]: https://github.com/postcss/postcss/blob/master/docs/writing-a-plugin.md
|
||||
[`postcss-inline-svg`]: https://github.com/TrySound/postcss-inline-svg
|
||||
[`react-css-modules`]: https://github.com/gajus/react-css-modules
|
||||
[`postcss-autoreset`]: https://github.com/maximkoretskiy/postcss-autoreset
|
||||
[`postcss-write-svg`]: https://github.com/jonathantneal/postcss-write-svg
|
||||
[`postcss-utilities`]: https://github.com/ismamz/postcss-utilities
|
||||
[`postcss-initial`]: https://github.com/maximkoretskiy/postcss-initial
|
||||
[`postcss-sprites`]: https://github.com/2createStudio/postcss-sprites
|
||||
[`postcss-modules`]: https://github.com/outpunk/postcss-modules
|
||||
[`postcss-sorting`]: https://github.com/hudochenkov/postcss-sorting
|
||||
[`postcss-cssnext`]: http://cssnext.io
|
||||
[`postcss-image-set-polyfill`]: https://github.com/SuperOl3g/postcss-image-set-polyfill
|
||||
[`postcss-assets`]: https://github.com/assetsjs/postcss-assets
|
||||
[`font-magician`]: https://github.com/jonathantneal/postcss-font-magician
|
||||
[`autoprefixer`]: https://github.com/postcss/autoprefixer
|
||||
[`cq-prolyfill`]: https://github.com/ausi/cq-prolyfill
|
||||
[`postcss-rtl`]: https://github.com/vkalinichev/postcss-rtl
|
||||
[`postcss-use`]: https://github.com/postcss/postcss-use
|
||||
[`css-modules`]: https://github.com/css-modules/css-modules
|
||||
[`colorguard`]: https://github.com/SlexAxton/css-colorguard
|
||||
[`stylelint`]: https://github.com/stylelint/stylelint
|
||||
[`stylefmt`]: https://github.com/morishitter/stylefmt
|
||||
[`cssnano`]: http://cssnano.co
|
||||
[`precss`]: https://github.com/jonathantneal/precss
|
||||
[`doiuse`]: https://github.com/anandthakker/doiuse
|
||||
[`rtlcss`]: https://github.com/MohammadYounes/rtlcss
|
||||
[`short`]: https://github.com/jonathantneal/postcss-short
|
||||
[`lost`]: https://github.com/peterramsing/lost
|
||||
[`image-set`]: https://drafts.csswg.org/css-images-3/#image-set-notation
|
||||
|
||||
## Syntaxes
|
||||
|
||||
PostCSS can transform styles in any syntax, not just CSS.
|
||||
If there is not yet support for your favorite syntax,
|
||||
you can write a parser and/or stringifier to extend PostCSS.
|
||||
|
||||
* [`sugarss`] is a indent-based syntax like Sass or Stylus.
|
||||
* [`postcss-scss`] allows you to work with SCSS
|
||||
*(but does not compile SCSS to CSS)*.
|
||||
* [`postcss-sass`] allows you to work with Sass
|
||||
*(but does not compile Sass to CSS)*.
|
||||
* [`postcss-less`] allows you to work with Less
|
||||
*(but does not compile LESS to CSS)*.
|
||||
* [`postcss-less-engine`] allows you to work with Less
|
||||
*(and DOES compile LESS to CSS using true Less.js evaluation)*.
|
||||
* [`postcss-js`] allows you to write styles in JS or transform
|
||||
React Inline Styles, Radium or JSS.
|
||||
* [`postcss-safe-parser`] finds and fixes CSS syntax errors.
|
||||
* [`midas`] converts a CSS string to highlighted HTML.
|
||||
|
||||
[`sugarss`]: https://github.com/postcss/sugarss
|
||||
[`postcss-scss`]: https://github.com/postcss/postcss-scss
|
||||
[`postcss-sass`]: https://github.com/AleshaOleg/postcss-sass
|
||||
[`postcss-less`]: https://github.com/webschik/postcss-less
|
||||
[`postcss-less-engine`]: https://github.com/Crunch/postcss-less
|
||||
[`postcss-js`]: https://github.com/postcss/postcss-js
|
||||
[`postcss-safe-parser`]: https://github.com/postcss/postcss-safe-parser
|
||||
[`midas`]: https://github.com/ben-eb/midas
|
||||
|
||||
## Articles
|
||||
|
||||
* [Some things you may think about PostCSS… and you might be wrong](http://julian.io/some-things-you-may-think-about-postcss-and-you-might-be-wrong)
|
||||
* [What PostCSS Really Is; What It Really Does](http://davidtheclark.com/its-time-for-everyone-to-learn-about-postcss)
|
||||
* [PostCSS Guides](http://webdesign.tutsplus.com/series/postcss-deep-dive--cms-889)
|
||||
|
||||
More articles and videos you can find on [awesome-postcss](https://github.com/jjaderg/awesome-postcss) list.
|
||||
|
||||
## Books
|
||||
|
||||
* [Mastering PostCSS for Web Design](https://www.packtpub.com/web-development/mastering-postcss-web-design) by Alex Libby, Packt. (June 2016)
|
||||
|
||||
## Usage
|
||||
|
||||
You can start using PostCSS in just two steps:
|
||||
|
||||
1. Find and add PostCSS extensions for your build tool.
|
||||
2. [Select plugins] and add them to your PostCSS process.
|
||||
|
||||
[Select plugins]: http://postcss.parts
|
||||
|
||||
### Webpack
|
||||
|
||||
Use [`postcss-loader`] in `webpack.config.js`:
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
{
|
||||
loader: 'style-loader',
|
||||
},
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
sourceMap: true,
|
||||
importLoaders: 1,
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
sourceMap: 'inline',
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then create `postcss.config.js`:
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
plugins: [
|
||||
require('precss'),
|
||||
require('autoprefixer')
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
[`postcss-loader`]: https://github.com/postcss/postcss-loader
|
||||
|
||||
### Gulp
|
||||
|
||||
Use [`gulp-postcss`] and [`gulp-sourcemaps`].
|
||||
|
||||
```js
|
||||
gulp.task('css', function () {
|
||||
var postcss = require('gulp-postcss');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
|
||||
return gulp.src('src/**/*.css')
|
||||
.pipe( sourcemaps.init() )
|
||||
.pipe( postcss([ require('precss'), require('autoprefixer') ]) )
|
||||
.pipe( sourcemaps.write('.') )
|
||||
.pipe( gulp.dest('build/') );
|
||||
});
|
||||
```
|
||||
|
||||
[`gulp-sourcemaps`]: https://github.com/floridoo/gulp-sourcemaps
|
||||
[`gulp-postcss`]: https://github.com/postcss/gulp-postcss
|
||||
|
||||
### npm run / CLI
|
||||
|
||||
To use PostCSS from your command-line interface or with npm scripts
|
||||
there is [`postcss-cli`].
|
||||
|
||||
```sh
|
||||
postcss --use autoprefixer -c options.json -o main.css css/*.css
|
||||
```
|
||||
|
||||
[`postcss-cli`]: https://github.com/postcss/postcss-cli
|
||||
|
||||
### Browser
|
||||
|
||||
If you want to compile CSS string in browser (for instance, in live edit
|
||||
tools like CodePen), just use [Browserify] or [webpack]. They will pack
|
||||
PostCSS and plugins files into a single file.
|
||||
|
||||
To apply PostCSS plugins to React Inline Styles, JSS, Radium
|
||||
and other [CSS-in-JS], you can use [`postcss-js`] and transforms style objects.
|
||||
|
||||
```js
|
||||
var postcss = require('postcss-js');
|
||||
var prefixer = postcss.sync([ require('autoprefixer') ]);
|
||||
|
||||
prefixer({ display: 'flex' }); //=> { display: ['-webkit-box', '-webkit-flex', '-ms-flexbox', 'flex'] }
|
||||
```
|
||||
|
||||
[`postcss-js`]: https://github.com/postcss/postcss-js
|
||||
[Browserify]: http://browserify.org/
|
||||
[webpack]: https://webpack.github.io/
|
||||
[CSS-in-JS]: https://github.com/MicheleBertoli/css-in-js
|
||||
|
||||
### Runners
|
||||
|
||||
* **Grunt**: [`grunt-postcss`](https://github.com/nDmitry/grunt-postcss)
|
||||
* **HTML**: [`posthtml-postcss`](https://github.com/posthtml/posthtml-postcss)
|
||||
* **Stylus**: [`poststylus`](https://github.com/seaneking/poststylus)
|
||||
* **Rollup**: [`rollup-plugin-postcss`](https://github.com/egoist/rollup-plugin-postcss)
|
||||
* **Brunch**: [`postcss-brunch`](https://github.com/brunch/postcss-brunch)
|
||||
* **Broccoli**: [`broccoli-postcss`](https://github.com/jeffjewiss/broccoli-postcss)
|
||||
* **Meteor**: [`postcss`](https://atmospherejs.com/juliancwirko/postcss)
|
||||
* **ENB**: [`enb-postcss`](https://github.com/awinogradov/enb-postcss)
|
||||
* **Fly**: [`fly-postcss`](https://github.com/postcss/fly-postcss)
|
||||
* **Start**: [`start-postcss`](https://github.com/start-runner/postcss)
|
||||
* **Connect/Express**: [`postcss-middleware`](https://github.com/jedmao/postcss-middleware)
|
||||
|
||||
### JS API
|
||||
|
||||
For other environments, you can use the JS API:
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const postcss = require('postcss');
|
||||
const precss = require('precss');
|
||||
const autoprefixer = require('autoprefixer');
|
||||
|
||||
fs.readFile('src/app.css', (err, css) => {
|
||||
postcss([precss, autoprefixer])
|
||||
.process(css, { from: 'src/app.css', to: 'dest/app.css' })
|
||||
.then(result => {
|
||||
fs.writeFile('dest/app.css', result.css);
|
||||
if ( result.map ) fs.writeFile('dest/app.css.map', result.map);
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
Read the [PostCSS API documentation] for more details about the JS API.
|
||||
|
||||
All PostCSS runners should pass [PostCSS Runner Guidelines].
|
||||
|
||||
[PostCSS Runner Guidelines]: https://github.com/postcss/postcss/blob/master/docs/guidelines/runner.md
|
||||
[PostCSS API documentation]: http://api.postcss.org/postcss.html
|
||||
|
||||
### Options
|
||||
|
||||
Most PostCSS runners accept two parameters:
|
||||
|
||||
* An array of plugins.
|
||||
* An object of options.
|
||||
|
||||
Common options:
|
||||
|
||||
* `syntax`: an object providing a syntax parser and a stringifier.
|
||||
* `parser`: a special syntax parser (for example, [SCSS]).
|
||||
* `stringifier`: a special syntax output generator (for example, [Midas]).
|
||||
* `map`: [source map options].
|
||||
* `from`: the input file name (most runners set it automatically).
|
||||
* `to`: the output file name (most runners set it automatically).
|
||||
|
||||
[source map options]: https://github.com/postcss/postcss/blob/master/docs/source-maps.md
|
||||
[Midas]: https://github.com/ben-eb/midas
|
||||
[SCSS]: https://github.com/postcss/postcss-scss
|
||||
|
||||
### Node.js 0.10 and the Promise API
|
||||
|
||||
If you want to run PostCSS in Node.js 0.10, add the [Promise polyfill]:
|
||||
|
||||
```js
|
||||
require('es6-promise').polyfill();
|
||||
var postcss = require('postcss');
|
||||
```
|
||||
|
||||
[Promise polyfill]: https://github.com/jakearchibald/es6-promise
|
||||
|
||||
## Editors & IDE Integration
|
||||
|
||||
### Atom
|
||||
|
||||
* [`language-postcss`] adds PostCSS and [SugarSS] highlight.
|
||||
* [`source-preview-postcss`] previews your output CSS in a separate, live pane.
|
||||
|
||||
[SugarSS]: https://github.com/postcss/sugarss
|
||||
|
||||
### Sublime Text
|
||||
|
||||
* [`Syntax-highlighting-for-PostCSS`] adds PostCSS highlight.
|
||||
|
||||
[`Syntax-highlighting-for-PostCSS`]: https://github.com/hudochenkov/Syntax-highlighting-for-PostCSS
|
||||
[`source-preview-postcss`]: https://atom.io/packages/source-preview-postcss
|
||||
[`language-postcss`]: https://atom.io/packages/language-postcss
|
||||
|
||||
### Vim
|
||||
|
||||
* [`postcss.vim`] adds PostCSS highlight.
|
||||
|
||||
[`postcss.vim`]: https://github.com/stephenway/postcss.vim
|
||||
|
||||
### WebStorm
|
||||
|
||||
WebStorm 2016.3 [has] built-in PostCSS support.
|
||||
|
||||
[has]: https://blog.jetbrains.com/webstorm/2016/08/webstorm-2016-3-early-access-preview/
|
||||
195
build/node_modules/postcss-discard-comments/node_modules/postcss/docs/guidelines/plugin.md
generated
vendored
Normal file
195
build/node_modules/postcss-discard-comments/node_modules/postcss/docs/guidelines/plugin.md
generated
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
# PostCSS Plugin Guidelines
|
||||
|
||||
A PostCSS plugin is a function that receives and, usually,
|
||||
transforms a CSS AST from the PostCSS parser.
|
||||
|
||||
The rules below are *mandatory* for all PostCSS plugins.
|
||||
|
||||
See also [ClojureWerkz’s recommendations] for open source projects.
|
||||
|
||||
[ClojureWerkz’s recommendations]: http://blog.clojurewerkz.org/blog/2013/04/20/how-to-make-your-open-source-project-really-awesome/
|
||||
|
||||
## 1. API
|
||||
|
||||
### 1.1 Clear name with `postcss-` prefix
|
||||
|
||||
The plugin’s purpose should be clear just by reading its name.
|
||||
If you wrote a transpiler for CSS 4 Custom Media, `postcss-custom-media`
|
||||
would be a good name. If you wrote a plugin to support mixins,
|
||||
`postcss-mixins` would be a good name.
|
||||
|
||||
The prefix `postcss-` shows that the plugin is part of the PostCSS ecosystem.
|
||||
|
||||
This rule is not mandatory for plugins that can run as independent tools,
|
||||
without the user necessarily knowing that it is powered by
|
||||
PostCSS — for example, [cssnext] and [Autoprefixer].
|
||||
|
||||
[Autoprefixer]: https://github.com/postcss/autoprefixer
|
||||
[cssnext]: http://cssnext.io/
|
||||
|
||||
### 1.2. Do one thing, and do it well
|
||||
|
||||
Do not create multitool plugins. Several small, one-purpose plugins bundled into
|
||||
a plugin pack is usually a better solution.
|
||||
|
||||
For example, [cssnext] contains many small plugins,
|
||||
one for each W3C specification. And [cssnano] contains a separate plugin
|
||||
for each of its optimization.
|
||||
|
||||
[cssnext]: http://cssnext.io/
|
||||
[cssnano]: https://github.com/ben-eb/cssnano
|
||||
|
||||
### 1.3. Do not use mixins
|
||||
|
||||
Preprocessors libraries like Compass provide an API with mixins.
|
||||
|
||||
PostCSS plugins are different.
|
||||
A plugin cannot be just a set of mixins for [postcss-mixins].
|
||||
|
||||
To achieve your goal, consider transforming valid CSS
|
||||
or using custom at-rules and custom properties.
|
||||
|
||||
[postcss-mixins]: https://github.com/postcss/postcss-mixins
|
||||
|
||||
### 1.4. Create plugin by `postcss.plugin`
|
||||
|
||||
By wrapping your function in this method,
|
||||
you are hooking into a common plugin API:
|
||||
|
||||
```js
|
||||
module.exports = postcss.plugin('plugin-name', function (opts) {
|
||||
return function (root, result) {
|
||||
// Plugin code
|
||||
};
|
||||
});
|
||||
```
|
||||
|
||||
## 2. Processing
|
||||
|
||||
### 2.1. Plugin must be tested
|
||||
|
||||
A CI service like [Travis] is also recommended for testing code in
|
||||
different environments. You should test in (at least) Node.js [active LTS](https://github.com/nodejs/LTS) and current stable version.
|
||||
|
||||
[Travis]: https://travis-ci.org/
|
||||
|
||||
### 2.2. Use asynchronous methods whenever possible
|
||||
|
||||
For example, use `fs.writeFile` instead of `fs.writeFileSync`:
|
||||
|
||||
```js
|
||||
postcss.plugin('plugin-sprite', function (opts) {
|
||||
return function (root, result) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
var sprite = makeSprite();
|
||||
fs.writeFile(opts.file, function (err) {
|
||||
if ( err ) return reject(err);
|
||||
resolve();
|
||||
})
|
||||
});
|
||||
|
||||
};
|
||||
});
|
||||
```
|
||||
|
||||
### 2.3. Set `node.source` for new nodes
|
||||
|
||||
Every node must have a relevant `source` so PostCSS can generate
|
||||
an accurate source map.
|
||||
|
||||
So if you add new declaration based on some existing declaration, you should
|
||||
clone the existing declaration in order to save that original `source`.
|
||||
|
||||
```js
|
||||
if ( needPrefix(decl.prop) ) {
|
||||
decl.cloneBefore({ prop: '-webkit-' + decl.prop });
|
||||
}
|
||||
```
|
||||
|
||||
You can also set `source` directly, copying from some existing node:
|
||||
|
||||
```js
|
||||
if ( decl.prop === 'animation' ) {
|
||||
var keyframe = createAnimationByName(decl.value);
|
||||
keyframes.source = decl.source;
|
||||
decl.root().append(keyframes);
|
||||
}
|
||||
```
|
||||
|
||||
### 2.4. Use only the public PostCSS API
|
||||
|
||||
PostCSS plugins must not rely on undocumented properties or methods,
|
||||
which may be subject to change in any minor release. The public API
|
||||
is described in [API docs].
|
||||
|
||||
[API docs]: http://api.postcss.org/
|
||||
|
||||
## 3. Errors
|
||||
|
||||
### 3.1. Use `node.error` on CSS relevant errors
|
||||
|
||||
If you have an error because of input CSS (like an unknown name
|
||||
in a mixin plugin) you should use `node.error` to create an error
|
||||
that includes source position:
|
||||
|
||||
```js
|
||||
if ( typeof mixins[name] === 'undefined' ) {
|
||||
throw decl.error('Unknown mixin ' + name, { plugin: 'postcss-mixins' });
|
||||
}
|
||||
```
|
||||
|
||||
### 3.2. Use `result.warn` for warnings
|
||||
|
||||
Do not print warnings with `console.log` or `console.warn`,
|
||||
because some PostCSS runner may not allow console output.
|
||||
|
||||
```js
|
||||
if ( outdated(decl.prop) ) {
|
||||
result.warn(decl.prop + ' is outdated', { node: decl });
|
||||
}
|
||||
```
|
||||
|
||||
If CSS input is a source of the warning, the plugin must set the `node` option.
|
||||
|
||||
## 4. Documentation
|
||||
|
||||
### 4.1. Document your plugin in English
|
||||
|
||||
PostCSS plugins must have their `README.md` written in English. Do not be afraid
|
||||
of your English skills, as the open source community will fix your errors.
|
||||
|
||||
Of course, you are welcome to write documentation in other languages;
|
||||
just name them appropriately (e.g. `README.ja.md`).
|
||||
|
||||
### 4.2. Include input and output examples
|
||||
|
||||
The plugin's `README.md` must contain example input and output CSS.
|
||||
A clear example is the best way to describe how your plugin works.
|
||||
|
||||
The first section of the `README.md` is a good place to put examples.
|
||||
See [postcss-opacity](https://github.com/iamvdo/postcss-opacity) for an example.
|
||||
|
||||
Of course, this guideline does not apply if your plugin does not
|
||||
transform the CSS.
|
||||
|
||||
### 4.3. Maintain a changelog
|
||||
|
||||
PostCSS plugins must describe the changes of all their releases
|
||||
in a separate file, such as `CHANGELOG.md`, `History.md`, or [GitHub Releases].
|
||||
Visit [Keep A Changelog] for more information about how to write one of these.
|
||||
|
||||
Of course, you should be using [SemVer].
|
||||
|
||||
[Keep A Changelog]: http://keepachangelog.com/
|
||||
[GitHub Releases]: https://help.github.com/articles/creating-releases/
|
||||
[SemVer]: http://semver.org/
|
||||
|
||||
### 4.4. Include `postcss-plugin` keyword in `package.json`
|
||||
|
||||
PostCSS plugins written for npm must have the `postcss-plugin` keyword
|
||||
in their `package.json`. This special keyword will be useful for feedback about
|
||||
the PostCSS ecosystem.
|
||||
|
||||
For packages not published to npm, this is not mandatory, but is recommended
|
||||
if the package format can contain keywords.
|
||||
143
build/node_modules/postcss-discard-comments/node_modules/postcss/docs/guidelines/runner.md
generated
vendored
Normal file
143
build/node_modules/postcss-discard-comments/node_modules/postcss/docs/guidelines/runner.md
generated
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
# PostCSS Runner Guidelines
|
||||
|
||||
A PostCSS runner is a tool that processes CSS through a user-defined list
|
||||
of plugins; for example, [`postcss-cli`] or [`gulp‑postcss`].
|
||||
These rules are mandatory for any such runners.
|
||||
|
||||
For single-plugin tools, like [`gulp-autoprefixer`],
|
||||
these rules are not mandatory but are highly recommended.
|
||||
|
||||
See also [ClojureWerkz’s recommendations] for open source projects.
|
||||
|
||||
[ClojureWerkz’s recommendations]: http://blog.clojurewerkz.org/blog/2013/04/20/how-to-make-your-open-source-project-really-awesome/
|
||||
[`gulp-autoprefixer`]: https://github.com/sindresorhus/gulp-autoprefixer
|
||||
[`gulp‑postcss`]: https://github.com/w0rm/gulp-postcss
|
||||
[`postcss-cli`]: https://github.com/postcss/postcss-cli
|
||||
|
||||
## 1. API
|
||||
|
||||
### 1.1. Accept functions in plugin parameters
|
||||
|
||||
If your runner uses a config file, it must be written in JavaScript, so that
|
||||
it can support plugins which accept a function, such as [`postcss-assets`]:
|
||||
|
||||
```js
|
||||
module.exports = [
|
||||
require('postcss-assets')({
|
||||
cachebuster: function (file) {
|
||||
return fs.statSync(file).mtime.getTime().toString(16);
|
||||
}
|
||||
})
|
||||
];
|
||||
```
|
||||
|
||||
[`postcss-assets`]: https://github.com/borodean/postcss-assets
|
||||
|
||||
## 2. Processing
|
||||
|
||||
### 2.1. Set `from` and `to` processing options
|
||||
|
||||
To ensure that PostCSS generates source maps and displays better syntax errors,
|
||||
runners must specify the `from` and `to` options. If your runner does not handle
|
||||
writing to disk (for example, a gulp transform), you should set both options
|
||||
to point to the same file:
|
||||
|
||||
```js
|
||||
processor.process({ from: file.path, to: file.path });
|
||||
```
|
||||
|
||||
### 2.2. Use only the asynchronous API
|
||||
|
||||
PostCSS runners must use only the asynchronous API.
|
||||
The synchronous API is provided only for debugging, is slower,
|
||||
and can’t work with asynchronous plugins.
|
||||
|
||||
```js
|
||||
processor.process(opts).then(function (result) {
|
||||
// processing is finished
|
||||
});
|
||||
```
|
||||
|
||||
### 2.3. Use only the public PostCSS API
|
||||
|
||||
PostCSS runners must not rely on undocumented properties or methods,
|
||||
which may be subject to change in any minor release. The public API
|
||||
is described in [API docs].
|
||||
|
||||
[API docs]: http://api.postcss.org/
|
||||
|
||||
## 3. Output
|
||||
|
||||
### 3.1. Don’t show JS stack for `CssSyntaxError`
|
||||
|
||||
PostCSS runners must not show a stack trace for CSS syntax errors,
|
||||
as the runner can be used by developers who are not familiar with JavaScript.
|
||||
Instead, handle such errors gracefully:
|
||||
|
||||
```js
|
||||
processor.process(opts).catch(function (error) {
|
||||
if ( error.name === 'CssSyntaxError' ) {
|
||||
process.stderr.write(error.message + error.showSourceCode());
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### 3.2. Display `result.warnings()`
|
||||
|
||||
PostCSS runners must output warnings from `result.warnings()`:
|
||||
|
||||
```js
|
||||
result.warnings().forEach(function (warn) {
|
||||
process.stderr.write(warn.toString());
|
||||
});
|
||||
```
|
||||
|
||||
See also [postcss-log-warnings] and [postcss-messages] plugins.
|
||||
|
||||
[postcss-log-warnings]: https://github.com/davidtheclark/postcss-log-warnings
|
||||
[postcss-messages]: https://github.com/postcss/postcss-messages
|
||||
|
||||
### 3.3. Allow the user to write source maps to different files
|
||||
|
||||
PostCSS by default will inline source maps in the generated file; however,
|
||||
PostCSS runners must provide an option to save the source map in a different
|
||||
file:
|
||||
|
||||
```js
|
||||
if ( result.map ) {
|
||||
fs.writeFile(opts.to + '.map', result.map.toString());
|
||||
}
|
||||
```
|
||||
|
||||
## 4. Documentation
|
||||
|
||||
### 4.1. Document your runner in English
|
||||
|
||||
PostCSS runners must have their `README.md` written in English. Do not be afraid
|
||||
of your English skills, as the open source community will fix your errors.
|
||||
|
||||
Of course, you are welcome to write documentation in other languages;
|
||||
just name them appropriately (e.g. `README.ja.md`).
|
||||
|
||||
### 4.2. Maintain a changelog
|
||||
|
||||
PostCSS runners must describe changes of all releases in a separate file,
|
||||
such as `ChangeLog.md`, `History.md`, or with [GitHub Releases].
|
||||
Visit [Keep A Changelog] for more information on how to write one of these.
|
||||
|
||||
Of course you should use [SemVer].
|
||||
|
||||
[Keep A Changelog]: http://keepachangelog.com/
|
||||
[GitHub Releases]: https://help.github.com/articles/creating-releases/
|
||||
[SemVer]: http://semver.org/
|
||||
|
||||
### 4.3. `postcss-runner` keyword in `package.json`
|
||||
|
||||
PostCSS runners written for npm must have the `postcss-runner` keyword
|
||||
in their `package.json`. This special keyword will be useful for feedback about
|
||||
the PostCSS ecosystem.
|
||||
|
||||
For packages not published to npm, this is not mandatory, but recommended
|
||||
if the package format is allowed to contain keywords.
|
||||
72
build/node_modules/postcss-discard-comments/node_modules/postcss/docs/source-maps.md
generated
vendored
Normal file
72
build/node_modules/postcss-discard-comments/node_modules/postcss/docs/source-maps.md
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
# PostCSS and Source Maps
|
||||
|
||||
PostCSS has great [source maps] support. It can read and interpret maps
|
||||
from previous transformation steps, autodetect the format that you expect,
|
||||
and output both external and inline maps.
|
||||
|
||||
To ensure that you generate an accurate source map, you must indicate the input
|
||||
and output CSS file paths — using the options `from` and `to`, respectively.
|
||||
|
||||
To generate a new source map with the default options, simply set `map: true`.
|
||||
This will generate an inline source map that contains the source content.
|
||||
If you don’t want the map inlined, you can set `map.inline: false`.
|
||||
|
||||
```js
|
||||
processor
|
||||
.process(css, {
|
||||
from: 'app.sass.css',
|
||||
to: 'app.css',
|
||||
map: { inline: false },
|
||||
})
|
||||
.then(function (result) {
|
||||
result.map //=> '{ "version":3,
|
||||
// "file":"app.css",
|
||||
// "sources":["app.sass"],
|
||||
// "mappings":"AAAA,KAAI" }'
|
||||
});
|
||||
```
|
||||
|
||||
If PostCSS finds source maps from a previous transformation,
|
||||
it will automatically update that source map with the same options.
|
||||
|
||||
## Options
|
||||
|
||||
If you want more control over source map generation, you can define the `map`
|
||||
option as an object with the following parameters:
|
||||
|
||||
* `inline` boolean: indicates that the source map should be embedded
|
||||
in the output CSS as a Base64-encoded comment. By default, it is `true`.
|
||||
But if all previous maps are external, not inline, PostCSS will not embed
|
||||
the map even if you do not set this option.
|
||||
|
||||
If you have an inline source map, the `result.map` property will be empty,
|
||||
as the source map will be contained within the text of `result.css`.
|
||||
|
||||
* `prev` string, object, boolean or function: source map content from
|
||||
a previous processing step (for example, Sass compilation).
|
||||
PostCSS will try to read the previous source map automatically
|
||||
(based on comments within the source CSS), but you can use this option
|
||||
to identify it manually. If desired, you can omit the previous map
|
||||
with `prev: false`.
|
||||
|
||||
* `sourcesContent` boolean: indicates that PostCSS should set the origin
|
||||
content (for example, Sass source) of the source map. By default,
|
||||
it is `true`. But if all previous maps do not contain sources content,
|
||||
PostCSS will also leave it out even if you do not set this option.
|
||||
|
||||
* `annotation` boolean or string: indicates that PostCSS should add annotation
|
||||
comments to the CSS. By default, PostCSS will always add a comment with a path
|
||||
to the source map. PostCSS will not add annotations to CSS files that
|
||||
do not contain any comments.
|
||||
|
||||
By default, PostCSS presumes that you want to save the source map as
|
||||
`opts.to + '.map'` and will use this path in the annotation comment.
|
||||
A different path can be set by providing a string value for `annotation`.
|
||||
|
||||
If you have set `inline: true`, annotation cannot be disabled.
|
||||
|
||||
* `from` string: by default, PostCSS will set the `sources` property of the map
|
||||
to the value of the `from` option. If you want to override this behaviour, you
|
||||
can use `map.from` to explicitly set the source map's `sources` property.
|
||||
|
||||
[source maps]: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
|
||||
231
build/node_modules/postcss-discard-comments/node_modules/postcss/docs/syntax.md
generated
vendored
Normal file
231
build/node_modules/postcss-discard-comments/node_modules/postcss/docs/syntax.md
generated
vendored
Normal file
@@ -0,0 +1,231 @@
|
||||
# How to Write Custom Syntax
|
||||
|
||||
PostCSS can transform styles in any syntax, and is not limited to just CSS.
|
||||
By writing a custom syntax, you can transform styles in any desired format.
|
||||
|
||||
Writing a custom syntax is much harder than writing a PostCSS plugin, but
|
||||
it is an awesome adventure.
|
||||
|
||||
There are 3 types of PostCSS syntax packages:
|
||||
|
||||
* **Parser** to parse input string to node’s tree.
|
||||
* **Stringifier** to generate output string by node’s tree.
|
||||
* **Syntax** contains both parser and stringifier.
|
||||
|
||||
## Syntax
|
||||
|
||||
A good example of a custom syntax is [SCSS]. Some users may want to transform
|
||||
SCSS sources with PostCSS plugins, for example if they need to add vendor
|
||||
prefixes or change the property order. So this syntax should output SCSS from
|
||||
an SCSS input.
|
||||
|
||||
The syntax API is a very simple plain object, with `parse` & `stringify`
|
||||
functions:
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
parse: require('./parse'),
|
||||
stringify: require('./stringify')
|
||||
};
|
||||
```
|
||||
|
||||
[SCSS]: https://github.com/postcss/postcss-scss
|
||||
|
||||
## Parser
|
||||
|
||||
A good example of a parser is [Safe Parser], which parses malformed/broken CSS.
|
||||
Because there is no point to generate broken output, this package only provides
|
||||
a parser.
|
||||
|
||||
The parser API is a function which receives a string & returns a [`Root`] node.
|
||||
The second argument is a function which receives an object with PostCSS options.
|
||||
|
||||
```js
|
||||
var postcss = require('postcss');
|
||||
|
||||
module.exports = function (css, opts) {
|
||||
var root = postcss.root();
|
||||
// Add other nodes to root
|
||||
return root;
|
||||
};
|
||||
```
|
||||
|
||||
[Safe Parser]: https://github.com/postcss/postcss-safe-parser
|
||||
[`Root`]: http://api.postcss.org/Root.html
|
||||
|
||||
### Main Theory
|
||||
|
||||
There are many books about parsers; but do not worry because CSS syntax is
|
||||
very easy, and so the parser will be much simpler than a programming language
|
||||
parser.
|
||||
|
||||
The default PostCSS parser contains two steps:
|
||||
|
||||
1. [Tokenizer] which reads input string character by character and builds a
|
||||
tokens array. For example, it joins space symbols to a `['space', '\n ']`
|
||||
token, and detects strings to a `['string', '"\"{"']` token.
|
||||
2. [Parser] which reads the tokens array, creates node instances and
|
||||
builds a tree.
|
||||
|
||||
[Tokenizer]: https://github.com/postcss/postcss/blob/master/lib/tokenize.es6
|
||||
[Parser]: https://github.com/postcss/postcss/blob/master/lib/parser.es6
|
||||
|
||||
### Performance
|
||||
|
||||
Parsing input is often the most time consuming task in CSS processors. So it
|
||||
is very important to have a fast parser.
|
||||
|
||||
The main rule of optimization is that there is no performance without a
|
||||
benchmark. You can look at [PostCSS benchmarks] to build your own.
|
||||
|
||||
Of parsing tasks, the tokenize step will often take the most time, so its
|
||||
performance should be prioritized. Unfortunately, classes, functions and
|
||||
high level structures can slow down your tokenizer. Be ready to write dirty
|
||||
code with repeated statements. This is why it is difficult to extend the
|
||||
default [PostCSS tokenizer]; copy & paste will be a necessary evil.
|
||||
|
||||
Second optimization is using character codes instead of strings.
|
||||
|
||||
```js
|
||||
// Slow
|
||||
string[i] === '{';
|
||||
|
||||
// Fast
|
||||
const OPEN_CURLY = 123; // `{'
|
||||
string.charCodeAt(i) === OPEN_CURLY;
|
||||
```
|
||||
|
||||
Third optimization is “fast jumps”. If you find open quotes, you can find
|
||||
next closing quote much faster by `indexOf`:
|
||||
|
||||
```js
|
||||
// Simple jump
|
||||
next = string.indexOf('"', currentPosition + 1);
|
||||
|
||||
// Jump by RegExp
|
||||
regexp.lastIndex = currentPosion + 1;
|
||||
regexp.text(string);
|
||||
next = regexp.lastIndex;
|
||||
```
|
||||
|
||||
The parser can be a well written class. There is no need in copy-paste and
|
||||
hardcore optimization there. You can extend the default [PostCSS parser].
|
||||
|
||||
[PostCSS benchmarks]: https://github.com/postcss/benchmark
|
||||
[PostCSS tokenizer]: https://github.com/postcss/postcss/blob/master/lib/tokenize.es6
|
||||
[PostCSS parser]: https://github.com/postcss/postcss/blob/master/lib/parser.es6
|
||||
|
||||
### Node Source
|
||||
|
||||
Every node should have `source` property to generate correct source map.
|
||||
This property contains `start` and `end` properties with `{ line, column }`,
|
||||
and `input` property with an [`Input`] instance.
|
||||
|
||||
Your tokenizer should save the original position so that you can propagate
|
||||
the values to the parser, to ensure that the source map is correctly updated.
|
||||
|
||||
[`Input`]: https://github.com/postcss/postcss/blob/master/lib/input.es6
|
||||
|
||||
### Raw Values
|
||||
|
||||
A good PostCSS parser should provide all information (including spaces symbols)
|
||||
to generate byte-to-byte equal output. It is not so difficult, but respectful
|
||||
for user input and allow integration smoke tests.
|
||||
|
||||
A parser should save all additional symbols to `node.raws` object.
|
||||
It is an open structure for you, you can add additional keys.
|
||||
For example, [SCSS parser] saves comment types (`/* */` or `//`)
|
||||
in `node.raws.inline`.
|
||||
|
||||
The default parser cleans CSS values from comments and spaces.
|
||||
It saves the original value with comments to `node.raws.value.raw` and uses it,
|
||||
if the node value was not changed.
|
||||
|
||||
[SCSS parser]: https://github.com/postcss/postcss-scss
|
||||
|
||||
### Tests
|
||||
|
||||
Of course, all parsers in the PostCSS ecosystem must have tests.
|
||||
|
||||
If your parser just extends CSS syntax (like [SCSS] or [Safe Parser]),
|
||||
you can use the [PostCSS Parser Tests]. It contains unit & integration tests.
|
||||
|
||||
[PostCSS Parser Tests]: https://github.com/postcss/postcss-parser-tests
|
||||
|
||||
## Stringifier
|
||||
|
||||
A style guide generator is a good example of a stringifier. It generates output
|
||||
HTML which contains CSS components. For this use case, a parser isn't necessary,
|
||||
so the package should just contain a stringifier.
|
||||
|
||||
The Stringifier API is little bit more complicated, than the parser API.
|
||||
PostCSS generates a source map, so a stringifier can’t just return a string.
|
||||
It must link every substring with its source node.
|
||||
|
||||
A Stringifier is a function which receives [`Root`] node and builder callback.
|
||||
Then it calls builder with every node’s string and node instance.
|
||||
|
||||
```js
|
||||
module.exports = function (root, builder) {
|
||||
// Some magic
|
||||
var string = decl.prop + ':' + decl.value + ';';
|
||||
builder(string, decl);
|
||||
// Some science
|
||||
};
|
||||
```
|
||||
|
||||
### Main Theory
|
||||
|
||||
PostCSS [default stringifier] is just a class with a method for each node type
|
||||
and many methods to detect raw properties.
|
||||
|
||||
In most cases it will be enough just to extend this class,
|
||||
like in [SCSS stringifier].
|
||||
|
||||
[default stringifier]: https://github.com/postcss/postcss/blob/master/lib/stringifier.es6
|
||||
[SCSS stringifier]: https://github.com/postcss/postcss-scss/blob/master/lib/scss-stringifier.es6
|
||||
|
||||
### Builder Function
|
||||
|
||||
A builder function will be passed to `stringify` function as second argument.
|
||||
For example, the default PostCSS stringifier class saves it
|
||||
to `this.builder` property.
|
||||
|
||||
Builder receives output substring and source node to append this substring
|
||||
to the final output.
|
||||
|
||||
Some nodes contain other nodes in the middle. For example, a rule has a `{`
|
||||
at the beginning, many declarations inside and a closing `}`.
|
||||
|
||||
For these cases, you should pass a third argument to builder function:
|
||||
`'start'` or `'end'` string:
|
||||
|
||||
```js
|
||||
this.builder(rule.selector + '{', rule, 'start');
|
||||
// Stringify declarations inside
|
||||
this.builder('}', rule, 'end');
|
||||
```
|
||||
|
||||
### Raw Values
|
||||
|
||||
A good PostCSS custom syntax saves all symbols and provide byte-to-byte equal
|
||||
output if there were no changes.
|
||||
|
||||
This is why every node has `node.raws` object to store space symbol, etc.
|
||||
|
||||
Be careful, because sometimes these raw properties will not be present; some
|
||||
nodes may be built manually, or may lose their indentation when they are moved
|
||||
to another parent node.
|
||||
|
||||
This is why the default stringifier has a `raw()` method to autodetect raw
|
||||
properties by other nodes. For example, it will look at other nodes to detect
|
||||
indent size and them multiply it with the current node depth.
|
||||
|
||||
### Tests
|
||||
|
||||
A stringifier must have tests too.
|
||||
|
||||
You can use unit and integration test cases from [PostCSS Parser Tests].
|
||||
Just compare input CSS with CSS after your parser and stringifier.
|
||||
|
||||
[PostCSS Parser Tests]: https://github.com/postcss/postcss-parser-tests
|
||||
159
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/at-rule.js
generated
vendored
Normal file
159
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/at-rule.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
89
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/comment.js
generated
vendored
Normal file
89
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/comment.js
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
var _warnOnce = require('./warn-once');
|
||||
|
||||
var _warnOnce2 = _interopRequireDefault(_warnOnce);
|
||||
|
||||
var _node = require('./node');
|
||||
|
||||
var _node2 = _interopRequireDefault(_node);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
/**
|
||||
* Represents a comment between declarations or statements (rule and at-rules).
|
||||
*
|
||||
* Comments inside selectors, at-rule parameters, or declaration values
|
||||
* will be stored in the `raws` properties explained above.
|
||||
*
|
||||
* @extends Node
|
||||
*/
|
||||
var Comment = function (_Node) {
|
||||
_inherits(Comment, _Node);
|
||||
|
||||
function Comment(defaults) {
|
||||
_classCallCheck(this, Comment);
|
||||
|
||||
var _this = _possibleConstructorReturn(this, _Node.call(this, defaults));
|
||||
|
||||
_this.type = 'comment';
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(Comment, [{
|
||||
key: 'left',
|
||||
get: function get() {
|
||||
(0, _warnOnce2.default)('Comment#left was deprecated. Use Comment#raws.left');
|
||||
return this.raws.left;
|
||||
},
|
||||
set: function set(val) {
|
||||
(0, _warnOnce2.default)('Comment#left was deprecated. Use Comment#raws.left');
|
||||
this.raws.left = val;
|
||||
}
|
||||
}, {
|
||||
key: 'right',
|
||||
get: function get() {
|
||||
(0, _warnOnce2.default)('Comment#right was deprecated. Use Comment#raws.right');
|
||||
return this.raws.right;
|
||||
},
|
||||
set: function set(val) {
|
||||
(0, _warnOnce2.default)('Comment#right was deprecated. Use Comment#raws.right');
|
||||
this.raws.right = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @memberof Comment#
|
||||
* @member {string} text - the comment’s text
|
||||
*/
|
||||
|
||||
/**
|
||||
* @memberof Comment#
|
||||
* @member {object} raws - Information to generate byte-to-byte equal
|
||||
* node string as it was in the origin input.
|
||||
*
|
||||
* Every parser saves its own properties,
|
||||
* but the default CSS parser uses:
|
||||
*
|
||||
* * `before`: the space symbols before the node.
|
||||
* * `left`: the space symbols between `/*` and the comment’s text.
|
||||
* * `right`: the space symbols between the comment’s text.
|
||||
*/
|
||||
|
||||
}]);
|
||||
|
||||
return Comment;
|
||||
}(_node2.default);
|
||||
|
||||
exports.default = Comment;
|
||||
module.exports = exports['default'];
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbW1lbnQuZXM2Il0sIm5hbWVzIjpbIkNvbW1lbnQiLCJkZWZhdWx0cyIsInR5cGUiLCJyYXdzIiwibGVmdCIsInZhbCIsInJpZ2h0Il0sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTs7OztBQUNBOzs7Ozs7Ozs7Ozs7QUFFQTs7Ozs7Ozs7SUFRTUEsTzs7O0FBRUYscUJBQVlDLFFBQVosRUFBc0I7QUFBQTs7QUFBQSxxREFDbEIsaUJBQU1BLFFBQU4sQ0FEa0I7O0FBRWxCLGNBQUtDLElBQUwsR0FBWSxTQUFaO0FBRmtCO0FBR3JCOzs7OzRCQUVVO0FBQ1Asb0NBQVMsb0RBQVQ7QUFDQSxtQkFBTyxLQUFLQyxJQUFMLENBQVVDLElBQWpCO0FBQ0gsUzswQkFFUUMsRyxFQUFLO0FBQ1Ysb0NBQVMsb0RBQVQ7QUFDQSxpQkFBS0YsSUFBTCxDQUFVQyxJQUFWLEdBQWlCQyxHQUFqQjtBQUNIOzs7NEJBRVc7QUFDUixvQ0FBUyxzREFBVDtBQUNBLG1CQUFPLEtBQUtGLElBQUwsQ0FBVUcsS0FBakI7QUFDSCxTOzBCQUVTRCxHLEVBQUs7QUFDWCxvQ0FBUyxzREFBVDtBQUNBLGlCQUFLRixJQUFMLENBQVVHLEtBQVYsR0FBa0JELEdBQWxCO0FBQ0g7O0FBRUQ7Ozs7O0FBS0E7Ozs7Ozs7Ozs7Ozs7Ozs7OztrQkFjV0wsTyIsImZpbGUiOiJjb21tZW50LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHdhcm5PbmNlIGZyb20gJy4vd2Fybi1vbmNlJztcbmltcG9ydCBOb2RlICAgICBmcm9tICcuL25vZGUnO1xuXG4vKipcbiAqIFJlcHJlc2VudHMgYSBjb21tZW50IGJldHdlZW4gZGVjbGFyYXRpb25zIG9yIHN0YXRlbWVudHMgKHJ1bGUgYW5kIGF0LXJ1bGVzKS5cbiAqXG4gKiBDb21tZW50cyBpbnNpZGUgc2VsZWN0b3JzLCBhdC1ydWxlIHBhcmFtZXRlcnMsIG9yIGRlY2xhcmF0aW9uIHZhbHVlc1xuICogd2lsbCBiZSBzdG9yZWQgaW4gdGhlIGByYXdzYCBwcm9wZXJ0aWVzIGV4cGxhaW5lZCBhYm92ZS5cbiAqXG4gKiBAZXh0ZW5kcyBOb2RlXG4gKi9cbmNsYXNzIENvbW1lbnQgZXh0ZW5kcyBOb2RlIHtcblxuICAgIGNvbnN0cnVjdG9yKGRlZmF1bHRzKSB7XG4gICAgICAgIHN1cGVyKGRlZmF1bHRzKTtcbiAgICAgICAgdGhpcy50eXBlID0gJ2NvbW1lbnQnO1xuICAgIH1cblxuICAgIGdldCBsZWZ0KCkge1xuICAgICAgICB3YXJuT25jZSgnQ29tbWVudCNsZWZ0IHdhcyBkZXByZWNhdGVkLiBVc2UgQ29tbWVudCNyYXdzLmxlZnQnKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucmF3cy5sZWZ0O1xuICAgIH1cblxuICAgIHNldCBsZWZ0KHZhbCkge1xuICAgICAgICB3YXJuT25jZSgnQ29tbWVudCNsZWZ0IHdhcyBkZXByZWNhdGVkLiBVc2UgQ29tbWVudCNyYXdzLmxlZnQnKTtcbiAgICAgICAgdGhpcy5yYXdzLmxlZnQgPSB2YWw7XG4gICAgfVxuXG4gICAgZ2V0IHJpZ2h0KCkge1xuICAgICAgICB3YXJuT25jZSgnQ29tbWVudCNyaWdodCB3YXMgZGVwcmVjYXRlZC4gVXNlIENvbW1lbnQjcmF3cy5yaWdodCcpO1xuICAgICAgICByZXR1cm4gdGhpcy5yYXdzLnJpZ2h0O1xuICAgIH1cblxuICAgIHNldCByaWdodCh2YWwpIHtcbiAgICAgICAgd2Fybk9uY2UoJ0NvbW1lbnQjcmlnaHQgd2FzIGRlcHJlY2F0ZWQuIFVzZSBDb21tZW50I3Jhd3MucmlnaHQnKTtcbiAgICAgICAgdGhpcy5yYXdzLnJpZ2h0ID0gdmFsO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEBtZW1iZXJvZiBDb21tZW50I1xuICAgICAqIEBtZW1iZXIge3N0cmluZ30gdGV4dCAtIHRoZSBjb21tZW504oCZcyB0ZXh0XG4gICAgICovXG5cbiAgICAvKipcbiAgICAgKiBAbWVtYmVyb2YgQ29tbWVudCNcbiAgICAgKiBAbWVtYmVyIHtvYmplY3R9IHJhd3MgLSBJbmZvcm1hdGlvbiB0byBnZW5lcmF0ZSBieXRlLXRvLWJ5dGUgZXF1YWxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBub2RlIHN0cmluZyBhcyBpdCB3YXMgaW4gdGhlIG9yaWdpbiBpbnB1dC5cbiAgICAgKlxuICAgICAqIEV2ZXJ5IHBhcnNlciBzYXZlcyBpdHMgb3duIHByb3BlcnRpZXMsXG4gICAgICogYnV0IHRoZSBkZWZhdWx0IENTUyBwYXJzZXIgdXNlczpcbiAgICAgKlxuICAgICAqICogYGJlZm9yZWA6IHRoZSBzcGFjZSBzeW1ib2xzIGJlZm9yZSB0aGUgbm9kZS5cbiAgICAgKiAqIGBsZWZ0YDogdGhlIHNwYWNlIHN5bWJvbHMgYmV0d2VlbiBgLypgIGFuZCB0aGUgY29tbWVudOKAmXMgdGV4dC5cbiAgICAgKiAqIGByaWdodGA6IHRoZSBzcGFjZSBzeW1ib2xzIGJldHdlZW4gdGhlIGNvbW1lbnTigJlzIHRleHQuXG4gICAgICovXG59XG5cbmV4cG9ydCBkZWZhdWx0IENvbW1lbnQ7XG4iXX0=
|
||||
935
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/container.js
generated
vendored
Normal file
935
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/container.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
272
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/css-syntax-error.js
generated
vendored
Normal file
272
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/css-syntax-error.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
130
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/declaration.js
generated
vendored
Normal file
130
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/declaration.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
198
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/input.js
generated
vendored
Normal file
198
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/input.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
432
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/lazy-result.js
generated
vendored
Normal file
432
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/lazy-result.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
95
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/list.js
generated
vendored
Normal file
95
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/list.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
312
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/map-generator.js
generated
vendored
Normal file
312
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/map-generator.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
672
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/node.js
generated
vendored
Normal file
672
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/node.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
43
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/parse.js
generated
vendored
Normal file
43
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/parse.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = parse;
|
||||
|
||||
var _parser = require('./parser');
|
||||
|
||||
var _parser2 = _interopRequireDefault(_parser);
|
||||
|
||||
var _input = require('./input');
|
||||
|
||||
var _input2 = _interopRequireDefault(_input);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function parse(css, opts) {
|
||||
if (opts && opts.safe) {
|
||||
throw new Error('Option safe was removed. ' + 'Use parser: require("postcss-safe-parser")');
|
||||
}
|
||||
|
||||
var input = new _input2.default(css, opts);
|
||||
|
||||
var parser = new _parser2.default(input);
|
||||
try {
|
||||
parser.tokenize();
|
||||
parser.loop();
|
||||
} catch (e) {
|
||||
if (e.name === 'CssSyntaxError' && opts && opts.from) {
|
||||
if (/\.scss$/i.test(opts.from)) {
|
||||
e.message += '\nYou tried to parse SCSS with ' + 'the standard CSS parser; ' + 'try again with the postcss-scss parser';
|
||||
} else if (/\.sass/i.test(opts.from)) {
|
||||
e.message += '\nYou tried to parse Sass with ' + 'the standard CSS parser; ' + 'try again with the postcss-sass parser';
|
||||
} else if (/\.less$/i.test(opts.from)) {
|
||||
e.message += '\nYou tried to parse Less with ' + 'the standard CSS parser; ' + 'try again with the postcss-less parser';
|
||||
}
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
return parser.root;
|
||||
}
|
||||
module.exports = exports['default'];
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhcnNlLmVzNiJdLCJuYW1lcyI6WyJwYXJzZSIsImNzcyIsIm9wdHMiLCJzYWZlIiwiRXJyb3IiLCJpbnB1dCIsInBhcnNlciIsInRva2VuaXplIiwibG9vcCIsImUiLCJuYW1lIiwiZnJvbSIsInRlc3QiLCJtZXNzYWdlIiwicm9vdCJdLCJtYXBwaW5ncyI6Ijs7O2tCQUd3QkEsSzs7QUFIeEI7Ozs7QUFDQTs7Ozs7O0FBRWUsU0FBU0EsS0FBVCxDQUFlQyxHQUFmLEVBQW9CQyxJQUFwQixFQUEwQjtBQUNyQyxRQUFLQSxRQUFRQSxLQUFLQyxJQUFsQixFQUF5QjtBQUNyQixjQUFNLElBQUlDLEtBQUosQ0FBVSw4QkFDQSw0Q0FEVixDQUFOO0FBRUg7O0FBRUQsUUFBSUMsUUFBUSxvQkFBVUosR0FBVixFQUFlQyxJQUFmLENBQVo7O0FBRUEsUUFBSUksU0FBUyxxQkFBV0QsS0FBWCxDQUFiO0FBQ0EsUUFBSTtBQUNBQyxlQUFPQyxRQUFQO0FBQ0FELGVBQU9FLElBQVA7QUFDSCxLQUhELENBR0UsT0FBT0MsQ0FBUCxFQUFVO0FBQ1IsWUFBS0EsRUFBRUMsSUFBRixLQUFXLGdCQUFYLElBQStCUixJQUEvQixJQUF1Q0EsS0FBS1MsSUFBakQsRUFBd0Q7QUFDcEQsZ0JBQUssV0FBV0MsSUFBWCxDQUFnQlYsS0FBS1MsSUFBckIsQ0FBTCxFQUFrQztBQUM5QkYsa0JBQUVJLE9BQUYsSUFBYSxvQ0FDQSwyQkFEQSxHQUVBLHdDQUZiO0FBR0gsYUFKRCxNQUlPLElBQUssVUFBVUQsSUFBVixDQUFlVixLQUFLUyxJQUFwQixDQUFMLEVBQWlDO0FBQ3BDRixrQkFBRUksT0FBRixJQUFhLG9DQUNBLDJCQURBLEdBRUEsd0NBRmI7QUFHSCxhQUpNLE1BSUEsSUFBSyxXQUFXRCxJQUFYLENBQWdCVixLQUFLUyxJQUFyQixDQUFMLEVBQWtDO0FBQ3JDRixrQkFBRUksT0FBRixJQUFhLG9DQUNBLDJCQURBLEdBRUEsd0NBRmI7QUFHSDtBQUNKO0FBQ0QsY0FBTUosQ0FBTjtBQUNIOztBQUVELFdBQU9ILE9BQU9RLElBQWQ7QUFDSCIsImZpbGUiOiJwYXJzZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBQYXJzZXIgZnJvbSAnLi9wYXJzZXInO1xuaW1wb3J0IElucHV0ICBmcm9tICcuL2lucHV0JztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gcGFyc2UoY3NzLCBvcHRzKSB7XG4gICAgaWYgKCBvcHRzICYmIG9wdHMuc2FmZSApIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdPcHRpb24gc2FmZSB3YXMgcmVtb3ZlZC4gJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAnVXNlIHBhcnNlcjogcmVxdWlyZShcInBvc3Rjc3Mtc2FmZS1wYXJzZXJcIiknKTtcbiAgICB9XG5cbiAgICBsZXQgaW5wdXQgPSBuZXcgSW5wdXQoY3NzLCBvcHRzKTtcblxuICAgIGxldCBwYXJzZXIgPSBuZXcgUGFyc2VyKGlucHV0KTtcbiAgICB0cnkge1xuICAgICAgICBwYXJzZXIudG9rZW5pemUoKTtcbiAgICAgICAgcGFyc2VyLmxvb3AoKTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIGlmICggZS5uYW1lID09PSAnQ3NzU3ludGF4RXJyb3InICYmIG9wdHMgJiYgb3B0cy5mcm9tICkge1xuICAgICAgICAgICAgaWYgKCAvXFwuc2NzcyQvaS50ZXN0KG9wdHMuZnJvbSkgKSB7XG4gICAgICAgICAgICAgICAgZS5tZXNzYWdlICs9ICdcXG5Zb3UgdHJpZWQgdG8gcGFyc2UgU0NTUyB3aXRoICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndGhlIHN0YW5kYXJkIENTUyBwYXJzZXI7ICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndHJ5IGFnYWluIHdpdGggdGhlIHBvc3Rjc3Mtc2NzcyBwYXJzZXInO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggL1xcLnNhc3MvaS50ZXN0KG9wdHMuZnJvbSkgKSB7XG4gICAgICAgICAgICAgICAgZS5tZXNzYWdlICs9ICdcXG5Zb3UgdHJpZWQgdG8gcGFyc2UgU2FzcyB3aXRoICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndGhlIHN0YW5kYXJkIENTUyBwYXJzZXI7ICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndHJ5IGFnYWluIHdpdGggdGhlIHBvc3Rjc3Mtc2FzcyBwYXJzZXInO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggL1xcLmxlc3MkL2kudGVzdChvcHRzLmZyb20pICkge1xuICAgICAgICAgICAgICAgIGUubWVzc2FnZSArPSAnXFxuWW91IHRyaWVkIHRvIHBhcnNlIExlc3Mgd2l0aCAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3RoZSBzdGFuZGFyZCBDU1MgcGFyc2VyOyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3RyeSBhZ2FpbiB3aXRoIHRoZSBwb3N0Y3NzLWxlc3MgcGFyc2VyJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBlO1xuICAgIH1cblxuICAgIHJldHVybiBwYXJzZXIucm9vdDtcbn1cbiJdfQ==
|
||||
514
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/parser.js
generated
vendored
Normal file
514
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/parser.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1305
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/postcss.d.ts
generated
vendored
Normal file
1305
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/postcss.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
292
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/postcss.js
generated
vendored
Normal file
292
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/postcss.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
162
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/previous-map.js
generated
vendored
Normal file
162
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/previous-map.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
240
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/processor.js
generated
vendored
Normal file
240
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/processor.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
206
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/result.js
generated
vendored
Normal file
206
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/result.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
143
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/root.js
generated
vendored
Normal file
143
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/root.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
136
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/rule.js
generated
vendored
Normal file
136
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/rule.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
335
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/stringifier.js
generated
vendored
Normal file
335
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/stringifier.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
17
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/stringify.js
generated
vendored
Normal file
17
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/stringify.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = stringify;
|
||||
|
||||
var _stringifier = require('./stringifier');
|
||||
|
||||
var _stringifier2 = _interopRequireDefault(_stringifier);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function stringify(node, builder) {
|
||||
var str = new _stringifier2.default(builder);
|
||||
str.stringify(node);
|
||||
}
|
||||
module.exports = exports['default'];
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0cmluZ2lmeS5lczYiXSwibmFtZXMiOlsic3RyaW5naWZ5Iiwibm9kZSIsImJ1aWxkZXIiLCJzdHIiXSwibWFwcGluZ3MiOiI7OztrQkFFd0JBLFM7O0FBRnhCOzs7Ozs7QUFFZSxTQUFTQSxTQUFULENBQW1CQyxJQUFuQixFQUF5QkMsT0FBekIsRUFBa0M7QUFDN0MsUUFBSUMsTUFBTSwwQkFBZ0JELE9BQWhCLENBQVY7QUFDQUMsUUFBSUgsU0FBSixDQUFjQyxJQUFkO0FBQ0giLCJmaWxlIjoic3RyaW5naWZ5LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFN0cmluZ2lmaWVyIGZyb20gJy4vc3RyaW5naWZpZXInO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBzdHJpbmdpZnkobm9kZSwgYnVpbGRlcikge1xuICAgIGxldCBzdHIgPSBuZXcgU3RyaW5naWZpZXIoYnVpbGRlcik7XG4gICAgc3RyLnN0cmluZ2lmeShub2RlKTtcbn1cbiJdfQ==
|
||||
76
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/terminal-highlight.js
generated
vendored
Normal file
76
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/terminal-highlight.js
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _chalk = require('chalk');
|
||||
|
||||
var _chalk2 = _interopRequireDefault(_chalk);
|
||||
|
||||
var _tokenize = require('./tokenize');
|
||||
|
||||
var _tokenize2 = _interopRequireDefault(_tokenize);
|
||||
|
||||
var _input = require('./input');
|
||||
|
||||
var _input2 = _interopRequireDefault(_input);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var colors = new _chalk2.default.constructor({ enabled: true });
|
||||
|
||||
var HIGHLIGHT_THEME = {
|
||||
'brackets': colors.cyan,
|
||||
'at-word': colors.cyan,
|
||||
'call': colors.cyan,
|
||||
'comment': colors.gray,
|
||||
'string': colors.green,
|
||||
'class': colors.yellow,
|
||||
'hash': colors.magenta,
|
||||
'(': colors.cyan,
|
||||
')': colors.cyan,
|
||||
'{': colors.yellow,
|
||||
'}': colors.yellow,
|
||||
'[': colors.yellow,
|
||||
']': colors.yellow,
|
||||
':': colors.yellow,
|
||||
';': colors.yellow
|
||||
};
|
||||
|
||||
function getTokenType(_ref, index, tokens) {
|
||||
var type = _ref[0],
|
||||
value = _ref[1];
|
||||
|
||||
if (type === 'word') {
|
||||
if (value[0] === '.') {
|
||||
return 'class';
|
||||
}
|
||||
if (value[0] === '#') {
|
||||
return 'hash';
|
||||
}
|
||||
}
|
||||
|
||||
var nextToken = tokens[index + 1];
|
||||
if (nextToken && (nextToken[0] === 'brackets' || nextToken[0] === '(')) {
|
||||
return 'call';
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
function terminalHighlight(css) {
|
||||
var tokens = (0, _tokenize2.default)(new _input2.default(css), { ignoreErrors: true });
|
||||
return tokens.map(function (token, index) {
|
||||
var color = HIGHLIGHT_THEME[getTokenType(token, index, tokens)];
|
||||
if (color) {
|
||||
return token[1].split(/\r?\n/).map(function (i) {
|
||||
return color(i);
|
||||
}).join('\n');
|
||||
} else {
|
||||
return token[1];
|
||||
}
|
||||
}).join('');
|
||||
}
|
||||
|
||||
exports.default = terminalHighlight;
|
||||
module.exports = exports['default'];
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlcm1pbmFsLWhpZ2hsaWdodC5lczYiXSwibmFtZXMiOlsiY29sb3JzIiwiY29uc3RydWN0b3IiLCJlbmFibGVkIiwiSElHSExJR0hUX1RIRU1FIiwiY3lhbiIsImdyYXkiLCJncmVlbiIsInllbGxvdyIsIm1hZ2VudGEiLCJnZXRUb2tlblR5cGUiLCJpbmRleCIsInRva2VucyIsInR5cGUiLCJ2YWx1ZSIsIm5leHRUb2tlbiIsInRlcm1pbmFsSGlnaGxpZ2h0IiwiY3NzIiwiaWdub3JlRXJyb3JzIiwibWFwIiwidG9rZW4iLCJjb2xvciIsInNwbGl0IiwiaSIsImpvaW4iXSwibWFwcGluZ3MiOiI7Ozs7QUFBQTs7OztBQUVBOzs7O0FBQ0E7Ozs7OztBQUVBLElBQUlBLFNBQVMsSUFBSSxnQkFBTUMsV0FBVixDQUFzQixFQUFFQyxTQUFTLElBQVgsRUFBdEIsQ0FBYjs7QUFFQSxJQUFNQyxrQkFBa0I7QUFDcEIsZ0JBQVlILE9BQU9JLElBREM7QUFFcEIsZUFBWUosT0FBT0ksSUFGQztBQUdwQixZQUFZSixPQUFPSSxJQUhDO0FBSXBCLGVBQVlKLE9BQU9LLElBSkM7QUFLcEIsY0FBWUwsT0FBT00sS0FMQztBQU1wQixhQUFZTixPQUFPTyxNQU5DO0FBT3BCLFlBQVlQLE9BQU9RLE9BUEM7QUFRcEIsU0FBWVIsT0FBT0ksSUFSQztBQVNwQixTQUFZSixPQUFPSSxJQVRDO0FBVXBCLFNBQVlKLE9BQU9PLE1BVkM7QUFXcEIsU0FBWVAsT0FBT08sTUFYQztBQVlwQixTQUFZUCxPQUFPTyxNQVpDO0FBYXBCLFNBQVlQLE9BQU9PLE1BYkM7QUFjcEIsU0FBWVAsT0FBT08sTUFkQztBQWVwQixTQUFZUCxPQUFPTztBQWZDLENBQXhCOztBQWtCQSxTQUFTRSxZQUFULE9BQXFDQyxLQUFyQyxFQUE0Q0MsTUFBNUMsRUFBb0Q7QUFBQSxRQUE3QkMsSUFBNkI7QUFBQSxRQUF2QkMsS0FBdUI7O0FBQ2hELFFBQUlELFNBQVMsTUFBYixFQUFxQjtBQUNqQixZQUFJQyxNQUFNLENBQU4sTUFBYSxHQUFqQixFQUFzQjtBQUNsQixtQkFBTyxPQUFQO0FBQ0g7QUFDRCxZQUFJQSxNQUFNLENBQU4sTUFBYSxHQUFqQixFQUFzQjtBQUNsQixtQkFBTyxNQUFQO0FBQ0g7QUFDSjs7QUFFRCxRQUFJQyxZQUFZSCxPQUFPRCxRQUFRLENBQWYsQ0FBaEI7QUFDQSxRQUFJSSxjQUFjQSxVQUFVLENBQVYsTUFBaUIsVUFBakIsSUFBK0JBLFVBQVUsQ0FBVixNQUFpQixHQUE5RCxDQUFKLEVBQXdFO0FBQ3BFLGVBQU8sTUFBUDtBQUNIOztBQUVELFdBQU9GLElBQVA7QUFDSDs7QUFFRCxTQUFTRyxpQkFBVCxDQUEyQkMsR0FBM0IsRUFBZ0M7QUFDNUIsUUFBSUwsU0FBUyx3QkFBUyxvQkFBVUssR0FBVixDQUFULEVBQXlCLEVBQUVDLGNBQWMsSUFBaEIsRUFBekIsQ0FBYjtBQUNBLFdBQU9OLE9BQU9PLEdBQVAsQ0FBVyxVQUFDQyxLQUFELEVBQVFULEtBQVIsRUFBa0I7QUFDaEMsWUFBSVUsUUFBUWpCLGdCQUFnQk0sYUFBYVUsS0FBYixFQUFvQlQsS0FBcEIsRUFBMkJDLE1BQTNCLENBQWhCLENBQVo7QUFDQSxZQUFLUyxLQUFMLEVBQWE7QUFDVCxtQkFBT0QsTUFBTSxDQUFOLEVBQVNFLEtBQVQsQ0FBZSxPQUFmLEVBQ0pILEdBREksQ0FDQztBQUFBLHVCQUFLRSxNQUFNRSxDQUFOLENBQUw7QUFBQSxhQURELEVBRUpDLElBRkksQ0FFQyxJQUZELENBQVA7QUFHSCxTQUpELE1BSU87QUFDSCxtQkFBT0osTUFBTSxDQUFOLENBQVA7QUFDSDtBQUNKLEtBVE0sRUFTSkksSUFUSSxDQVNDLEVBVEQsQ0FBUDtBQVVIOztrQkFFY1IsaUIiLCJmaWxlIjoidGVybWluYWwtaGlnaGxpZ2h0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGNoYWxrIGZyb20gJ2NoYWxrJztcblxuaW1wb3J0IHRva2VuaXplIGZyb20gJy4vdG9rZW5pemUnO1xuaW1wb3J0IElucHV0ICAgIGZyb20gJy4vaW5wdXQnO1xuXG5sZXQgY29sb3JzID0gbmV3IGNoYWxrLmNvbnN0cnVjdG9yKHsgZW5hYmxlZDogdHJ1ZSB9KTtcblxuY29uc3QgSElHSExJR0hUX1RIRU1FID0ge1xuICAgICdicmFja2V0cyc6IGNvbG9ycy5jeWFuLFxuICAgICdhdC13b3JkJzogIGNvbG9ycy5jeWFuLFxuICAgICdjYWxsJzogICAgIGNvbG9ycy5jeWFuLFxuICAgICdjb21tZW50JzogIGNvbG9ycy5ncmF5LFxuICAgICdzdHJpbmcnOiAgIGNvbG9ycy5ncmVlbixcbiAgICAnY2xhc3MnOiAgICBjb2xvcnMueWVsbG93LFxuICAgICdoYXNoJzogICAgIGNvbG9ycy5tYWdlbnRhLFxuICAgICcoJzogICAgICAgIGNvbG9ycy5jeWFuLFxuICAgICcpJzogICAgICAgIGNvbG9ycy5jeWFuLFxuICAgICd7JzogICAgICAgIGNvbG9ycy55ZWxsb3csXG4gICAgJ30nOiAgICAgICAgY29sb3JzLnllbGxvdyxcbiAgICAnWyc6ICAgICAgICBjb2xvcnMueWVsbG93LFxuICAgICddJzogICAgICAgIGNvbG9ycy55ZWxsb3csXG4gICAgJzonOiAgICAgICAgY29sb3JzLnllbGxvdyxcbiAgICAnOyc6ICAgICAgICBjb2xvcnMueWVsbG93XG59O1xuXG5mdW5jdGlvbiBnZXRUb2tlblR5cGUoW3R5cGUsIHZhbHVlXSwgaW5kZXgsIHRva2Vucykge1xuICAgIGlmICh0eXBlID09PSAnd29yZCcpIHtcbiAgICAgICAgaWYgKHZhbHVlWzBdID09PSAnLicpIHtcbiAgICAgICAgICAgIHJldHVybiAnY2xhc3MnO1xuICAgICAgICB9XG4gICAgICAgIGlmICh2YWx1ZVswXSA9PT0gJyMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2hhc2gnO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgbGV0IG5leHRUb2tlbiA9IHRva2Vuc1tpbmRleCArIDFdO1xuICAgIGlmIChuZXh0VG9rZW4gJiYgKG5leHRUb2tlblswXSA9PT0gJ2JyYWNrZXRzJyB8fCBuZXh0VG9rZW5bMF0gPT09ICcoJykpIHtcbiAgICAgICAgcmV0dXJuICdjYWxsJztcbiAgICB9XG5cbiAgICByZXR1cm4gdHlwZTtcbn1cblxuZnVuY3Rpb24gdGVybWluYWxIaWdobGlnaHQoY3NzKSB7XG4gICAgbGV0IHRva2VucyA9IHRva2VuaXplKG5ldyBJbnB1dChjc3MpLCB7IGlnbm9yZUVycm9yczogdHJ1ZSB9KTtcbiAgICByZXR1cm4gdG9rZW5zLm1hcCgodG9rZW4sIGluZGV4KSA9PiB7XG4gICAgICAgIGxldCBjb2xvciA9IEhJR0hMSUdIVF9USEVNRVtnZXRUb2tlblR5cGUodG9rZW4sIGluZGV4LCB0b2tlbnMpXTtcbiAgICAgICAgaWYgKCBjb2xvciApIHtcbiAgICAgICAgICAgIHJldHVybiB0b2tlblsxXS5zcGxpdCgvXFxyP1xcbi8pXG4gICAgICAgICAgICAgIC5tYXAoIGkgPT4gY29sb3IoaSkgKVxuICAgICAgICAgICAgICAuam9pbignXFxuJyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdG9rZW5bMV07XG4gICAgICAgIH1cbiAgICB9KS5qb2luKCcnKTtcbn1cblxuZXhwb3J0IGRlZmF1bHQgdGVybWluYWxIaWdobGlnaHQ7XG4iXX0=
|
||||
273
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/tokenize.js
generated
vendored
Normal file
273
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/tokenize.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
52
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/vendor.js
generated
vendored
Normal file
52
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/vendor.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
/**
|
||||
* Contains helpers for working with vendor prefixes.
|
||||
*
|
||||
* @example
|
||||
* const vendor = postcss.vendor;
|
||||
*
|
||||
* @namespace vendor
|
||||
*/
|
||||
var vendor = {
|
||||
|
||||
/**
|
||||
* Returns the vendor prefix extracted from an input string.
|
||||
*
|
||||
* @param {string} prop - string with or without vendor prefix
|
||||
*
|
||||
* @return {string} vendor prefix or empty string
|
||||
*
|
||||
* @example
|
||||
* postcss.vendor.prefix('-moz-tab-size') //=> '-moz-'
|
||||
* postcss.vendor.prefix('tab-size') //=> ''
|
||||
*/
|
||||
prefix: function prefix(prop) {
|
||||
var match = prop.match(/^(-\w+-)/);
|
||||
if (match) {
|
||||
return match[0];
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Returns the input string stripped of its vendor prefix.
|
||||
*
|
||||
* @param {string} prop - string with or without vendor prefix
|
||||
*
|
||||
* @return {string} string name without vendor prefixes
|
||||
*
|
||||
* @example
|
||||
* postcss.vendor.unprefixed('-moz-tab-size') //=> 'tab-size'
|
||||
*/
|
||||
unprefixed: function unprefixed(prop) {
|
||||
return prop.replace(/^-\w+-/, '');
|
||||
}
|
||||
};
|
||||
|
||||
exports.default = vendor;
|
||||
module.exports = exports['default'];
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInZlbmRvci5lczYiXSwibmFtZXMiOlsidmVuZG9yIiwicHJlZml4IiwicHJvcCIsIm1hdGNoIiwidW5wcmVmaXhlZCIsInJlcGxhY2UiXSwibWFwcGluZ3MiOiI7OztBQUFBOzs7Ozs7OztBQVFBLElBQUlBLFNBQVM7O0FBRVQ7Ozs7Ozs7Ozs7O0FBV0FDLFVBYlMsa0JBYUZDLElBYkUsRUFhSTtBQUNULFlBQUlDLFFBQVFELEtBQUtDLEtBQUwsQ0FBVyxVQUFYLENBQVo7QUFDQSxZQUFLQSxLQUFMLEVBQWE7QUFDVCxtQkFBT0EsTUFBTSxDQUFOLENBQVA7QUFDSCxTQUZELE1BRU87QUFDSCxtQkFBTyxFQUFQO0FBQ0g7QUFDSixLQXBCUTs7O0FBc0JUOzs7Ozs7Ozs7O0FBVUFDLGNBaENTLHNCQWdDRUYsSUFoQ0YsRUFnQ1E7QUFDYixlQUFPQSxLQUFLRyxPQUFMLENBQWEsUUFBYixFQUF1QixFQUF2QixDQUFQO0FBQ0g7QUFsQ1EsQ0FBYjs7a0JBc0NlTCxNIiwiZmlsZSI6InZlbmRvci5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29udGFpbnMgaGVscGVycyBmb3Igd29ya2luZyB3aXRoIHZlbmRvciBwcmVmaXhlcy5cbiAqXG4gKiBAZXhhbXBsZVxuICogY29uc3QgdmVuZG9yID0gcG9zdGNzcy52ZW5kb3I7XG4gKlxuICogQG5hbWVzcGFjZSB2ZW5kb3JcbiAqL1xubGV0IHZlbmRvciA9IHtcblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgdGhlIHZlbmRvciBwcmVmaXggZXh0cmFjdGVkIGZyb20gYW4gaW5wdXQgc3RyaW5nLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IHByb3AgLSBzdHJpbmcgd2l0aCBvciB3aXRob3V0IHZlbmRvciBwcmVmaXhcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge3N0cmluZ30gdmVuZG9yIHByZWZpeCBvciBlbXB0eSBzdHJpbmdcbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogcG9zdGNzcy52ZW5kb3IucHJlZml4KCctbW96LXRhYi1zaXplJykgLy89PiAnLW1vei0nXG4gICAgICogcG9zdGNzcy52ZW5kb3IucHJlZml4KCd0YWItc2l6ZScpICAgICAgLy89PiAnJ1xuICAgICAqL1xuICAgIHByZWZpeChwcm9wKSB7XG4gICAgICAgIGxldCBtYXRjaCA9IHByb3AubWF0Y2goL14oLVxcdystKS8pO1xuICAgICAgICBpZiAoIG1hdGNoICkge1xuICAgICAgICAgICAgcmV0dXJuIG1hdGNoWzBdO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgdGhlIGlucHV0IHN0cmluZyBzdHJpcHBlZCBvZiBpdHMgdmVuZG9yIHByZWZpeC5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7c3RyaW5nfSBwcm9wIC0gc3RyaW5nIHdpdGggb3Igd2l0aG91dCB2ZW5kb3IgcHJlZml4XG4gICAgICpcbiAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IHN0cmluZyBuYW1lIHdpdGhvdXQgdmVuZG9yIHByZWZpeGVzXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHBvc3Rjc3MudmVuZG9yLnVucHJlZml4ZWQoJy1tb3otdGFiLXNpemUnKSAvLz0+ICd0YWItc2l6ZSdcbiAgICAgKi9cbiAgICB1bnByZWZpeGVkKHByb3ApIHtcbiAgICAgICAgcmV0dXJuIHByb3AucmVwbGFjZSgvXi1cXHcrLS8sICcnKTtcbiAgICB9XG5cbn07XG5cbmV4cG9ydCBkZWZhdWx0IHZlbmRvcjtcbiJdfQ==
|
||||
14
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/warn-once.js
generated
vendored
Normal file
14
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/warn-once.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = warnOnce;
|
||||
var printed = {};
|
||||
|
||||
function warnOnce(message) {
|
||||
if (printed[message]) return;
|
||||
printed[message] = true;
|
||||
|
||||
if (typeof console !== 'undefined' && console.warn) console.warn(message);
|
||||
}
|
||||
module.exports = exports['default'];
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndhcm4tb25jZS5lczYiXSwibmFtZXMiOlsid2Fybk9uY2UiLCJwcmludGVkIiwibWVzc2FnZSIsImNvbnNvbGUiLCJ3YXJuIl0sIm1hcHBpbmdzIjoiOzs7a0JBRXdCQSxRO0FBRnhCLElBQUlDLFVBQVUsRUFBZDs7QUFFZSxTQUFTRCxRQUFULENBQWtCRSxPQUFsQixFQUEyQjtBQUN0QyxRQUFLRCxRQUFRQyxPQUFSLENBQUwsRUFBd0I7QUFDeEJELFlBQVFDLE9BQVIsSUFBbUIsSUFBbkI7O0FBRUEsUUFBSyxPQUFPQyxPQUFQLEtBQW1CLFdBQW5CLElBQWtDQSxRQUFRQyxJQUEvQyxFQUFzREQsUUFBUUMsSUFBUixDQUFhRixPQUFiO0FBQ3pEIiwiZmlsZSI6Indhcm4tb25jZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImxldCBwcmludGVkID0geyB9O1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiB3YXJuT25jZShtZXNzYWdlKSB7XG4gICAgaWYgKCBwcmludGVkW21lc3NhZ2VdICkgcmV0dXJuO1xuICAgIHByaW50ZWRbbWVzc2FnZV0gPSB0cnVlO1xuXG4gICAgaWYgKCB0eXBlb2YgY29uc29sZSAhPT0gJ3VuZGVmaW5lZCcgJiYgY29uc29sZS53YXJuICkgY29uc29sZS53YXJuKG1lc3NhZ2UpO1xufVxuIl19
|
||||
122
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/warning.js
generated
vendored
Normal file
122
build/node_modules/postcss-discard-comments/node_modules/postcss/lib/warning.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
113
build/node_modules/postcss-discard-comments/node_modules/postcss/package.json
generated
vendored
Normal file
113
build/node_modules/postcss-discard-comments/node_modules/postcss/package.json
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"postcss@5.2.18",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "postcss@5.2.18",
|
||||
"_id": "postcss@5.2.18",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==",
|
||||
"_location": "/postcss-discard-comments/postcss",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "postcss@5.2.18",
|
||||
"name": "postcss",
|
||||
"escapedName": "postcss",
|
||||
"rawSpec": "5.2.18",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "5.2.18"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/postcss-discard-comments"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz",
|
||||
"_spec": "5.2.18",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Andrey Sitnik",
|
||||
"email": "andrey@sitnik.ru"
|
||||
},
|
||||
"browser": {
|
||||
"fs": false
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/postcss/postcss/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"chalk": "^1.1.3",
|
||||
"js-base64": "^2.1.9",
|
||||
"source-map": "^0.5.6",
|
||||
"supports-color": "^3.2.3"
|
||||
},
|
||||
"description": "Tool for transforming styles with JS plugins",
|
||||
"devDependencies": {
|
||||
"ava": "^0.17.0",
|
||||
"babel-core": "^6.24.0",
|
||||
"babel-eslint": "^7.1.1",
|
||||
"babel-plugin-add-module-exports": "^0.2.1",
|
||||
"babel-plugin-precompile-charcodes": "^1.0.0",
|
||||
"babel-preset-es2015": "^6.24.0",
|
||||
"chalk": "^1.1.3",
|
||||
"concat-with-sourcemaps": "^1.0.4",
|
||||
"del": "^2.2.2",
|
||||
"docdash": "^0.4.0",
|
||||
"eslint": "^3.18.0",
|
||||
"eslint-config-postcss": "^2.0.2",
|
||||
"fs-extra": "^1.0.0",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-ava": "^0.15.0",
|
||||
"gulp-babel": "^6.1.2",
|
||||
"gulp-changed": "^1.3.2",
|
||||
"gulp-eslint": "^3.0.1",
|
||||
"gulp-run": "^1.7.1",
|
||||
"gulp-sourcemaps": "^2.4.1",
|
||||
"jsdoc": "^3.4.3",
|
||||
"lint-staged": "^3.4.0",
|
||||
"postcss-parser-tests": "^5.0.11",
|
||||
"pre-commit": "^1.2.2",
|
||||
"run-sequence": "^1.2.2",
|
||||
"sinon": "^2.0.0",
|
||||
"strip-ansi": "^3.0.1",
|
||||
"yaspeller-ci": "^0.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
},
|
||||
"homepage": "http://postcss.org/",
|
||||
"keywords": [
|
||||
"css",
|
||||
"postcss",
|
||||
"rework",
|
||||
"preprocessor",
|
||||
"parser",
|
||||
"source map",
|
||||
"transform",
|
||||
"manipulation",
|
||||
"transpiler"
|
||||
],
|
||||
"license": "MIT",
|
||||
"lint-staged": {
|
||||
"test/*.js": "eslint",
|
||||
"lib/*.es6": "eslint",
|
||||
"*.md": "yaspeller-ci"
|
||||
},
|
||||
"main": "lib/postcss",
|
||||
"name": "postcss",
|
||||
"pre-commit": [
|
||||
"lint-staged"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/postcss/postcss.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint-staged": "lint-staged",
|
||||
"test": "gulp"
|
||||
},
|
||||
"types": "lib/postcss.d.ts",
|
||||
"version": "5.2.18"
|
||||
}
|
||||
301
build/node_modules/postcss-discard-comments/node_modules/source-map/CHANGELOG.md
generated
vendored
Normal file
301
build/node_modules/postcss-discard-comments/node_modules/source-map/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,301 @@
|
||||
# Change Log
|
||||
|
||||
## 0.5.6
|
||||
|
||||
* Fix for regression when people were using numbers as names in source maps. See
|
||||
#236.
|
||||
|
||||
## 0.5.5
|
||||
|
||||
* Fix "regression" of unsupported, implementation behavior that half the world
|
||||
happens to have come to depend on. See #235.
|
||||
|
||||
* Fix regression involving function hoisting in SpiderMonkey. See #233.
|
||||
|
||||
## 0.5.4
|
||||
|
||||
* Large performance improvements to source-map serialization. See #228 and #229.
|
||||
|
||||
## 0.5.3
|
||||
|
||||
* Do not include unnecessary distribution files. See
|
||||
commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86.
|
||||
|
||||
## 0.5.2
|
||||
|
||||
* Include browser distributions of the library in package.json's `files`. See
|
||||
issue #212.
|
||||
|
||||
## 0.5.1
|
||||
|
||||
* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See
|
||||
ff05274becc9e6e1295ed60f3ea090d31d843379.
|
||||
|
||||
## 0.5.0
|
||||
|
||||
* Node 0.8 is no longer supported.
|
||||
|
||||
* Use webpack instead of dryice for bundling.
|
||||
|
||||
* Big speedups serializing source maps. See pull request #203.
|
||||
|
||||
* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that
|
||||
explicitly start with the source root. See issue #199.
|
||||
|
||||
## 0.4.4
|
||||
|
||||
* Fix an issue where using a `SourceMapGenerator` after having created a
|
||||
`SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See
|
||||
issue #191.
|
||||
|
||||
* Fix an issue with where `SourceMapGenerator` would mistakenly consider
|
||||
different mappings as duplicates of each other and avoid generating them. See
|
||||
issue #192.
|
||||
|
||||
## 0.4.3
|
||||
|
||||
* A very large number of performance improvements, particularly when parsing
|
||||
source maps. Collectively about 75% of time shaved off of the source map
|
||||
parsing benchmark!
|
||||
|
||||
* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy
|
||||
searching in the presence of a column option. See issue #177.
|
||||
|
||||
* Fix a bug with joining a source and its source root when the source is above
|
||||
the root. See issue #182.
|
||||
|
||||
* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to
|
||||
determine when all sources' contents are inlined into the source map. See
|
||||
issue #190.
|
||||
|
||||
## 0.4.2
|
||||
|
||||
* Add an `.npmignore` file so that the benchmarks aren't pulled down by
|
||||
dependent projects. Issue #169.
|
||||
|
||||
* Add an optional `column` argument to
|
||||
`SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines
|
||||
with no mappings. Issues #172 and #173.
|
||||
|
||||
## 0.4.1
|
||||
|
||||
* Fix accidentally defining a global variable. #170.
|
||||
|
||||
## 0.4.0
|
||||
|
||||
* The default direction for fuzzy searching was changed back to its original
|
||||
direction. See #164.
|
||||
|
||||
* There is now a `bias` option you can supply to `SourceMapConsumer` to control
|
||||
the fuzzy searching direction. See #167.
|
||||
|
||||
* About an 8% speed up in parsing source maps. See #159.
|
||||
|
||||
* Added a benchmark for parsing and generating source maps.
|
||||
|
||||
## 0.3.0
|
||||
|
||||
* Change the default direction that searching for positions fuzzes when there is
|
||||
not an exact match. See #154.
|
||||
|
||||
* Support for environments using json2.js for JSON serialization. See #156.
|
||||
|
||||
## 0.2.0
|
||||
|
||||
* Support for consuming "indexed" source maps which do not have any remote
|
||||
sections. See pull request #127. This introduces a minor backwards
|
||||
incompatibility if you are monkey patching `SourceMapConsumer.prototype`
|
||||
methods.
|
||||
|
||||
## 0.1.43
|
||||
|
||||
* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue
|
||||
#148 for some discussion and issues #150, #151, and #152 for implementations.
|
||||
|
||||
## 0.1.42
|
||||
|
||||
* Fix an issue where `SourceNode`s from different versions of the source-map
|
||||
library couldn't be used in conjunction with each other. See issue #142.
|
||||
|
||||
## 0.1.41
|
||||
|
||||
* Fix a bug with getting the source content of relative sources with a "./"
|
||||
prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768).
|
||||
|
||||
* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the
|
||||
column span of each mapping.
|
||||
|
||||
* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find
|
||||
all generated positions associated with a given original source and line.
|
||||
|
||||
## 0.1.40
|
||||
|
||||
* Performance improvements for parsing source maps in SourceMapConsumer.
|
||||
|
||||
## 0.1.39
|
||||
|
||||
* Fix a bug where setting a source's contents to null before any source content
|
||||
had been set before threw a TypeError. See issue #131.
|
||||
|
||||
## 0.1.38
|
||||
|
||||
* Fix a bug where finding relative paths from an empty path were creating
|
||||
absolute paths. See issue #129.
|
||||
|
||||
## 0.1.37
|
||||
|
||||
* Fix a bug where if the source root was an empty string, relative source paths
|
||||
would turn into absolute source paths. Issue #124.
|
||||
|
||||
## 0.1.36
|
||||
|
||||
* Allow the `names` mapping property to be an empty string. Issue #121.
|
||||
|
||||
## 0.1.35
|
||||
|
||||
* A third optional parameter was added to `SourceNode.fromStringWithSourceMap`
|
||||
to specify a path that relative sources in the second parameter should be
|
||||
relative to. Issue #105.
|
||||
|
||||
* If no file property is given to a `SourceMapGenerator`, then the resulting
|
||||
source map will no longer have a `null` file property. The property will
|
||||
simply not exist. Issue #104.
|
||||
|
||||
* Fixed a bug where consecutive newlines were ignored in `SourceNode`s.
|
||||
Issue #116.
|
||||
|
||||
## 0.1.34
|
||||
|
||||
* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103.
|
||||
|
||||
* Fix bug involving source contents and the
|
||||
`SourceMapGenerator.prototype.applySourceMap`. Issue #100.
|
||||
|
||||
## 0.1.33
|
||||
|
||||
* Fix some edge cases surrounding path joining and URL resolution.
|
||||
|
||||
* Add a third parameter for relative path to
|
||||
`SourceMapGenerator.prototype.applySourceMap`.
|
||||
|
||||
* Fix issues with mappings and EOLs.
|
||||
|
||||
## 0.1.32
|
||||
|
||||
* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns
|
||||
(issue 92).
|
||||
|
||||
* Fixed test runner to actually report number of failed tests as its process
|
||||
exit code.
|
||||
|
||||
* Fixed a typo when reporting bad mappings (issue 87).
|
||||
|
||||
## 0.1.31
|
||||
|
||||
* Delay parsing the mappings in SourceMapConsumer until queried for a source
|
||||
location.
|
||||
|
||||
* Support Sass source maps (which at the time of writing deviate from the spec
|
||||
in small ways) in SourceMapConsumer.
|
||||
|
||||
## 0.1.30
|
||||
|
||||
* Do not join source root with a source, when the source is a data URI.
|
||||
|
||||
* Extend the test runner to allow running single specific test files at a time.
|
||||
|
||||
* Performance improvements in `SourceNode.prototype.walk` and
|
||||
`SourceMapConsumer.prototype.eachMapping`.
|
||||
|
||||
* Source map browser builds will now work inside Workers.
|
||||
|
||||
* Better error messages when attempting to add an invalid mapping to a
|
||||
`SourceMapGenerator`.
|
||||
|
||||
## 0.1.29
|
||||
|
||||
* Allow duplicate entries in the `names` and `sources` arrays of source maps
|
||||
(usually from TypeScript) we are parsing. Fixes github issue 72.
|
||||
|
||||
## 0.1.28
|
||||
|
||||
* Skip duplicate mappings when creating source maps from SourceNode; github
|
||||
issue 75.
|
||||
|
||||
## 0.1.27
|
||||
|
||||
* Don't throw an error when the `file` property is missing in SourceMapConsumer,
|
||||
we don't use it anyway.
|
||||
|
||||
## 0.1.26
|
||||
|
||||
* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70.
|
||||
|
||||
## 0.1.25
|
||||
|
||||
* Make compatible with browserify
|
||||
|
||||
## 0.1.24
|
||||
|
||||
* Fix issue with absolute paths and `file://` URIs. See
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=885597
|
||||
|
||||
## 0.1.23
|
||||
|
||||
* Fix issue with absolute paths and sourcesContent, github issue 64.
|
||||
|
||||
## 0.1.22
|
||||
|
||||
* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21.
|
||||
|
||||
## 0.1.21
|
||||
|
||||
* Fixed handling of sources that start with a slash so that they are relative to
|
||||
the source root's host.
|
||||
|
||||
## 0.1.20
|
||||
|
||||
* Fixed github issue #43: absolute URLs aren't joined with the source root
|
||||
anymore.
|
||||
|
||||
## 0.1.19
|
||||
|
||||
* Using Travis CI to run tests.
|
||||
|
||||
## 0.1.18
|
||||
|
||||
* Fixed a bug in the handling of sourceRoot.
|
||||
|
||||
## 0.1.17
|
||||
|
||||
* Added SourceNode.fromStringWithSourceMap.
|
||||
|
||||
## 0.1.16
|
||||
|
||||
* Added missing documentation.
|
||||
|
||||
* Fixed the generating of empty mappings in SourceNode.
|
||||
|
||||
## 0.1.15
|
||||
|
||||
* Added SourceMapGenerator.applySourceMap.
|
||||
|
||||
## 0.1.14
|
||||
|
||||
* The sourceRoot is now handled consistently.
|
||||
|
||||
## 0.1.13
|
||||
|
||||
* Added SourceMapGenerator.fromSourceMap.
|
||||
|
||||
## 0.1.12
|
||||
|
||||
* SourceNode now generates empty mappings too.
|
||||
|
||||
## 0.1.11
|
||||
|
||||
* Added name support to SourceNode.
|
||||
|
||||
## 0.1.10
|
||||
|
||||
* Added sourcesContent support to the customer and generator.
|
||||
28
build/node_modules/postcss-discard-comments/node_modules/source-map/LICENSE
generated
vendored
Normal file
28
build/node_modules/postcss-discard-comments/node_modules/source-map/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
Copyright (c) 2009-2011, Mozilla Foundation and contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the names of the Mozilla Foundation nor the names of project
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
729
build/node_modules/postcss-discard-comments/node_modules/source-map/README.md
generated
vendored
Normal file
729
build/node_modules/postcss-discard-comments/node_modules/source-map/README.md
generated
vendored
Normal file
@@ -0,0 +1,729 @@
|
||||
# Source Map
|
||||
|
||||
[](https://travis-ci.org/mozilla/source-map)
|
||||
|
||||
[](https://www.npmjs.com/package/source-map)
|
||||
|
||||
This is a library to generate and consume the source map format
|
||||
[described here][format].
|
||||
|
||||
[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
|
||||
|
||||
## Use with Node
|
||||
|
||||
$ npm install source-map
|
||||
|
||||
## Use on the Web
|
||||
|
||||
<script src="https://raw.githubusercontent.com/mozilla/source-map/master/dist/source-map.min.js" defer></script>
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
<!-- `npm run toc` to regenerate the Table of Contents -->
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
## Table of Contents
|
||||
|
||||
- [Examples](#examples)
|
||||
- [Consuming a source map](#consuming-a-source-map)
|
||||
- [Generating a source map](#generating-a-source-map)
|
||||
- [With SourceNode (high level API)](#with-sourcenode-high-level-api)
|
||||
- [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api)
|
||||
- [API](#api)
|
||||
- [SourceMapConsumer](#sourcemapconsumer)
|
||||
- [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap)
|
||||
- [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans)
|
||||
- [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition)
|
||||
- [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition)
|
||||
- [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition)
|
||||
- [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources)
|
||||
- [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing)
|
||||
- [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order)
|
||||
- [SourceMapGenerator](#sourcemapgenerator)
|
||||
- [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap)
|
||||
- [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer)
|
||||
- [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping)
|
||||
- [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent)
|
||||
- [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath)
|
||||
- [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring)
|
||||
- [SourceNode](#sourcenode)
|
||||
- [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name)
|
||||
- [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath)
|
||||
- [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk)
|
||||
- [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk)
|
||||
- [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent)
|
||||
- [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn)
|
||||
- [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn)
|
||||
- [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep)
|
||||
- [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement)
|
||||
- [SourceNode.prototype.toString()](#sourcenodeprototypetostring)
|
||||
- [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## Examples
|
||||
|
||||
### Consuming a source map
|
||||
|
||||
```js
|
||||
var rawSourceMap = {
|
||||
version: 3,
|
||||
file: 'min.js',
|
||||
names: ['bar', 'baz', 'n'],
|
||||
sources: ['one.js', 'two.js'],
|
||||
sourceRoot: 'http://example.com/www/js/',
|
||||
mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
|
||||
};
|
||||
|
||||
var smc = new SourceMapConsumer(rawSourceMap);
|
||||
|
||||
console.log(smc.sources);
|
||||
// [ 'http://example.com/www/js/one.js',
|
||||
// 'http://example.com/www/js/two.js' ]
|
||||
|
||||
console.log(smc.originalPositionFor({
|
||||
line: 2,
|
||||
column: 28
|
||||
}));
|
||||
// { source: 'http://example.com/www/js/two.js',
|
||||
// line: 2,
|
||||
// column: 10,
|
||||
// name: 'n' }
|
||||
|
||||
console.log(smc.generatedPositionFor({
|
||||
source: 'http://example.com/www/js/two.js',
|
||||
line: 2,
|
||||
column: 10
|
||||
}));
|
||||
// { line: 2, column: 28 }
|
||||
|
||||
smc.eachMapping(function (m) {
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
### Generating a source map
|
||||
|
||||
In depth guide:
|
||||
[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)
|
||||
|
||||
#### With SourceNode (high level API)
|
||||
|
||||
```js
|
||||
function compile(ast) {
|
||||
switch (ast.type) {
|
||||
case 'BinaryExpression':
|
||||
return new SourceNode(
|
||||
ast.location.line,
|
||||
ast.location.column,
|
||||
ast.location.source,
|
||||
[compile(ast.left), " + ", compile(ast.right)]
|
||||
);
|
||||
case 'Literal':
|
||||
return new SourceNode(
|
||||
ast.location.line,
|
||||
ast.location.column,
|
||||
ast.location.source,
|
||||
String(ast.value)
|
||||
);
|
||||
// ...
|
||||
default:
|
||||
throw new Error("Bad AST");
|
||||
}
|
||||
}
|
||||
|
||||
var ast = parse("40 + 2", "add.js");
|
||||
console.log(compile(ast).toStringWithSourceMap({
|
||||
file: 'add.js'
|
||||
}));
|
||||
// { code: '40 + 2',
|
||||
// map: [object SourceMapGenerator] }
|
||||
```
|
||||
|
||||
#### With SourceMapGenerator (low level API)
|
||||
|
||||
```js
|
||||
var map = new SourceMapGenerator({
|
||||
file: "source-mapped.js"
|
||||
});
|
||||
|
||||
map.addMapping({
|
||||
generated: {
|
||||
line: 10,
|
||||
column: 35
|
||||
},
|
||||
source: "foo.js",
|
||||
original: {
|
||||
line: 33,
|
||||
column: 2
|
||||
},
|
||||
name: "christopher"
|
||||
});
|
||||
|
||||
console.log(map.toString());
|
||||
// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
Get a reference to the module:
|
||||
|
||||
```js
|
||||
// Node.js
|
||||
var sourceMap = require('source-map');
|
||||
|
||||
// Browser builds
|
||||
var sourceMap = window.sourceMap;
|
||||
|
||||
// Inside Firefox
|
||||
const sourceMap = require("devtools/toolkit/sourcemap/source-map.js");
|
||||
```
|
||||
|
||||
### SourceMapConsumer
|
||||
|
||||
A SourceMapConsumer instance represents a parsed source map which we can query
|
||||
for information about the original file positions by giving it a file position
|
||||
in the generated source.
|
||||
|
||||
#### new SourceMapConsumer(rawSourceMap)
|
||||
|
||||
The only parameter is the raw source map (either as a string which can be
|
||||
`JSON.parse`'d, or an object). According to the spec, source maps have the
|
||||
following attributes:
|
||||
|
||||
* `version`: Which version of the source map spec this map is following.
|
||||
|
||||
* `sources`: An array of URLs to the original source files.
|
||||
|
||||
* `names`: An array of identifiers which can be referenced by individual
|
||||
mappings.
|
||||
|
||||
* `sourceRoot`: Optional. The URL root from which all sources are relative.
|
||||
|
||||
* `sourcesContent`: Optional. An array of contents of the original source files.
|
||||
|
||||
* `mappings`: A string of base64 VLQs which contain the actual mappings.
|
||||
|
||||
* `file`: Optional. The generated filename this source map is associated with.
|
||||
|
||||
```js
|
||||
var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData);
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.computeColumnSpans()
|
||||
|
||||
Compute the last column for each generated mapping. The last column is
|
||||
inclusive.
|
||||
|
||||
```js
|
||||
// Before:
|
||||
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
|
||||
// [ { line: 2,
|
||||
// column: 1 },
|
||||
// { line: 2,
|
||||
// column: 10 },
|
||||
// { line: 2,
|
||||
// column: 20 } ]
|
||||
|
||||
consumer.computeColumnSpans();
|
||||
|
||||
// After:
|
||||
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
|
||||
// [ { line: 2,
|
||||
// column: 1,
|
||||
// lastColumn: 9 },
|
||||
// { line: 2,
|
||||
// column: 10,
|
||||
// lastColumn: 19 },
|
||||
// { line: 2,
|
||||
// column: 20,
|
||||
// lastColumn: Infinity } ]
|
||||
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)
|
||||
|
||||
Returns the original source, line, and column information for the generated
|
||||
source's line and column positions provided. The only argument is an object with
|
||||
the following properties:
|
||||
|
||||
* `line`: The line number in the generated source.
|
||||
|
||||
* `column`: The column number in the generated source.
|
||||
|
||||
* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or
|
||||
`SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest
|
||||
element that is smaller than or greater than the one we are searching for,
|
||||
respectively, if the exact element cannot be found. Defaults to
|
||||
`SourceMapConsumer.GREATEST_LOWER_BOUND`.
|
||||
|
||||
and an object is returned with the following properties:
|
||||
|
||||
* `source`: The original source file, or null if this information is not
|
||||
available.
|
||||
|
||||
* `line`: The line number in the original source, or null if this information is
|
||||
not available.
|
||||
|
||||
* `column`: The column number in the original source, or null if this
|
||||
information is not available.
|
||||
|
||||
* `name`: The original identifier, or null if this information is not available.
|
||||
|
||||
```js
|
||||
consumer.originalPositionFor({ line: 2, column: 10 })
|
||||
// { source: 'foo.coffee',
|
||||
// line: 2,
|
||||
// column: 2,
|
||||
// name: null }
|
||||
|
||||
consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 })
|
||||
// { source: null,
|
||||
// line: null,
|
||||
// column: null,
|
||||
// name: null }
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)
|
||||
|
||||
Returns the generated line and column information for the original source,
|
||||
line, and column positions provided. The only argument is an object with
|
||||
the following properties:
|
||||
|
||||
* `source`: The filename of the original source.
|
||||
|
||||
* `line`: The line number in the original source.
|
||||
|
||||
* `column`: The column number in the original source.
|
||||
|
||||
and an object is returned with the following properties:
|
||||
|
||||
* `line`: The line number in the generated source, or null.
|
||||
|
||||
* `column`: The column number in the generated source, or null.
|
||||
|
||||
```js
|
||||
consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 })
|
||||
// { line: 1,
|
||||
// column: 56 }
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)
|
||||
|
||||
Returns all generated line and column information for the original source, line,
|
||||
and column provided. If no column is provided, returns all mappings
|
||||
corresponding to a either the line we are searching for or the next closest line
|
||||
that has any mappings. Otherwise, returns all mappings corresponding to the
|
||||
given line and either the column we are searching for or the next closest column
|
||||
that has any offsets.
|
||||
|
||||
The only argument is an object with the following properties:
|
||||
|
||||
* `source`: The filename of the original source.
|
||||
|
||||
* `line`: The line number in the original source.
|
||||
|
||||
* `column`: Optional. The column number in the original source.
|
||||
|
||||
and an array of objects is returned, each with the following properties:
|
||||
|
||||
* `line`: The line number in the generated source, or null.
|
||||
|
||||
* `column`: The column number in the generated source, or null.
|
||||
|
||||
```js
|
||||
consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" })
|
||||
// [ { line: 2,
|
||||
// column: 1 },
|
||||
// { line: 2,
|
||||
// column: 10 },
|
||||
// { line: 2,
|
||||
// column: 20 } ]
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.hasContentsOfAllSources()
|
||||
|
||||
Return true if we have the embedded source content for every source listed in
|
||||
the source map, false otherwise.
|
||||
|
||||
In other words, if this method returns `true`, then
|
||||
`consumer.sourceContentFor(s)` will succeed for every source `s` in
|
||||
`consumer.sources`.
|
||||
|
||||
```js
|
||||
// ...
|
||||
if (consumer.hasContentsOfAllSources()) {
|
||||
consumerReadyCallback(consumer);
|
||||
} else {
|
||||
fetchSources(consumer, consumerReadyCallback);
|
||||
}
|
||||
// ...
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])
|
||||
|
||||
Returns the original source content for the source provided. The only
|
||||
argument is the URL of the original source file.
|
||||
|
||||
If the source content for the given source is not found, then an error is
|
||||
thrown. Optionally, pass `true` as the second param to have `null` returned
|
||||
instead.
|
||||
|
||||
```js
|
||||
consumer.sources
|
||||
// [ "my-cool-lib.clj" ]
|
||||
|
||||
consumer.sourceContentFor("my-cool-lib.clj")
|
||||
// "..."
|
||||
|
||||
consumer.sourceContentFor("this is not in the source map");
|
||||
// Error: "this is not in the source map" is not in the source map
|
||||
|
||||
consumer.sourceContentFor("this is not in the source map", true);
|
||||
// null
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.eachMapping(callback, context, order)
|
||||
|
||||
Iterate over each mapping between an original source/line/column and a
|
||||
generated line/column in this source map.
|
||||
|
||||
* `callback`: The function that is called with each mapping. Mappings have the
|
||||
form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,
|
||||
name }`
|
||||
|
||||
* `context`: Optional. If specified, this object will be the value of `this`
|
||||
every time that `callback` is called.
|
||||
|
||||
* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or
|
||||
`SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over
|
||||
the mappings sorted by the generated file's line/column order or the
|
||||
original's source/line/column order, respectively. Defaults to
|
||||
`SourceMapConsumer.GENERATED_ORDER`.
|
||||
|
||||
```js
|
||||
consumer.eachMapping(function (m) { console.log(m); })
|
||||
// ...
|
||||
// { source: 'illmatic.js',
|
||||
// generatedLine: 1,
|
||||
// generatedColumn: 0,
|
||||
// originalLine: 1,
|
||||
// originalColumn: 0,
|
||||
// name: null }
|
||||
// { source: 'illmatic.js',
|
||||
// generatedLine: 2,
|
||||
// generatedColumn: 0,
|
||||
// originalLine: 2,
|
||||
// originalColumn: 0,
|
||||
// name: null }
|
||||
// ...
|
||||
```
|
||||
### SourceMapGenerator
|
||||
|
||||
An instance of the SourceMapGenerator represents a source map which is being
|
||||
built incrementally.
|
||||
|
||||
#### new SourceMapGenerator([startOfSourceMap])
|
||||
|
||||
You may pass an object with the following properties:
|
||||
|
||||
* `file`: The filename of the generated source that this source map is
|
||||
associated with.
|
||||
|
||||
* `sourceRoot`: A root for all relative URLs in this source map.
|
||||
|
||||
* `skipValidation`: Optional. When `true`, disables validation of mappings as
|
||||
they are added. This can improve performance but should be used with
|
||||
discretion, as a last resort. Even then, one should avoid using this flag when
|
||||
running tests, if possible.
|
||||
|
||||
```js
|
||||
var generator = new sourceMap.SourceMapGenerator({
|
||||
file: "my-generated-javascript-file.js",
|
||||
sourceRoot: "http://example.com/app/js/"
|
||||
});
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.fromSourceMap(sourceMapConsumer)
|
||||
|
||||
Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance.
|
||||
|
||||
* `sourceMapConsumer` The SourceMap.
|
||||
|
||||
```js
|
||||
var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer);
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.prototype.addMapping(mapping)
|
||||
|
||||
Add a single mapping from original source line and column to the generated
|
||||
source's line and column for this source map being created. The mapping object
|
||||
should have the following properties:
|
||||
|
||||
* `generated`: An object with the generated line and column positions.
|
||||
|
||||
* `original`: An object with the original line and column positions.
|
||||
|
||||
* `source`: The original source file (relative to the sourceRoot).
|
||||
|
||||
* `name`: An optional original token name for this mapping.
|
||||
|
||||
```js
|
||||
generator.addMapping({
|
||||
source: "module-one.scm",
|
||||
original: { line: 128, column: 0 },
|
||||
generated: { line: 3, column: 456 }
|
||||
})
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)
|
||||
|
||||
Set the source content for an original source file.
|
||||
|
||||
* `sourceFile` the URL of the original source file.
|
||||
|
||||
* `sourceContent` the content of the source file.
|
||||
|
||||
```js
|
||||
generator.setSourceContent("module-one.scm",
|
||||
fs.readFileSync("path/to/module-one.scm"))
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])
|
||||
|
||||
Applies a SourceMap for a source file to the SourceMap.
|
||||
Each mapping to the supplied source file is rewritten using the
|
||||
supplied SourceMap. Note: The resolution for the resulting mappings
|
||||
is the minimum of this map and the supplied map.
|
||||
|
||||
* `sourceMapConsumer`: The SourceMap to be applied.
|
||||
|
||||
* `sourceFile`: Optional. The filename of the source file.
|
||||
If omitted, sourceMapConsumer.file will be used, if it exists.
|
||||
Otherwise an error will be thrown.
|
||||
|
||||
* `sourceMapPath`: Optional. The dirname of the path to the SourceMap
|
||||
to be applied. If relative, it is relative to the SourceMap.
|
||||
|
||||
This parameter is needed when the two SourceMaps aren't in the same
|
||||
directory, and the SourceMap to be applied contains relative source
|
||||
paths. If so, those relative source paths need to be rewritten
|
||||
relative to the SourceMap.
|
||||
|
||||
If omitted, it is assumed that both SourceMaps are in the same directory,
|
||||
thus not needing any rewriting. (Supplying `'.'` has the same effect.)
|
||||
|
||||
#### SourceMapGenerator.prototype.toString()
|
||||
|
||||
Renders the source map being generated to a string.
|
||||
|
||||
```js
|
||||
generator.toString()
|
||||
// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}'
|
||||
```
|
||||
|
||||
### SourceNode
|
||||
|
||||
SourceNodes provide a way to abstract over interpolating and/or concatenating
|
||||
snippets of generated JavaScript source code, while maintaining the line and
|
||||
column information associated between those snippets and the original source
|
||||
code. This is useful as the final intermediate representation a compiler might
|
||||
use before outputting the generated JS and source map.
|
||||
|
||||
#### new SourceNode([line, column, source[, chunk[, name]]])
|
||||
|
||||
* `line`: The original line number associated with this source node, or null if
|
||||
it isn't associated with an original line.
|
||||
|
||||
* `column`: The original column number associated with this source node, or null
|
||||
if it isn't associated with an original column.
|
||||
|
||||
* `source`: The original source's filename; null if no filename is provided.
|
||||
|
||||
* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see
|
||||
below.
|
||||
|
||||
* `name`: Optional. The original identifier.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.cpp", [
|
||||
new SourceNode(3, 4, "b.cpp", "extern int status;\n"),
|
||||
new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"),
|
||||
new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"),
|
||||
]);
|
||||
```
|
||||
|
||||
#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])
|
||||
|
||||
Creates a SourceNode from generated code and a SourceMapConsumer.
|
||||
|
||||
* `code`: The generated code
|
||||
|
||||
* `sourceMapConsumer` The SourceMap for the generated code
|
||||
|
||||
* `relativePath` The optional path that relative sources in `sourceMapConsumer`
|
||||
should be relative to.
|
||||
|
||||
```js
|
||||
var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8"));
|
||||
var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"),
|
||||
consumer);
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.add(chunk)
|
||||
|
||||
Add a chunk of generated JS to this source node.
|
||||
|
||||
* `chunk`: A string snippet of generated JS code, another instance of
|
||||
`SourceNode`, or an array where each member is one of those things.
|
||||
|
||||
```js
|
||||
node.add(" + ");
|
||||
node.add(otherNode);
|
||||
node.add([leftHandOperandNode, " + ", rightHandOperandNode]);
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.prepend(chunk)
|
||||
|
||||
Prepend a chunk of generated JS to this source node.
|
||||
|
||||
* `chunk`: A string snippet of generated JS code, another instance of
|
||||
`SourceNode`, or an array where each member is one of those things.
|
||||
|
||||
```js
|
||||
node.prepend("/** Build Id: f783haef86324gf **/\n\n");
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)
|
||||
|
||||
Set the source content for a source file. This will be added to the
|
||||
`SourceMap` in the `sourcesContent` field.
|
||||
|
||||
* `sourceFile`: The filename of the source file
|
||||
|
||||
* `sourceContent`: The content of the source file
|
||||
|
||||
```js
|
||||
node.setSourceContent("module-one.scm",
|
||||
fs.readFileSync("path/to/module-one.scm"))
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.walk(fn)
|
||||
|
||||
Walk over the tree of JS snippets in this node and its children. The walking
|
||||
function is called once for each snippet of JS and is passed that snippet and
|
||||
the its original associated source's line/column location.
|
||||
|
||||
* `fn`: The traversal function.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.js", [
|
||||
new SourceNode(3, 4, "b.js", "uno"),
|
||||
"dos",
|
||||
[
|
||||
"tres",
|
||||
new SourceNode(5, 6, "c.js", "quatro")
|
||||
]
|
||||
]);
|
||||
|
||||
node.walk(function (code, loc) { console.log("WALK:", code, loc); })
|
||||
// WALK: uno { source: 'b.js', line: 3, column: 4, name: null }
|
||||
// WALK: dos { source: 'a.js', line: 1, column: 2, name: null }
|
||||
// WALK: tres { source: 'a.js', line: 1, column: 2, name: null }
|
||||
// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null }
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.walkSourceContents(fn)
|
||||
|
||||
Walk over the tree of SourceNodes. The walking function is called for each
|
||||
source file content and is passed the filename and source content.
|
||||
|
||||
* `fn`: The traversal function.
|
||||
|
||||
```js
|
||||
var a = new SourceNode(1, 2, "a.js", "generated from a");
|
||||
a.setSourceContent("a.js", "original a");
|
||||
var b = new SourceNode(1, 2, "b.js", "generated from b");
|
||||
b.setSourceContent("b.js", "original b");
|
||||
var c = new SourceNode(1, 2, "c.js", "generated from c");
|
||||
c.setSourceContent("c.js", "original c");
|
||||
|
||||
var node = new SourceNode(null, null, null, [a, b, c]);
|
||||
node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); })
|
||||
// WALK: a.js : original a
|
||||
// WALK: b.js : original b
|
||||
// WALK: c.js : original c
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.join(sep)
|
||||
|
||||
Like `Array.prototype.join` except for SourceNodes. Inserts the separator
|
||||
between each of this source node's children.
|
||||
|
||||
* `sep`: The separator.
|
||||
|
||||
```js
|
||||
var lhs = new SourceNode(1, 2, "a.rs", "my_copy");
|
||||
var operand = new SourceNode(3, 4, "a.rs", "=");
|
||||
var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()");
|
||||
|
||||
var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]);
|
||||
var joinedNode = node.join(" ");
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.replaceRight(pattern, replacement)
|
||||
|
||||
Call `String.prototype.replace` on the very right-most source snippet. Useful
|
||||
for trimming white space from the end of a source node, etc.
|
||||
|
||||
* `pattern`: The pattern to replace.
|
||||
|
||||
* `replacement`: The thing to replace the pattern with.
|
||||
|
||||
```js
|
||||
// Trim trailing white space.
|
||||
node.replaceRight(/\s*$/, "");
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.toString()
|
||||
|
||||
Return the string representation of this source node. Walks over the tree and
|
||||
concatenates all the various snippets together to one string.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.js", [
|
||||
new SourceNode(3, 4, "b.js", "uno"),
|
||||
"dos",
|
||||
[
|
||||
"tres",
|
||||
new SourceNode(5, 6, "c.js", "quatro")
|
||||
]
|
||||
]);
|
||||
|
||||
node.toString()
|
||||
// 'unodostresquatro'
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])
|
||||
|
||||
Returns the string representation of this tree of source nodes, plus a
|
||||
SourceMapGenerator which contains all the mappings between the generated and
|
||||
original sources.
|
||||
|
||||
The arguments are the same as those to `new SourceMapGenerator`.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.js", [
|
||||
new SourceNode(3, 4, "b.js", "uno"),
|
||||
"dos",
|
||||
[
|
||||
"tres",
|
||||
new SourceNode(5, 6, "c.js", "quatro")
|
||||
]
|
||||
]);
|
||||
|
||||
node.toStringWithSourceMap({ file: "my-output-file.js" })
|
||||
// { code: 'unodostresquatro',
|
||||
// map: [object SourceMapGenerator] }
|
||||
```
|
||||
3091
build/node_modules/postcss-discard-comments/node_modules/source-map/dist/source-map.debug.js
generated
vendored
Normal file
3091
build/node_modules/postcss-discard-comments/node_modules/source-map/dist/source-map.debug.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3090
build/node_modules/postcss-discard-comments/node_modules/source-map/dist/source-map.js
generated
vendored
Normal file
3090
build/node_modules/postcss-discard-comments/node_modules/source-map/dist/source-map.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
build/node_modules/postcss-discard-comments/node_modules/source-map/dist/source-map.min.js
generated
vendored
Normal file
2
build/node_modules/postcss-discard-comments/node_modules/source-map/dist/source-map.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
build/node_modules/postcss-discard-comments/node_modules/source-map/dist/source-map.min.js.map
generated
vendored
Normal file
1
build/node_modules/postcss-discard-comments/node_modules/source-map/dist/source-map.min.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
121
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/array-set.js
generated
vendored
Normal file
121
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/array-set.js
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var util = require('./util');
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
var hasNativeMap = typeof Map !== "undefined";
|
||||
|
||||
/**
|
||||
* A data structure which is a combination of an array and a set. Adding a new
|
||||
* member is O(1), testing for membership is O(1), and finding the index of an
|
||||
* element is O(1). Removing elements from the set is not supported. Only
|
||||
* strings are supported for membership.
|
||||
*/
|
||||
function ArraySet() {
|
||||
this._array = [];
|
||||
this._set = hasNativeMap ? new Map() : Object.create(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Static method for creating ArraySet instances from an existing array.
|
||||
*/
|
||||
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
|
||||
var set = new ArraySet();
|
||||
for (var i = 0, len = aArray.length; i < len; i++) {
|
||||
set.add(aArray[i], aAllowDuplicates);
|
||||
}
|
||||
return set;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return how many unique items are in this ArraySet. If duplicates have been
|
||||
* added, than those do not count towards the size.
|
||||
*
|
||||
* @returns Number
|
||||
*/
|
||||
ArraySet.prototype.size = function ArraySet_size() {
|
||||
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add the given string to this set.
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
|
||||
var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
|
||||
var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
|
||||
var idx = this._array.length;
|
||||
if (!isDuplicate || aAllowDuplicates) {
|
||||
this._array.push(aStr);
|
||||
}
|
||||
if (!isDuplicate) {
|
||||
if (hasNativeMap) {
|
||||
this._set.set(aStr, idx);
|
||||
} else {
|
||||
this._set[sStr] = idx;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Is the given string a member of this set?
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
ArraySet.prototype.has = function ArraySet_has(aStr) {
|
||||
if (hasNativeMap) {
|
||||
return this._set.has(aStr);
|
||||
} else {
|
||||
var sStr = util.toSetString(aStr);
|
||||
return has.call(this._set, sStr);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* What is the index of the given string in the array?
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
|
||||
if (hasNativeMap) {
|
||||
var idx = this._set.get(aStr);
|
||||
if (idx >= 0) {
|
||||
return idx;
|
||||
}
|
||||
} else {
|
||||
var sStr = util.toSetString(aStr);
|
||||
if (has.call(this._set, sStr)) {
|
||||
return this._set[sStr];
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error('"' + aStr + '" is not in the set.');
|
||||
};
|
||||
|
||||
/**
|
||||
* What is the element at the given index?
|
||||
*
|
||||
* @param Number aIdx
|
||||
*/
|
||||
ArraySet.prototype.at = function ArraySet_at(aIdx) {
|
||||
if (aIdx >= 0 && aIdx < this._array.length) {
|
||||
return this._array[aIdx];
|
||||
}
|
||||
throw new Error('No element indexed by ' + aIdx);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the array representation of this set (which has the proper indices
|
||||
* indicated by indexOf). Note that this is a copy of the internal array used
|
||||
* for storing the members so that no one can mess with internal state.
|
||||
*/
|
||||
ArraySet.prototype.toArray = function ArraySet_toArray() {
|
||||
return this._array.slice();
|
||||
};
|
||||
|
||||
exports.ArraySet = ArraySet;
|
||||
140
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/base64-vlq.js
generated
vendored
Normal file
140
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/base64-vlq.js
generated
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* Based on the Base 64 VLQ implementation in Closure Compiler:
|
||||
* https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
|
||||
*
|
||||
* Copyright 2011 The Closure Compiler Authors. All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of Google Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
var base64 = require('./base64');
|
||||
|
||||
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
|
||||
// length quantities we use in the source map spec, the first bit is the sign,
|
||||
// the next four bits are the actual value, and the 6th bit is the
|
||||
// continuation bit. The continuation bit tells us whether there are more
|
||||
// digits in this value following this digit.
|
||||
//
|
||||
// Continuation
|
||||
// | Sign
|
||||
// | |
|
||||
// V V
|
||||
// 101011
|
||||
|
||||
var VLQ_BASE_SHIFT = 5;
|
||||
|
||||
// binary: 100000
|
||||
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
||||
|
||||
// binary: 011111
|
||||
var VLQ_BASE_MASK = VLQ_BASE - 1;
|
||||
|
||||
// binary: 100000
|
||||
var VLQ_CONTINUATION_BIT = VLQ_BASE;
|
||||
|
||||
/**
|
||||
* Converts from a two-complement value to a value where the sign bit is
|
||||
* placed in the least significant bit. For example, as decimals:
|
||||
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
|
||||
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
|
||||
*/
|
||||
function toVLQSigned(aValue) {
|
||||
return aValue < 0
|
||||
? ((-aValue) << 1) + 1
|
||||
: (aValue << 1) + 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts to a two-complement value from a value where the sign bit is
|
||||
* placed in the least significant bit. For example, as decimals:
|
||||
* 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
|
||||
* 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
|
||||
*/
|
||||
function fromVLQSigned(aValue) {
|
||||
var isNegative = (aValue & 1) === 1;
|
||||
var shifted = aValue >> 1;
|
||||
return isNegative
|
||||
? -shifted
|
||||
: shifted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the base 64 VLQ encoded value.
|
||||
*/
|
||||
exports.encode = function base64VLQ_encode(aValue) {
|
||||
var encoded = "";
|
||||
var digit;
|
||||
|
||||
var vlq = toVLQSigned(aValue);
|
||||
|
||||
do {
|
||||
digit = vlq & VLQ_BASE_MASK;
|
||||
vlq >>>= VLQ_BASE_SHIFT;
|
||||
if (vlq > 0) {
|
||||
// There are still more digits in this value, so we must make sure the
|
||||
// continuation bit is marked.
|
||||
digit |= VLQ_CONTINUATION_BIT;
|
||||
}
|
||||
encoded += base64.encode(digit);
|
||||
} while (vlq > 0);
|
||||
|
||||
return encoded;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes the next base 64 VLQ value from the given string and returns the
|
||||
* value and the rest of the string via the out parameter.
|
||||
*/
|
||||
exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
|
||||
var strLen = aStr.length;
|
||||
var result = 0;
|
||||
var shift = 0;
|
||||
var continuation, digit;
|
||||
|
||||
do {
|
||||
if (aIndex >= strLen) {
|
||||
throw new Error("Expected more digits in base 64 VLQ value.");
|
||||
}
|
||||
|
||||
digit = base64.decode(aStr.charCodeAt(aIndex++));
|
||||
if (digit === -1) {
|
||||
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
|
||||
}
|
||||
|
||||
continuation = !!(digit & VLQ_CONTINUATION_BIT);
|
||||
digit &= VLQ_BASE_MASK;
|
||||
result = result + (digit << shift);
|
||||
shift += VLQ_BASE_SHIFT;
|
||||
} while (continuation);
|
||||
|
||||
aOutParam.value = fromVLQSigned(result);
|
||||
aOutParam.rest = aIndex;
|
||||
};
|
||||
67
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/base64.js
generated
vendored
Normal file
67
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/base64.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
|
||||
|
||||
/**
|
||||
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
|
||||
*/
|
||||
exports.encode = function (number) {
|
||||
if (0 <= number && number < intToCharMap.length) {
|
||||
return intToCharMap[number];
|
||||
}
|
||||
throw new TypeError("Must be between 0 and 63: " + number);
|
||||
};
|
||||
|
||||
/**
|
||||
* Decode a single base 64 character code digit to an integer. Returns -1 on
|
||||
* failure.
|
||||
*/
|
||||
exports.decode = function (charCode) {
|
||||
var bigA = 65; // 'A'
|
||||
var bigZ = 90; // 'Z'
|
||||
|
||||
var littleA = 97; // 'a'
|
||||
var littleZ = 122; // 'z'
|
||||
|
||||
var zero = 48; // '0'
|
||||
var nine = 57; // '9'
|
||||
|
||||
var plus = 43; // '+'
|
||||
var slash = 47; // '/'
|
||||
|
||||
var littleOffset = 26;
|
||||
var numberOffset = 52;
|
||||
|
||||
// 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
if (bigA <= charCode && charCode <= bigZ) {
|
||||
return (charCode - bigA);
|
||||
}
|
||||
|
||||
// 26 - 51: abcdefghijklmnopqrstuvwxyz
|
||||
if (littleA <= charCode && charCode <= littleZ) {
|
||||
return (charCode - littleA + littleOffset);
|
||||
}
|
||||
|
||||
// 52 - 61: 0123456789
|
||||
if (zero <= charCode && charCode <= nine) {
|
||||
return (charCode - zero + numberOffset);
|
||||
}
|
||||
|
||||
// 62: +
|
||||
if (charCode == plus) {
|
||||
return 62;
|
||||
}
|
||||
|
||||
// 63: /
|
||||
if (charCode == slash) {
|
||||
return 63;
|
||||
}
|
||||
|
||||
// Invalid base64 digit.
|
||||
return -1;
|
||||
};
|
||||
111
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/binary-search.js
generated
vendored
Normal file
111
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/binary-search.js
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
exports.GREATEST_LOWER_BOUND = 1;
|
||||
exports.LEAST_UPPER_BOUND = 2;
|
||||
|
||||
/**
|
||||
* Recursive implementation of binary search.
|
||||
*
|
||||
* @param aLow Indices here and lower do not contain the needle.
|
||||
* @param aHigh Indices here and higher do not contain the needle.
|
||||
* @param aNeedle The element being searched for.
|
||||
* @param aHaystack The non-empty array being searched.
|
||||
* @param aCompare Function which takes two elements and returns -1, 0, or 1.
|
||||
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
||||
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||||
* closest element that is smaller than or greater than the one we are
|
||||
* searching for, respectively, if the exact element cannot be found.
|
||||
*/
|
||||
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
||||
// This function terminates when one of the following is true:
|
||||
//
|
||||
// 1. We find the exact element we are looking for.
|
||||
//
|
||||
// 2. We did not find the exact element, but we can return the index of
|
||||
// the next-closest element.
|
||||
//
|
||||
// 3. We did not find the exact element, and there is no next-closest
|
||||
// element than the one we are searching for, so we return -1.
|
||||
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
|
||||
var cmp = aCompare(aNeedle, aHaystack[mid], true);
|
||||
if (cmp === 0) {
|
||||
// Found the element we are looking for.
|
||||
return mid;
|
||||
}
|
||||
else if (cmp > 0) {
|
||||
// Our needle is greater than aHaystack[mid].
|
||||
if (aHigh - mid > 1) {
|
||||
// The element is in the upper half.
|
||||
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
|
||||
}
|
||||
|
||||
// The exact needle element was not found in this haystack. Determine if
|
||||
// we are in termination case (3) or (2) and return the appropriate thing.
|
||||
if (aBias == exports.LEAST_UPPER_BOUND) {
|
||||
return aHigh < aHaystack.length ? aHigh : -1;
|
||||
} else {
|
||||
return mid;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Our needle is less than aHaystack[mid].
|
||||
if (mid - aLow > 1) {
|
||||
// The element is in the lower half.
|
||||
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
|
||||
}
|
||||
|
||||
// we are in termination case (3) or (2) and return the appropriate thing.
|
||||
if (aBias == exports.LEAST_UPPER_BOUND) {
|
||||
return mid;
|
||||
} else {
|
||||
return aLow < 0 ? -1 : aLow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is an implementation of binary search which will always try and return
|
||||
* the index of the closest element if there is no exact hit. This is because
|
||||
* mappings between original and generated line/col pairs are single points,
|
||||
* and there is an implicit region between each of them, so a miss just means
|
||||
* that you aren't on the very start of a region.
|
||||
*
|
||||
* @param aNeedle The element you are looking for.
|
||||
* @param aHaystack The array that is being searched.
|
||||
* @param aCompare A function which takes the needle and an element in the
|
||||
* array and returns -1, 0, or 1 depending on whether the needle is less
|
||||
* than, equal to, or greater than the element, respectively.
|
||||
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
||||
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||||
* closest element that is smaller than or greater than the one we are
|
||||
* searching for, respectively, if the exact element cannot be found.
|
||||
* Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
|
||||
*/
|
||||
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
||||
if (aHaystack.length === 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
|
||||
aCompare, aBias || exports.GREATEST_LOWER_BOUND);
|
||||
if (index < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// We have found either the exact element, or the next-closest element than
|
||||
// the one we are searching for. However, there may be more than one such
|
||||
// element. Make sure we always return the smallest of these.
|
||||
while (index - 1 >= 0) {
|
||||
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
|
||||
break;
|
||||
}
|
||||
--index;
|
||||
}
|
||||
|
||||
return index;
|
||||
};
|
||||
79
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/mapping-list.js
generated
vendored
Normal file
79
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/mapping-list.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2014 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var util = require('./util');
|
||||
|
||||
/**
|
||||
* Determine whether mappingB is after mappingA with respect to generated
|
||||
* position.
|
||||
*/
|
||||
function generatedPositionAfter(mappingA, mappingB) {
|
||||
// Optimized for most common case
|
||||
var lineA = mappingA.generatedLine;
|
||||
var lineB = mappingB.generatedLine;
|
||||
var columnA = mappingA.generatedColumn;
|
||||
var columnB = mappingB.generatedColumn;
|
||||
return lineB > lineA || lineB == lineA && columnB >= columnA ||
|
||||
util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* A data structure to provide a sorted view of accumulated mappings in a
|
||||
* performance conscious manner. It trades a neglibable overhead in general
|
||||
* case for a large speedup in case of mappings being added in order.
|
||||
*/
|
||||
function MappingList() {
|
||||
this._array = [];
|
||||
this._sorted = true;
|
||||
// Serves as infimum
|
||||
this._last = {generatedLine: -1, generatedColumn: 0};
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate through internal items. This method takes the same arguments that
|
||||
* `Array.prototype.forEach` takes.
|
||||
*
|
||||
* NOTE: The order of the mappings is NOT guaranteed.
|
||||
*/
|
||||
MappingList.prototype.unsortedForEach =
|
||||
function MappingList_forEach(aCallback, aThisArg) {
|
||||
this._array.forEach(aCallback, aThisArg);
|
||||
};
|
||||
|
||||
/**
|
||||
* Add the given source mapping.
|
||||
*
|
||||
* @param Object aMapping
|
||||
*/
|
||||
MappingList.prototype.add = function MappingList_add(aMapping) {
|
||||
if (generatedPositionAfter(this._last, aMapping)) {
|
||||
this._last = aMapping;
|
||||
this._array.push(aMapping);
|
||||
} else {
|
||||
this._sorted = false;
|
||||
this._array.push(aMapping);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the flat, sorted array of mappings. The mappings are sorted by
|
||||
* generated position.
|
||||
*
|
||||
* WARNING: This method returns internal data without copying, for
|
||||
* performance. The return value must NOT be mutated, and should be treated as
|
||||
* an immutable borrow. If you want to take ownership, you must make your own
|
||||
* copy.
|
||||
*/
|
||||
MappingList.prototype.toArray = function MappingList_toArray() {
|
||||
if (!this._sorted) {
|
||||
this._array.sort(util.compareByGeneratedPositionsInflated);
|
||||
this._sorted = true;
|
||||
}
|
||||
return this._array;
|
||||
};
|
||||
|
||||
exports.MappingList = MappingList;
|
||||
114
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/quick-sort.js
generated
vendored
Normal file
114
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/quick-sort.js
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
// It turns out that some (most?) JavaScript engines don't self-host
|
||||
// `Array.prototype.sort`. This makes sense because C++ will likely remain
|
||||
// faster than JS when doing raw CPU-intensive sorting. However, when using a
|
||||
// custom comparator function, calling back and forth between the VM's C++ and
|
||||
// JIT'd JS is rather slow *and* loses JIT type information, resulting in
|
||||
// worse generated code for the comparator function than would be optimal. In
|
||||
// fact, when sorting with a comparator, these costs outweigh the benefits of
|
||||
// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
|
||||
// a ~3500ms mean speed-up in `bench/bench.html`.
|
||||
|
||||
/**
|
||||
* Swap the elements indexed by `x` and `y` in the array `ary`.
|
||||
*
|
||||
* @param {Array} ary
|
||||
* The array.
|
||||
* @param {Number} x
|
||||
* The index of the first item.
|
||||
* @param {Number} y
|
||||
* The index of the second item.
|
||||
*/
|
||||
function swap(ary, x, y) {
|
||||
var temp = ary[x];
|
||||
ary[x] = ary[y];
|
||||
ary[y] = temp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a random integer within the range `low .. high` inclusive.
|
||||
*
|
||||
* @param {Number} low
|
||||
* The lower bound on the range.
|
||||
* @param {Number} high
|
||||
* The upper bound on the range.
|
||||
*/
|
||||
function randomIntInRange(low, high) {
|
||||
return Math.round(low + (Math.random() * (high - low)));
|
||||
}
|
||||
|
||||
/**
|
||||
* The Quick Sort algorithm.
|
||||
*
|
||||
* @param {Array} ary
|
||||
* An array to sort.
|
||||
* @param {function} comparator
|
||||
* Function to use to compare two items.
|
||||
* @param {Number} p
|
||||
* Start index of the array
|
||||
* @param {Number} r
|
||||
* End index of the array
|
||||
*/
|
||||
function doQuickSort(ary, comparator, p, r) {
|
||||
// If our lower bound is less than our upper bound, we (1) partition the
|
||||
// array into two pieces and (2) recurse on each half. If it is not, this is
|
||||
// the empty array and our base case.
|
||||
|
||||
if (p < r) {
|
||||
// (1) Partitioning.
|
||||
//
|
||||
// The partitioning chooses a pivot between `p` and `r` and moves all
|
||||
// elements that are less than or equal to the pivot to the before it, and
|
||||
// all the elements that are greater than it after it. The effect is that
|
||||
// once partition is done, the pivot is in the exact place it will be when
|
||||
// the array is put in sorted order, and it will not need to be moved
|
||||
// again. This runs in O(n) time.
|
||||
|
||||
// Always choose a random pivot so that an input array which is reverse
|
||||
// sorted does not cause O(n^2) running time.
|
||||
var pivotIndex = randomIntInRange(p, r);
|
||||
var i = p - 1;
|
||||
|
||||
swap(ary, pivotIndex, r);
|
||||
var pivot = ary[r];
|
||||
|
||||
// Immediately after `j` is incremented in this loop, the following hold
|
||||
// true:
|
||||
//
|
||||
// * Every element in `ary[p .. i]` is less than or equal to the pivot.
|
||||
//
|
||||
// * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
|
||||
for (var j = p; j < r; j++) {
|
||||
if (comparator(ary[j], pivot) <= 0) {
|
||||
i += 1;
|
||||
swap(ary, i, j);
|
||||
}
|
||||
}
|
||||
|
||||
swap(ary, i + 1, j);
|
||||
var q = i + 1;
|
||||
|
||||
// (2) Recurse on each half.
|
||||
|
||||
doQuickSort(ary, comparator, p, q - 1);
|
||||
doQuickSort(ary, comparator, q + 1, r);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the given array in-place with the given comparator function.
|
||||
*
|
||||
* @param {Array} ary
|
||||
* An array to sort.
|
||||
* @param {function} comparator
|
||||
* Function to use to compare two items.
|
||||
*/
|
||||
exports.quickSort = function (ary, comparator) {
|
||||
doQuickSort(ary, comparator, 0, ary.length - 1);
|
||||
};
|
||||
1082
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/source-map-consumer.js
generated
vendored
Normal file
1082
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/source-map-consumer.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
416
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/source-map-generator.js
generated
vendored
Normal file
416
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/source-map-generator.js
generated
vendored
Normal file
@@ -0,0 +1,416 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var base64VLQ = require('./base64-vlq');
|
||||
var util = require('./util');
|
||||
var ArraySet = require('./array-set').ArraySet;
|
||||
var MappingList = require('./mapping-list').MappingList;
|
||||
|
||||
/**
|
||||
* An instance of the SourceMapGenerator represents a source map which is
|
||||
* being built incrementally. You may pass an object with the following
|
||||
* properties:
|
||||
*
|
||||
* - file: The filename of the generated source.
|
||||
* - sourceRoot: A root for all relative URLs in this source map.
|
||||
*/
|
||||
function SourceMapGenerator(aArgs) {
|
||||
if (!aArgs) {
|
||||
aArgs = {};
|
||||
}
|
||||
this._file = util.getArg(aArgs, 'file', null);
|
||||
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
|
||||
this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
|
||||
this._sources = new ArraySet();
|
||||
this._names = new ArraySet();
|
||||
this._mappings = new MappingList();
|
||||
this._sourcesContents = null;
|
||||
}
|
||||
|
||||
SourceMapGenerator.prototype._version = 3;
|
||||
|
||||
/**
|
||||
* Creates a new SourceMapGenerator based on a SourceMapConsumer
|
||||
*
|
||||
* @param aSourceMapConsumer The SourceMap.
|
||||
*/
|
||||
SourceMapGenerator.fromSourceMap =
|
||||
function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
|
||||
var sourceRoot = aSourceMapConsumer.sourceRoot;
|
||||
var generator = new SourceMapGenerator({
|
||||
file: aSourceMapConsumer.file,
|
||||
sourceRoot: sourceRoot
|
||||
});
|
||||
aSourceMapConsumer.eachMapping(function (mapping) {
|
||||
var newMapping = {
|
||||
generated: {
|
||||
line: mapping.generatedLine,
|
||||
column: mapping.generatedColumn
|
||||
}
|
||||
};
|
||||
|
||||
if (mapping.source != null) {
|
||||
newMapping.source = mapping.source;
|
||||
if (sourceRoot != null) {
|
||||
newMapping.source = util.relative(sourceRoot, newMapping.source);
|
||||
}
|
||||
|
||||
newMapping.original = {
|
||||
line: mapping.originalLine,
|
||||
column: mapping.originalColumn
|
||||
};
|
||||
|
||||
if (mapping.name != null) {
|
||||
newMapping.name = mapping.name;
|
||||
}
|
||||
}
|
||||
|
||||
generator.addMapping(newMapping);
|
||||
});
|
||||
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
||||
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
||||
if (content != null) {
|
||||
generator.setSourceContent(sourceFile, content);
|
||||
}
|
||||
});
|
||||
return generator;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a single mapping from original source line and column to the generated
|
||||
* source's line and column for this source map being created. The mapping
|
||||
* object should have the following properties:
|
||||
*
|
||||
* - generated: An object with the generated line and column positions.
|
||||
* - original: An object with the original line and column positions.
|
||||
* - source: The original source file (relative to the sourceRoot).
|
||||
* - name: An optional original token name for this mapping.
|
||||
*/
|
||||
SourceMapGenerator.prototype.addMapping =
|
||||
function SourceMapGenerator_addMapping(aArgs) {
|
||||
var generated = util.getArg(aArgs, 'generated');
|
||||
var original = util.getArg(aArgs, 'original', null);
|
||||
var source = util.getArg(aArgs, 'source', null);
|
||||
var name = util.getArg(aArgs, 'name', null);
|
||||
|
||||
if (!this._skipValidation) {
|
||||
this._validateMapping(generated, original, source, name);
|
||||
}
|
||||
|
||||
if (source != null) {
|
||||
source = String(source);
|
||||
if (!this._sources.has(source)) {
|
||||
this._sources.add(source);
|
||||
}
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
name = String(name);
|
||||
if (!this._names.has(name)) {
|
||||
this._names.add(name);
|
||||
}
|
||||
}
|
||||
|
||||
this._mappings.add({
|
||||
generatedLine: generated.line,
|
||||
generatedColumn: generated.column,
|
||||
originalLine: original != null && original.line,
|
||||
originalColumn: original != null && original.column,
|
||||
source: source,
|
||||
name: name
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the source content for a source file.
|
||||
*/
|
||||
SourceMapGenerator.prototype.setSourceContent =
|
||||
function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
||||
var source = aSourceFile;
|
||||
if (this._sourceRoot != null) {
|
||||
source = util.relative(this._sourceRoot, source);
|
||||
}
|
||||
|
||||
if (aSourceContent != null) {
|
||||
// Add the source content to the _sourcesContents map.
|
||||
// Create a new _sourcesContents map if the property is null.
|
||||
if (!this._sourcesContents) {
|
||||
this._sourcesContents = Object.create(null);
|
||||
}
|
||||
this._sourcesContents[util.toSetString(source)] = aSourceContent;
|
||||
} else if (this._sourcesContents) {
|
||||
// Remove the source file from the _sourcesContents map.
|
||||
// If the _sourcesContents map is empty, set the property to null.
|
||||
delete this._sourcesContents[util.toSetString(source)];
|
||||
if (Object.keys(this._sourcesContents).length === 0) {
|
||||
this._sourcesContents = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Applies the mappings of a sub-source-map for a specific source file to the
|
||||
* source map being generated. Each mapping to the supplied source file is
|
||||
* rewritten using the supplied source map. Note: The resolution for the
|
||||
* resulting mappings is the minimium of this map and the supplied map.
|
||||
*
|
||||
* @param aSourceMapConsumer The source map to be applied.
|
||||
* @param aSourceFile Optional. The filename of the source file.
|
||||
* If omitted, SourceMapConsumer's file property will be used.
|
||||
* @param aSourceMapPath Optional. The dirname of the path to the source map
|
||||
* to be applied. If relative, it is relative to the SourceMapConsumer.
|
||||
* This parameter is needed when the two source maps aren't in the same
|
||||
* directory, and the source map to be applied contains relative source
|
||||
* paths. If so, those relative source paths need to be rewritten
|
||||
* relative to the SourceMapGenerator.
|
||||
*/
|
||||
SourceMapGenerator.prototype.applySourceMap =
|
||||
function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
|
||||
var sourceFile = aSourceFile;
|
||||
// If aSourceFile is omitted, we will use the file property of the SourceMap
|
||||
if (aSourceFile == null) {
|
||||
if (aSourceMapConsumer.file == null) {
|
||||
throw new Error(
|
||||
'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
|
||||
'or the source map\'s "file" property. Both were omitted.'
|
||||
);
|
||||
}
|
||||
sourceFile = aSourceMapConsumer.file;
|
||||
}
|
||||
var sourceRoot = this._sourceRoot;
|
||||
// Make "sourceFile" relative if an absolute Url is passed.
|
||||
if (sourceRoot != null) {
|
||||
sourceFile = util.relative(sourceRoot, sourceFile);
|
||||
}
|
||||
// Applying the SourceMap can add and remove items from the sources and
|
||||
// the names array.
|
||||
var newSources = new ArraySet();
|
||||
var newNames = new ArraySet();
|
||||
|
||||
// Find mappings for the "sourceFile"
|
||||
this._mappings.unsortedForEach(function (mapping) {
|
||||
if (mapping.source === sourceFile && mapping.originalLine != null) {
|
||||
// Check if it can be mapped by the source map, then update the mapping.
|
||||
var original = aSourceMapConsumer.originalPositionFor({
|
||||
line: mapping.originalLine,
|
||||
column: mapping.originalColumn
|
||||
});
|
||||
if (original.source != null) {
|
||||
// Copy mapping
|
||||
mapping.source = original.source;
|
||||
if (aSourceMapPath != null) {
|
||||
mapping.source = util.join(aSourceMapPath, mapping.source)
|
||||
}
|
||||
if (sourceRoot != null) {
|
||||
mapping.source = util.relative(sourceRoot, mapping.source);
|
||||
}
|
||||
mapping.originalLine = original.line;
|
||||
mapping.originalColumn = original.column;
|
||||
if (original.name != null) {
|
||||
mapping.name = original.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var source = mapping.source;
|
||||
if (source != null && !newSources.has(source)) {
|
||||
newSources.add(source);
|
||||
}
|
||||
|
||||
var name = mapping.name;
|
||||
if (name != null && !newNames.has(name)) {
|
||||
newNames.add(name);
|
||||
}
|
||||
|
||||
}, this);
|
||||
this._sources = newSources;
|
||||
this._names = newNames;
|
||||
|
||||
// Copy sourcesContents of applied map.
|
||||
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
||||
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
||||
if (content != null) {
|
||||
if (aSourceMapPath != null) {
|
||||
sourceFile = util.join(aSourceMapPath, sourceFile);
|
||||
}
|
||||
if (sourceRoot != null) {
|
||||
sourceFile = util.relative(sourceRoot, sourceFile);
|
||||
}
|
||||
this.setSourceContent(sourceFile, content);
|
||||
}
|
||||
}, this);
|
||||
};
|
||||
|
||||
/**
|
||||
* A mapping can have one of the three levels of data:
|
||||
*
|
||||
* 1. Just the generated position.
|
||||
* 2. The Generated position, original position, and original source.
|
||||
* 3. Generated and original position, original source, as well as a name
|
||||
* token.
|
||||
*
|
||||
* To maintain consistency, we validate that any new mapping being added falls
|
||||
* in to one of these categories.
|
||||
*/
|
||||
SourceMapGenerator.prototype._validateMapping =
|
||||
function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
|
||||
aName) {
|
||||
// When aOriginal is truthy but has empty values for .line and .column,
|
||||
// it is most likely a programmer error. In this case we throw a very
|
||||
// specific error message to try to guide them the right way.
|
||||
// For example: https://github.com/Polymer/polymer-bundler/pull/519
|
||||
if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
|
||||
throw new Error(
|
||||
'original.line and original.column are not numbers -- you probably meant to omit ' +
|
||||
'the original mapping entirely and only map the generated position. If so, pass ' +
|
||||
'null for the original mapping instead of an object with empty or null values.'
|
||||
);
|
||||
}
|
||||
|
||||
if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
|
||||
&& aGenerated.line > 0 && aGenerated.column >= 0
|
||||
&& !aOriginal && !aSource && !aName) {
|
||||
// Case 1.
|
||||
return;
|
||||
}
|
||||
else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
|
||||
&& aOriginal && 'line' in aOriginal && 'column' in aOriginal
|
||||
&& aGenerated.line > 0 && aGenerated.column >= 0
|
||||
&& aOriginal.line > 0 && aOriginal.column >= 0
|
||||
&& aSource) {
|
||||
// Cases 2 and 3.
|
||||
return;
|
||||
}
|
||||
else {
|
||||
throw new Error('Invalid mapping: ' + JSON.stringify({
|
||||
generated: aGenerated,
|
||||
source: aSource,
|
||||
original: aOriginal,
|
||||
name: aName
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Serialize the accumulated mappings in to the stream of base 64 VLQs
|
||||
* specified by the source map format.
|
||||
*/
|
||||
SourceMapGenerator.prototype._serializeMappings =
|
||||
function SourceMapGenerator_serializeMappings() {
|
||||
var previousGeneratedColumn = 0;
|
||||
var previousGeneratedLine = 1;
|
||||
var previousOriginalColumn = 0;
|
||||
var previousOriginalLine = 0;
|
||||
var previousName = 0;
|
||||
var previousSource = 0;
|
||||
var result = '';
|
||||
var next;
|
||||
var mapping;
|
||||
var nameIdx;
|
||||
var sourceIdx;
|
||||
|
||||
var mappings = this._mappings.toArray();
|
||||
for (var i = 0, len = mappings.length; i < len; i++) {
|
||||
mapping = mappings[i];
|
||||
next = ''
|
||||
|
||||
if (mapping.generatedLine !== previousGeneratedLine) {
|
||||
previousGeneratedColumn = 0;
|
||||
while (mapping.generatedLine !== previousGeneratedLine) {
|
||||
next += ';';
|
||||
previousGeneratedLine++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (i > 0) {
|
||||
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
|
||||
continue;
|
||||
}
|
||||
next += ',';
|
||||
}
|
||||
}
|
||||
|
||||
next += base64VLQ.encode(mapping.generatedColumn
|
||||
- previousGeneratedColumn);
|
||||
previousGeneratedColumn = mapping.generatedColumn;
|
||||
|
||||
if (mapping.source != null) {
|
||||
sourceIdx = this._sources.indexOf(mapping.source);
|
||||
next += base64VLQ.encode(sourceIdx - previousSource);
|
||||
previousSource = sourceIdx;
|
||||
|
||||
// lines are stored 0-based in SourceMap spec version 3
|
||||
next += base64VLQ.encode(mapping.originalLine - 1
|
||||
- previousOriginalLine);
|
||||
previousOriginalLine = mapping.originalLine - 1;
|
||||
|
||||
next += base64VLQ.encode(mapping.originalColumn
|
||||
- previousOriginalColumn);
|
||||
previousOriginalColumn = mapping.originalColumn;
|
||||
|
||||
if (mapping.name != null) {
|
||||
nameIdx = this._names.indexOf(mapping.name);
|
||||
next += base64VLQ.encode(nameIdx - previousName);
|
||||
previousName = nameIdx;
|
||||
}
|
||||
}
|
||||
|
||||
result += next;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
SourceMapGenerator.prototype._generateSourcesContent =
|
||||
function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
|
||||
return aSources.map(function (source) {
|
||||
if (!this._sourcesContents) {
|
||||
return null;
|
||||
}
|
||||
if (aSourceRoot != null) {
|
||||
source = util.relative(aSourceRoot, source);
|
||||
}
|
||||
var key = util.toSetString(source);
|
||||
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
|
||||
? this._sourcesContents[key]
|
||||
: null;
|
||||
}, this);
|
||||
};
|
||||
|
||||
/**
|
||||
* Externalize the source map.
|
||||
*/
|
||||
SourceMapGenerator.prototype.toJSON =
|
||||
function SourceMapGenerator_toJSON() {
|
||||
var map = {
|
||||
version: this._version,
|
||||
sources: this._sources.toArray(),
|
||||
names: this._names.toArray(),
|
||||
mappings: this._serializeMappings()
|
||||
};
|
||||
if (this._file != null) {
|
||||
map.file = this._file;
|
||||
}
|
||||
if (this._sourceRoot != null) {
|
||||
map.sourceRoot = this._sourceRoot;
|
||||
}
|
||||
if (this._sourcesContents) {
|
||||
map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
|
||||
}
|
||||
|
||||
return map;
|
||||
};
|
||||
|
||||
/**
|
||||
* Render the source map being generated to a string.
|
||||
*/
|
||||
SourceMapGenerator.prototype.toString =
|
||||
function SourceMapGenerator_toString() {
|
||||
return JSON.stringify(this.toJSON());
|
||||
};
|
||||
|
||||
exports.SourceMapGenerator = SourceMapGenerator;
|
||||
413
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/source-node.js
generated
vendored
Normal file
413
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/source-node.js
generated
vendored
Normal file
@@ -0,0 +1,413 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
|
||||
var util = require('./util');
|
||||
|
||||
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
|
||||
// operating systems these days (capturing the result).
|
||||
var REGEX_NEWLINE = /(\r?\n)/;
|
||||
|
||||
// Newline character code for charCodeAt() comparisons
|
||||
var NEWLINE_CODE = 10;
|
||||
|
||||
// Private symbol for identifying `SourceNode`s when multiple versions of
|
||||
// the source-map library are loaded. This MUST NOT CHANGE across
|
||||
// versions!
|
||||
var isSourceNode = "$$$isSourceNode$$$";
|
||||
|
||||
/**
|
||||
* SourceNodes provide a way to abstract over interpolating/concatenating
|
||||
* snippets of generated JavaScript source code while maintaining the line and
|
||||
* column information associated with the original source code.
|
||||
*
|
||||
* @param aLine The original line number.
|
||||
* @param aColumn The original column number.
|
||||
* @param aSource The original source's filename.
|
||||
* @param aChunks Optional. An array of strings which are snippets of
|
||||
* generated JS, or other SourceNodes.
|
||||
* @param aName The original identifier.
|
||||
*/
|
||||
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
|
||||
this.children = [];
|
||||
this.sourceContents = {};
|
||||
this.line = aLine == null ? null : aLine;
|
||||
this.column = aColumn == null ? null : aColumn;
|
||||
this.source = aSource == null ? null : aSource;
|
||||
this.name = aName == null ? null : aName;
|
||||
this[isSourceNode] = true;
|
||||
if (aChunks != null) this.add(aChunks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a SourceNode from generated code and a SourceMapConsumer.
|
||||
*
|
||||
* @param aGeneratedCode The generated code
|
||||
* @param aSourceMapConsumer The SourceMap for the generated code
|
||||
* @param aRelativePath Optional. The path that relative sources in the
|
||||
* SourceMapConsumer should be relative to.
|
||||
*/
|
||||
SourceNode.fromStringWithSourceMap =
|
||||
function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
|
||||
// The SourceNode we want to fill with the generated code
|
||||
// and the SourceMap
|
||||
var node = new SourceNode();
|
||||
|
||||
// All even indices of this array are one line of the generated code,
|
||||
// while all odd indices are the newlines between two adjacent lines
|
||||
// (since `REGEX_NEWLINE` captures its match).
|
||||
// Processed fragments are accessed by calling `shiftNextLine`.
|
||||
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
|
||||
var remainingLinesIndex = 0;
|
||||
var shiftNextLine = function() {
|
||||
var lineContents = getNextLine();
|
||||
// The last line of a file might not have a newline.
|
||||
var newLine = getNextLine() || "";
|
||||
return lineContents + newLine;
|
||||
|
||||
function getNextLine() {
|
||||
return remainingLinesIndex < remainingLines.length ?
|
||||
remainingLines[remainingLinesIndex++] : undefined;
|
||||
}
|
||||
};
|
||||
|
||||
// We need to remember the position of "remainingLines"
|
||||
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
|
||||
|
||||
// The generate SourceNodes we need a code range.
|
||||
// To extract it current and last mapping is used.
|
||||
// Here we store the last mapping.
|
||||
var lastMapping = null;
|
||||
|
||||
aSourceMapConsumer.eachMapping(function (mapping) {
|
||||
if (lastMapping !== null) {
|
||||
// We add the code from "lastMapping" to "mapping":
|
||||
// First check if there is a new line in between.
|
||||
if (lastGeneratedLine < mapping.generatedLine) {
|
||||
// Associate first line with "lastMapping"
|
||||
addMappingWithCode(lastMapping, shiftNextLine());
|
||||
lastGeneratedLine++;
|
||||
lastGeneratedColumn = 0;
|
||||
// The remaining code is added without mapping
|
||||
} else {
|
||||
// There is no new line in between.
|
||||
// Associate the code between "lastGeneratedColumn" and
|
||||
// "mapping.generatedColumn" with "lastMapping"
|
||||
var nextLine = remainingLines[remainingLinesIndex];
|
||||
var code = nextLine.substr(0, mapping.generatedColumn -
|
||||
lastGeneratedColumn);
|
||||
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
|
||||
lastGeneratedColumn);
|
||||
lastGeneratedColumn = mapping.generatedColumn;
|
||||
addMappingWithCode(lastMapping, code);
|
||||
// No more remaining code, continue
|
||||
lastMapping = mapping;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// We add the generated code until the first mapping
|
||||
// to the SourceNode without any mapping.
|
||||
// Each line is added as separate string.
|
||||
while (lastGeneratedLine < mapping.generatedLine) {
|
||||
node.add(shiftNextLine());
|
||||
lastGeneratedLine++;
|
||||
}
|
||||
if (lastGeneratedColumn < mapping.generatedColumn) {
|
||||
var nextLine = remainingLines[remainingLinesIndex];
|
||||
node.add(nextLine.substr(0, mapping.generatedColumn));
|
||||
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
|
||||
lastGeneratedColumn = mapping.generatedColumn;
|
||||
}
|
||||
lastMapping = mapping;
|
||||
}, this);
|
||||
// We have processed all mappings.
|
||||
if (remainingLinesIndex < remainingLines.length) {
|
||||
if (lastMapping) {
|
||||
// Associate the remaining code in the current line with "lastMapping"
|
||||
addMappingWithCode(lastMapping, shiftNextLine());
|
||||
}
|
||||
// and add the remaining lines without any mapping
|
||||
node.add(remainingLines.splice(remainingLinesIndex).join(""));
|
||||
}
|
||||
|
||||
// Copy sourcesContent into SourceNode
|
||||
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
||||
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
||||
if (content != null) {
|
||||
if (aRelativePath != null) {
|
||||
sourceFile = util.join(aRelativePath, sourceFile);
|
||||
}
|
||||
node.setSourceContent(sourceFile, content);
|
||||
}
|
||||
});
|
||||
|
||||
return node;
|
||||
|
||||
function addMappingWithCode(mapping, code) {
|
||||
if (mapping === null || mapping.source === undefined) {
|
||||
node.add(code);
|
||||
} else {
|
||||
var source = aRelativePath
|
||||
? util.join(aRelativePath, mapping.source)
|
||||
: mapping.source;
|
||||
node.add(new SourceNode(mapping.originalLine,
|
||||
mapping.originalColumn,
|
||||
source,
|
||||
code,
|
||||
mapping.name));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a chunk of generated JS to this source node.
|
||||
*
|
||||
* @param aChunk A string snippet of generated JS code, another instance of
|
||||
* SourceNode, or an array where each member is one of those things.
|
||||
*/
|
||||
SourceNode.prototype.add = function SourceNode_add(aChunk) {
|
||||
if (Array.isArray(aChunk)) {
|
||||
aChunk.forEach(function (chunk) {
|
||||
this.add(chunk);
|
||||
}, this);
|
||||
}
|
||||
else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
||||
if (aChunk) {
|
||||
this.children.push(aChunk);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new TypeError(
|
||||
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
||||
);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a chunk of generated JS to the beginning of this source node.
|
||||
*
|
||||
* @param aChunk A string snippet of generated JS code, another instance of
|
||||
* SourceNode, or an array where each member is one of those things.
|
||||
*/
|
||||
SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
|
||||
if (Array.isArray(aChunk)) {
|
||||
for (var i = aChunk.length-1; i >= 0; i--) {
|
||||
this.prepend(aChunk[i]);
|
||||
}
|
||||
}
|
||||
else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
||||
this.children.unshift(aChunk);
|
||||
}
|
||||
else {
|
||||
throw new TypeError(
|
||||
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
||||
);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Walk over the tree of JS snippets in this node and its children. The
|
||||
* walking function is called once for each snippet of JS and is passed that
|
||||
* snippet and the its original associated source's line/column location.
|
||||
*
|
||||
* @param aFn The traversal function.
|
||||
*/
|
||||
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
|
||||
var chunk;
|
||||
for (var i = 0, len = this.children.length; i < len; i++) {
|
||||
chunk = this.children[i];
|
||||
if (chunk[isSourceNode]) {
|
||||
chunk.walk(aFn);
|
||||
}
|
||||
else {
|
||||
if (chunk !== '') {
|
||||
aFn(chunk, { source: this.source,
|
||||
line: this.line,
|
||||
column: this.column,
|
||||
name: this.name });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
|
||||
* each of `this.children`.
|
||||
*
|
||||
* @param aSep The separator.
|
||||
*/
|
||||
SourceNode.prototype.join = function SourceNode_join(aSep) {
|
||||
var newChildren;
|
||||
var i;
|
||||
var len = this.children.length;
|
||||
if (len > 0) {
|
||||
newChildren = [];
|
||||
for (i = 0; i < len-1; i++) {
|
||||
newChildren.push(this.children[i]);
|
||||
newChildren.push(aSep);
|
||||
}
|
||||
newChildren.push(this.children[i]);
|
||||
this.children = newChildren;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Call String.prototype.replace on the very right-most source snippet. Useful
|
||||
* for trimming whitespace from the end of a source node, etc.
|
||||
*
|
||||
* @param aPattern The pattern to replace.
|
||||
* @param aReplacement The thing to replace the pattern with.
|
||||
*/
|
||||
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
|
||||
var lastChild = this.children[this.children.length - 1];
|
||||
if (lastChild[isSourceNode]) {
|
||||
lastChild.replaceRight(aPattern, aReplacement);
|
||||
}
|
||||
else if (typeof lastChild === 'string') {
|
||||
this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
|
||||
}
|
||||
else {
|
||||
this.children.push(''.replace(aPattern, aReplacement));
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the source content for a source file. This will be added to the SourceMapGenerator
|
||||
* in the sourcesContent field.
|
||||
*
|
||||
* @param aSourceFile The filename of the source file
|
||||
* @param aSourceContent The content of the source file
|
||||
*/
|
||||
SourceNode.prototype.setSourceContent =
|
||||
function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
|
||||
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
|
||||
};
|
||||
|
||||
/**
|
||||
* Walk over the tree of SourceNodes. The walking function is called for each
|
||||
* source file content and is passed the filename and source content.
|
||||
*
|
||||
* @param aFn The traversal function.
|
||||
*/
|
||||
SourceNode.prototype.walkSourceContents =
|
||||
function SourceNode_walkSourceContents(aFn) {
|
||||
for (var i = 0, len = this.children.length; i < len; i++) {
|
||||
if (this.children[i][isSourceNode]) {
|
||||
this.children[i].walkSourceContents(aFn);
|
||||
}
|
||||
}
|
||||
|
||||
var sources = Object.keys(this.sourceContents);
|
||||
for (var i = 0, len = sources.length; i < len; i++) {
|
||||
aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the string representation of this source node. Walks over the tree
|
||||
* and concatenates all the various snippets together to one string.
|
||||
*/
|
||||
SourceNode.prototype.toString = function SourceNode_toString() {
|
||||
var str = "";
|
||||
this.walk(function (chunk) {
|
||||
str += chunk;
|
||||
});
|
||||
return str;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the string representation of this source node along with a source
|
||||
* map.
|
||||
*/
|
||||
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
|
||||
var generated = {
|
||||
code: "",
|
||||
line: 1,
|
||||
column: 0
|
||||
};
|
||||
var map = new SourceMapGenerator(aArgs);
|
||||
var sourceMappingActive = false;
|
||||
var lastOriginalSource = null;
|
||||
var lastOriginalLine = null;
|
||||
var lastOriginalColumn = null;
|
||||
var lastOriginalName = null;
|
||||
this.walk(function (chunk, original) {
|
||||
generated.code += chunk;
|
||||
if (original.source !== null
|
||||
&& original.line !== null
|
||||
&& original.column !== null) {
|
||||
if(lastOriginalSource !== original.source
|
||||
|| lastOriginalLine !== original.line
|
||||
|| lastOriginalColumn !== original.column
|
||||
|| lastOriginalName !== original.name) {
|
||||
map.addMapping({
|
||||
source: original.source,
|
||||
original: {
|
||||
line: original.line,
|
||||
column: original.column
|
||||
},
|
||||
generated: {
|
||||
line: generated.line,
|
||||
column: generated.column
|
||||
},
|
||||
name: original.name
|
||||
});
|
||||
}
|
||||
lastOriginalSource = original.source;
|
||||
lastOriginalLine = original.line;
|
||||
lastOriginalColumn = original.column;
|
||||
lastOriginalName = original.name;
|
||||
sourceMappingActive = true;
|
||||
} else if (sourceMappingActive) {
|
||||
map.addMapping({
|
||||
generated: {
|
||||
line: generated.line,
|
||||
column: generated.column
|
||||
}
|
||||
});
|
||||
lastOriginalSource = null;
|
||||
sourceMappingActive = false;
|
||||
}
|
||||
for (var idx = 0, length = chunk.length; idx < length; idx++) {
|
||||
if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
|
||||
generated.line++;
|
||||
generated.column = 0;
|
||||
// Mappings end at eol
|
||||
if (idx + 1 === length) {
|
||||
lastOriginalSource = null;
|
||||
sourceMappingActive = false;
|
||||
} else if (sourceMappingActive) {
|
||||
map.addMapping({
|
||||
source: original.source,
|
||||
original: {
|
||||
line: original.line,
|
||||
column: original.column
|
||||
},
|
||||
generated: {
|
||||
line: generated.line,
|
||||
column: generated.column
|
||||
},
|
||||
name: original.name
|
||||
});
|
||||
}
|
||||
} else {
|
||||
generated.column++;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.walkSourceContents(function (sourceFile, sourceContent) {
|
||||
map.setSourceContent(sourceFile, sourceContent);
|
||||
});
|
||||
|
||||
return { code: generated.code, map: map };
|
||||
};
|
||||
|
||||
exports.SourceNode = SourceNode;
|
||||
417
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/util.js
generated
vendored
Normal file
417
build/node_modules/postcss-discard-comments/node_modules/source-map/lib/util.js
generated
vendored
Normal file
@@ -0,0 +1,417 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is a helper function for getting values from parameter/options
|
||||
* objects.
|
||||
*
|
||||
* @param args The object we are extracting values from
|
||||
* @param name The name of the property we are getting.
|
||||
* @param defaultValue An optional value to return if the property is missing
|
||||
* from the object. If this is not specified and the property is missing, an
|
||||
* error will be thrown.
|
||||
*/
|
||||
function getArg(aArgs, aName, aDefaultValue) {
|
||||
if (aName in aArgs) {
|
||||
return aArgs[aName];
|
||||
} else if (arguments.length === 3) {
|
||||
return aDefaultValue;
|
||||
} else {
|
||||
throw new Error('"' + aName + '" is a required argument.');
|
||||
}
|
||||
}
|
||||
exports.getArg = getArg;
|
||||
|
||||
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
|
||||
var dataUrlRegexp = /^data:.+\,.+$/;
|
||||
|
||||
function urlParse(aUrl) {
|
||||
var match = aUrl.match(urlRegexp);
|
||||
if (!match) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
scheme: match[1],
|
||||
auth: match[2],
|
||||
host: match[3],
|
||||
port: match[4],
|
||||
path: match[5]
|
||||
};
|
||||
}
|
||||
exports.urlParse = urlParse;
|
||||
|
||||
function urlGenerate(aParsedUrl) {
|
||||
var url = '';
|
||||
if (aParsedUrl.scheme) {
|
||||
url += aParsedUrl.scheme + ':';
|
||||
}
|
||||
url += '//';
|
||||
if (aParsedUrl.auth) {
|
||||
url += aParsedUrl.auth + '@';
|
||||
}
|
||||
if (aParsedUrl.host) {
|
||||
url += aParsedUrl.host;
|
||||
}
|
||||
if (aParsedUrl.port) {
|
||||
url += ":" + aParsedUrl.port
|
||||
}
|
||||
if (aParsedUrl.path) {
|
||||
url += aParsedUrl.path;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
exports.urlGenerate = urlGenerate;
|
||||
|
||||
/**
|
||||
* Normalizes a path, or the path portion of a URL:
|
||||
*
|
||||
* - Replaces consecutive slashes with one slash.
|
||||
* - Removes unnecessary '.' parts.
|
||||
* - Removes unnecessary '<dir>/..' parts.
|
||||
*
|
||||
* Based on code in the Node.js 'path' core module.
|
||||
*
|
||||
* @param aPath The path or url to normalize.
|
||||
*/
|
||||
function normalize(aPath) {
|
||||
var path = aPath;
|
||||
var url = urlParse(aPath);
|
||||
if (url) {
|
||||
if (!url.path) {
|
||||
return aPath;
|
||||
}
|
||||
path = url.path;
|
||||
}
|
||||
var isAbsolute = exports.isAbsolute(path);
|
||||
|
||||
var parts = path.split(/\/+/);
|
||||
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
||||
part = parts[i];
|
||||
if (part === '.') {
|
||||
parts.splice(i, 1);
|
||||
} else if (part === '..') {
|
||||
up++;
|
||||
} else if (up > 0) {
|
||||
if (part === '') {
|
||||
// The first part is blank if the path is absolute. Trying to go
|
||||
// above the root is a no-op. Therefore we can remove all '..' parts
|
||||
// directly after the root.
|
||||
parts.splice(i + 1, up);
|
||||
up = 0;
|
||||
} else {
|
||||
parts.splice(i, 2);
|
||||
up--;
|
||||
}
|
||||
}
|
||||
}
|
||||
path = parts.join('/');
|
||||
|
||||
if (path === '') {
|
||||
path = isAbsolute ? '/' : '.';
|
||||
}
|
||||
|
||||
if (url) {
|
||||
url.path = path;
|
||||
return urlGenerate(url);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
exports.normalize = normalize;
|
||||
|
||||
/**
|
||||
* Joins two paths/URLs.
|
||||
*
|
||||
* @param aRoot The root path or URL.
|
||||
* @param aPath The path or URL to be joined with the root.
|
||||
*
|
||||
* - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
|
||||
* scheme-relative URL: Then the scheme of aRoot, if any, is prepended
|
||||
* first.
|
||||
* - Otherwise aPath is a path. If aRoot is a URL, then its path portion
|
||||
* is updated with the result and aRoot is returned. Otherwise the result
|
||||
* is returned.
|
||||
* - If aPath is absolute, the result is aPath.
|
||||
* - Otherwise the two paths are joined with a slash.
|
||||
* - Joining for example 'http://' and 'www.example.com' is also supported.
|
||||
*/
|
||||
function join(aRoot, aPath) {
|
||||
if (aRoot === "") {
|
||||
aRoot = ".";
|
||||
}
|
||||
if (aPath === "") {
|
||||
aPath = ".";
|
||||
}
|
||||
var aPathUrl = urlParse(aPath);
|
||||
var aRootUrl = urlParse(aRoot);
|
||||
if (aRootUrl) {
|
||||
aRoot = aRootUrl.path || '/';
|
||||
}
|
||||
|
||||
// `join(foo, '//www.example.org')`
|
||||
if (aPathUrl && !aPathUrl.scheme) {
|
||||
if (aRootUrl) {
|
||||
aPathUrl.scheme = aRootUrl.scheme;
|
||||
}
|
||||
return urlGenerate(aPathUrl);
|
||||
}
|
||||
|
||||
if (aPathUrl || aPath.match(dataUrlRegexp)) {
|
||||
return aPath;
|
||||
}
|
||||
|
||||
// `join('http://', 'www.example.com')`
|
||||
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
|
||||
aRootUrl.host = aPath;
|
||||
return urlGenerate(aRootUrl);
|
||||
}
|
||||
|
||||
var joined = aPath.charAt(0) === '/'
|
||||
? aPath
|
||||
: normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
|
||||
|
||||
if (aRootUrl) {
|
||||
aRootUrl.path = joined;
|
||||
return urlGenerate(aRootUrl);
|
||||
}
|
||||
return joined;
|
||||
}
|
||||
exports.join = join;
|
||||
|
||||
exports.isAbsolute = function (aPath) {
|
||||
return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
|
||||
};
|
||||
|
||||
/**
|
||||
* Make a path relative to a URL or another path.
|
||||
*
|
||||
* @param aRoot The root path or URL.
|
||||
* @param aPath The path or URL to be made relative to aRoot.
|
||||
*/
|
||||
function relative(aRoot, aPath) {
|
||||
if (aRoot === "") {
|
||||
aRoot = ".";
|
||||
}
|
||||
|
||||
aRoot = aRoot.replace(/\/$/, '');
|
||||
|
||||
// It is possible for the path to be above the root. In this case, simply
|
||||
// checking whether the root is a prefix of the path won't work. Instead, we
|
||||
// need to remove components from the root one by one, until either we find
|
||||
// a prefix that fits, or we run out of components to remove.
|
||||
var level = 0;
|
||||
while (aPath.indexOf(aRoot + '/') !== 0) {
|
||||
var index = aRoot.lastIndexOf("/");
|
||||
if (index < 0) {
|
||||
return aPath;
|
||||
}
|
||||
|
||||
// If the only part of the root that is left is the scheme (i.e. http://,
|
||||
// file:///, etc.), one or more slashes (/), or simply nothing at all, we
|
||||
// have exhausted all components, so the path is not relative to the root.
|
||||
aRoot = aRoot.slice(0, index);
|
||||
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
|
||||
return aPath;
|
||||
}
|
||||
|
||||
++level;
|
||||
}
|
||||
|
||||
// Make sure we add a "../" for each component we removed from the root.
|
||||
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
||||
}
|
||||
exports.relative = relative;
|
||||
|
||||
var supportsNullProto = (function () {
|
||||
var obj = Object.create(null);
|
||||
return !('__proto__' in obj);
|
||||
}());
|
||||
|
||||
function identity (s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Because behavior goes wacky when you set `__proto__` on objects, we
|
||||
* have to prefix all the strings in our set with an arbitrary character.
|
||||
*
|
||||
* See https://github.com/mozilla/source-map/pull/31 and
|
||||
* https://github.com/mozilla/source-map/issues/30
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
function toSetString(aStr) {
|
||||
if (isProtoString(aStr)) {
|
||||
return '$' + aStr;
|
||||
}
|
||||
|
||||
return aStr;
|
||||
}
|
||||
exports.toSetString = supportsNullProto ? identity : toSetString;
|
||||
|
||||
function fromSetString(aStr) {
|
||||
if (isProtoString(aStr)) {
|
||||
return aStr.slice(1);
|
||||
}
|
||||
|
||||
return aStr;
|
||||
}
|
||||
exports.fromSetString = supportsNullProto ? identity : fromSetString;
|
||||
|
||||
function isProtoString(s) {
|
||||
if (!s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var length = s.length;
|
||||
|
||||
if (length < 9 /* "__proto__".length */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
|
||||
s.charCodeAt(length - 2) !== 95 /* '_' */ ||
|
||||
s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
|
||||
s.charCodeAt(length - 4) !== 116 /* 't' */ ||
|
||||
s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
|
||||
s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
|
||||
s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
|
||||
s.charCodeAt(length - 8) !== 95 /* '_' */ ||
|
||||
s.charCodeAt(length - 9) !== 95 /* '_' */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = length - 10; i >= 0; i--) {
|
||||
if (s.charCodeAt(i) !== 36 /* '$' */) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Comparator between two mappings where the original positions are compared.
|
||||
*
|
||||
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
|
||||
* mappings with the same original source/line/column, but different generated
|
||||
* line and column the same. Useful when searching for a mapping with a
|
||||
* stubbed out mapping.
|
||||
*/
|
||||
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
|
||||
var cmp = mappingA.source - mappingB.source;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0 || onlyCompareOriginal) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return mappingA.name - mappingB.name;
|
||||
}
|
||||
exports.compareByOriginalPositions = compareByOriginalPositions;
|
||||
|
||||
/**
|
||||
* Comparator between two mappings with deflated source and name indices where
|
||||
* the generated positions are compared.
|
||||
*
|
||||
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
|
||||
* mappings with the same generated line and column, but different
|
||||
* source/name/original line and column the same. Useful when searching for a
|
||||
* mapping with a stubbed out mapping.
|
||||
*/
|
||||
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
|
||||
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0 || onlyCompareGenerated) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.source - mappingB.source;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return mappingA.name - mappingB.name;
|
||||
}
|
||||
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
|
||||
|
||||
function strcmp(aStr1, aStr2) {
|
||||
if (aStr1 === aStr2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (aStr1 > aStr2) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Comparator between two mappings with inflated source and name strings where
|
||||
* the generated positions are compared.
|
||||
*/
|
||||
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
|
||||
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = strcmp(mappingA.source, mappingB.source);
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return strcmp(mappingA.name, mappingB.name);
|
||||
}
|
||||
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
|
||||
214
build/node_modules/postcss-discard-comments/node_modules/source-map/package.json
generated
vendored
Normal file
214
build/node_modules/postcss-discard-comments/node_modules/source-map/package.json
generated
vendored
Normal file
@@ -0,0 +1,214 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"source-map@0.5.7",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "source-map@0.5.7",
|
||||
"_id": "source-map@0.5.7",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
|
||||
"_location": "/postcss-discard-comments/source-map",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "source-map@0.5.7",
|
||||
"name": "source-map",
|
||||
"escapedName": "source-map",
|
||||
"rawSpec": "0.5.7",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.5.7"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/postcss-discard-comments/postcss"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
|
||||
"_spec": "0.5.7",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Nick Fitzgerald",
|
||||
"email": "nfitzgerald@mozilla.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/mozilla/source-map/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Tobias Koppers",
|
||||
"email": "tobias.koppers@googlemail.com"
|
||||
},
|
||||
{
|
||||
"name": "Duncan Beevers",
|
||||
"email": "duncan@dweebd.com"
|
||||
},
|
||||
{
|
||||
"name": "Stephen Crane",
|
||||
"email": "scrane@mozilla.com"
|
||||
},
|
||||
{
|
||||
"name": "Ryan Seddon",
|
||||
"email": "seddon.ryan@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Miles Elam",
|
||||
"email": "miles.elam@deem.com"
|
||||
},
|
||||
{
|
||||
"name": "Mihai Bazon",
|
||||
"email": "mihai.bazon@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Michael Ficarra",
|
||||
"email": "github.public.email@michael.ficarra.me"
|
||||
},
|
||||
{
|
||||
"name": "Todd Wolfson",
|
||||
"email": "todd@twolfson.com"
|
||||
},
|
||||
{
|
||||
"name": "Alexander Solovyov",
|
||||
"email": "alexander@solovyov.net"
|
||||
},
|
||||
{
|
||||
"name": "Felix Gnass",
|
||||
"email": "fgnass@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Conrad Irwin",
|
||||
"email": "conrad.irwin@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "usrbincc",
|
||||
"email": "usrbincc@yahoo.com"
|
||||
},
|
||||
{
|
||||
"name": "David Glasser",
|
||||
"email": "glasser@davidglasser.net"
|
||||
},
|
||||
{
|
||||
"name": "Chase Douglas",
|
||||
"email": "chase@newrelic.com"
|
||||
},
|
||||
{
|
||||
"name": "Evan Wallace",
|
||||
"email": "evan.exe@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Heather Arthur",
|
||||
"email": "fayearthur@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Hugh Kennedy",
|
||||
"email": "hughskennedy@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "David Glasser",
|
||||
"email": "glasser@davidglasser.net"
|
||||
},
|
||||
{
|
||||
"name": "Simon Lydell",
|
||||
"email": "simon.lydell@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jmeas Smith",
|
||||
"email": "jellyes2@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Michael Z Goddard",
|
||||
"email": "mzgoddard@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "azu",
|
||||
"email": "azu@users.noreply.github.com"
|
||||
},
|
||||
{
|
||||
"name": "John Gozde",
|
||||
"email": "john@gozde.ca"
|
||||
},
|
||||
{
|
||||
"name": "Adam Kirkton",
|
||||
"email": "akirkton@truefitinnovation.com"
|
||||
},
|
||||
{
|
||||
"name": "Chris Montgomery",
|
||||
"email": "christopher.montgomery@dowjones.com"
|
||||
},
|
||||
{
|
||||
"name": "J. Ryan Stinnett",
|
||||
"email": "jryans@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jack Herrington",
|
||||
"email": "jherrington@walmartlabs.com"
|
||||
},
|
||||
{
|
||||
"name": "Chris Truter",
|
||||
"email": "jeffpalentine@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Daniel Espeset",
|
||||
"email": "daniel@danielespeset.com"
|
||||
},
|
||||
{
|
||||
"name": "Jamie Wong",
|
||||
"email": "jamie.lf.wong@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Eddy Bruël",
|
||||
"email": "ejpbruel@mozilla.com"
|
||||
},
|
||||
{
|
||||
"name": "Hawken Rives",
|
||||
"email": "hawkrives@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Gilad Peleg",
|
||||
"email": "giladp007@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "djchie",
|
||||
"email": "djchie.dev@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Gary Ye",
|
||||
"email": "garysye@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Nicolas Lalevée",
|
||||
"email": "nicolas.lalevee@hibnet.org"
|
||||
}
|
||||
],
|
||||
"description": "Generates and consumes source maps",
|
||||
"devDependencies": {
|
||||
"doctoc": "^0.15.0",
|
||||
"webpack": "^1.12.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"source-map.js",
|
||||
"lib/",
|
||||
"dist/source-map.debug.js",
|
||||
"dist/source-map.js",
|
||||
"dist/source-map.min.js",
|
||||
"dist/source-map.min.js.map"
|
||||
],
|
||||
"homepage": "https://github.com/mozilla/source-map",
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "./source-map.js",
|
||||
"name": "source-map",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/mozilla/source-map.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack --color",
|
||||
"test": "npm run build && node test/run-tests.js",
|
||||
"toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md"
|
||||
},
|
||||
"typings": "source-map",
|
||||
"version": "0.5.7"
|
||||
}
|
||||
8
build/node_modules/postcss-discard-comments/node_modules/source-map/source-map.js
generated
vendored
Normal file
8
build/node_modules/postcss-discard-comments/node_modules/source-map/source-map.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Copyright 2009-2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE.txt or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;
|
||||
exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;
|
||||
exports.SourceNode = require('./lib/source-node').SourceNode;
|
||||
2
build/node_modules/postcss-discard-comments/node_modules/supports-color/browser.js
generated
vendored
Normal file
2
build/node_modules/postcss-discard-comments/node_modules/supports-color/browser.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
'use strict';
|
||||
module.exports = false;
|
||||
84
build/node_modules/postcss-discard-comments/node_modules/supports-color/index.js
generated
vendored
Normal file
84
build/node_modules/postcss-discard-comments/node_modules/supports-color/index.js
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
'use strict';
|
||||
var hasFlag = require('has-flag');
|
||||
|
||||
var support = function (level) {
|
||||
if (level === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return {
|
||||
level: level,
|
||||
hasBasic: true,
|
||||
has256: level >= 2,
|
||||
has16m: level >= 3
|
||||
};
|
||||
};
|
||||
|
||||
var supportLevel = (function () {
|
||||
if (hasFlag('no-color') ||
|
||||
hasFlag('no-colors') ||
|
||||
hasFlag('color=false')) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (hasFlag('color=16m') ||
|
||||
hasFlag('color=full') ||
|
||||
hasFlag('color=truecolor')) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
if (hasFlag('color=256')) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (hasFlag('color') ||
|
||||
hasFlag('colors') ||
|
||||
hasFlag('color=true') ||
|
||||
hasFlag('color=always')) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (process.stdout && !process.stdout.isTTY) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ('CI' in process.env) {
|
||||
if ('TRAVIS' in process.env || process.env.CI === 'Travis') {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ('TEAMCITY_VERSION' in process.env) {
|
||||
return process.env.TEAMCITY_VERSION.match(/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/) === null ? 0 : 1;
|
||||
}
|
||||
|
||||
if (/^(screen|xterm)-256(?:color)?/.test(process.env.TERM)) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ('COLORTERM' in process.env) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (process.env.TERM === 'dumb') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
})();
|
||||
|
||||
if (supportLevel === 0 && 'FORCE_COLOR' in process.env) {
|
||||
supportLevel = 1;
|
||||
}
|
||||
|
||||
module.exports = process && support(supportLevel);
|
||||
21
build/node_modules/postcss-discard-comments/node_modules/supports-color/license
generated
vendored
Normal file
21
build/node_modules/postcss-discard-comments/node_modules/supports-color/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
113
build/node_modules/postcss-discard-comments/node_modules/supports-color/package.json
generated
vendored
Normal file
113
build/node_modules/postcss-discard-comments/node_modules/supports-color/package.json
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"supports-color@3.2.3",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "supports-color@3.2.3",
|
||||
"_id": "supports-color@3.2.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=",
|
||||
"_location": "/postcss-discard-comments/supports-color",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "supports-color@3.2.3",
|
||||
"name": "supports-color",
|
||||
"escapedName": "supports-color",
|
||||
"rawSpec": "3.2.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.2.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/postcss-discard-comments/postcss"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz",
|
||||
"_spec": "3.2.3",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"browser": "browser.js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/chalk/supports-color/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"has-flag": "^1.0.0"
|
||||
},
|
||||
"description": "Detect whether a terminal supports color",
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"require-uncached": "^1.0.2",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"browser.js"
|
||||
],
|
||||
"homepage": "https://github.com/chalk/supports-color#readme",
|
||||
"keywords": [
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"ansi",
|
||||
"styles",
|
||||
"tty",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"command-line",
|
||||
"support",
|
||||
"supports",
|
||||
"capability",
|
||||
"detect",
|
||||
"truecolor",
|
||||
"16m",
|
||||
"million"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
{
|
||||
"name": "Joshua Boy Nicolai Appelman",
|
||||
"email": "joshua@jbna.nl",
|
||||
"url": "jbna.nl"
|
||||
},
|
||||
{
|
||||
"name": "JD Ballard",
|
||||
"email": "i.am.qix@gmail.com",
|
||||
"url": "github.com/qix-"
|
||||
}
|
||||
],
|
||||
"name": "supports-color",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/chalk/supports-color.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && mocha",
|
||||
"travis": "mocha"
|
||||
},
|
||||
"version": "3.2.3",
|
||||
"xo": {
|
||||
"envs": [
|
||||
"node",
|
||||
"mocha"
|
||||
]
|
||||
}
|
||||
}
|
||||
60
build/node_modules/postcss-discard-comments/node_modules/supports-color/readme.md
generated
vendored
Normal file
60
build/node_modules/postcss-discard-comments/node_modules/supports-color/readme.md
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
# supports-color [](https://travis-ci.org/chalk/supports-color)
|
||||
|
||||
> Detect whether a terminal supports color
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save supports-color
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var supportsColor = require('supports-color');
|
||||
|
||||
if (supportsColor) {
|
||||
console.log('Terminal supports color');
|
||||
}
|
||||
|
||||
if (supportsColor.has256) {
|
||||
console.log('Terminal supports 256 colors');
|
||||
}
|
||||
|
||||
if (supportsColor.has16m) {
|
||||
console.log('Terminal supports 16 million colors (truecolor)');
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
Returns an `object`, or `false` if color is not supported.
|
||||
|
||||
The returned object specifies a level of support for color through a `.level` property and a corresponding flag:
|
||||
|
||||
- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)
|
||||
- `.level = 2` and `.has256 = true`: 256 color support
|
||||
- `.level = 3` and `.has16m = true`: 16 million (truecolor) support
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
It obeys the `--color` and `--no-color` CLI flags.
|
||||
|
||||
For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
|
||||
|
||||
Explicit 256/truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
|
||||
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
91
build/node_modules/postcss-discard-comments/package.json
generated
vendored
Normal file
91
build/node_modules/postcss-discard-comments/package.json
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"postcss-discard-comments@2.0.4",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "postcss-discard-comments@2.0.4",
|
||||
"_id": "postcss-discard-comments@2.0.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-vv6J+v1bPazlzM5Rt2uBUUvgDj0=",
|
||||
"_location": "/postcss-discard-comments",
|
||||
"_phantomChildren": {
|
||||
"escape-string-regexp": "1.0.5",
|
||||
"has-ansi": "2.0.0",
|
||||
"js-base64": "2.4.0",
|
||||
"strip-ansi": "3.0.1"
|
||||
},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "postcss-discard-comments@2.0.4",
|
||||
"name": "postcss-discard-comments",
|
||||
"escapedName": "postcss-discard-comments",
|
||||
"rawSpec": "2.0.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cssnano"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz",
|
||||
"_spec": "2.0.4",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Ben Briggs",
|
||||
"email": "beneb.info@gmail.com",
|
||||
"url": "http://beneb.info"
|
||||
},
|
||||
"ava": {
|
||||
"require": "babel-core/register"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ben-eb/postcss-discard-comments/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"postcss": "^5.0.14"
|
||||
},
|
||||
"description": "Discard comments in your CSS files with PostCSS.",
|
||||
"devDependencies": {
|
||||
"ava": "^0.11.0",
|
||||
"babel-cli": "^6.5.1",
|
||||
"babel-core": "^6.5.1",
|
||||
"babel-plugin-add-module-exports": "^0.1.2",
|
||||
"babel-preset-es2015": "^6.5.0",
|
||||
"babel-preset-es2015-loose": "^7.0.0",
|
||||
"babel-preset-stage-0": "^6.5.0",
|
||||
"del-cli": "^0.2.0",
|
||||
"eslint": "^1.10.3",
|
||||
"eslint-config-cssnano": "^1.0.0",
|
||||
"postcss-scss": "^0.1.3",
|
||||
"postcss-simple-vars": "^1.2.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "cssnano"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"LICENSE-MIT"
|
||||
],
|
||||
"homepage": "https://github.com/ben-eb/postcss-discard-comments",
|
||||
"keywords": [
|
||||
"css",
|
||||
"comments",
|
||||
"postcss",
|
||||
"postcss-plugin"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"name": "postcss-discard-comments",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ben-eb/postcss-discard-comments.git"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "del-cli dist && BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/",
|
||||
"pretest": "eslint src",
|
||||
"test": "ava src/__tests__"
|
||||
},
|
||||
"version": "2.0.4"
|
||||
}
|
||||
Reference in New Issue
Block a user