Skip to content
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

Build(deps): Bump postcss-less from 3.1.4 to 4.0.0 #9471

Merged
merged 5 commits into from
Oct 26, 2020
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"parse-srcset": "ikatyang/parse-srcset#54eb9c1cb21db5c62b4d0e275d7249516df6f0ee",
"please-upgrade-node": "3.2.0",
"postcss": "8.1.3",
"postcss-less": "3.1.4",
"postcss-less": "4.0.0",
"postcss-media-query-parser": "0.2.3",
"postcss-scss": "3.0.2",
"postcss-selector-parser": "2.2.3",
Expand Down
5 changes: 3 additions & 2 deletions src/language-css/parser-postcss.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ function parseNestedCSS(node, options) {

// Custom properties looks like declarations
if (
(options.parser === "css" || options.parser === "scss") &&
node.type === "css-decl" &&
typeof node.prop === "string" &&
node.prop.startsWith("--") &&
Expand All @@ -325,7 +324,9 @@ function parseNestedCSS(node, options) {
let parse;
if (options.parser === "scss") {
parse = parseScss;
} else if (options.parser === "css") {
} else if (options.parser === "less") {
parse = parseLess;
} else {
parse = parseCss;
}
let ast;
Expand Down
4 changes: 2 additions & 2 deletions tests/less/comments/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,11 @@ printWidth: 80
/* custom properties set & @apply rule */
:root {
/* comments 192 */
--centered /* comments 193 */ : /* comments 194 */ {
--centered/* comments 193 */ : /* comments 194 */ {
display: flex;
align-items: center;
justify-content: center;
}
};
}

================================================================================
Expand Down
34 changes: 31 additions & 3 deletions tests/less/custom-properties/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ printWidth: 80
--without-semi: {color:red;}
}

:root {
--like-a-apply-rule: {
color:red;} /* no semi here*/
--another-prop: blue;
}

:root {
--like-a-apply-rule: {
color:red;} /* no semi here*/
--another-one-like-a-apply-rule: {
color:red;
};
}

=====================================output=====================================
/* http://tabatkins.github.io/specs/css-apply-rule/#defining */

Expand All @@ -31,16 +45,30 @@ printWidth: 80
background-color: hsl(120, 70%, 95%);
border-radius: 4px;
border: 1px solid var(--theme-color late);
}
};
--toolbar-title-theme: {
color: green;
}
};
}

:root {
--without-semi: {
color: red;
}
};
}

:root {
--like-a-apply-rule: {
color:red;} /* no semi here*/
--another-prop: blue;
}

:root {
--like-a-apply-rule: {
color:red;} /* no semi here*/
--another-one-like-a-apply-rule: {
color:red;
};
}

================================================================================
Expand Down
14 changes: 14 additions & 0 deletions tests/less/custom-properties/apply-rule.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,17 @@
:root {
--without-semi: {color:red;}
}

:root {
--like-a-apply-rule: {
color:red;} /* no semi here*/
--another-prop: blue;
}

:root {
--like-a-apply-rule: {
color:red;} /* no semi here*/
--another-one-like-a-apply-rule: {
color:red;
};
}
71 changes: 71 additions & 0 deletions tests/less/postcss-8-improment/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`empty-props.less format 1`] = `
====================================options=====================================
parsers: ["less"]
printWidth: 80
| printWidth
=====================================input======================================
:root {
--empty:;
--one-space: ;
--two-space: ;
--many-space: ;
}

=====================================output=====================================
:root {
--empty:;
--one-space: ;
--two-space: ;
--many-space: ;
}

================================================================================
`;

exports[`test.less format 1`] = `
====================================options=====================================
parsers: ["less"]
printWidth: 80
| printWidth
=====================================input======================================
/*
This test is copied from \`postcss@8\` release note

https://github.com/postcss/postcss/releases/tag/8.0.0
*/

:root {
--empty: ;
--JSON: [1, "2", {"three": {"a":1}}, [4]];
--javascript: function(rule) { console.log(rule) };
}

@supports (--element(".minwidth", { "minWidth": 300 })) {
[--self] {
background: greenyellow;
}
}

=====================================output=====================================
/*
This test is copied from \`postcss@8\` release note

https://github.com/postcss/postcss/releases/tag/8.0.0
*/

:root {
--empty: ;
--JSON: [1, "2", {"three": {"a": 1}}, [4]];
--javascript: function(rule) {console.log(rule)};
}

@supports (--element(".minwidth", {"minWidth": 300})) {
[--self] {
background: greenyellow;
}
}

================================================================================
`;
6 changes: 6 additions & 0 deletions tests/less/postcss-8-improment/empty-props.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:root {
--empty:;
--one-space: ;
--two-space: ;
--many-space: ;
}
1 change: 1 addition & 0 deletions tests/less/postcss-8-improment/jsfmt.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
run_spec(__dirname, ["less"]);
11 changes: 0 additions & 11 deletions tests/misc/errors/less/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ exports[`open-sigle-quote.less error test 1`] = `
4 | "
`;

exports[`postcss-8-improment.less error test 1`] = `
"CssSyntaxError: Missed semicolon (9:20)
7 | :root {
8 | --empty: ;
> 9 | --JSON: [1, \\"2\\", {\\"three\\": {\\"a\\":1}}, [4]];
| ^
10 | --javascript: function(rule) { console.log(rule) };
11 | }
12 | "
`;

exports[`scss-syntax.scss error test 1`] = `
"CssSyntaxError: Unknown word (1:15)
> 1 | a {content: #{$foo}}
Expand Down
30 changes: 7 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2155,7 +2155,7 @@ ccount@^1.0.0:
resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.5.tgz#ac82a944905a65ce204eb03023157edf29425c17"
integrity sha512-MOli1W+nfbPLlKEhInaxhRdp7KVLFxLN5ykwzHgLsLI3H3gs5jjFAK4Eoj3OzzcxCtumDaI8onoVDeQyWaNTkw==

chalk@2.4.2, chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2:
chalk@2.4.2, chalk@^2.0.0, chalk@^2.4.1:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
Expand Down Expand Up @@ -5828,12 +5828,12 @@ posix-character-classes@^0.1.0:
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=

postcss-less@3.1.4:
version "3.1.4"
resolved "https://registry.yarnpkg.com/postcss-less/-/postcss-less-3.1.4.tgz#369f58642b5928ef898ffbc1a6e93c958304c5ad"
integrity sha512-7TvleQWNM2QLcHqvudt3VYjULVB49uiW6XzEUFmvwHzvsOEF5MwBrIXZDJQvJNFGjJQTzSzZnDoCJ8h/ljyGXA==
postcss-less@4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/postcss-less/-/postcss-less-4.0.0.tgz#88ad544041750023650f249a896930a741506390"
integrity sha512-wKT2JuR3dTBgtQ61HAyqx/uPlYgkf4OTlYcZaqLWjW/hMIIV58d79ab03oilkn7ob84lOd9W1oBB1Pu7bmzUYQ==
dependencies:
postcss "^7.0.14"
postcss "^8.1.2"

postcss-media-query-parser@0.2.3:
version "0.2.3"
Expand Down Expand Up @@ -5865,7 +5865,7 @@ postcss-values-parser@2.0.1:
indexes-of "^1.0.1"
uniq "^1.0.1"

postcss@8.1.3, postcss@^8.1.0:
postcss@8.1.3, postcss@^8.1.0, postcss@^8.1.2:
version "8.1.3"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.1.3.tgz#b25138b872ca9f9512c218d9d57ebb59015a9c39"
integrity sha512-AKsHGqd7HmXmL/EgyAjI4Gx719A5yQdt9HzyXrI8M/hzxfumecYS95kfvIt40UZqPVNoEt0Va1M3PG54XtNPbg==
Expand All @@ -5875,15 +5875,6 @@ postcss@8.1.3, postcss@^8.1.0:
nanoid "^3.1.15"
source-map "^0.6.1"

postcss@^7.0.14:
version "7.0.34"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.34.tgz#f2baf57c36010df7de4009940f21532c16d65c20"
integrity sha512-H/7V2VeNScX9KE83GDrDZNiGT1m2H+UTnlinIzhjlLX9hfMUn1mHNnGeX81a1c8JSBdBvqk7c2ZOG6ZPn5itGw==
dependencies:
chalk "^2.4.2"
source-map "^0.6.1"
supports-color "^6.1.0"

prelude-ls@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
Expand Down Expand Up @@ -6819,13 +6810,6 @@ supports-color@^5.3.0:
dependencies:
has-flag "^3.0.0"

supports-color@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3"
integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==
dependencies:
has-flag "^3.0.0"

supports-color@^7.0.0, supports-color@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1"
Expand Down