Completely updated React, fixed #11, (hopefully)

This commit is contained in:
2018-03-04 19:11:49 -05:00
parent 6e0afd6e2a
commit 34e5f5139a
13674 changed files with 333464 additions and 473223 deletions

View File

@@ -1,6 +1,23 @@
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).
## 6.0.19
* Fix TypeScript definitions for source maps (by Oleh Kuchuk).
* Fix `source` field in TypeScript definitions (by Sylvain Pollet-Villard).
## 6.0.18
* Use primitive object in TypeScript definitions (by Sylvain Pollet-Villard).
## 6.0.17
* Fix parsing comment in selector between word tokens (by Oleh Kuchuk).
## 6.0.16
* Fix warning text (by Michael Keller).
## 6.0.15
* Add warning about missed `from` option on `process().then()` call.
* Add IE 10 support.
## 6.0.14
* Fix TypeScript definitions (by Jed Mao).

View File

@@ -104,7 +104,7 @@ next = string.indexOf('"', currentPosition + 1);
// Jump by RegExp
regexp.lastIndex = currentPosion + 1;
regexp.text(string);
regexp.test(string);
next = regexp.lastIndex;
```

View File

@@ -0,0 +1,97 @@
'use strict';
const gulp = require('gulp');
gulp.task('clean', () => {
let del = require('del');
return del(['lib/*.js', 'postcss.js', 'build/', 'api/']);
});
// Build
gulp.task('compile', () => {
let sourcemaps = require('gulp-sourcemaps');
let changed = require('gulp-changed');
let babel = require('gulp-babel');
return gulp.src('lib/*.es6')
.pipe(changed('lib', { extension: '.js' }))
.pipe(sourcemaps.init())
.pipe(babel({
presets: [
[
'env',
{
targets: {
browsers: 'last 2 version',
node: 4
},
loose: true
}
]
],
plugins: ['add-module-exports', 'precompile-charcodes']
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest('lib'));
});
gulp.task('build:lib', ['compile'], () => {
return gulp.src(['lib/*.js', 'lib/*.d.ts']).pipe(gulp.dest('build/lib'));
});
gulp.task('build:package', () => {
const editor = require('gulp-json-editor');
return gulp.src('./package.json')
.pipe(editor((json) => {
delete json.babel;
delete json.scripts;
delete json.jest;
delete json.eslintConfig;
delete json['size-limit'];
delete json['pre-commit'];
delete json['lint-staged'];
delete json.devDependencies;
return json;
}))
.pipe(gulp.dest('build'));
});
gulp.task('build:docs', () => {
let ignore = require('fs').readFileSync('.npmignore').toString()
.trim().split(/\n+/)
.concat([
'package.json', '.npmignore', 'lib/*', 'test/*',
'node_modules/**/*', 'docs/api.md', 'docs/plugins.md',
'docs/writing-a-plugin.md'
]).map( i => '!' + i );
return gulp.src(['**/*'].concat(ignore))
.pipe(gulp.dest('build'));
});
gulp.task('build', done => {
let runSequence = require('run-sequence');
runSequence('clean', ['build:lib', 'build:docs', 'build:package'], done);
});
// Tests
gulp.task('integration', ['build'], done => {
let postcss = require('./build');
let real = require('postcss-parser-tests/real');
real(done, css => {
return postcss.parse(css).toResult({ map: { annotation: false } });
});
});
gulp.task('version', ['build:lib'], () => {
let Processor = require('./lib/processor');
let instance = new Processor();
let pkg = require('./package');
if ( pkg.version !== instance.version ) {
throw new Error('Version in Processor is not equal to package.json');
}
});
// Common
gulp.task('default', ['version', 'integration']);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,5 @@
import * as mozilla from 'source-map';
/**
* @param plugins Can also be included with the Processor#use method.
* @returns A processor that will apply plugins as CSS processors.
@@ -139,7 +141,7 @@ declare namespace postcss {
* @param defaults Properties for the new Root node.
* @returns The new node.
*/
function root(defaults?: Object): Root;
function root(defaults?: object): Root;
interface SourceMapOptions {
/**
* Indicates that the source map should be embedded in the output CSS as a
@@ -399,21 +401,7 @@ declare namespace postcss {
* @param mapping
* @returns {}
*/
addMapping(mapping: {
generated: {
line: number;
column: number;
};
original: {
line: number;
column: number;
};
/**
* The original source file (relative to the sourceRoot).
*/
source: string;
name?: string;
}): void;
addMapping(mapping: mozilla.Mapping): void;
/**
* Set the source content for an original source file.
* @param sourceFile The URL of the original source file.
@@ -436,11 +424,15 @@ declare namespace postcss {
* If omitted, it is assumed that both SourceMaps are in the same directory;
* thus, not needing any rewriting (Supplying '.' has the same effect).
*/
applySourceMap(sourceMapConsumer: any, sourceFile?: string, sourceMapPath?: string): void;
applySourceMap(
sourceMapConsumer: mozilla.SourceMapConsumer,
sourceFile?: string,
sourceMapPath?: string
): void;
/**
* Renders the source map being generated to JSON.
*/
toJSON: () => any;
toJSON: () => mozilla.RawSourceMap;
/**
* Renders the source map being generated to a string.
*/
@@ -573,12 +565,15 @@ declare namespace postcss {
text: string;
file: string;
constructor(css: any, opts: any);
consumer(): any;
consumer(): mozilla.SourceMapConsumer;
withContent(): boolean;
startWith(string: any, start: any): boolean;
loadAnnotation(css: any): void;
decodeInline(text: any): any;
loadMap(file: any, prev: any): any;
startWith(string: string, start: string): boolean;
loadAnnotation(css: string): void;
decodeInline(text: string): string;
loadMap(
file: any,
prev: string | Function | mozilla.SourceMapConsumer | mozilla.SourceMapGenerator | mozilla.RawSourceMap
): string;
isMap(map: any): boolean;
}
/**
@@ -667,26 +662,26 @@ declare namespace postcss {
prev(): ChildNode | void;
/**
* Insert new node before current node to current nodes parent.
*
*
* Just an alias for `node.parent.insertBefore(node, newNode)`.
*
*
* @returns this node for method chaining.
*
*
* @example
* decl.before('content: ""');
*/
before(newNode: Node | object | string | Node[]): this;
before(newNode: Node | object | string | Node[]): this;
/**
* Insert new node after current node to current nodes parent.
*
*
* Just an alias for `node.parent.insertAfter(node, newNode)`.
*
*
* @returns this node for method chaining.
*
*
* @example
* decl.after('color: black');
*/
after(newNode: Node | object | string | Node[]): this;
after(newNode: Node | object | string | Node[]): this;
/**
* @returns The Root instance of the node's tree.
*/
@@ -701,27 +696,27 @@ declare namespace postcss {
* Inserts node(s) before the current node and removes the current node.
* @returns This node for chaining.
*/
replaceWith(...nodes: (Node | Object)[]): this;
replaceWith(...nodes: (Node | object)[]): this;
/**
* @param overrides New properties to override in the clone.
* @returns A clone of this node. The node and its (cloned) children will
* have a clean parent and code style properties.
*/
clone(overrides?: Object): this;
clone(overrides?: object): this;
/**
* Shortcut to clone the node and insert the resulting cloned node before
* the current node.
* @param overrides New Properties to override in the clone.
* @returns The cloned node.
*/
cloneBefore(overrides?: Object): this;
cloneBefore(overrides?: object): this;
/**
* Shortcut to clone the node and insert the resulting cloned node after
* the current node.
* @param overrides New Properties to override in the clone.
* @returns The cloned node.
*/
cloneAfter(overrides?: Object): this;
cloneAfter(overrides?: object): this;
/**
* @param prop Name or code style property.
* @param defaultType Name of default value. It can be easily missed if the
@@ -734,6 +729,7 @@ declare namespace postcss {
raw(prop: string, defaultType?: string): any;
}
interface NodeNewProps {
source?: NodeSource;
raws?: NodeRaws;
}
interface NodeRaws {
@@ -855,7 +851,7 @@ declare namespace postcss {
* @returns A clone of this node. The node and its (cloned) children will
* have a clean parent and code style properties.
*/
clone(overrides?: Object): this;
clone(overrides?: object): this;
/**
* @param child Child of the current container.
* @returns The child's index within the container's "nodes" array.
@@ -990,7 +986,7 @@ declare namespace postcss {
* @param nodes New nodes.
* @returns This container for chaining.
*/
prepend(...nodes: (Node | Object | string)[]): this;
prepend(...nodes: (Node | object | string)[]): this;
/**
* Inserts new nodes to the end of the container.
* Because each node class is identifiable by unique properties, use the
@@ -1006,19 +1002,19 @@ declare namespace postcss {
* @param nodes New nodes.
* @returns This container for chaining.
*/
append(...nodes: (Node | Object | string)[]): this;
append(...nodes: (Node | object | string)[]): this;
/**
* Insert newNode before oldNode within the container.
* @param oldNode Child or child's index.
* @returns This container for chaining.
*/
insertBefore(oldNode: ChildNode | number, newNode: ChildNode | Object | string): this;
insertBefore(oldNode: ChildNode | number, newNode: ChildNode | object | string): this;
/**
* Insert newNode after oldNode within the container.
* @param oldNode Child or child's index.
* @returns This container for chaining.
*/
insertAfter(oldNode: ChildNode | number, newNode: ChildNode | Object | string): this;
insertAfter(oldNode: ChildNode | number, newNode: ChildNode | object | string): this;
/**
* Removes the container from its parent and cleans the parent property in the
* container and its children.
@@ -1077,7 +1073,7 @@ declare namespace postcss {
* @returns A clone of this node. The node and its (cloned) children will
* have a clean parent and code style properties.
*/
clone(overrides?: Object): this;
clone(overrides?: object): this;
/**
* @returns A Result instance representing the root's CSS.
*/
@@ -1125,7 +1121,7 @@ declare namespace postcss {
* @returns A clone of this node. The node and its (cloned) children will
* have a clean parent and code style properties.
*/
clone(overrides?: Object): this;
clone(overrides?: object): this;
}
interface AtRuleNewProps extends ContainerNewProps {
/**
@@ -1177,7 +1173,7 @@ declare namespace postcss {
* @returns A clone of this node. The node and its (cloned) children will
* have a clean parent and code style properties.
*/
clone(overrides?: Object): this;
clone(overrides?: object): this;
}
interface RuleNewProps extends ContainerNewProps {
/**
@@ -1240,7 +1236,7 @@ declare namespace postcss {
* @returns A clone of this node. The node and its (cloned) children will
* have a clean parent and code style properties.
*/
clone(overrides?: Object): this;
clone(overrides?: object): this;
}
interface DeclarationNewProps {
/**
@@ -1291,7 +1287,7 @@ declare namespace postcss {
* @returns A clone of this node. The node and its (cloned) children will
* have a clean parent and code style properties.
*/
clone(overrides?: Object): this;
clone(overrides?: object): this;
}
interface CommentNewProps {
/**

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
'use strict';
const escapeStringRegexp = require('escape-string-regexp');
const ansiStyles = require('ansi-styles');
const supportsColor = require('supports-color');
const stdoutColor = require('supports-color').stdout;
const template = require('./templates.js');
@@ -19,7 +19,7 @@ function applyOptions(obj, options) {
options = options || {};
// Detect level if not set manually
const scLevel = supportsColor ? supportsColor.level : 0;
const scLevel = stdoutColor ? stdoutColor.level : 0;
obj.level = options.level === undefined ? scLevel : options.level;
obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
}
@@ -224,5 +224,5 @@ function chalkTag(chalk, strings) {
Object.defineProperties(Chalk.prototype, styles);
module.exports = Chalk(); // eslint-disable-line new-cap
module.exports.supportsColor = supportsColor;
module.exports.supportsColor = stdoutColor;
module.exports.default = module.exports; // For TypeScript

View File

@@ -1,45 +1,45 @@
{
"_args": [
[
"chalk@2.3.0",
"chalk@2.3.2",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI"
]
],
"_from": "chalk@2.3.0",
"_id": "chalk@2.3.0",
"_from": "chalk@2.3.2",
"_id": "chalk@2.3.2",
"_inBundle": false,
"_integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==",
"_integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==",
"_location": "/react-scripts/postcss/chalk",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "chalk@2.3.0",
"raw": "chalk@2.3.2",
"name": "chalk",
"escapedName": "chalk",
"rawSpec": "2.3.0",
"rawSpec": "2.3.2",
"saveSpec": null,
"fetchSpec": "2.3.0"
"fetchSpec": "2.3.2"
},
"_requiredBy": [
"/react-scripts/postcss"
],
"_resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz",
"_spec": "2.3.0",
"_resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz",
"_spec": "2.3.2",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI",
"bugs": {
"url": "https://github.com/chalk/chalk/issues"
},
"dependencies": {
"ansi-styles": "^3.1.0",
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^4.0.0"
"supports-color": "^5.3.0"
},
"description": "Terminal string styling done right",
"devDependencies": {
"ava": "*",
"coveralls": "^3.0.0",
"execa": "^0.8.0",
"execa": "^0.9.0",
"import-fresh": "^2.0.0",
"matcha": "^0.7.0",
"nyc": "^11.0.2",
@@ -91,7 +91,7 @@
"test": "xo && tsc --project types && nyc ava"
},
"types": "types/index.d.ts",
"version": "2.3.0",
"version": "2.3.2",
"xo": {
"envs": [
"node",

View File

@@ -9,11 +9,11 @@
> Terminal string styling done right
[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs)
[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs)
### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0)
![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png)
<img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" alt="" width="900">
## Highlights
@@ -26,7 +26,7 @@
- Doesn't extend `String.prototype`
- Clean and focused
- Actively maintained
- [Used by ~17,000 packages](https://www.npmjs.com/browse/depended/chalk) as of June 20th, 2017
- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017
## Install
@@ -51,7 +51,7 @@ const chalk = require('chalk');
const log = console.log;
// Combine styled and normal strings
log(chalk.blue('Hello') + 'World' + chalk.red('!'));
log(chalk.blue('Hello') + ' World' + chalk.red('!'));
// Compose multiple styles using the chainable API
log(chalk.blue.bgRed.bold('Hello world!'));
@@ -124,7 +124,7 @@ Multiple arguments will be separated by space.
Color support is automatically detected, as is the level (see `chalk.level`). However, if you'd like to simply enable/disable Chalk, you can do so via the `.enabled` property.
Chalk is enabled by default unless expicitly disabled via the constructor or `chalk.level` is `0`.
Chalk is enabled by default unless explicitly disabled via the constructor or `chalk.level` is `0`.
If you need to change this in a reusable module, create a new instance:
@@ -265,8 +265,8 @@ The following color models can be used:
- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')`
- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 1, 1).bold('Orange!')`
- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hsl(32, 0, 50).bold('Orange!')`
- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')`
- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')`
- `ansi16`
- `ansi256`

View File

@@ -1,29 +1,29 @@
{
"_args": [
[
"postcss@6.0.14",
"postcss@6.0.19",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI"
]
],
"_from": "postcss@6.0.14",
"_id": "postcss@6.0.14",
"_from": "postcss@6.0.19",
"_id": "postcss@6.0.19",
"_inBundle": false,
"_integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==",
"_integrity": "sha512-f13HRz0HtVwVaEuW6J6cOUCBLFtymhgyLPV7t4QEk2UD3twRI9IluDcQNdzQdBpiixkXj2OmzejhhTbSbDxNTg==",
"_location": "/react-scripts/postcss",
"_phantomChildren": {
"ansi-styles": "3.2.0",
"ansi-styles": "3.2.1",
"escape-string-regexp": "1.0.5",
"supports-color": "4.5.0"
"supports-color": "5.3.0"
},
"_requested": {
"type": "version",
"registry": true,
"raw": "postcss@6.0.14",
"raw": "postcss@6.0.19",
"name": "postcss",
"escapedName": "postcss",
"rawSpec": "6.0.14",
"rawSpec": "6.0.19",
"saveSpec": null,
"fetchSpec": "6.0.14"
"fetchSpec": "6.0.19"
},
"_requiredBy": [
"/react-scripts/autoprefixer",
@@ -35,8 +35,8 @@
"/react-scripts/postcss-modules-scope",
"/react-scripts/postcss-modules-values"
],
"_resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz",
"_spec": "6.0.14",
"_resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.19.tgz",
"_spec": "6.0.19",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI",
"author": {
"name": "Andrey Sitnik",
@@ -51,63 +51,15 @@
"url": "https://github.com/postcss/postcss/issues"
},
"dependencies": {
"chalk": "^2.3.0",
"chalk": "^2.3.1",
"source-map": "^0.6.1",
"supports-color": "^4.4.0"
"supports-color": "^5.2.0"
},
"description": "Tool for transforming styles with JS plugins",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.1",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-precompile-charcodes": "^1.1.0",
"babel-preset-env": "^1.6.1",
"concat-with-sourcemaps": "^1.0.4",
"del": "^3.0.0",
"docdash": "^0.4.0",
"eslint": "^4.10.0",
"eslint-config-postcss": "^2.0.2",
"fs-extra": "^4.0.2",
"gulp": "^3.9.1",
"gulp-babel": "^7.0.0",
"gulp-changed": "^3.1.1",
"gulp-eslint": "^4.0.0",
"gulp-jest": "^2.0.0",
"gulp-run": "^1.7.1",
"gulp-sourcemaps": "^2.6.1",
"jest": "^21.2.1",
"jsdoc": "^3.5.5",
"lint-staged": "^4.3.0",
"postcss-parser-tests": "^6.1.0",
"pre-commit": "^1.2.2",
"run-sequence": "^2.2.0",
"size-limit": "^0.12.1",
"strip-ansi": "^4.0.0",
"yaspeller-ci": "^0.7.0"
},
"engines": {
"node": ">=4.0.0"
},
"eslintConfig": {
"parser": "babel-eslint",
"extends": "eslint-config-postcss",
"rules": {
"consistent-return": "off",
"valid-jsdoc": "error",
"complexity": "off",
"no-new": "off"
},
"env": {
"browser": true,
"jest": true
}
},
"homepage": "http://postcss.org/",
"jest": {
"modulePathIgnorePatterns": [
"build"
]
},
"keywords": [
"css",
"postcss",
@@ -120,30 +72,12 @@
"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"
},
"size-limit": [
{
"path": "lib/postcss.js",
"limit": "29 KB"
}
],
"types": "lib/postcss.d.ts",
"version": "6.0.14"
"version": "6.0.19"
}