From f8c6abb515bd18fdd1fdf9375eb9141b8c7e80e1 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 16 Aug 2024 22:55:12 +0200 Subject: [PATCH 1/6] Remove left-over ruby-sass output (#2008) --- spec/values/identifiers/escape/normalize.hrx | 28 -------------------- 1 file changed, 28 deletions(-) diff --git a/spec/values/identifiers/escape/normalize.hrx b/spec/values/identifiers/escape/normalize.hrx index 03cdd2133..d7b126c61 100644 --- a/spec/values/identifiers/escape/normalize.hrx +++ b/spec/values/identifiers/escape/normalize.hrx @@ -60,31 +60,3 @@ selector\9 { selector\9 { x: y; } - -<===> output-ruby-sass.css -@charset "UTF-8"; -.normalize { - name-start-char: ax ax ax ax ax ax; - name-start-char-non-hex: xx; - name-start-char-non-ascii: ☃x ☃x ☃x; - name-char-in-middle: a-x a-x; - name-char-at-start: \-x \-x; - digit-in-middle: a1x a1x; - digit-at-start: \31 x \31 x; - non-printable: \0 x \1 x \2 x \3 x \4 x \5 x \6 x \7 x \8 x \b x \e x \f x \10 x \11 x \12 x \13 x \14 x \15 x \16 x \17 x \18 x \19 x \1a x \1b x \1c x \1d x \1e x \1f x \7f x; - newline: \a x \c x \d x; - tab: \9 x \9 x; - name-char-interpolation-beginning: \-foo; - name-char-interpolation-middle: foo-bar; - name-char-interpolation-end: foo-; - raw-escaped-tab: \ ; -} - -@media screen\9 { - x { - y: z; - } -} -selector\9 { - x: y; -} From 41ce01a89f0588a4f3d35d89ad2f444288af1ab9 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 16 Aug 2024 22:56:05 +0200 Subject: [PATCH 2/6] Remove tests that are ignored on dart-sass (#2009) --- spec/libsass-closed-issues/issue_1258.hrx | 25 --------- spec/libsass-closed-issues/issue_1291.hrx | 48 ----------------- spec/libsass-closed-issues/issue_54.hrx | 52 ------------------- spec/libsass-closed-issues/issue_698.hrx | 14 ----- spec/libsass-closed-issues/issue_950.hrx | 18 ------- .../extend-tests/090_test_comma_extendee.hrx | 18 ------- .../222_test_newline_near_combinator.hrx | 17 ------ .../040_test_newlines_in_selectors.hrx | 14 ----- .../043_test_newlines_in_selectors.hrx | 19 ------- .../scss/newlines_in_selectors.hrx | 19 ------- 10 files changed, 244 deletions(-) delete mode 100644 spec/libsass-closed-issues/issue_1258.hrx delete mode 100644 spec/libsass-closed-issues/issue_1291.hrx delete mode 100644 spec/libsass-closed-issues/issue_54.hrx delete mode 100644 spec/libsass-closed-issues/issue_698.hrx delete mode 100644 spec/libsass-closed-issues/issue_950.hrx delete mode 100644 spec/non_conformant/extend-tests/090_test_comma_extendee.hrx delete mode 100644 spec/non_conformant/extend-tests/222_test_newline_near_combinator.hrx delete mode 100644 spec/non_conformant/scss-tests/040_test_newlines_in_selectors.hrx delete mode 100644 spec/non_conformant/scss-tests/043_test_newlines_in_selectors.hrx delete mode 100644 spec/non_conformant/scss/newlines_in_selectors.hrx diff --git a/spec/libsass-closed-issues/issue_1258.hrx b/spec/libsass-closed-issues/issue_1258.hrx deleted file mode 100644 index 16b7eece0..000000000 --- a/spec/libsass-closed-issues/issue_1258.hrx +++ /dev/null @@ -1,25 +0,0 @@ -<===> options.yml ---- -:ignore_for: -- dart-sass - -<===> input.scss -@use "sass:string"; -$list: '(-webkit-min-device-pixel-ratio: 2)', '(min-resolution: 192dpi)'; -$string: '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)'; - -.foo { - // I should not unquote a list, I know. But still. - content: string.unquote($list); - content: string.unquote($string); -} -<===> output.css -.foo { - content: "(-webkit-min-device-pixel-ratio: 2)", "(min-resolution: 192dpi)"; - content: (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi); -} - -<===> warning -DEPRECATION WARNING: Passing "(-webkit-min-device-pixel-ratio: 2)", "(min-resolution: 192dpi)", a non-string value, to unquote() -will be an error in future versions of Sass. - on line 6 of input.scss diff --git a/spec/libsass-closed-issues/issue_1291.hrx b/spec/libsass-closed-issues/issue_1291.hrx deleted file mode 100644 index ebaee0635..000000000 --- a/spec/libsass-closed-issues/issue_1291.hrx +++ /dev/null @@ -1,48 +0,0 @@ -<===> options.yml ---- -:ignore_for: -- dart-sass - -<===> input.scss -@use "sass:string"; -@mixin spec1($decimal) { - $decimal: string.unquote($decimal) * -1; - value: $decimal; -} - -@mixin spec2($decimal) { - $decimal: -1 * string.unquote($decimal); - value: $decimal; -} - -@mixin spec3($decimal) { - value: #{$decimal * -1}; -} - -.my-element { - @include spec1(3); - @include spec1(-3); - @include spec2(5); - @include spec2(-5); - @include spec3(7); - @include spec3(-7); -} -<===> output.css -.my-element { - value: -3; - value: 3; - value: -5; - value: 5; - value: -7; - value: 7; -} - -<===> warning -DEPRECATION WARNING: Passing 3, a non-string value, to unquote() -will be an error in future versions of Sass. - on line 2 of input.scss, in `spec1' - from line 16 of input.scss -DEPRECATION WARNING: Passing 5, a non-string value, to unquote() -will be an error in future versions of Sass. - on line 7 of input.scss, in `spec2' - from line 18 of input.scss diff --git a/spec/libsass-closed-issues/issue_54.hrx b/spec/libsass-closed-issues/issue_54.hrx deleted file mode 100644 index 724345ced..000000000 --- a/spec/libsass-closed-issues/issue_54.hrx +++ /dev/null @@ -1,52 +0,0 @@ -<===> options.yml ---- -:ignore_for: -- dart-sass - -<===> input.scss -@use "sass:color"; -@mixin opacity($percent) { - foo { test: color.opacity($percent); } -} - -@-webkit-keyframes uiDelayedFadeIn { - 0% { @include opacity(0.01); } - 50% { @include opacity(0.01); } - 100% { @include opacity(1); } -} - -@-webkit-keyframes bounce { - from { - left: 0px; - } - to { - left: 200px; - } -} - -<===> output.css -@-webkit-keyframes uiDelayedFadeIn { - 0% { - foo { - test: opacity(0.01); - } - } - 50% { - foo { - test: opacity(0.01); - } - } - 100% { - foo { - test: opacity(1); - } - } -} -@-webkit-keyframes bounce { - from { - left: 0px; - } - to { - left: 200px; - } -} diff --git a/spec/libsass-closed-issues/issue_698.hrx b/spec/libsass-closed-issues/issue_698.hrx deleted file mode 100644 index 60c79dc9c..000000000 --- a/spec/libsass-closed-issues/issue_698.hrx +++ /dev/null @@ -1,14 +0,0 @@ -<===> options.yml ---- -:ignore_for: -- dart-sass - -<===> input.scss -test { - test: foo + null; -} - -<===> error -Error: Invalid null operation: ""foo" plus null". - on line 2 of input.scss - Use --trace for backtrace. diff --git a/spec/libsass-closed-issues/issue_950.hrx b/spec/libsass-closed-issues/issue_950.hrx deleted file mode 100644 index 772665140..000000000 --- a/spec/libsass-closed-issues/issue_950.hrx +++ /dev/null @@ -1,18 +0,0 @@ -<===> options.yml ---- -:ignore_for: -- dart-sass - -<===> input.scss -.selector1{ foo: bar; } -.selector2{ zapf: dings; } - -.selector3{ @extend .selector1, .selector2; } -<===> output.css -.selector1, .selector3 { - foo: bar; -} - -.selector2, .selector3 { - zapf: dings; -} diff --git a/spec/non_conformant/extend-tests/090_test_comma_extendee.hrx b/spec/non_conformant/extend-tests/090_test_comma_extendee.hrx deleted file mode 100644 index aead87b16..000000000 --- a/spec/non_conformant/extend-tests/090_test_comma_extendee.hrx +++ /dev/null @@ -1,18 +0,0 @@ -<===> options.yml ---- -:ignore_for: -- dart-sass - -<===> input.scss -.foo {a: b} -.bar {c: d} -.baz {@extend .foo, .bar} - -<===> output.css -.foo, .baz { - a: b; -} - -.bar, .baz { - c: d; -} diff --git a/spec/non_conformant/extend-tests/222_test_newline_near_combinator.hrx b/spec/non_conformant/extend-tests/222_test_newline_near_combinator.hrx deleted file mode 100644 index a0302ef67..000000000 --- a/spec/non_conformant/extend-tests/222_test_newline_near_combinator.hrx +++ /dev/null @@ -1,17 +0,0 @@ -<===> options.yml ---- -:ignore_for: -- dart-sass - -<===> input.scss -.a + -.b x {a: b} -.c y {@extend x} - -<===> output.css -.a + -.b x, .a + -.b .c y, .c .a + -.b y { - a: b; -} diff --git a/spec/non_conformant/scss-tests/040_test_newlines_in_selectors.hrx b/spec/non_conformant/scss-tests/040_test_newlines_in_selectors.hrx deleted file mode 100644 index fc0f190a9..000000000 --- a/spec/non_conformant/scss-tests/040_test_newlines_in_selectors.hrx +++ /dev/null @@ -1,14 +0,0 @@ -<===> options.yml ---- -:ignore_for: -- dart-sass - -<===> input.scss -foo -bar {a: b} - -<===> output.css -foo -bar { - a: b; -} diff --git a/spec/non_conformant/scss-tests/043_test_newlines_in_selectors.hrx b/spec/non_conformant/scss-tests/043_test_newlines_in_selectors.hrx deleted file mode 100644 index f56bf13c6..000000000 --- a/spec/non_conformant/scss-tests/043_test_newlines_in_selectors.hrx +++ /dev/null @@ -1,19 +0,0 @@ -<===> options.yml ---- -:ignore_for: -- dart-sass - -<===> input.scss -foo, bar -baz { - bang, bip - bop {a: b}} - -<===> output.css -foo bang, foo bip -bop, bar -baz bang, bar -baz bip -bop { - a: b; -} diff --git a/spec/non_conformant/scss/newlines_in_selectors.hrx b/spec/non_conformant/scss/newlines_in_selectors.hrx deleted file mode 100644 index f56bf13c6..000000000 --- a/spec/non_conformant/scss/newlines_in_selectors.hrx +++ /dev/null @@ -1,19 +0,0 @@ -<===> options.yml ---- -:ignore_for: -- dart-sass - -<===> input.scss -foo, bar -baz { - bang, bip - bop {a: b}} - -<===> output.css -foo bang, foo bip -bop, bar -baz bang, bar -baz bip -bop { - a: b; -} From 1d12ef885923b46d8b514c9dd028d11c2bc7a9c3 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Mon, 19 Aug 2024 16:41:27 -0700 Subject: [PATCH 3/6] Add tests for an empty `@at-root` rule in the indented syntax (#2010) --- spec/directives/at_root.hrx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/spec/directives/at_root.hrx b/spec/directives/at_root.hrx index ddef1f01e..bcd185bda 100644 --- a/spec/directives/at_root.hrx +++ b/spec/directives/at_root.hrx @@ -1,3 +1,32 @@ +<===> sass/empty/no_query/input.sass +@at-root + +<===> sass/empty/no_query/output.css + +<===> +================================================================================ +<===> sass/empty/query/input.sass +@at-root (with: rule) + +<===> sass/empty/query/output.css + +<===> +================================================================================ +<===> sass/empty/selector/input.sass +@at-root a + +<===> sass/empty/selector/output.css + +<===> sass/empty/selector/warning +WARNING on line 1, column 10 of input.sass: +This selector doesn't have any properties and won't be rendered. + , +1 | @at-root a + | ^ + ' + +<===> +================================================================================ <===> keyframes/all/input.scss @keyframes a { @at-root (without: all) { From 303da5c3449a69173620e14f0aa622638176f27a Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Tue, 20 Aug 2024 02:57:49 +0200 Subject: [PATCH 4/6] Update specs for the deprecation of feature-exists (#1986) Co-authored-by: Natalie Weizenbaum --- spec/core_functions/global/meta.hrx | 11 ++ spec/core_functions/meta/feature_exists.hrx | 109 ++++++++++++++++++ spec/libsass-closed-issues/issue_702.hrx | 11 ++ spec/libsass/at-error/feature-test.hrx | 11 ++ spec/libsass/units/feature-test.hrx | 11 ++ .../libsass/variable-scoping/feature-test.hrx | 11 ++ 6 files changed, 164 insertions(+) diff --git a/spec/core_functions/global/meta.hrx b/spec/core_functions/global/meta.hrx index cda938d11..91d163c1f 100644 --- a/spec/core_functions/global/meta.hrx +++ b/spec/core_functions/global/meta.hrx @@ -16,6 +16,17 @@ a { b: true; } +<===> feature_exists/warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +1 | a {b: feature-exists(at-error)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + <===> ================================================================================ <===> variable_exists/input.scss diff --git a/spec/core_functions/meta/feature_exists.hrx b/spec/core_functions/meta/feature_exists.hrx index 58a9748a6..bc342c5a8 100644 --- a/spec/core_functions/meta/feature_exists.hrx +++ b/spec/core_functions/meta/feature_exists.hrx @@ -13,6 +13,17 @@ a { b: true; } +<===> global_variable_shadowing/warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +2 | a {b: meta.feature-exists(global-variable-shadowing)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> extend_selector_pseudoclass/input.scss @@ -24,6 +35,17 @@ a { b: true; } +<===> extend_selector_pseudoclass/warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +2 | a {b: meta.feature-exists(extend-selector-pseudoclass)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> units_level_3/input.scss @@ -35,6 +57,17 @@ a { b: true; } +<===> units_level_3/warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +2 | a {b: meta.feature-exists(units-level-3)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> at_error/input.scss @@ -46,6 +79,17 @@ a { b: true; } +<===> at_error/warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +2 | a {b: meta.feature-exists(at-error)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> custom_property/input.scss @@ -57,6 +101,17 @@ a { b: true; } +<===> custom_property/warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +2 | a {b: meta.feature-exists(custom-property)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> unknown/input.scss @@ -68,6 +123,17 @@ a { b: false; } +<===> unknown/warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +2 | a {b: meta.feature-exists(unknown)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> dash_sensitive/input.scss @@ -79,6 +145,17 @@ a { b: false; } +<===> dash_sensitive/warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +2 | a {b: meta.feature-exists(at_error)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> quote_insensitive/input.scss @@ -90,6 +167,17 @@ a { b: true; } +<===> quote_insensitive/warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +2 | a {b: meta.feature-exists("at-error")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> named/input.scss @@ -101,6 +189,17 @@ a { b: true; } +<===> named/warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +2 | a {b: meta.feature-exists($feature: at-error)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/type/input.scss @@ -108,6 +207,16 @@ a { a {b: meta.feature-exists(1)} <===> error/type/error +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +2 | a {b: meta.feature-exists(1)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + Error: $feature: 1 is not a string. , 2 | a {b: meta.feature-exists(1)} diff --git a/spec/libsass-closed-issues/issue_702.hrx b/spec/libsass-closed-issues/issue_702.hrx index bf4cf7a34..ed286fdba 100644 --- a/spec/libsass-closed-issues/issue_702.hrx +++ b/spec/libsass-closed-issues/issue_702.hrx @@ -10,3 +10,14 @@ content: true; content: false; } + +<===> warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +4 | content: meta.feature-exists("foo"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 4:12 root stylesheet diff --git a/spec/libsass/at-error/feature-test.hrx b/spec/libsass/at-error/feature-test.hrx index f19c31889..ab6d78653 100644 --- a/spec/libsass/at-error/feature-test.hrx +++ b/spec/libsass/at-error/feature-test.hrx @@ -10,3 +10,14 @@ div { feature: true; } + +<===> warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +2 | @if meta.feature-exists(at-error) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:5 root stylesheet diff --git a/spec/libsass/units/feature-test.hrx b/spec/libsass/units/feature-test.hrx index ba99f2e14..f419c1c1b 100644 --- a/spec/libsass/units/feature-test.hrx +++ b/spec/libsass/units/feature-test.hrx @@ -10,3 +10,14 @@ div { feature: true; } + +<===> warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +2 | @if meta.feature-exists(units-level-3) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:5 root stylesheet diff --git a/spec/libsass/variable-scoping/feature-test.hrx b/spec/libsass/variable-scoping/feature-test.hrx index 47881aebe..ac1374990 100644 --- a/spec/libsass/variable-scoping/feature-test.hrx +++ b/spec/libsass/variable-scoping/feature-test.hrx @@ -9,3 +9,14 @@ div { feature: true; } + +<===> warning +DEPRECATION WARNING: The feature-exists() function is deprecated. + +More info: https://sass-lang.com/d/feature-exists + + , +2 | @if meta.feature-exists(global-variable-shadowing) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:5 root stylesheet From c1eda3a64a5263cbe842b491fe02bdc218077f7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:52:37 -0700 Subject: [PATCH 5/6] Bump micromatch from 4.0.4 to 4.0.8 (#2011) Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.4 to 4.0.8. - [Release notes](https://github.com/micromatch/micromatch/releases) - [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/micromatch/compare/4.0.4...4.0.8) --- updated-dependencies: - dependency-name: micromatch dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 87665dcb4..d654c80ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6148,12 +6148,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.3", + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" @@ -6541,9 +6541,9 @@ "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, "node_modules/picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "engines": { "node": ">=8.6" }, @@ -12646,12 +12646,12 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" }, "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.3", + "picomatch": "^2.3.1" } }, "mime": { @@ -12928,9 +12928,9 @@ "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, "picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" }, "pirates": { "version": "4.0.1", From 3d10521ad8e9e2081c47636c1b87c28e81d7e01d Mon Sep 17 00:00:00 2001 From: Jennifer Thakar Date: Tue, 3 Sep 2024 15:04:40 -0700 Subject: [PATCH 6/6] Test deprecations in legacy JS API (#2006) --- js-api-spec/legacy/render.node.test.ts | 84 ++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/js-api-spec/legacy/render.node.test.ts b/js-api-spec/legacy/render.node.test.ts index 0b96311a0..ccff0a1cc 100644 --- a/js-api-spec/legacy/render.node.test.ts +++ b/js-api-spec/legacy/render.node.test.ts @@ -531,6 +531,90 @@ describe('options', () => { }); }); + describe('fatalDeprecations', () => { + it('makes specified deprecations fatal', () => { + expect(() => + sass.renderSync({ + data: '$_: 1/2;', + fatalDeprecations: ['slash-div'], + }) + ).toThrowLegacyException({includes: 'math.div'}); + }); + + it('leaves other deprecations as warnings', () => { + const stdio = captureStdio(() => + sass.renderSync({ + data: '$_: 1/2;', + fatalDeprecations: ['call-string'], + }) + ); + expect(stdio.out).toBeEmptyString(); + expect(stdio.err).toContain('math.div'); + }); + }); + + describe('futureDeprecations', () => { + it('opts into future deprecation early', () => { + sandbox(dir => { + dir.write({ + 'test.scss': '@import "other";', + '_other.scss': '', + }); + + const stdio = captureStdio(() => + sass.renderSync({ + file: dir('test.scss'), + // data: '@import "other"', + futureDeprecations: ['import'], + }) + ); + expect(stdio.out).toBeEmptyString(); + expect(stdio.err).toContain('@import rule'); + }); + }); + + it('emits no warning when not set', () => { + sandbox(dir => { + dir.write({ + 'test.scss': '@import "other";', + '_other.scss': '', + }); + + const stdio = captureStdio(() => + sass.renderSync({ + file: dir('test.scss'), + }) + ); + expect(stdio.out).toBeEmptyString(); + expect(stdio.err).toBeEmptyString(); + }); + }); + }); + + describe('silenceDeprecations', () => { + it('hides specified deprecation warnings', () => { + const stdio = captureStdio(() => + sass.renderSync({ + data: '$_: 1/2;', + silenceDeprecations: ['slash-div'], + }) + ); + expect(stdio.out).toBeEmptyString(); + expect(stdio.err).toBeEmptyString(); + }); + + it('emits other deprecation warnings', () => { + const stdio = captureStdio(() => + sass.renderSync({ + data: '$_: 1/2;', + silenceDeprecations: ['call-string'], + }) + ); + expect(stdio.out).toBeEmptyString(); + expect(stdio.err).toContain('math.div'); + }); + }); + describe('verbose', () => { const data = ` $_: call("inspect", null);