Repository navigation
chore: release v11.0.2 (develop → main) #2956
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
39689fe
test: make negative tests fail when nothing throws (#2953)
srod ce1a1c2
fix(oxc): report oxc parse errors instead of an empty result (#2954)
srod 8903c65
fix(core): fail when an input glob matches no file (#2955)
srod ed9c912
Merge branch 'main' into develop
srod c47416b
docs(changeset): narrow the glob no-match wording (#2957)
srod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@node-minify/core": patch | ||
| --- | ||
|
|
||
| Fail when no input file is left after glob expansion. | ||
|
|
||
| `minify()` used to resolve with an empty string and write nothing when a wildcard input such as `src/**/*.js` matched nothing and the output used `$1`; with a plain output it failed with `No content provided`. Both cases now throw `No files matched input pattern: <pattern>`. An array where at least one entry matches keeps working, and unmatched globs in it are skipped as before. Explicit empty arrays and in-memory `content` are unaffected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@node-minify/oxc": patch | ||
| --- | ||
|
|
||
| Fix the oxc compressor ignoring parse errors reported by `oxc-minify`. | ||
|
|
||
| A JavaScript syntax error used to surface as `No content provided`, or as a silent success when `allowEmptyOutput` was set. It now fails with `oxc minification failed: <oxc's message>`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| /*! | ||
| * node-minify | ||
| * Copyright (c) 2011-2026 Rodolphe Stoclin | ||
| * MIT Licensed | ||
| */ | ||
|
|
||
| import { randomUUID } from "node:crypto"; | ||
| import os from "node:os"; | ||
| import path from "node:path"; | ||
| import type { Compressor } from "@node-minify/types"; | ||
| import { describe, expect, test } from "vitest"; | ||
| import { setup } from "../src/setup.ts"; | ||
|
|
||
| const compressor: Compressor = async () => ({ code: "" }); | ||
| const noMatch = path | ||
| .join(os.tmpdir(), `node-minify-no-such-dir-${randomUUID()}`, "**", "*.js") | ||
| .replaceAll("\\", "/"); | ||
|
|
||
| describe("setup glob with no matching files", () => { | ||
| test("throws when a string glob with $1 output matches no file", () => { | ||
| expect(() => | ||
| setup({ | ||
| compressor, | ||
| input: noMatch, | ||
| output: "out/$1.min.js", | ||
| }) | ||
| ).toThrow("No files matched input pattern"); | ||
| }); | ||
|
|
||
| test("throws when a string glob with plain output matches no file", () => { | ||
| expect(() => | ||
| setup({ | ||
| compressor, | ||
| input: noMatch, | ||
| output: "out.js", | ||
| }) | ||
| ).toThrow("No files matched input pattern"); | ||
| }); | ||
|
|
||
| test("throws when an array containing only an unmatched glob is given", () => { | ||
| expect(() => | ||
| setup({ | ||
| compressor, | ||
| input: [noMatch], | ||
| output: "out.js", | ||
| }) | ||
| ).toThrow("No files matched input pattern"); | ||
| }); | ||
|
|
||
| test("includes the unmatched pattern in the error message", () => { | ||
| expect(() => | ||
| setup({ | ||
| compressor, | ||
| input: noMatch, | ||
| output: "out.js", | ||
| }) | ||
| ).toThrow(noMatch); | ||
| }); | ||
|
|
||
| test("does not throw from setup for a non-glob missing file", () => { | ||
| expect(() => | ||
| setup({ | ||
| compressor, | ||
| input: "missing.js", | ||
| output: "out.js", | ||
| }) | ||
| ).not.toThrow(); | ||
| }); | ||
|
|
||
| test("does not throw from setup in in-memory mode", () => { | ||
| expect(() => | ||
| setup({ | ||
| compressor, | ||
| content: "var a = 1;", | ||
| }) | ||
| ).not.toThrow(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.