@csstools/postcss-syntax-descriptor-syntax-production 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,7 +1,11 @@
1
1
  # Changes to PostCSS Syntax Descriptor Syntax Production
2
2
 
3
- ### 1.0.0
3
+ ### 2.0.0
4
4
 
5
- _December 27, 2025_
5
+ _January 14, 2026_
6
6
 
7
- - Initial version
7
+ - Updated: Support for Node `20.19.0` or later (major).
8
+ - Removed: `commonjs` API. In supported Node versions `require(esm)` will work without needing to make code changes.
9
+ - Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`4.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#400) (major)
10
+
11
+ [Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-syntax-descriptor-syntax-production/CHANGELOG.md)
package/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
  @property --color {
17
17
  inherits: true;
18
18
  initial-value: black;
19
- color: "<color>";
19
+ syntax: "<color>";
20
20
  }
21
21
  ```
22
22
 
@@ -64,7 +64,7 @@ postcssSyntaxDescriptorSyntaxProduction({ preserve: true })
64
64
  @property --color {
65
65
  inherits: true;
66
66
  initial-value: black;
67
- color: "<color>";
67
+ syntax: "<color>";
68
68
  syntax: <color>;
69
69
  }
70
70
  ```
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { PluginCreator } from 'postcss';
2
2
 
3
3
  declare const creator: PluginCreator<pluginOptions>;
4
4
  export default creator;
5
+ export { creator as 'module.exports' }
5
6
 
6
7
  /** postcss-syntax-descriptor-syntax-production plugin options */
7
8
  export declare type pluginOptions = {
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{tokenize as e,isTokenComment as s,isTokenWhitespace as a}from"@csstools/css-tokenizer";const c=/^property$/i,t=/^syntax$/i,creator=r=>{const o=Object.assign({preserve:!1},r);return{postcssPlugin:"postcss-syntax-descriptor-syntax-production",Declaration(r){if(!t.test(r.prop))return;if(!r.parent||"atrule"!==r.parent.type)return;if(!c.test(r.parent.name))return;const n=r.value,i=e({css:r.value});let p="";i.forEach(e=>{s(e)||(a(e)?p+=" ":p+=e[1])});let f='"';for(const e of p){const s=e.codePointAt(0);if(void 0!==s)switch(s){case 0:f+=String.fromCodePoint(65533);break;case 34:case 92:f+="\\"+String.fromCodePoint(s);break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 127:f+="\\"+s.toString(16)+" ";break;default:f+=String.fromCodePoint(s)}}f+='"',n!==f&&(r.cloneBefore({prop:"color",value:f}),o.preserve||r.remove())}}};creator.postcss=!0;export{creator as default};
1
+ import{tokenize as e,isTokenWhiteSpaceOrComment as s,isTokenEOF as a,isTokenString as t,isTokenComment as c,isTokenWhitespace as r}from"@csstools/css-tokenizer";const o=/^property$/i,n=/^syntax$/i,creator=i=>{const p=Object.assign({preserve:!1},i);return{postcssPlugin:"postcss-syntax-descriptor-syntax-production",Declaration(i){if(!n.test(i.prop))return;if(!i.parent||"atrule"!==i.parent.type)return;if(!o.test(i.parent.name))return;const f=i.prev();if(f&&"decl"===f.type&&n.test(f.prop))return;const l=i.value,u=e({css:i.value}),d=u.filter(e=>!(s(e)||a(e)));if(1===d.length&&t(d[0]))return;let m="";u.forEach(e=>{c(e)||(r(e)?m+=" ":m+=e[1])});let v='"';for(const e of m){const s=e.codePointAt(0);if(void 0!==s)switch(s){case 0:v+=String.fromCodePoint(65533);break;case 34:case 92:v+="\\"+String.fromCodePoint(s);break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 127:v+="\\"+s.toString(16)+" ";break;default:v+=String.fromCodePoint(s)}}v+='"',l!==v&&(i.cloneBefore({value:v}),p.preserve||i.remove())}}};creator.postcss=!0;export{creator as default,creator as"module.exports"};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@csstools/postcss-syntax-descriptor-syntax-production",
3
3
  "description": "Use the syntax production in syntax descriptors",
4
- "version": "1.0.0",
4
+ "version": "2.0.0",
5
5
  "contributors": [
6
6
  {
7
7
  "name": "Antonio Laguna",
@@ -25,20 +25,13 @@
25
25
  }
26
26
  ],
27
27
  "engines": {
28
- "node": ">=18"
28
+ "node": ">=20.19.0"
29
29
  },
30
30
  "type": "module",
31
- "main": "dist/index.cjs",
32
- "module": "dist/index.mjs",
33
31
  "exports": {
34
32
  ".": {
35
- "import": {
36
- "types": "./dist/index.d.ts",
37
- "default": "./dist/index.mjs"
38
- },
39
- "require": {
40
- "default": "./dist/index.cjs"
41
- }
33
+ "types": "./dist/index.d.ts",
34
+ "default": "./dist/index.mjs"
42
35
  }
43
36
  },
44
37
  "files": [
@@ -48,7 +41,7 @@
48
41
  "dist"
49
42
  ],
50
43
  "dependencies": {
51
- "@csstools/css-tokenizer": "^3.0.4"
44
+ "@csstools/css-tokenizer": "^4.0.0"
52
45
  },
53
46
  "peerDependencies": {
54
47
  "postcss": "^8.4"
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";var e=require("@csstools/css-tokenizer");const s=/^property$/i,c=/^syntax$/i,creator=a=>{const t=Object.assign({preserve:!1},a);return{postcssPlugin:"postcss-syntax-descriptor-syntax-production",Declaration(a){if(!c.test(a.prop))return;if(!a.parent||"atrule"!==a.parent.type)return;if(!s.test(a.parent.name))return;const o=a.value,r=e.tokenize({css:a.value});let n="";r.forEach(s=>{e.isTokenComment(s)||(e.isTokenWhitespace(s)?n+=" ":n+=s[1])});let i='"';for(const e of n){const s=e.codePointAt(0);if(void 0!==s)switch(s){case 0:i+=String.fromCodePoint(65533);break;case 34:case 92:i+="\\"+String.fromCodePoint(s);break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 127:i+="\\"+s.toString(16)+" ";break;default:i+=String.fromCodePoint(s)}}i+='"',o!==i&&(a.cloneBefore({prop:"color",value:i}),t.preserve||a.remove())}}};creator.postcss=!0,module.exports=creator;