Skip to content

Commit 1b6e261

Browse files
committed
dropped support for Node.js 20, requires Node.js 22+ (BC break)
Node.js 20 reached end of life in April 2026. The CI matrix now runs 22 and 24, package.json declares engines >= 22, and the runtime guard around fs.globSync is gone, so glob entries work on every supported version. Also bumped actions/setup-node from v4 to v7.
1 parent 692de3b commit 1b6e261

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
uses: actions/checkout@v6
1818

1919
- name: Setup Node.js
20-
uses: actions/setup-node@v4
20+
uses: actions/setup-node@v7
2121
with:
22-
node-version: 20
22+
node-version: 22
2323
cache: 'npm'
2424

2525
- name: Install dependencies

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ jobs:
88

99
strategy:
1010
matrix:
11-
node-version: [20, 22]
11+
node-version: [22, 24]
1212

1313
steps:
1414
- name: Checkout code
1515
uses: actions/checkout@v6
1616

1717
- name: Setup Node.js ${{ matrix.node-version }}
18-
uses: actions/setup-node@v4
18+
uses: actions/setup-node@v7
1919
with:
2020
node-version: ${{ matrix.node-version }}
2121
cache: 'npm'

docs/internals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ covers direct `process.exit()` calls. Keep this one-time, process-scoped structu
4040
non-`localhost` host is also auto-whitelisted in `server.allowedHosts`, so a custom
4141
host works behind a proxy (e.g. Docker).
4242
- **Named entries are deliberately unsupported.** `resolveEntries` resolves patterns
43-
(including globs, which need Node 22+) to **absolute paths**, because Vite keys the
43+
(including globs) to **absolute paths**, because Vite keys the
4444
manifest by **source path, not input name** — a name would be invisible to `{asset}`
4545
on the PHP side.
4646
- **CORS is about which page origin may fetch from the dev server** — that origin is

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"import": "./dist/index.js"
2727
}
2828
},
29+
"engines": {
30+
"node": ">=22.0.0"
31+
},
2932
"peerDependencies": {
3033
"vite": "^6.2.0 || ^7.0.0 || ^8.0.0"
3134
},

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Installation
3636
npm install -D vite @nette/vite-plugin
3737
```
3838

39-
Works with Vite 6.2+, 7 and 8, on whichever Node.js version your Vite requires (glob patterns in `entry` additionally need Node.js 22+). On the PHP side you need [nette/assets](https://github.com/nette/assets).
39+
Works with Vite 6.2+, 7 and 8 on Node.js 22 or newer. On the PHP side you need [nette/assets](https://github.com/nette/assets).
4040

4141

4242
Quick Start
@@ -142,7 +142,7 @@ nette({
142142

143143
Insert them in the templates that need them: `{asset 'app.js'}` in the layout, `{asset 'admin.js'}` in the admin one.
144144

145-
When every entry point lives in its own directory, use a glob instead of a hand-written list. It is expanded relative to `root` and needs Node.js 22+:
145+
When every entry point lives in its own directory, use a glob instead of a hand-written list. It is expanded relative to `root`:
146146

147147
```js
148148
nette({

src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ function resolveEntries(entry: string | string[], root: string): string[] {
6363
let result = (new Set<string>);
6464
for (let pattern of Array.isArray(entry) ? entry : [entry]) {
6565
if (/[*?[{]/.test(pattern)) {
66-
if (typeof fs.globSync !== 'function') {
67-
throw new Error(`Glob entry patterns require Node.js 22 or newer (got "${pattern}").`);
68-
}
6966
for (let match of fs.globSync(pattern, { cwd: rootDir }).sort()) {
7067
result.add(path.resolve(rootDir, match));
7168
}

0 commit comments

Comments
 (0)