Skip to content

chore(deps): update #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"presets": ["es2015-loose", "stage-0"],
"plugins": ["add-module-exports", "precompile-charcodes"],
"env": {
"development": {
"sourceMaps": "inline"
"presets": [
["@babel/preset-env", { "loose": true }]
],
"plugins": [
"@babel/proposal-class-properties",
"add-module-exports"
],
"env": {
"development": {
"sourceMaps": "inline"
}
}
}
}
7,987 changes: 2,901 additions & 5,086 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,23 @@
"name": "postcss-selector-parser",
"version": "5.0.0",
"devDependencies": {
"ava": "^0.25.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.3",
"babel-plugin-add-module-exports": "^0.2.0",
"babel-plugin-precompile-charcodes": "^1.1.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.26.0",
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.3",
"@babel/plugin-proposal-class-properties": "^7.3.3",
"@babel/preset-env": "^7.3.1",
"@babel/register": "^7.0.0",
"ava": "^1.2.1",
"babel-eslint": "^10.0.1",
"babel-plugin-add-module-exports": "^1.0.0",
"coveralls": "^3.0.2",
"del-cli": "^1.1.0",
"eslint": "^4.19.1",
"eslint-plugin-babel": "^3.3.0",
"eslint": "^5.14.1",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.14.0",
"glob": "^7.1.3",
"minimist": "^1.2.0",
"nyc": "^11.7.3",
"postcss": "^7.0.7",
"nyc": "^13.3.0",
"postcss": "^7.0.14",
"semver": "^5.6.0"
},
"main": "dist/index.js",
Expand Down Expand Up @@ -64,7 +62,9 @@
],
"repository": "postcss/postcss-selector-parser",
"ava": {
"require": "babel-register",
"require": [
"@babel/register"
],
"concurrency": 5
},
"nyc": {
Expand Down
10 changes: 0 additions & 10 deletions src/__tests__/__snapshots__/postcss.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,6 @@ Generated by [AVA](https://ava.li).
| ^␊
`

## bad whitespace instead of namespace token

> Snapshot 1

`CssSyntaxError: <css input>:1:2: Expected an attribute, found " " instead.␊
> 1 | [ |href=test] {}␊
| ^␊
`

## missing open parenthesis

> Snapshot 1
Expand Down
Binary file modified src/__tests__/__snapshots__/postcss.js.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion src/__tests__/combinators.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ test('multiple combinators with whitespaces', 'h1 + h2 > h3', (t, tree) => {
t.deepEqual(tree.nodes[0].nodes[3].value, '>', 'should have a combinator');
});

test('multiple combinators with whitespaces', 'h1+ h2 >h3', (t, tree) => {
test('multiple combinators with whitespaces (2)', 'h1+ h2 >h3', (t, tree) => {
t.deepEqual(tree.nodes[0].nodes[1].value, '+', 'should have a combinator');
t.deepEqual(tree.nodes[0].nodes[3].value, '>', 'should have a combinator');
});
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test('comments', '/*test comment*/h2', (t, tree) => {
t.deepEqual(tree.nodes[0].nodes[1].value, 'h2');
});

test('comments', '.a /*test comment*/label', (t, tree) => {
test('comments (2)', '.a /*test comment*/label', (t, tree) => {
t.deepEqual(tree.nodes[0].nodes[0].type, 'class');
t.deepEqual(tree.nodes[0].nodes[1].type, 'combinator');
t.deepEqual(tree.nodes[0].nodes[1].value, ' ');
Expand All @@ -14,7 +14,7 @@ test('comments', '.a /*test comment*/label', (t, tree) => {
t.deepEqual(tree.nodes[0].nodes[2].type, 'tag');
});

test('comments', '.a /*test comment*/ label', (t, tree) => {
test('comments (3)', '.a /*test comment*/ label', (t, tree) => {
t.deepEqual(tree.nodes[0].nodes[0].type, 'class');
t.deepEqual(tree.nodes[0].nodes[1].type, 'combinator');
t.deepEqual(tree.nodes[0].nodes[1].value, ' ');
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/exceptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ throws('missing closing parenthesis in pseudo', ':not([attr="test"]:not([attr="t
throws('bad syntax', '-moz-osx-font-smoothing: grayscale');

throws('missing backslash for semicolon', '.;');
throws('missing backslash for semicolon', '.\;');
throws('missing backslash for semicolon (2)', '.\;');
throws('unexpected / foo', '-Option\/root', "Unexpected '/'. Escaping special characters with \\ may help.");
throws('bang in selector', '.foo !optional', "Unexpected '!'. Escaping special characters with \\ may help.");
2 changes: 1 addition & 1 deletion src/__tests__/nonstandard.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test('sass escapes', '.#{$classname}', (t, tree) => {
t.deepEqual(tree.nodes[0].nodes[0].value, "#{$classname}");
});

test('sass escapes', '[lang=#{$locale}]', (t, tree) => {
test('sass escapes (2)', '[lang=#{$locale}]', (t, tree) => {
t.deepEqual(tree.nodes[0].nodes.map(n => n.type), ["attribute"]);
t.deepEqual(tree.nodes[0].nodes[0].value, "#{$locale}");
});
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/util/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test.serial = (spec, input, callback) => test(spec, input, callback, false, fals

export const throws = (spec, input, validator) => {
ava(`${spec} (throws)`, t => {
t.throws(() => parser().processSync(input), validator);
t.throws(() => parser().processSync(input), validator || Error);
});
};

Expand Down
54 changes: 27 additions & 27 deletions src/tokenTypes.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
export const ampersand = `&`.charCodeAt(0);
export const asterisk = `*`.charCodeAt(0);
export const at = `@`.charCodeAt(0);
export const comma = `,`.charCodeAt(0);
export const colon = `:`.charCodeAt(0);
export const semicolon = `;`.charCodeAt(0);
export const openParenthesis = `(`.charCodeAt(0);
export const closeParenthesis = `)`.charCodeAt(0);
export const openSquare = `[`.charCodeAt(0);
export const closeSquare = `]`.charCodeAt(0);
export const dollar = `$`.charCodeAt(0);
export const tilde = `~`.charCodeAt(0);
export const caret = `^`.charCodeAt(0);
export const plus = `+`.charCodeAt(0);
export const equals = `=`.charCodeAt(0);
export const pipe = `|`.charCodeAt(0);
export const greaterThan = `>`.charCodeAt(0);
export const space = ` `.charCodeAt(0);
export const singleQuote = `'`.charCodeAt(0);
export const doubleQuote = `"`.charCodeAt(0);
export const slash = `/`.charCodeAt(0);
export const bang = `!`.charCodeAt(0);
export const ampersand = 38; // `&`.charCodeAt(0);
export const asterisk = 42; // `*`.charCodeAt(0);
export const at = 64; // `@`.charCodeAt(0);
export const comma = 44; // `,`.charCodeAt(0);
export const colon = 58; // `:`.charCodeAt(0);
export const semicolon = 59; // `;`.charCodeAt(0);
export const openParenthesis = 40; // `(`.charCodeAt(0);
export const closeParenthesis = 41; // `)`.charCodeAt(0);
export const openSquare = 91; // `[`.charCodeAt(0);
export const closeSquare = 93; // `]`.charCodeAt(0);
export const dollar = 36; // `$`.charCodeAt(0);
export const tilde = 126; // `~`.charCodeAt(0);
export const caret = 94; // `^`.charCodeAt(0);
export const plus = 43; // `+`.charCodeAt(0);
export const equals = 61; // `=`.charCodeAt(0);
export const pipe = 124; // `|`.charCodeAt(0);
export const greaterThan = 62; // `>`.charCodeAt(0);
export const space = 32; // ` `.charCodeAt(0);
export const singleQuote = 39; // `'`.charCodeAt(0);
export const doubleQuote = 34; // `"`.charCodeAt(0);
export const slash = 47; // `/`.charCodeAt(0);
export const bang = 33; // `!`.charCodeAt(0);

export const backslash = '\\'.charCodeAt(0);
export const cr = '\r'.charCodeAt(0);
export const feed = '\f'.charCodeAt(0);
export const newline = '\n'.charCodeAt(0);
export const tab = '\t'.charCodeAt(0);
export const backslash = 92; // '\\'.charCodeAt(0);
export const cr = 13; // '\r'.charCodeAt(0);
export const feed = 12; // '\f'.charCodeAt(0);
export const newline = 10; // '\n'.charCodeAt(0);
export const tab = 9; // '\t'.charCodeAt(0);

// Expose aliases primarily for readability.
export const str = singleQuote;
Expand Down