-
Notifications
You must be signed in to change notification settings - Fork 50
v11: release major (Node 22 baseline, lockfile repair) #2903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
023e7f4
a8c32e4
e08b278
7262b16
d6592bc
8487110
0b1abfc
b6bbd47
8f83f4c
5b9bec0
6036763
e30dea8
5e67f38
11d191b
814a99c
45fcc6d
c59ef01
d6dc79f
e463ec1
05ffbc0
92d9d3a
812fa85
754e34e
2da575b
2b4f0aa
0603c01
0c7f2b4
fb9e00f
db73ce5
16509d4
933bdce
f77da14
80caaab
ede8925
e132520
1d77cb3
f7ba5aa
38b02a3
eab7330
f425bfb
6b2bc46
5e3f72d
c154d85
a318141
73639b4
c6abf45
39d7eba
8ff8d3b
3deb5b6
926ae35
79ae434
1890679
0887d33
6ef9549
82936bb
730d4d4
200e492
0b84431
ad2c250
9ce056b
94db82e
4528ee0
3b6d2f0
abbd1f2
42a6b75
a4d2b77
f90dd37
e9aca87
8280183
47d3a93
4228f98
ee1f550
2afad53
3a5ec03
94b5bb0
7cab5c4
0bc6fe4
218e1f7
215ea24
903e57e
c6a4ff3
e8fdc46
1c8de13
1a1be73
892384d
82c3820
b87649a
aefa44f
a124d54
39a3426
33e46a3
f5255e9
f33ff48
6968861
311d3dc
bee3698
5d5067c
226bc26
f28d5dd
b8a4317
fecbfc4
03d7b8d
05cef7a
5377342
768a648
1771727
d665a4d
ed9f5d2
eaf02b6
d1029b3
8360cab
0cfc60e
af594d7
09253dc
ccc22ff
c5edee7
97f7b02
9d2d1a8
0cc3f32
de23599
c8cf1d7
78dc2b1
1faae2c
40cc771
a801d76
ad392c9
f250efb
e3a997a
56b0673
2047741
edc8ff4
4c14ca3
01ce5f2
ec86b73
18cfcb5
a71c901
3fff5a7
e1fb6a2
5d4a8b7
f7a7f8e
032ea79
b405e0a
272e2e5
d66690a
9542427
b4c4cd7
b8548bb
27074d5
3f77cc8
e5aadfe
5de85b4
168428b
0ec8a94
d8180c2
e4fa385
666c172
0094935
ad0d150
59c058a
b2dc29c
1d8484c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| "@node-minify/minify-html": patch | ||
| --- | ||
|
|
||
| Fix `minify-html` throwing `minifyHtmlLib.minify is not a function` at runtime. | ||
|
|
||
| `@minify-html/node` is a CommonJS native addon, so under Node's ESM loader its exports are reachable only through the default export. The compressor called `minify` off the namespace object, which is always `undefined` there, making the package fail on every input when consumed from real Node. | ||
|
|
||
| The bug was masked in CI: the error test mocked `@minify-html/node` with a flat `{ minify }` shape that does not match the real module, and Vitest's CommonJS interop resolved the namespace differently than Node does. The mock now mirrors the real default-export shape, and a regression test asserts the interop directly. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| "@node-minify/core": major | ||
| --- | ||
|
|
||
| v11: cleanup major release. | ||
|
|
||
| ### Breaking changes | ||
|
|
||
| - **Minimum Node.js is now 22**: `engines.node` moved from `>=20.0.0` to `>=22.0.0` across all packages. Node 20 reached end-of-life on 2026-04-30 and is no longer covered by CI (the test matrix runs 22.x and 24.x). Upgrade to Node 22 or later. | ||
| - **Removed 5 deprecated compressor packages**: `@node-minify/babel-minify`, `@node-minify/uglify-es`, `@node-minify/yui`, `@node-minify/sqwish`, `@node-minify/crass`. Use the recommended replacements (terser/oxc/swc/esbuild for JS, lightningcss/cssnano for CSS). | ||
| - **Removed `@node-minify/run`**: internal Java/process-spawn helper, no longer used by any compressor. | ||
| - **Removed deprecated type aliases** from `@node-minify/types`: `CompressorReturnType` (use `CompressorResult`) and `MinifyOptions` (use `Settings`). | ||
| - **Google Closure Compiler now uses the `google-closure-compiler` npm API** instead of invoking the Java JAR through `@node-minify/run`. Same flags and output. Note: the npm package still bundles `google-closure-compiler-java`, so Java may still be invoked under the hood — this change removes node-minify's custom Java plumbing, not Java itself. | ||
|
|
||
| ### New features | ||
|
|
||
| - **Compressor support tiers**: shared status registry in `@node-minify/utils` (`recommended` / `supported` / `legacy` / `removed`), surfaced in CLI help and the GitHub Action. | ||
| - **`node-minify doctor`**: read-only CLI command covering every v11 break. Scans `package.json`, source imports, `compressor:` values and workflow YAML for removed/legacy compressors, the removed `@node-minify/run` package, the removed `CompressorReturnType`/`MinifyOptions` type aliases, and `engines.node` ranges that still allow Node below 22. Exits non-zero on errors so it can gate CI. | ||
| - **CLI and Action fail early** when a removed compressor is requested, pointing at the replacement. | ||
| - **GCC runtime controls**: configurable `buffer` limit (kills the child process when stdout/stderr exceeds it) plus hardened process/timeout/error handling. | ||
|
|
||
| ### Migration | ||
|
|
||
| See the [v11 migration guide](https://github.com/srod/node-minify/blob/main/docs/src/content/docs/guides/v11-migration.md), or run `npx --package=@node-minify/cli -- node-minify doctor` in your project. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Shell scripts must keep LF endings: the Windows CI legs run them through Git | ||
| # Bash, which fails to parse `set -euo pipefail\r` if Git checks them out CRLF. | ||
| *.sh text eol=lf |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -109,7 +109,7 @@ async function run(): Promise<void> { | |||||
|
|
||||||
| console.log(`Minifying ${inputFile} with ${label}...`); | ||||||
|
|
||||||
| const requiresType = ["esbuild", "yui"].includes(compressorName); | ||||||
| const requiresType = compressorName === "esbuild"; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: yui still requires a type: @node-minify/yui@10.5.0 throws "You must specify a type: js or css" when Prompt for AI agents
Suggested change
|
||||||
| if (requiresType && !fileType) { | ||||||
| console.error( | ||||||
| `::error::Compressor '${compressorName}' requires the 'type' input (js or css)` | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: When a workflow passes
compressor: yui, the install step still runsbun add @node-minify/yui(the yui entry remains in compressor-registry), but the yui Java setup and its deprecation warning were removed. yui requires Java, so remaining users get no explicit Java provisioning and no guidance, and fail only at minification time. Since yui is being dropped, fail fast instead: reject theyuiinput with a clear error in the alias mapping, or keep the Java setup and warning.Prompt for AI agents