Skip to content

Commit b6bd356

Browse files
authored
esm only (#1763)
1 parent 976df17 commit b6bd356

549 files changed

Lines changed: 1229 additions & 1577 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/bin/format-package-json.mjs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,22 @@ const formatted = {};
7575
delete packageJSONInfo.private;
7676

7777
formatted.engines = {
78-
node: '>=18',
78+
node: '>=20.19.0',
7979
};
8080
delete packageJSONInfo.engines;
8181

82+
// json only package
83+
if (formatted.name === '@csstools/css-syntax-patches-for-csstree') {
84+
delete formatted.engines;
85+
}
86+
8287
formatted.type = packageJSONInfo.type;
8388
delete packageJSONInfo.type;
8489
}
8590

8691
// Exports and packaged
8792
{
88-
formatted.main = packageJSONInfo.main;
8993
delete packageJSONInfo.main;
90-
91-
formatted.module = packageJSONInfo.module;
9294
delete packageJSONInfo.module;
9395

9496
formatted.bin = packageJSONInfo.bin;
@@ -103,16 +105,8 @@ const formatted = {};
103105
formatted.unpkg = packageJSONInfo.unpkg;
104106
delete packageJSONInfo.unpkg;
105107

106-
if (packageJSONInfo.exports) {
107-
formatted.exports = packageJSONInfo.exports;
108-
if (packageJSONInfo.exports['.'] && packageJSONInfo.exports['.'].types) {
109-
formatted.exports['.'] = {
110-
types: packageJSONInfo.exports['.'].types,
111-
...formatted.exports['.'],
112-
};
113-
}
114-
delete packageJSONInfo.exports;
115-
}
108+
formatted.exports = packageJSONInfo.exports;
109+
delete packageJSONInfo.exports;
116110

117111
formatted.files = packageJSONInfo.files;
118112
delete packageJSONInfo.files;

.github/workflows/codeql.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
schedule:
55
- cron: '0 4 * * 1'
66
workflow_dispatch:
7+
push:
8+
branches:
9+
- 'main'
10+
pull_request:
711

812
defaults:
913
run:
@@ -33,14 +37,5 @@ jobs:
3337
languages: ${{ matrix.language }}
3438
queries: security-extended
3539

36-
- name: setup node
37-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f
38-
with:
39-
node-version: 24
40-
cache: 'npm'
41-
42-
- run: npm ci --ignore-scripts
43-
- run: npm run build --workspaces --if-present
44-
4540
- name: Perform CodeQL Analysis
4641
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
# Enable annotations only for node 24 + ubuntu
2424
matrix:
2525
os: [ubuntu-latest]
26-
node: [18, 20, 22, 24, 25]
26+
node: [20, 22, 24, 25]
2727
include:
2828
- os: macos-latest
2929
node: 24

cli/csstools-cli/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changes to CSSTools CLI
22

3+
### Unreleased (major)
4+
5+
- Updated: Support for Node `20.19.0` or later (major).
6+
- Removed: `commonjs` API. In supported Node versions `require(esm)` will work without needing to make code changes.
7+
38
### 4.0.25
49

510
_January 10, 2026_

cli/csstools-cli/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@
2525
}
2626
],
2727
"engines": {
28-
"node": ">=18"
28+
"node": ">=20.19.0"
2929
},
3030
"bin": {
3131
"csstools-cli": "dist/cli.cjs"
3232
},
33-
"types": "dist/cli.d.ts",
3433
"files": [
3534
"CHANGELOG.md",
3635
"LICENSE.md",

e2e/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
import assert from 'node:assert';
22
import plugin from 'postcss-preset-env';
3-
plugin({ preserve: true });
3+
plugin({
4+
preserve: true,
5+
features: {
6+
'all-property': [true, { preserve: true }],
7+
'any-link-pseudo-class': [false, { preserve: true }],
8+
'cascade-layers': ['auto', { onImportLayerRule: 'warn' }],
9+
'color-function': { preserve: true, enableProgressiveCustomProperties: false },
10+
'color-mix': false,
11+
'light-dark-function': true,
12+
},
13+
});
414
assert.ok(plugin.postcss, 'should have "postcss flag"');
515
assert.equal(typeof plugin, 'function', 'should return a function');

e2e/webpack/bundle-through/index.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const postcss = require('postcss');
2-
const postcssPresetEnv = require('postcss-preset-env');
2+
const postcssPresetEnv = require('postcss-preset-env').default;
33

44
try {
55
postcss([postcssPresetEnv({

eslint.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default [
3434
globals: {
3535
...globals.node,
3636
},
37-
ecmaVersion: 2022,
37+
ecmaVersion: 2025,
3838
sourceType: 'module',
3939
},
4040

@@ -71,7 +71,7 @@ export default [
7171
globals: {
7272
...globals.browser,
7373
},
74-
ecmaVersion: 2022,
74+
ecmaVersion: 2025,
7575
sourceType: 'module',
7676
},
7777

experimental/css-has-pseudo/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changes to CSS Has Pseudo
22

3+
### Unreleased (major)
4+
5+
- Updated: Support for Node `20.19.0` or later (major).
6+
- Removed: `commonjs` API. In supported Node versions `require(esm)` will work without needing to make code changes.
7+
38
### 1.0.0
49

510
_August 3, 2024_

0 commit comments

Comments
 (0)