Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 8 additions & 14 deletions .github/bin/format-package-json.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,22 @@ const formatted = {};
delete packageJSONInfo.private;

formatted.engines = {
node: '>=18',
node: '>=20.19.0',
};
delete packageJSONInfo.engines;

// json only package
if (formatted.name === '@csstools/css-syntax-patches-for-csstree') {
delete formatted.engines;
}

formatted.type = packageJSONInfo.type;
delete packageJSONInfo.type;
}

// Exports and packaged
{
formatted.main = packageJSONInfo.main;
delete packageJSONInfo.main;

formatted.module = packageJSONInfo.module;
delete packageJSONInfo.module;

formatted.bin = packageJSONInfo.bin;
Expand All @@ -103,16 +105,8 @@ const formatted = {};
formatted.unpkg = packageJSONInfo.unpkg;
delete packageJSONInfo.unpkg;

if (packageJSONInfo.exports) {
formatted.exports = packageJSONInfo.exports;
if (packageJSONInfo.exports['.'] && packageJSONInfo.exports['.'].types) {
formatted.exports['.'] = {
types: packageJSONInfo.exports['.'].types,
...formatted.exports['.'],
};
}
delete packageJSONInfo.exports;
}
formatted.exports = packageJSONInfo.exports;
delete packageJSONInfo.exports;

formatted.files = packageJSONInfo.files;
delete packageJSONInfo.files;
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
schedule:
- cron: '0 4 * * 1'
workflow_dispatch:
push:
branches:
- 'main'
pull_request:

defaults:
run:
Expand Down Expand Up @@ -33,14 +37,5 @@ jobs:
languages: ${{ matrix.language }}
queries: security-extended

- name: setup node
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f
with:
node-version: 24
cache: 'npm'

- run: npm ci --ignore-scripts
- run: npm run build --workspaces --if-present

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# Enable annotations only for node 24 + ubuntu
matrix:
os: [ubuntu-latest]
node: [18, 20, 22, 24, 25]
node: [20, 22, 24, 25]
include:
- os: macos-latest
node: 24
Expand Down
5 changes: 5 additions & 0 deletions cli/csstools-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changes to CSSTools CLI

### Unreleased (major)

- Updated: Support for Node `20.19.0` or later (major).
- Removed: `commonjs` API. In supported Node versions `require(esm)` will work without needing to make code changes.

### 4.0.25

_January 10, 2026_
Expand Down
3 changes: 1 addition & 2 deletions cli/csstools-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@
}
],
"engines": {
"node": ">=18"
"node": ">=20.19.0"
},
"bin": {
"csstools-cli": "dist/cli.cjs"
},
"types": "dist/cli.d.ts",
"files": [
"CHANGELOG.md",
"LICENSE.md",
Expand Down
16 changes: 8 additions & 8 deletions e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion e2e/typescript/esm--node-next/dist/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
import assert from 'node:assert';
import plugin from 'postcss-preset-env';
plugin({ preserve: true });
plugin({
preserve: true,
features: {
'all-property': [true, { preserve: true }],
'any-link-pseudo-class': [false, { preserve: true }],
'cascade-layers': ['auto', { onImportLayerRule: 'warn' }],
'color-function': { preserve: true, enableProgressiveCustomProperties: false },
'color-mix': false,
'light-dark-function': true,
},
});
assert.ok(plugin.postcss, 'should have "postcss flag"');
assert.equal(typeof plugin, 'function', 'should return a function');
2 changes: 1 addition & 1 deletion e2e/webpack/bundle-through/index.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const postcss = require('postcss');
const postcssPresetEnv = require('postcss-preset-env');
const postcssPresetEnv = require('postcss-preset-env').default;

try {
postcss([postcssPresetEnv({
Expand Down
4 changes: 2 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default [
globals: {
...globals.node,
},
ecmaVersion: 2022,
ecmaVersion: 2025,
sourceType: 'module',
},

Expand Down Expand Up @@ -71,7 +71,7 @@ export default [
globals: {
...globals.browser,
},
ecmaVersion: 2022,
ecmaVersion: 2025,
sourceType: 'module',
},

Expand Down
5 changes: 5 additions & 0 deletions experimental/css-has-pseudo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changes to CSS Has Pseudo

### Unreleased (major)

- Updated: Support for Node `20.19.0` or later (major).
- Removed: `commonjs` API. In supported Node versions `require(esm)` will work without needing to make code changes.

### 1.0.0

_August 3, 2024_
Expand Down
1 change: 0 additions & 1 deletion experimental/css-has-pseudo/dist/index.cjs

This file was deleted.

1 change: 1 addition & 0 deletions experimental/css-has-pseudo/dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import type { PluginCreator } from 'postcss';

declare const creator: PluginCreator<unknown>;
export default creator;
export { creator as 'module.exports' }

export { }
2 changes: 1 addition & 1 deletion experimental/css-has-pseudo/dist/index.mjs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const creator=()=>({postcssPlugin:"css-has-pseudo-experimental",Once(s,{result:e}){s.warn(e,'"@csstools/css-has-pseudo-experimental" is no longer supported. Please use "css-has-pseudo" instead.')}});creator.postcss=!0;export{creator as default};
const creator=()=>({postcssPlugin:"css-has-pseudo-experimental",Once(s,{result:e}){s.warn(e,'"@csstools/css-has-pseudo-experimental" is no longer supported. Please use "css-has-pseudo" instead.')}});creator.postcss=!0;export{creator as default,creator as"module.exports"};
13 changes: 3 additions & 10 deletions experimental/css-has-pseudo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,13 @@
}
],
"engines": {
"node": ">=18"
"node": ">=20.19.0"
},
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
},
"require": {
"default": "./dist/index.cjs"
}
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
},
"./browser": {
"import": "./dist/browser.mjs",
Expand Down
1 change: 1 addition & 0 deletions experimental/css-has-pseudo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ const creator: PluginCreator<unknown> = () => {
creator.postcss = true;

export default creator;
export { creator as 'module.exports' };
5 changes: 5 additions & 0 deletions experimental/postcss-gradient-stop-increments/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changes to PostCSS Gradient Stop Increments

### Unreleased (major)

- Updated: Support for Node `20.19.0` or later (major).
- Removed: `commonjs` API. In supported Node versions `require(esm)` will work without needing to make code changes.

### 2.0.9

_May 27, 2025_
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { PluginCreator } from 'postcss';

declare const creator: PluginCreator<pluginOptions>;
export default creator;
export { creator as 'module.exports' }

/** postcss-gradient-stop-increments plugin options */
export declare type pluginOptions = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import{stringify as e,replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as t,isFunctionNode as a,isTokenNode as r,isCommentNode as o,TokenNode as s,FunctionNode as i,WhitespaceNode as c}from"@csstools/css-parser-algorithms";import{calcFromComponentValues as u}from"@csstools/css-calc";import{tokenize as l,isTokenDelim as v,TokenType as m,NumberType as d,isTokenNumeric as f}from"@csstools/css-tokenizer";const g=/(?:repeating-)?(?:linear|radial|conic)-gradient\(/i,p=/^(?:repeating-)?(?:linear|radial|conic)-gradient$/i,h=/^(?:abs|acos|asin|atan|atan2|calc|clamp|cos|exp|hypot|log|max|min|mod|pow|rem|round|sign|sin|sqrt|tan)$/i,creator=i=>{const c=Object.assign({preserve:!1},i);return{postcssPlugin:"postcss-gradient-stop-increments",Declaration(i){if(!g.test(i.value))return;const u=l({css:i.value});if(!u.find(e=>v(e)&&"+"===e[4].value))return;const f=e(n(t(u),e=>{if(!a(e))return;const n=e.getName();if(!p.test(n))return;let t=null;for(let n=0;n<e.value.length;n++){const i=e.value[n];if(r(i)&&v(i.value)&&"+"===i.value[4].value){const a=i,r=n;for(;o(e.value[n+1]);)n++;if(n++,isZeroOrNegative(e.value[n])){const t=new s([m.Number,"0",-1,-1,{value:0,type:d.Integer}]);e.value.splice(r,n-r+1,t),n=e.value.indexOf(t);continue}const c=incrementLengthNode(t,a,e.value[n]);e.value.splice(r,n-r+1,c),t=c,n=e.value.indexOf(c);continue}isNumericLargerThanZero(i)?t=maxOfLastAndCurrentLengthNode(t,i):a(i)&&h.test(i.getName())&&(t=maxOfLastAndCurrentLengthNode(t,i))}}));f!==i.value&&(i.cloneBefore({value:f}),c?.preserve||i.remove())}}};function isNumericLargerThanZero(e){return!!(r(e)&&f(e.value)&&e.value[4].value>0)}function isZeroOrNegative(e){return!!(r(e)&&f(e.value)&&e.value[4].value<=0)}function incrementLengthNode(e,n,t){if(!e)return t;const a=new i([m.Function,"calc(",-1,-1,{value:"calc"}],[m.CloseParen,")",-1,-1,void 0],[e,new c([[m.Whitespace," ",-1,-1,void 0]]),n,new c([[m.Whitespace," ",-1,-1,void 0]]),t]),[[r]]=u([[a]]);return r}function maxOfLastAndCurrentLengthNode(e,n){if(!e)return n;const t=new i([m.Function,"max(",-1,-1,{value:"max"}],[m.CloseParen,")",-1,-1,void 0],[e,new s([m.Comma,",",-1,-1,void 0]),new c([[m.Whitespace," ",-1,-1,void 0]]),n]),[[a]]=u([[t]]);return a}creator.postcss=!0;export{creator as default};
import{stringify as e,replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as t,isFunctionNode as a,isTokenNode as r,isCommentNode as o,TokenNode as s,FunctionNode as i,WhitespaceNode as c}from"@csstools/css-parser-algorithms";import{calcFromComponentValues as u}from"@csstools/css-calc";import{tokenize as l,isTokenDelim as v,TokenType as m,NumberType as d,isTokenNumeric as f}from"@csstools/css-tokenizer";const p=/(?:repeating-)?(?:linear|radial|conic)-gradient\(/i,g=/^(?:repeating-)?(?:linear|radial|conic)-gradient$/i,h=/^(?:abs|acos|asin|atan|atan2|calc|clamp|cos|exp|hypot|log|max|min|mod|pow|rem|round|sign|sin|sqrt|tan)$/i,creator=i=>{const c=Object.assign({preserve:!1},i);return{postcssPlugin:"postcss-gradient-stop-increments",Declaration(i){if(!p.test(i.value))return;const u=l({css:i.value});if(!u.find(e=>v(e)&&"+"===e[4].value))return;const f=e(n(t(u),e=>{if(!a(e))return;const n=e.getName();if(!g.test(n))return;let t=null;for(let n=0;n<e.value.length;n++){const i=e.value[n];if(r(i)&&v(i.value)&&"+"===i.value[4].value){const a=i,r=n;for(;o(e.value[n+1]);)n++;if(n++,isZeroOrNegative(e.value[n])){const t=new s([m.Number,"0",-1,-1,{value:0,type:d.Integer}]);e.value.splice(r,n-r+1,t),n=e.value.indexOf(t);continue}const c=incrementLengthNode(t,a,e.value[n]);e.value.splice(r,n-r+1,c),t=c,n=e.value.indexOf(c);continue}isNumericLargerThanZero(i)?t=maxOfLastAndCurrentLengthNode(t,i):a(i)&&h.test(i.getName())&&(t=maxOfLastAndCurrentLengthNode(t,i))}}));f!==i.value&&(i.cloneBefore({value:f}),c?.preserve||i.remove())}}};function isNumericLargerThanZero(e){return!!(r(e)&&f(e.value)&&e.value[4].value>0)}function isZeroOrNegative(e){return!!(r(e)&&f(e.value)&&e.value[4].value<=0)}function incrementLengthNode(e,n,t){if(!e)return t;const a=new i([m.Function,"calc(",-1,-1,{value:"calc"}],[m.CloseParen,")",-1,-1,void 0],[e,new c([[m.Whitespace," ",-1,-1,void 0]]),n,new c([[m.Whitespace," ",-1,-1,void 0]]),t]),[[r]]=u([[a]]);return r}function maxOfLastAndCurrentLengthNode(e,n){if(!e)return n;const t=new i([m.Function,"max(",-1,-1,{value:"max"}],[m.CloseParen,")",-1,-1,void 0],[e,new s([m.Comma,",",-1,-1,void 0]),new c([[m.Whitespace," ",-1,-1,void 0]]),n]),[[a]]=u([[t]]);return a}creator.postcss=!0;export{creator as default,creator as"module.exports"};
13 changes: 3 additions & 10 deletions experimental/postcss-gradient-stop-increments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,13 @@
}
],
"engines": {
"node": ">=18"
"node": ">=20.19.0"
},
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
},
"require": {
"default": "./dist/index.cjs"
}
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
1 change: 1 addition & 0 deletions experimental/postcss-gradient-stop-increments/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const creator: PluginCreator<pluginOptions> = (opts?: pluginOptions) => {
creator.postcss = true;

export default creator;
export { creator as 'module.exports' };

function isNumericLargerThanZero(node: ComponentValue): boolean {
if (
Expand Down
5 changes: 5 additions & 0 deletions experimental/postcss-nesting/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changes to PostCSS Nesting Experimental

### Unreleased (major)

- Updated: Support for Node `20.19.0` or later (major).
- Removed: `commonjs` API. In supported Node versions `require(esm)` will work without needing to make code changes.

### 3.0.1

_October 23, 2024_
Expand Down
1 change: 0 additions & 1 deletion experimental/postcss-nesting/dist/index.cjs

This file was deleted.

1 change: 1 addition & 0 deletions experimental/postcss-nesting/dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import type { PluginCreator } from 'postcss';

declare const creator: PluginCreator<never>;
export default creator;
export { creator as 'module.exports' }

export { }
Loading
Loading