Skip to content

Commit 75781af

Browse files
Bump the production-dependencies group with 2 updates (#1866)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Romain Menke <romainmenke@gmail.com>
1 parent 877ee47 commit 75781af

38 files changed

Lines changed: 2551 additions & 2558 deletions

File tree

package-lock.json

Lines changed: 2403 additions & 2457 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/postcss-tape/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes to PostCSS Tape
22

3+
### Unreleased (patch)
4+
5+
- Ignore whitespace when comparing latest and oldest PostCSS versions.
6+
37
### 7.0.0
48

59
_January 14, 2026_
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/* node:coverage disable */
2-
import e from"node:assert/strict";import t from"node:fs/promises";import s from"node:fs";import o from"node:path";import n from"postcss";import r from"postcss-8.4";import i from"node:test";import a from"node:url";const noopPlugin=()=>({postcssPlugin:"noop-plugin",Once(){}});async function fileContentsOrEmptyString(e){try{return await t.readFile(e,"utf8")}catch{return""}}function reduceInformationInCssSyntaxError(e){process.env.DEBUG||(delete e.source,e.input&&delete e.input.source,delete e.postcssNode)}function postcssTape(a,c){return async p=>{c=c??{},await i("`postcss` flag is set on exported plugin creator",()=>{e.equal(a.postcss,!0)}),await i("exported plugin creator is a function",()=>{e.equal(typeof a,"function")}),await i("`postcssPlugin` is set on a plugin instance",()=>{const t=a();e.ok(t.postcssPlugin),e.equal(typeof t.postcssPlugin,"string")}),await i("package.json",async s=>{const o=await t.readFile("./package.json","utf-8"),n=JSON.parse(o);await s.test('includes "postcss-plugin" keyword',()=>{e.ok(Array.isArray(n.keywords)&&n.keywords?.includes("postcss-plugin"),new PackageDescriptionError('Missing "postcss-plugin" keyword in package.json',"keywords"))}),await s.test('name starts with "postcss-"',{skip:c?.skipPackageNameCheck},()=>{let t="string"==typeof n.name?n.name:"";if(t.startsWith("@")){const e=t.split("/");t=e.slice(1).join("/")}e.ok(t.startsWith("postcss-"),new PackageDescriptionError(`package name "${t}" does not start with "postcss-"`,"name"))}),await s.test("`postcss` is a peer dependency and not a direct dependency",{skip:"postcssTapeSelfTest"in a},()=>{e.ok(Object.keys(Object(n.peerDependencies)).includes("postcss"),new PackageDescriptionError('"postcss" must be listed in "peerDependencies"',"peerDependencies")),e.ok(!Object.keys(Object(n.dependencies)).includes("postcss"),new PackageDescriptionError('"postcss" must not be listed in "dependencies"',"dependencies"))})});const l=a().postcssPlugin;await i(l,async i=>{for(const c in p)await i.test(c,async i=>{const l=p[c];l.before&&await l.before();const u=o.join(".","test",...c.split(":")[0].split(o.posix.sep)),d=o.join(".","test",...c.replace(/:/g,".").split(o.posix.sep)),m="css";let g=`${u}.${m}`,w=`${d}.expect.${m}`,f=`${d}.result.${m}`;l.source&&(g=o.join(".","test",l.source)),l.expect&&(w=o.join(".","test",l.expect)),l.result&&(f=o.join(".","test",l.result));const k=l.plugins??[a(l.options)],h=await fileContentsOrEmptyString(g),y=await fileContentsOrEmptyString(w);let E,x=null;const S=n([noopPlugin()]).version===r([noopPlugin()]).version;try{E=await n(k).process(h,{from:g,to:f,map:{inline:!1,annotation:!1}});try{x=S?null:await r(k).process(h,{from:g,to:f,map:{inline:!1,annotation:!1}})}catch{}}catch(e){if(!(e instanceof Error))throw e;if(reduceInformationInCssSyntaxError(e),l.exception&&l.exception.test(e.message))return;throw e}e.ok(!l.exception,new OutcomeError(`expected an exception matching "${l.exception}"`,g));const P=E.css.toString();{const e=[t.writeFile(f,P,"utf8")];process.env.REWRITE_EXPECTS&&e.push(t.writeFile(w,P,"utf8")),await Promise.all(e)}y||e.ok(s.existsSync(w),new OutcomeError(`Missing expect file: "${w}"`,g)),l.after&&await l.after();const $=await fileContentsOrEmptyString(f);let O=null;try{O=await n([noopPlugin()]).process($,{from:f,to:f,map:{inline:!1,annotation:!1}})}catch{}await i.test("has expected output",()=>{e.deepEqual(P,y),e.deepEqual(E.warnings().length,l.warnings??0,`Unexpected number warnings:\n${E.warnings().toString()}`)}),await i.test("sourcemaps",()=>{e.ok(!E.map.toJSON().sources.includes("<no source>"),'Sourcemap is broken. This is most likely a newly created PostCSS AST Node without a value for "source". See: https://github.com/postcss/postcss/blob/main/docs/guidelines/plugin.md#24-set-nodesource-for-new-nodes')}),await i.test("output is parsable with PostCSS",()=>{e.deepEqual(O?.warnings(),[],"Unexpected warnings on second pass")}),await i.test("The oldest and current PostCSS version produce the same result",{skip:S},()=>{e.deepEqual(x?.css?.toString(),P)})})})}}noopPlugin.postcss=!0;const c={postcssPlugin:"declaration-cloner",Declaration(e){"to-clone"===e.prop&&e.cloneBefore({prop:"cloned"})}},p={postcssPlugin:"rule-cloner",prepare(){const e=new WeakSet;return{postcssPlugin:"rule-cloner",RuleExit(t){e.has(t)||"to-clone"===t.selector&&(e.add(t),t.cloneBefore({selector:"cloned"}))}}}},l={postcssPlugin:"at-rule-cloner",prepare(){const e=new WeakSet;return{postcssPlugin:"at-rule-cloner",AtRuleExit(t){if(!e.has(t))return"to-clone"===t.params?(e.add(t),void t.cloneBefore({params:"cloned"})):void("to-clone"===t.name&&(e.add(t),t.cloneBefore({name:"cloned"})))}}}};class PackageDescriptionError extends Error{constructor(e,t){super(e),this.name="PackageDescriptionError",this.stack=`${this.name}: ${this.message}\n at "${t}" (${a.pathToFileURL(o.resolve("package.json")).href}:1:1)`}}class OutcomeError extends Error{constructor(e,t){super(e),this.name="OutcomeError",this.stack=`${this.name}: ${this.message}\n at ${a.pathToFileURL(o.resolve(t)).href}:1:1`}}export{l as atRuleClonerPlugin,c as declarationClonerPlugin,postcssTape,p as ruleClonerPlugin};
2+
import e from"node:assert/strict";import s from"node:fs/promises";import t from"node:fs";import o from"node:path";import n from"postcss";import r from"postcss-8.4";import i from"node:test";import a from"node:url";const noopPlugin=()=>({postcssPlugin:"noop-plugin",Once(){}});async function fileContentsOrEmptyString(e){try{return await s.readFile(e,"utf8")}catch{return""}}function reduceInformationInCssSyntaxError(e){process.env.DEBUG||(delete e.source,e.input&&delete e.input.source,delete e.postcssNode)}function postcssTape(a,c){return async p=>{c=c??{},await i("`postcss` flag is set on exported plugin creator",()=>{e.equal(a.postcss,!0)}),await i("exported plugin creator is a function",()=>{e.equal(typeof a,"function")}),await i("`postcssPlugin` is set on a plugin instance",()=>{const s=a();e.ok(s.postcssPlugin),e.equal(typeof s.postcssPlugin,"string")}),await i("package.json",async t=>{const o=await s.readFile("./package.json","utf-8"),n=JSON.parse(o);await t.test('includes "postcss-plugin" keyword',()=>{e.ok(Array.isArray(n.keywords)&&n.keywords?.includes("postcss-plugin"),new PackageDescriptionError('Missing "postcss-plugin" keyword in package.json',"keywords"))}),await t.test('name starts with "postcss-"',{skip:c?.skipPackageNameCheck},()=>{let s="string"==typeof n.name?n.name:"";if(s.startsWith("@")){const e=s.split("/");s=e.slice(1).join("/")}e.ok(s.startsWith("postcss-"),new PackageDescriptionError(`package name "${s}" does not start with "postcss-"`,"name"))}),await t.test("`postcss` is a peer dependency and not a direct dependency",{skip:"postcssTapeSelfTest"in a},()=>{e.ok(Object.keys(Object(n.peerDependencies)).includes("postcss"),new PackageDescriptionError('"postcss" must be listed in "peerDependencies"',"peerDependencies")),e.ok(!Object.keys(Object(n.dependencies)).includes("postcss"),new PackageDescriptionError('"postcss" must not be listed in "dependencies"',"dependencies"))})});const l=a().postcssPlugin;await i(l,async i=>{for(const c in p)await i.test(c,async i=>{const l=p[c];l.before&&await l.before();const u=o.join(".","test",...c.split(":")[0].split(o.posix.sep)),d=o.join(".","test",...c.replace(/:/g,".").split(o.posix.sep)),m="css";let g=`${u}.${m}`,w=`${d}.expect.${m}`,f=`${d}.result.${m}`;l.source&&(g=o.join(".","test",l.source)),l.expect&&(w=o.join(".","test",l.expect)),l.result&&(f=o.join(".","test",l.result));const k=l.plugins??[a(l.options)],h=await fileContentsOrEmptyString(g),y=await fileContentsOrEmptyString(w);let E,x=null;const S=n([noopPlugin()]).version===r([noopPlugin()]).version;try{E=await n(k).process(h,{from:g,to:f,map:{inline:!1,annotation:!1}});try{x=S?null:await r(k).process(h,{from:g,to:f,map:{inline:!1,annotation:!1}})}catch{}}catch(e){if(!(e instanceof Error))throw e;if(reduceInformationInCssSyntaxError(e),l.exception&&l.exception.test(e.message))return;throw e}e.ok(!l.exception,new OutcomeError(`expected an exception matching "${l.exception}"`,g));const P=E.css.toString();{const e=[s.writeFile(f,P,"utf8")];process.env.REWRITE_EXPECTS&&e.push(s.writeFile(w,P,"utf8")),await Promise.all(e)}y||e.ok(t.existsSync(w),new OutcomeError(`Missing expect file: "${w}"`,g)),l.after&&await l.after();const $=await fileContentsOrEmptyString(f);let O=null;try{O=await n([noopPlugin()]).process($,{from:f,to:f,map:{inline:!1,annotation:!1}})}catch{}await i.test("has expected output",()=>{e.deepEqual(P,y),e.deepEqual(E.warnings().length,l.warnings??0,`Unexpected number warnings:\n${E.warnings().toString()}`)}),await i.test("sourcemaps",()=>{e.ok(!E.map.toJSON().sources.includes("<no source>"),'Sourcemap is broken. This is most likely a newly created PostCSS AST Node without a value for "source". See: https://github.com/postcss/postcss/blob/main/docs/guidelines/plugin.md#24-set-nodesource-for-new-nodes')}),await i.test("output is parsable with PostCSS",()=>{e.deepEqual(O?.warnings(),[],"Unexpected warnings on second pass")}),await i.test("The oldest and current PostCSS version produce the same result",{skip:S},()=>{e.deepEqual(x?.css?.toString()?.replaceAll(/\s+/g,""),P.replaceAll(/\s+/g,""))})})})}}noopPlugin.postcss=!0;const c={postcssPlugin:"declaration-cloner",Declaration(e){"to-clone"===e.prop&&e.cloneBefore({prop:"cloned"})}},p={postcssPlugin:"rule-cloner",prepare(){const e=new WeakSet;return{postcssPlugin:"rule-cloner",RuleExit(s){e.has(s)||"to-clone"===s.selector&&(e.add(s),s.cloneBefore({selector:"cloned"}))}}}},l={postcssPlugin:"at-rule-cloner",prepare(){const e=new WeakSet;return{postcssPlugin:"at-rule-cloner",AtRuleExit(s){if(!e.has(s))return"to-clone"===s.params?(e.add(s),void s.cloneBefore({params:"cloned"})):void("to-clone"===s.name&&(e.add(s),s.cloneBefore({name:"cloned"})))}}}};class PackageDescriptionError extends Error{constructor(e,s){super(e),this.name="PackageDescriptionError",this.stack=`${this.name}: ${this.message}\n at "${s}" (${a.pathToFileURL(o.resolve("package.json")).href}:1:1)`}}class OutcomeError extends Error{constructor(e,s){super(e),this.name="OutcomeError",this.stack=`${this.name}: ${this.message}\n at ${a.pathToFileURL(o.resolve(s)).href}:1:1`}}export{l as atRuleClonerPlugin,c as declarationClonerPlugin,postcssTape,p as ruleClonerPlugin};
33
/* node:coverage enable */

packages/postcss-tape/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export function postcssTape(pluginCreator: PluginCreator<unknown>, runOptions?:
281281
'The oldest and current PostCSS version produce the same result',
282282
{ skip: olderVersionAndCurrentVersionAreTheSame },
283283
() => {
284-
assert.deepEqual(resultFromOldestPostCSS?.css?.toString(), resultString);
284+
assert.deepEqual(resultFromOldestPostCSS?.css?.toString()?.replaceAll(/\s+/g, ''), resultString.replaceAll(/\s+/g, ''));
285285
},
286286
);
287287
});

plugin-packs/postcss-bundler/test/basic.expect.css

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,8 @@
2020
background: url("images/green.png?foo=bar");
2121
}
2222

23-
/* ./imports/minified-source.css */
24-
25-
.foo { --var: /* a comment */; bar: red }
26-
27-
.foo { color: red }
28-
29-
.foo { color: red }
30-
31-
.foo { color: rgb(0 0 0) }
32-
33-
.foo { color: rgb(0 0 0) }
34-
35-
.foo { color: rgb(0 0 0) }
36-
37-
/* node_modules:@rmenke/css-package-main */
38-
39-
.box {
23+
/* ./imports/minified-source.css */ .foo { --var: /* a comment */; bar: red } .foo { color: red } .foo { color: red } .foo { color: rgb(0 0 0) } .foo { color: rgb(0 0 0) } .foo { color: rgb(0 0 0) } /* node_modules:@rmenke/css-package-main */ .box {
4024
background-color: green;
41-
}
42-
43-
/* node_modules:@rmenke/css-package-conditional-3/styles */
44-
45-
.box {
25+
} /* node_modules:@rmenke/css-package-conditional-3/styles */ .box {
4626
background-color: green;
4727
}

plugin-packs/postcss-bundler/test/conditional-layer-before-external.expect.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* imports/layer-before-external.css */
22

33
@import "data:text/css;base64,QGxheWVyIHJlc2V0LCBib290c3RyYXA=" (min-width: 300px);
4-
54
@import "data:text/css;base64,QGltcG9ydCB1cmwoJ2h0dHBzOi8vY2RuLmpzZGVsaXZyLm5ldC9ucG0vYm9vdHN0cmFwQDUuMy4wL2Rpc3QvY3NzL2Jvb3RzdHJhcC5jc3MnKSAobWluLXdpZHRoOiAzMDBweCk=" layer(bootstrap);
65

76
@media (min-width: 300px){
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
@charset "utf-8";
2+
23
/* a.css */
4+
35
.box {
46
background-color: red;
57
}
8+
69
/* b.css */
10+
711
.box {
812
background-color: green;
913
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/* a.css */
22
/* b.css */
3+
34
.box {
45
background-color: red;
56
}
7+
68
.box {
79
background-color: green;
810
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
/* a.css */
2+
23
/* b.css */
4+
35
.box {
46
background-color: green;
57
}
8+
69
.box {
710
background-color: red;
811
}
12+
913
/* b.css */
14+
1015
/* a.css */
16+
1117
.box {
1218
background-color: red;
1319
}
20+
1421
.box {
1522
background-color: green;
1623
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
/* a.css */
2+
23
/* b.css */
4+
35
.box {
46
background-color: red;
57
}
8+
69
.box {
710
background-color: green;
811
}
12+
913
/* b.css */
14+
1015
/* a.css */
16+
1117
.box {
1218
background-color: green;
1319
}
20+
1421
.box {
1522
background-color: red;
1623
}
24+
1725
/* a.css */
26+
1827
/* b.css */
28+
1929
.box {
2030
background-color: red;
2131
}
32+
2233
.box {
2334
background-color: green;
2435
}

0 commit comments

Comments
 (0)