@node-minify/cli 10.4.0 → 10.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +30 -30
- package/dist/bin/cli.js.map +1 -1
- package/dist/index.d.ts +0 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -2
- package/dist/index.js.map +1 -0
- package/dist/{src-DWQ6qSE1.js → spinner-DhrxzYjU.js} +5 -71
- package/dist/spinner-DhrxzYjU.js.map +1 -0
- package/package.json +22 -22
- package/dist/src-DWQ6qSE1.js.map +0 -1
package/dist/bin/cli.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { i as AVAILABLE_MINIFIER } from "../spinner-DhrxzYjU.js";
|
|
3
|
+
import { run } from "../index.js";
|
|
3
4
|
import ora from "ora";
|
|
4
5
|
import { benchmark, getReporter } from "@node-minify/benchmark";
|
|
5
6
|
import { Command } from "commander";
|
|
6
7
|
import updateNotifier from "update-notifier";
|
|
7
8
|
|
|
8
9
|
//#region package.json
|
|
9
|
-
var version = "10.
|
|
10
|
+
var version = "10.5.0";
|
|
10
11
|
var package_default = {
|
|
11
12
|
name: "@node-minify/cli",
|
|
12
13
|
version,
|
|
@@ -53,31 +54,31 @@ var package_default = {
|
|
|
53
54
|
"dev": "tsdown src/index.ts --watch"
|
|
54
55
|
},
|
|
55
56
|
dependencies: {
|
|
56
|
-
"@node-minify/
|
|
57
|
-
"@node-minify/
|
|
58
|
-
"@node-minify/utils": "10.
|
|
57
|
+
"@node-minify/benchmark": "10.5.0",
|
|
58
|
+
"@node-minify/core": "10.5.0",
|
|
59
|
+
"@node-minify/utils": "10.5.0",
|
|
59
60
|
"chalk": "5.6.2",
|
|
60
|
-
"commander": "14.0.
|
|
61
|
-
"ora": "9.
|
|
61
|
+
"commander": "14.0.3",
|
|
62
|
+
"ora": "9.3.0",
|
|
62
63
|
"update-notifier": "7.3.1"
|
|
63
64
|
},
|
|
64
65
|
devDependencies: {
|
|
65
|
-
"@node-minify/clean-css": "10.
|
|
66
|
-
"@node-minify/cssnano": "10.
|
|
67
|
-
"@node-minify/csso": "10.
|
|
68
|
-
"@node-minify/esbuild": "10.
|
|
69
|
-
"@node-minify/google-closure-compiler": "10.
|
|
70
|
-
"@node-minify/imagemin": "10.
|
|
71
|
-
"@node-minify/jsonminify": "10.
|
|
72
|
-
"@node-minify/lightningcss": "10.
|
|
73
|
-
"@node-minify/oxc": "10.
|
|
74
|
-
"@node-minify/sharp": "10.
|
|
75
|
-
"@node-minify/svgo": "10.
|
|
76
|
-
"@node-minify/swc": "10.
|
|
77
|
-
"@node-minify/terser": "10.
|
|
78
|
-
"@node-minify/types": "10.
|
|
79
|
-
"@node-minify/uglify-js": "10.
|
|
80
|
-
"@node-minify/yui": "10.
|
|
66
|
+
"@node-minify/clean-css": "10.5.0",
|
|
67
|
+
"@node-minify/cssnano": "10.5.0",
|
|
68
|
+
"@node-minify/csso": "10.5.0",
|
|
69
|
+
"@node-minify/esbuild": "10.5.0",
|
|
70
|
+
"@node-minify/google-closure-compiler": "10.5.0",
|
|
71
|
+
"@node-minify/imagemin": "10.5.0",
|
|
72
|
+
"@node-minify/jsonminify": "10.5.0",
|
|
73
|
+
"@node-minify/lightningcss": "10.5.0",
|
|
74
|
+
"@node-minify/oxc": "10.5.0",
|
|
75
|
+
"@node-minify/sharp": "10.5.0",
|
|
76
|
+
"@node-minify/svgo": "10.5.0",
|
|
77
|
+
"@node-minify/swc": "10.5.0",
|
|
78
|
+
"@node-minify/terser": "10.5.0",
|
|
79
|
+
"@node-minify/types": "10.5.0",
|
|
80
|
+
"@node-minify/uglify-js": "10.5.0",
|
|
81
|
+
"@node-minify/yui": "10.5.0"
|
|
81
82
|
}
|
|
82
83
|
};
|
|
83
84
|
|
|
@@ -119,29 +120,28 @@ function setupProgram() {
|
|
|
119
120
|
}
|
|
120
121
|
});
|
|
121
122
|
program.command("benchmark <input>").description("Benchmark compressors on input files").option("-c, --compressors [compressors]", "comma-separated list of compressors").option("-n, --iterations [iterations]", "number of iterations", "1").option("-f, --format [format]", "output format: console|json|markdown", "console").option("-o, --output [output]", "output file path").option("--gzip", "include gzip size").option("--brotli", "include brotli size").option("-v, --verbose", "verbose output").action(async (input, options) => {
|
|
122
|
-
const
|
|
123
|
-
const spinner = ora("Benchmarking...").start();
|
|
123
|
+
const spinner = options.format !== "json" && !!process.stderr.isTTY ? ora("Benchmarking...").start() : null;
|
|
124
124
|
try {
|
|
125
125
|
const results = await benchmark({
|
|
126
126
|
input,
|
|
127
|
-
compressors: options.compressors?.split(",")
|
|
127
|
+
compressors: options.compressors?.split(","),
|
|
128
128
|
iterations: parseInt(options.iterations, 10),
|
|
129
129
|
format: options.format,
|
|
130
130
|
output: options.output,
|
|
131
131
|
includeGzip: !!options.gzip,
|
|
132
132
|
includeBrotli: !!options.brotli,
|
|
133
|
-
type:
|
|
133
|
+
type: program.opts().type,
|
|
134
134
|
verbose: !!options.verbose,
|
|
135
135
|
onProgress: (compressor, file) => {
|
|
136
|
-
spinner.text = `Benchmarking ${compressor} on ${file}...`;
|
|
136
|
+
if (spinner) spinner.text = `Benchmarking ${compressor} on ${file}...`;
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
|
-
spinner
|
|
139
|
+
spinner?.stop();
|
|
140
140
|
const reporter = getReporter(options.format);
|
|
141
141
|
console.log(reporter(results));
|
|
142
142
|
process.exit(0);
|
|
143
143
|
} catch (error) {
|
|
144
|
-
spinner
|
|
144
|
+
spinner?.fail("Benchmark failed");
|
|
145
145
|
console.error(error);
|
|
146
146
|
process.exit(1);
|
|
147
147
|
}
|
package/dist/bin/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":["packageJson.version","packageJson"],"sources":["../../package.json","../../src/bin/cli.ts"],"sourcesContent":["","#!/usr/bin/env node\n\n/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\nimport { benchmark, getReporter } from \"@node-minify/benchmark\";\nimport { Command } from \"commander\";\nimport ora from \"ora\";\nimport updateNotifier from \"update-notifier\";\nimport packageJson from \"../../package.json\" with { type: \"json\" };\nimport { AVAILABLE_MINIFIER } from \"../config.ts\";\nimport type { SettingsWithCompressor } from \"../index.ts\";\nimport { run } from \"../index.ts\";\n\nconst DEFAULT_COMPRESSOR = \"uglify-js\";\n\n/**\n * Create and configure the command-line interface for the node-minify tool.\n *\n * Configures options for selecting a compressor, input and output paths, file\n * type, silence mode, and compressor-specific options; registers a help hook\n * that displays available compressors and sets the CLI version.\n *\n * @returns The configured Command instance ready to parse CLI arguments.\n */\nfunction setupProgram(): Command {\n const program = new Command();\n\n program\n .storeOptionsAsProperties()\n .version(packageJson.version, \"-v, --version\")\n .option(\n \"-c, --compressor [compressor]\",\n \"compressor name, npm package, or path to local file [uglify-js]\",\n DEFAULT_COMPRESSOR\n )\n .option(\n \"-i, --input [file]\",\n \"input file path\",\n (val: string, memo: string[]) => {\n memo.push(val);\n return memo;\n },\n []\n )\n .option(\"-o, --output [file]\", \"output file path\")\n .option(\n \"-t, --type [type]\",\n \"file type: js or css (required for esbuild, yui)\"\n )\n .option(\"-s, --silence\", \"no output will be printed\")\n .option(\n \"--allow-empty-output\",\n \"Skip writing output when result is empty\"\n )\n .option(\n \"-O, --option [option]\",\n \"option for the compressor as JSON object\",\n \"\"\n )\n .action(async () => {\n const options: SettingsWithCompressor = program.opts();\n const hasInput =\n Array.isArray(options.input) && options.input.length > 0;\n if (!options.compressor || !hasInput || !options.output) {\n program.help();\n return;\n }\n try {\n await run(options);\n process.exit(0);\n } catch (error) {\n console.error(error);\n process.exit(1);\n }\n });\n\n program\n .command(\"benchmark <input>\")\n .description(\"Benchmark compressors on input files\")\n .option(\n \"-c, --compressors [compressors]\",\n \"comma-separated list of compressors\"\n )\n .option(\"-n, --iterations [iterations]\", \"number of iterations\", \"1\")\n .option(\n \"-f, --format [format]\",\n \"output format: console|json|markdown\",\n \"console\"\n )\n .option(\"-o, --output [output]\", \"output file path\")\n .option(\"--gzip\", \"include gzip size\")\n .option(\"--brotli\", \"include brotli size\")\n .option(\"-v, --verbose\", \"verbose output\")\n .action(async (input, options) => {\n const
|
|
1
|
+
{"version":3,"file":"cli.js","names":["packageJson.version","packageJson"],"sources":["../../package.json","../../src/bin/cli.ts"],"sourcesContent":["","#!/usr/bin/env node\n\n/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\nimport { benchmark, getReporter } from \"@node-minify/benchmark\";\nimport { Command } from \"commander\";\nimport ora from \"ora\";\nimport updateNotifier from \"update-notifier\";\nimport packageJson from \"../../package.json\" with { type: \"json\" };\nimport { AVAILABLE_MINIFIER } from \"../config.ts\";\nimport type { SettingsWithCompressor } from \"../index.ts\";\nimport { run } from \"../index.ts\";\n\nconst DEFAULT_COMPRESSOR = \"uglify-js\";\n\n/**\n * Create and configure the command-line interface for the node-minify tool.\n *\n * Configures options for selecting a compressor, input and output paths, file\n * type, silence mode, and compressor-specific options; registers a help hook\n * that displays available compressors and sets the CLI version.\n *\n * @returns The configured Command instance ready to parse CLI arguments.\n */\nfunction setupProgram(): Command {\n const program = new Command();\n\n program\n .storeOptionsAsProperties()\n .version(packageJson.version, \"-v, --version\")\n .option(\n \"-c, --compressor [compressor]\",\n \"compressor name, npm package, or path to local file [uglify-js]\",\n DEFAULT_COMPRESSOR\n )\n .option(\n \"-i, --input [file]\",\n \"input file path\",\n (val: string, memo: string[]) => {\n memo.push(val);\n return memo;\n },\n []\n )\n .option(\"-o, --output [file]\", \"output file path\")\n .option(\n \"-t, --type [type]\",\n \"file type: js or css (required for esbuild, yui)\"\n )\n .option(\"-s, --silence\", \"no output will be printed\")\n .option(\n \"--allow-empty-output\",\n \"Skip writing output when result is empty\"\n )\n .option(\n \"-O, --option [option]\",\n \"option for the compressor as JSON object\",\n \"\"\n )\n .action(async () => {\n const options: SettingsWithCompressor = program.opts();\n const hasInput =\n Array.isArray(options.input) && options.input.length > 0;\n if (!options.compressor || !hasInput || !options.output) {\n program.help();\n return;\n }\n try {\n await run(options);\n process.exit(0);\n } catch (error) {\n console.error(error);\n process.exit(1);\n }\n });\n\n program\n .command(\"benchmark <input>\")\n .description(\"Benchmark compressors on input files\")\n .option(\n \"-c, --compressors [compressors]\",\n \"comma-separated list of compressors\"\n )\n .option(\"-n, --iterations [iterations]\", \"number of iterations\", \"1\")\n .option(\n \"-f, --format [format]\",\n \"output format: console|json|markdown\",\n \"console\"\n )\n .option(\"-o, --output [output]\", \"output file path\")\n .option(\"--gzip\", \"include gzip size\")\n .option(\"--brotli\", \"include brotli size\")\n .option(\"-v, --verbose\", \"verbose output\")\n .action(async (input, options) => {\n const shouldUseSpinner =\n options.format !== \"json\" && !!process.stderr.isTTY;\n const spinner = shouldUseSpinner\n ? ora(\"Benchmarking...\").start()\n : null;\n try {\n const results = await benchmark({\n input,\n compressors: options.compressors?.split(\",\"),\n iterations: parseInt(options.iterations, 10),\n format: options.format,\n output: options.output,\n includeGzip: !!options.gzip,\n includeBrotli: !!options.brotli,\n type: program.opts().type,\n verbose: !!options.verbose,\n onProgress: (compressor: string, file: string) => {\n if (spinner) {\n spinner.text = `Benchmarking ${compressor} on ${file}...`;\n }\n },\n });\n\n spinner?.stop();\n const reporter = getReporter(options.format);\n console.log(reporter(results));\n process.exit(0);\n } catch (error) {\n spinner?.fail(\"Benchmark failed\");\n console.error(error);\n process.exit(1);\n }\n });\n\n program.on(\"--help\", displayCompressorsList);\n\n return program;\n}\n\n/**\n * Prints the list of available compressors to standard output.\n *\n * Outputs a header, each compressor name prefixed with a dash, and a trailing blank line.\n */\nfunction displayCompressorsList() {\n console.log(\" List of compressors:\");\n console.log(\"\");\n AVAILABLE_MINIFIER.forEach((compressor) => {\n console.log(` - ${compressor.name}`);\n });\n console.log(\"\");\n}\n\n/**\n * Initialize the update notifier and start parsing command-line arguments for the CLI.\n *\n * Registers the package update notifier and parses process.argv with the configured command-line program.\n */\nasync function main(): Promise<void> {\n updateNotifier({ pkg: packageJson }).notify();\n\n const program = setupProgram();\n await program.parseAsync(process.argv);\n}\n\nmain();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACiBA,MAAM,qBAAqB;;;;;;;;;;AAW3B,SAAS,eAAwB;CAC7B,MAAM,UAAU,IAAI,SAAS;AAE7B,SACK,0BAA0B,CAC1B,QAAQA,SAAqB,gBAAgB,CAC7C,OACG,iCACA,mEACA,mBACH,CACA,OACG,sBACA,oBACC,KAAa,SAAmB;AAC7B,OAAK,KAAK,IAAI;AACd,SAAO;IAEX,EAAE,CACL,CACA,OAAO,uBAAuB,mBAAmB,CACjD,OACG,qBACA,mDACH,CACA,OAAO,iBAAiB,4BAA4B,CACpD,OACG,wBACA,2CACH,CACA,OACG,yBACA,4CACA,GACH,CACA,OAAO,YAAY;EAChB,MAAM,UAAkC,QAAQ,MAAM;EACtD,MAAM,WACF,MAAM,QAAQ,QAAQ,MAAM,IAAI,QAAQ,MAAM,SAAS;AAC3D,MAAI,CAAC,QAAQ,cAAc,CAAC,YAAY,CAAC,QAAQ,QAAQ;AACrD,WAAQ,MAAM;AACd;;AAEJ,MAAI;AACA,SAAM,IAAI,QAAQ;AAClB,WAAQ,KAAK,EAAE;WACV,OAAO;AACZ,WAAQ,MAAM,MAAM;AACpB,WAAQ,KAAK,EAAE;;GAErB;AAEN,SACK,QAAQ,oBAAoB,CAC5B,YAAY,uCAAuC,CACnD,OACG,mCACA,sCACH,CACA,OAAO,iCAAiC,wBAAwB,IAAI,CACpE,OACG,yBACA,wCACA,UACH,CACA,OAAO,yBAAyB,mBAAmB,CACnD,OAAO,UAAU,oBAAoB,CACrC,OAAO,YAAY,sBAAsB,CACzC,OAAO,iBAAiB,iBAAiB,CACzC,OAAO,OA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
*/
|
|
@@ -8,7 +7,6 @@ type CompressorOutput = {
|
|
|
8
7
|
* Format of the output (e.g., 'webp', 'avif').
|
|
9
8
|
*/
|
|
10
9
|
format?: string;
|
|
11
|
-
|
|
12
10
|
/**
|
|
13
11
|
* Output content as string or Buffer.
|
|
14
12
|
*/
|
|
@@ -22,19 +20,16 @@ type CompressorResult = {
|
|
|
22
20
|
* Minified content as string (for text-based formats like JS, CSS, HTML, SVG).
|
|
23
21
|
*/
|
|
24
22
|
code: string;
|
|
25
|
-
|
|
26
23
|
/**
|
|
27
24
|
* Source map (for JS/CSS compressors).
|
|
28
25
|
*/
|
|
29
26
|
map?: string;
|
|
30
|
-
|
|
31
27
|
/**
|
|
32
28
|
* Minified content as Buffer (for binary formats like images).
|
|
33
29
|
* @example
|
|
34
30
|
* When using sharp for PNG/WebP compression
|
|
35
31
|
*/
|
|
36
32
|
buffer?: Buffer;
|
|
37
|
-
|
|
38
33
|
/**
|
|
39
34
|
* Multiple outputs for multi-format image compression.
|
|
40
35
|
* Used when converting to multiple formats simultaneously.
|
|
@@ -80,12 +75,10 @@ type Settings<TOptions extends CompressorOptions = CompressorOptions> = {
|
|
|
80
75
|
* The compressor function to use for minification.
|
|
81
76
|
*/
|
|
82
77
|
compressor: Compressor<TOptions>;
|
|
83
|
-
|
|
84
78
|
/**
|
|
85
79
|
* Optional label for the compressor (used in logging).
|
|
86
80
|
*/
|
|
87
81
|
compressorLabel?: string;
|
|
88
|
-
|
|
89
82
|
/**
|
|
90
83
|
* Content to minify (for in-memory minification).
|
|
91
84
|
* If provided, input/output are not required.
|
|
@@ -93,7 +86,6 @@ type Settings<TOptions extends CompressorOptions = CompressorOptions> = {
|
|
|
93
86
|
* For binary formats (images): Buffer (handled internally by image compressors)
|
|
94
87
|
*/
|
|
95
88
|
content?: string | Buffer;
|
|
96
|
-
|
|
97
89
|
/**
|
|
98
90
|
* Input file path(s) or glob pattern.
|
|
99
91
|
* Can be a single file, array of files, or wildcard pattern.
|
|
@@ -104,7 +96,6 @@ type Settings<TOptions extends CompressorOptions = CompressorOptions> = {
|
|
|
104
96
|
* - 'src/**\/*.js'
|
|
105
97
|
*/
|
|
106
98
|
input?: string | string[];
|
|
107
|
-
|
|
108
99
|
/**
|
|
109
100
|
* Output file path.
|
|
110
101
|
* Use $1 as placeholder for input filename in multi-file scenarios.
|
|
@@ -116,43 +107,36 @@ type Settings<TOptions extends CompressorOptions = CompressorOptions> = {
|
|
|
116
107
|
* - '$1.min.js' (creates app.min.js from app.js)
|
|
117
108
|
*/
|
|
118
109
|
output?: string | string[];
|
|
119
|
-
|
|
120
110
|
/**
|
|
121
111
|
* Compressor-specific options.
|
|
122
112
|
* See individual compressor documentation for available options.
|
|
123
113
|
*/
|
|
124
114
|
options?: TOptions;
|
|
125
|
-
|
|
126
115
|
/**
|
|
127
116
|
* CLI option string (used by CLI only).
|
|
128
117
|
* @internal
|
|
129
118
|
*/
|
|
130
119
|
option?: string;
|
|
131
|
-
|
|
132
120
|
/**
|
|
133
121
|
* Buffer size for file operations (in bytes).
|
|
134
122
|
* @default 1024000 (1MB)
|
|
135
123
|
*/
|
|
136
124
|
buffer?: number;
|
|
137
|
-
|
|
138
125
|
/**
|
|
139
126
|
* Timeout for the compressor process (in milliseconds).
|
|
140
127
|
* If execution exceeds this limit, the process will be killed.
|
|
141
128
|
*/
|
|
142
129
|
timeout?: number;
|
|
143
|
-
|
|
144
130
|
/**
|
|
145
131
|
* File type for compressors that support multiple types.
|
|
146
132
|
* Required for YUI compressor.
|
|
147
133
|
*/
|
|
148
134
|
type?: FileType;
|
|
149
|
-
|
|
150
135
|
/**
|
|
151
136
|
* Suppress console output.
|
|
152
137
|
* @default false
|
|
153
138
|
*/
|
|
154
139
|
silence?: boolean;
|
|
155
|
-
|
|
156
140
|
/**
|
|
157
141
|
* Public folder to prepend to input paths.
|
|
158
142
|
*
|
|
@@ -161,13 +145,11 @@ type Settings<TOptions extends CompressorOptions = CompressorOptions> = {
|
|
|
161
145
|
* the actual path becomes 'public/js/app.js'
|
|
162
146
|
*/
|
|
163
147
|
publicFolder?: string;
|
|
164
|
-
|
|
165
148
|
/**
|
|
166
149
|
* Replace files in place instead of creating new output files.
|
|
167
150
|
* @default false
|
|
168
151
|
*/
|
|
169
152
|
replaceInPlace?: boolean;
|
|
170
|
-
|
|
171
153
|
/**
|
|
172
154
|
* Allow empty output without throwing an error.
|
|
173
155
|
* When true, if minification results in empty content, the output file will not be written.
|
|
@@ -185,7 +167,6 @@ type MinifierOptions<TOptions extends CompressorOptions = CompressorOptions> = {
|
|
|
185
167
|
* The full settings object.
|
|
186
168
|
*/
|
|
187
169
|
settings: Settings<TOptions>;
|
|
188
|
-
|
|
189
170
|
/**
|
|
190
171
|
* The content to minify.
|
|
191
172
|
* For text-based formats (JS, CSS, HTML, SVG): string
|
|
@@ -193,7 +174,6 @@ type MinifierOptions<TOptions extends CompressorOptions = CompressorOptions> = {
|
|
|
193
174
|
* For multiple binary files: Buffer[]
|
|
194
175
|
*/
|
|
195
176
|
content?: string | Buffer | Buffer[];
|
|
196
|
-
|
|
197
177
|
/**
|
|
198
178
|
* Index of current file when processing multiple files.
|
|
199
179
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["CompressorReturnType","ImageFormat","CompressorOutput","Buffer","CompressorResult","CompressorOptions","Record","Compressor","TOptions","MinifierOptions","Promise","FileType","Settings","
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["CompressorReturnType","ImageFormat","CompressorOutput","Buffer","format","content","CompressorResult","code","map","buffer","outputs","CompressorOptions","Record","Compressor","TOptions","MinifierOptions","Promise","args","FileType","Settings","compressor","compressorLabel","input","output","options","option","timeout","type","silence","publicFolder","replaceInPlace","allowEmptyOutput","settings","index","Result","size","sizeGzip","MinifyOptions"],"sources":["../../types/src/types.d.ts","../src/index.ts"],"mappings":";;AAkFA;;KArDYE,gBAAAA;EAqD4BS;;;EAjDpCP,MAAA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1
|
-
import { t as
|
|
1
|
+
import { a as compress, i as AVAILABLE_MINIFIER, n as start, r as stop, t as error } from "./spinner-DhrxzYjU.js";
|
|
2
|
+
import { resolveCompressor } from "@node-minify/utils";
|
|
3
|
+
import chalk from "chalk";
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
//#region src/index.ts
|
|
6
|
+
/**
|
|
7
|
+
* Module variables.
|
|
8
|
+
*/
|
|
9
|
+
let silence = false;
|
|
10
|
+
/**
|
|
11
|
+
* Runs a single compression task using the compressor specified in the CLI settings.
|
|
12
|
+
*
|
|
13
|
+
* Loads and validates the requested compressor, constructs the runtime Settings object
|
|
14
|
+
* (including parsed input, output, type, and options), executes compression, and
|
|
15
|
+
* manages CLI spinner state when not silenced.
|
|
16
|
+
*
|
|
17
|
+
* @param cli - CLI settings identifying the compressor and its runtime options
|
|
18
|
+
* @returns The compression Result produced by the compressor
|
|
19
|
+
* @throws Error if the specified compressor is not found
|
|
20
|
+
* @throws Error if the compressor implementation is missing or not a function
|
|
21
|
+
* @throws Error if the compressor only supports CSS but a non-`css` type is provided
|
|
22
|
+
*/
|
|
23
|
+
async function runOne(cli) {
|
|
24
|
+
const resolution = await resolveCompressor(cli.compressor);
|
|
25
|
+
const { compressor: minifierImplementation, label: compressorLabel } = resolution;
|
|
26
|
+
if (resolution.isBuiltIn) {
|
|
27
|
+
const minifierDefinition = AVAILABLE_MINIFIER.find((c) => c.name === cli.compressor);
|
|
28
|
+
if (minifierDefinition && "cssOnly" in minifierDefinition && cli.type && cli.type !== "css") throw new Error(`${cli.compressor} only supports type 'css'`);
|
|
29
|
+
}
|
|
30
|
+
const settings = {
|
|
31
|
+
compressorLabel,
|
|
32
|
+
compressor: minifierImplementation,
|
|
33
|
+
input: cli.input,
|
|
34
|
+
output: cli.output,
|
|
35
|
+
...cli.type && { type: cli.type },
|
|
36
|
+
...cli.option && { options: JSON.parse(cli.option) },
|
|
37
|
+
...cli.allowEmptyOutput && { allowEmptyOutput: cli.allowEmptyOutput }
|
|
38
|
+
};
|
|
39
|
+
if (!silence) start(settings);
|
|
40
|
+
try {
|
|
41
|
+
const result = await compress(settings);
|
|
42
|
+
if (!silence) stop(result);
|
|
43
|
+
return result;
|
|
44
|
+
} catch (error$1) {
|
|
45
|
+
if (!silence) error(settings);
|
|
46
|
+
throw error$1;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Run cli.
|
|
51
|
+
* @param cli Settings
|
|
52
|
+
*/
|
|
53
|
+
async function run(cli) {
|
|
54
|
+
silence = !!cli.silence;
|
|
55
|
+
if (!silence) logMessage("INFO", "Starting compression...", "bgBlue");
|
|
56
|
+
try {
|
|
57
|
+
await runOne(cli);
|
|
58
|
+
if (!silence) logMessage("DONE", "Done!", "bgGreen", "green");
|
|
59
|
+
} catch (error) {
|
|
60
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
61
|
+
throw new Error(`Compression failed: ${errorMessage}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function logMessage(badge, message, badgeColor, messageColor) {
|
|
65
|
+
console.log("");
|
|
66
|
+
console.log(chalk[badgeColor].black(` ${badge} `), messageColor ? chalk[messageColor](message) : message);
|
|
67
|
+
console.log("");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
//#endregion
|
|
71
|
+
export { run };
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["error"],"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { Result, Settings } from \"@node-minify/types\";\nimport { resolveCompressor } from \"@node-minify/utils\";\nimport chalk from \"chalk\";\nimport { compress } from \"./compress.ts\";\nimport { AVAILABLE_MINIFIER } from \"./config.ts\";\nimport { spinnerError, spinnerStart, spinnerStop } from \"./spinner.ts\";\n\nexport type SettingsWithCompressor = Omit<Settings, \"compressor\"> & {\n compressor: string;\n};\n\n/**\n * Module variables.\n */\nlet silence = false;\n\n/**\n * Runs a single compression task using the compressor specified in the CLI settings.\n *\n * Loads and validates the requested compressor, constructs the runtime Settings object\n * (including parsed input, output, type, and options), executes compression, and\n * manages CLI spinner state when not silenced.\n *\n * @param cli - CLI settings identifying the compressor and its runtime options\n * @returns The compression Result produced by the compressor\n * @throws Error if the specified compressor is not found\n * @throws Error if the compressor implementation is missing or not a function\n * @throws Error if the compressor only supports CSS but a non-`css` type is provided\n */\nasync function runOne(cli: SettingsWithCompressor): Promise<Result> {\n const resolution = await resolveCompressor(cli.compressor);\n const { compressor: minifierImplementation, label: compressorLabel } =\n resolution;\n\n if (resolution.isBuiltIn) {\n const minifierDefinition = AVAILABLE_MINIFIER.find(\n (c) => c.name === cli.compressor\n );\n if (\n minifierDefinition &&\n \"cssOnly\" in minifierDefinition &&\n cli.type &&\n cli.type !== \"css\"\n ) {\n throw new Error(`${cli.compressor} only supports type 'css'`);\n }\n }\n\n const inputValue = cli.input;\n\n const settings: Settings = {\n compressorLabel,\n compressor: minifierImplementation,\n input: inputValue,\n output: cli.output,\n ...(cli.type && { type: cli.type }),\n ...(cli.option && { options: JSON.parse(cli.option) }),\n ...(cli.allowEmptyOutput && { allowEmptyOutput: cli.allowEmptyOutput }),\n };\n\n if (!silence) spinnerStart(settings);\n\n try {\n const result = await compress(settings);\n if (!silence) spinnerStop(result);\n return result;\n } catch (error) {\n if (!silence) spinnerError(settings);\n throw error;\n }\n}\n\n/**\n * Run cli.\n * @param cli Settings\n */\nexport async function run(cli: SettingsWithCompressor) {\n silence = !!cli.silence;\n\n if (!silence) {\n logMessage(\"INFO\", \"Starting compression...\", \"bgBlue\");\n }\n\n try {\n await runOne(cli);\n\n if (!silence) {\n logMessage(\"DONE\", \"Done!\", \"bgGreen\", \"green\");\n }\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n throw new Error(`Compression failed: ${errorMessage}`);\n }\n}\n\n// Helper function to handle consistent logging\nfunction logMessage(\n badge: \"INFO\" | \"DONE\",\n message: string,\n badgeColor: \"bgBlue\" | \"bgGreen\",\n messageColor?: \"green\"\n) {\n console.log(\"\");\n console.log(\n chalk[badgeColor].black(` ${badge} `),\n messageColor ? chalk[messageColor](message) : message\n );\n console.log(\"\");\n}\n"],"mappings":";;;;;;;;AAuBA,IAAI,UAAU;;;;;;;;;;;;;;AAed,eAAe,OAAO,KAA8C;CAChE,MAAM,aAAa,MAAM,kBAAkB,IAAI,WAAW;CAC1D,MAAM,EAAE,YAAY,wBAAwB,OAAO,oBAC/C;AAEJ,KAAI,WAAW,WAAW;EACtB,MAAM,qBAAqB,mBAAmB,MACzC,MAAM,EAAE,SAAS,IAAI,WACzB;AACD,MACI,sBACA,aAAa,sBACb,IAAI,QACJ,IAAI,SAAS,MAEb,OAAM,IAAI,MAAM,GAAG,IAAI,WAAW,2BAA2B;;CAMrE,MAAM,WAAqB;EACvB;EACA,YAAY;EACZ,OALe,IAAI;EAMnB,QAAQ,IAAI;EACZ,GAAI,IAAI,QAAQ,EAAE,MAAM,IAAI,MAAM;EAClC,GAAI,IAAI,UAAU,EAAE,SAAS,KAAK,MAAM,IAAI,OAAO,EAAE;EACrD,GAAI,IAAI,oBAAoB,EAAE,kBAAkB,IAAI,kBAAkB;EACzE;AAED,KAAI,CAAC,QAAS,OAAa,SAAS;AAEpC,KAAI;EACA,MAAM,SAAS,MAAM,SAAS,SAAS;AACvC,MAAI,CAAC,QAAS,MAAY,OAAO;AACjC,SAAO;UACFA,SAAO;AACZ,MAAI,CAAC,QAAS,OAAa,SAAS;AACpC,QAAMA;;;;;;;AAQd,eAAsB,IAAI,KAA6B;AACnD,WAAU,CAAC,CAAC,IAAI;AAEhB,KAAI,CAAC,QACD,YAAW,QAAQ,2BAA2B,SAAS;AAG3D,KAAI;AACA,QAAM,OAAO,IAAI;AAEjB,MAAI,CAAC,QACD,YAAW,QAAQ,SAAS,WAAW,QAAQ;UAE9C,OAAO;EACZ,MAAM,eACF,iBAAiB,QAAQ,MAAM,UAAU;AAC7C,QAAM,IAAI,MAAM,uBAAuB,eAAe;;;AAK9D,SAAS,WACL,OACA,SACA,YACA,cACF;AACE,SAAQ,IAAI,GAAG;AACf,SAAQ,IACJ,MAAM,YAAY,MAAM,IAAI,MAAM,GAAG,EACrC,eAAe,MAAM,cAAc,QAAQ,GAAG,QACjD;AACD,SAAQ,IAAI,GAAG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getFilesizeGzippedInBytes, getFilesizeInBytes, isValidFileAsync
|
|
1
|
+
import { getFilesizeGzippedInBytes, getFilesizeInBytes, isValidFileAsync } from "@node-minify/utils";
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import { minify } from "@node-minify/core";
|
|
4
4
|
import ora from "ora";
|
|
@@ -42,8 +42,8 @@ async function compress(options) {
|
|
|
42
42
|
size,
|
|
43
43
|
sizeGzip
|
|
44
44
|
};
|
|
45
|
-
} catch (error
|
|
46
|
-
const errorMessage = error
|
|
45
|
+
} catch (error) {
|
|
46
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
47
47
|
throw new Error(`Compression failed: ${errorMessage}`);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -189,71 +189,5 @@ function error({ compressorLabel }) {
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
//#endregion
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
* Module variables.
|
|
195
|
-
*/
|
|
196
|
-
let silence = false;
|
|
197
|
-
/**
|
|
198
|
-
* Runs a single compression task using the compressor specified in the CLI settings.
|
|
199
|
-
*
|
|
200
|
-
* Loads and validates the requested compressor, constructs the runtime Settings object
|
|
201
|
-
* (including parsed input, output, type, and options), executes compression, and
|
|
202
|
-
* manages CLI spinner state when not silenced.
|
|
203
|
-
*
|
|
204
|
-
* @param cli - CLI settings identifying the compressor and its runtime options
|
|
205
|
-
* @returns The compression Result produced by the compressor
|
|
206
|
-
* @throws Error if the specified compressor is not found
|
|
207
|
-
* @throws Error if the compressor implementation is missing or not a function
|
|
208
|
-
* @throws Error if the compressor only supports CSS but a non-`css` type is provided
|
|
209
|
-
*/
|
|
210
|
-
async function runOne(cli) {
|
|
211
|
-
const resolution = await resolveCompressor(cli.compressor);
|
|
212
|
-
const { compressor: minifierImplementation, label: compressorLabel } = resolution;
|
|
213
|
-
if (resolution.isBuiltIn) {
|
|
214
|
-
const minifierDefinition = AVAILABLE_MINIFIER.find((c) => c.name === cli.compressor);
|
|
215
|
-
if (minifierDefinition && "cssOnly" in minifierDefinition && cli.type && cli.type !== "css") throw new Error(`${cli.compressor} only supports type 'css'`);
|
|
216
|
-
}
|
|
217
|
-
const settings = {
|
|
218
|
-
compressorLabel,
|
|
219
|
-
compressor: minifierImplementation,
|
|
220
|
-
input: cli.input,
|
|
221
|
-
output: cli.output,
|
|
222
|
-
...cli.type && { type: cli.type },
|
|
223
|
-
...cli.option && { options: JSON.parse(cli.option) },
|
|
224
|
-
...cli.allowEmptyOutput && { allowEmptyOutput: cli.allowEmptyOutput }
|
|
225
|
-
};
|
|
226
|
-
if (!silence) start(settings);
|
|
227
|
-
try {
|
|
228
|
-
const result = await compress(settings);
|
|
229
|
-
if (!silence) stop(result);
|
|
230
|
-
return result;
|
|
231
|
-
} catch (error$1) {
|
|
232
|
-
if (!silence) error(settings);
|
|
233
|
-
throw error$1;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Run cli.
|
|
238
|
-
* @param cli Settings
|
|
239
|
-
*/
|
|
240
|
-
async function run(cli) {
|
|
241
|
-
silence = !!cli.silence;
|
|
242
|
-
if (!silence) logMessage("INFO", "Starting compression...", "bgBlue");
|
|
243
|
-
try {
|
|
244
|
-
await runOne(cli);
|
|
245
|
-
if (!silence) logMessage("DONE", "Done!", "bgGreen", "green");
|
|
246
|
-
} catch (error$1) {
|
|
247
|
-
const errorMessage = error$1 instanceof Error ? error$1.message : "Unknown error occurred";
|
|
248
|
-
throw new Error(`Compression failed: ${errorMessage}`);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
function logMessage(badge, message, badgeColor, messageColor) {
|
|
252
|
-
console.log("");
|
|
253
|
-
console.log(chalk[badgeColor].black(` ${badge} `), messageColor ? chalk[messageColor](message) : message);
|
|
254
|
-
console.log("");
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
//#endregion
|
|
258
|
-
export { AVAILABLE_MINIFIER as n, run as t };
|
|
259
|
-
//# sourceMappingURL=src-DWQ6qSE1.js.map
|
|
192
|
+
export { compress as a, AVAILABLE_MINIFIER as i, start as n, stop as r, error as t };
|
|
193
|
+
//# sourceMappingURL=spinner-DhrxzYjU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner-DhrxzYjU.js","names":[],"sources":["../src/compress.ts","../src/config.ts","../src/spinner.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport { minify } from \"@node-minify/core\";\nimport type { CompressorOptions, Result, Settings } from \"@node-minify/types\";\nimport {\n getFilesizeGzippedInBytes,\n getFilesizeInBytes,\n isValidFileAsync,\n} from \"@node-minify/utils\";\n\n/**\n * Run the configured compressor and, when possible, include output file sizes in the result.\n *\n * When `options.output` is a single file path (not an array and not containing the `$1` pattern),\n * the returned result will include `size` and `sizeGzip` with the output file's byte sizes; otherwise\n * those fields will be `\"0\"`.\n *\n * @param options - Compression settings; if `options.output` is a single path the returned result may include computed `size` and `sizeGzip`\n * @returns The compression result containing:\n * - `compressorLabel`: label of the compressor,\n * - `size`: output file size in bytes as a string (or `\"0\"` if not computed),\n * - `sizeGzip`: gzipped output size in bytes as a string (or `\"0\"` if not computed)\n */\nasync function compress<T extends CompressorOptions = CompressorOptions>(\n options: Settings<T>\n): Promise<Result> {\n try {\n await minify(options);\n\n const defaultResult: Result = {\n compressorLabel: options.compressorLabel ?? \"\",\n size: \"0\",\n sizeGzip: \"0\",\n };\n\n // Return default result if output contains pattern, is an array, or is undefined\n // Arrays and $1 patterns produce multiple files, so we can't calculate a single size\n if (\n !options.output ||\n Array.isArray(options.output) ||\n options.output.includes(\"$1\")\n ) {\n return defaultResult;\n }\n\n // Check if file exists (may not exist if allowEmptyOutput skipped writing)\n const fileExists = await isValidFileAsync(options.output);\n if (!fileExists) {\n return defaultResult;\n }\n\n // Get file sizes - let IO/permission errors propagate\n const sizeGzip = await getFilesizeGzippedInBytes(options.output);\n const size = getFilesizeInBytes(options.output);\n\n return {\n ...defaultResult,\n size,\n sizeGzip,\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n throw new Error(`Compression failed: ${errorMessage}`);\n }\n}\n\nexport { compress };\n","/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\nexport const AVAILABLE_MINIFIER = [\n // JavaScript compressors\n { name: \"esbuild\", export: \"esbuild\" },\n { name: \"google-closure-compiler\", export: \"gcc\" },\n { name: \"oxc\", export: \"oxc\" },\n { name: \"swc\", export: \"swc\" },\n { name: \"terser\", export: \"terser\" },\n { name: \"uglify-js\", export: \"uglifyJs\" },\n // Deprecated JS compressors\n { name: \"babel-minify\", export: \"babelMinify\" },\n { name: \"uglify-es\", export: \"uglifyEs\" },\n { name: \"yui\", export: \"yui\" },\n // CSS compressors\n { name: \"clean-css\", export: \"cleanCss\", cssOnly: true },\n { name: \"cssnano\", export: \"cssnano\", cssOnly: true },\n { name: \"csso\", export: \"csso\", cssOnly: true },\n { name: \"lightningcss\", export: \"lightningCss\", cssOnly: true },\n // Deprecated CSS compressors\n { name: \"crass\", export: \"crass\", cssOnly: true },\n { name: \"sqwish\", export: \"sqwish\", cssOnly: true },\n // HTML compressors\n { name: \"html-minifier\", export: \"htmlMinifier\" },\n { name: \"minify-html\", export: \"minifyHtml\" },\n // JSON compressors\n { name: \"jsonminify\", export: \"jsonMinify\" },\n // Image compressors\n { name: \"imagemin\", export: \"imagemin\" },\n { name: \"sharp\", export: \"sharp\" },\n { name: \"svgo\", export: \"svgo\" },\n // Other\n { name: \"no-compress\", export: \"noCompress\" },\n] as const;\n","/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { Result, Settings } from \"@node-minify/types\";\nimport chalk from \"chalk\";\nimport ora from \"ora\";\n\nconst spinner = ora();\n\n/**\n * Formats a compression message with the compressor label\n */\nfunction formatCompressionMessage(\n status: string,\n compressorLabel?: string\n): string {\n return `${status} with ${chalk.green(compressorLabel)}`;\n}\n\n/**\n * Start spinner for compression process\n */\nfunction start({ compressorLabel }: Settings): void {\n spinner.text = `Compressing file(s) ${formatCompressionMessage(\n \"...\",\n compressorLabel\n )}`;\n spinner.start();\n}\n\n/**\n * Stop spinner with success message\n */\nfunction stop({ compressorLabel, size, sizeGzip }: Result): void {\n spinner.text = [\n \"File(s) compressed successfully\",\n formatCompressionMessage(\"\", compressorLabel),\n `(${chalk.green(size)} minified,`,\n `${chalk.green(sizeGzip)} gzipped)`,\n ].join(\" \");\n spinner.succeed();\n}\n\n/**\n * Stop spinner with error message\n */\nfunction error({ compressorLabel }: Settings): void {\n spinner.text = `Error - file(s) not compressed ${formatCompressionMessage(\n \"\",\n compressorLabel\n )}`;\n spinner.fail();\n}\n\nexport { start as spinnerStart, stop as spinnerStop, error as spinnerError };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,eAAe,SACX,SACe;AACf,KAAI;AACA,QAAM,OAAO,QAAQ;EAErB,MAAM,gBAAwB;GAC1B,iBAAiB,QAAQ,mBAAmB;GAC5C,MAAM;GACN,UAAU;GACb;AAID,MACI,CAAC,QAAQ,UACT,MAAM,QAAQ,QAAQ,OAAO,IAC7B,QAAQ,OAAO,SAAS,KAAK,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Q;EAAc;CAChD;;;;ACxBD,MAAM,UAAU,KAAK;;;;AAKrB,SAAS,yBACL,QACA,iBACM;AACN,QAAO,GAAG,OAAO,QAAQ,MAAM,MAAM,gBAAgB;;;;;AAMzD,SAAS,MAAM,EAAE,mBAAmC;AAChD,SAAQ,OAAO,uBAAuB,yBAClC,OACA,gBACH;AACD,SAAQ,OAAO;;;;;AAMnB,SAAS,KAAK,EAAE,iBAAiB,MAAM,YAA0B;AAC7D,SAAQ,OAAO;EACX;EACA,yBAAyB,IAAI,gBAAgB;EAC7C,IAAI,MAAM,MAAM,KAAK,CAAC;EACtB,GAAG,MAAM,MAAM,SAAS,CAAC;EAC5B,CAAC,KAAK,IAAI;AACX,SAAQ,SAAS;;;;;AAMrB,SAAS,MAAM,EAAE,mBAAmC;AAChD,SAAQ,OAAO,kCAAkC,yBAC7C,IACA,gBACH;AACD,SAAQ,MAAM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-minify/cli",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.5.0",
|
|
4
4
|
"description": "CLI - command line interface for @node-minify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compressor",
|
|
@@ -54,30 +54,30 @@
|
|
|
54
54
|
"dev": "tsdown src/index.ts --watch"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@node-minify/
|
|
58
|
-
"@node-minify/
|
|
59
|
-
"@node-minify/utils": "10.
|
|
57
|
+
"@node-minify/benchmark": "10.5.0",
|
|
58
|
+
"@node-minify/core": "10.5.0",
|
|
59
|
+
"@node-minify/utils": "10.5.0",
|
|
60
60
|
"chalk": "5.6.2",
|
|
61
|
-
"commander": "14.0.
|
|
62
|
-
"ora": "9.
|
|
61
|
+
"commander": "14.0.3",
|
|
62
|
+
"ora": "9.3.0",
|
|
63
63
|
"update-notifier": "7.3.1"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@node-minify/clean-css": "10.
|
|
67
|
-
"@node-minify/cssnano": "10.
|
|
68
|
-
"@node-minify/csso": "10.
|
|
69
|
-
"@node-minify/esbuild": "10.
|
|
70
|
-
"@node-minify/google-closure-compiler": "10.
|
|
71
|
-
"@node-minify/imagemin": "10.
|
|
72
|
-
"@node-minify/jsonminify": "10.
|
|
73
|
-
"@node-minify/lightningcss": "10.
|
|
74
|
-
"@node-minify/oxc": "10.
|
|
75
|
-
"@node-minify/sharp": "10.
|
|
76
|
-
"@node-minify/svgo": "10.
|
|
77
|
-
"@node-minify/swc": "10.
|
|
78
|
-
"@node-minify/terser": "10.
|
|
79
|
-
"@node-minify/types": "10.
|
|
80
|
-
"@node-minify/uglify-js": "10.
|
|
81
|
-
"@node-minify/yui": "10.
|
|
66
|
+
"@node-minify/clean-css": "10.5.0",
|
|
67
|
+
"@node-minify/cssnano": "10.5.0",
|
|
68
|
+
"@node-minify/csso": "10.5.0",
|
|
69
|
+
"@node-minify/esbuild": "10.5.0",
|
|
70
|
+
"@node-minify/google-closure-compiler": "10.5.0",
|
|
71
|
+
"@node-minify/imagemin": "10.5.0",
|
|
72
|
+
"@node-minify/jsonminify": "10.5.0",
|
|
73
|
+
"@node-minify/lightningcss": "10.5.0",
|
|
74
|
+
"@node-minify/oxc": "10.5.0",
|
|
75
|
+
"@node-minify/sharp": "10.5.0",
|
|
76
|
+
"@node-minify/svgo": "10.5.0",
|
|
77
|
+
"@node-minify/swc": "10.5.0",
|
|
78
|
+
"@node-minify/terser": "10.5.0",
|
|
79
|
+
"@node-minify/types": "10.5.0",
|
|
80
|
+
"@node-minify/uglify-js": "10.5.0",
|
|
81
|
+
"@node-minify/yui": "10.5.0"
|
|
82
82
|
}
|
|
83
83
|
}
|
package/dist/src-DWQ6qSE1.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"src-DWQ6qSE1.js","names":["error","error"],"sources":["../src/compress.ts","../src/config.ts","../src/spinner.ts","../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport { minify } from \"@node-minify/core\";\nimport type { CompressorOptions, Result, Settings } from \"@node-minify/types\";\nimport {\n getFilesizeGzippedInBytes,\n getFilesizeInBytes,\n isValidFileAsync,\n} from \"@node-minify/utils\";\n\n/**\n * Run the configured compressor and, when possible, include output file sizes in the result.\n *\n * When `options.output` is a single file path (not an array and not containing the `$1` pattern),\n * the returned result will include `size` and `sizeGzip` with the output file's byte sizes; otherwise\n * those fields will be `\"0\"`.\n *\n * @param options - Compression settings; if `options.output` is a single path the returned result may include computed `size` and `sizeGzip`\n * @returns The compression result containing:\n * - `compressorLabel`: label of the compressor,\n * - `size`: output file size in bytes as a string (or `\"0\"` if not computed),\n * - `sizeGzip`: gzipped output size in bytes as a string (or `\"0\"` if not computed)\n */\nasync function compress<T extends CompressorOptions = CompressorOptions>(\n options: Settings<T>\n): Promise<Result> {\n try {\n await minify(options);\n\n const defaultResult: Result = {\n compressorLabel: options.compressorLabel ?? \"\",\n size: \"0\",\n sizeGzip: \"0\",\n };\n\n // Return default result if output contains pattern, is an array, or is undefined\n // Arrays and $1 patterns produce multiple files, so we can't calculate a single size\n if (\n !options.output ||\n Array.isArray(options.output) ||\n options.output.includes(\"$1\")\n ) {\n return defaultResult;\n }\n\n // Check if file exists (may not exist if allowEmptyOutput skipped writing)\n const fileExists = await isValidFileAsync(options.output);\n if (!fileExists) {\n return defaultResult;\n }\n\n // Get file sizes - let IO/permission errors propagate\n const sizeGzip = await getFilesizeGzippedInBytes(options.output);\n const size = getFilesizeInBytes(options.output);\n\n return {\n ...defaultResult,\n size,\n sizeGzip,\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n throw new Error(`Compression failed: ${errorMessage}`);\n }\n}\n\nexport { compress };\n","/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\nexport const AVAILABLE_MINIFIER = [\n // JavaScript compressors\n { name: \"esbuild\", export: \"esbuild\" },\n { name: \"google-closure-compiler\", export: \"gcc\" },\n { name: \"oxc\", export: \"oxc\" },\n { name: \"swc\", export: \"swc\" },\n { name: \"terser\", export: \"terser\" },\n { name: \"uglify-js\", export: \"uglifyJs\" },\n // Deprecated JS compressors\n { name: \"babel-minify\", export: \"babelMinify\" },\n { name: \"uglify-es\", export: \"uglifyEs\" },\n { name: \"yui\", export: \"yui\" },\n // CSS compressors\n { name: \"clean-css\", export: \"cleanCss\", cssOnly: true },\n { name: \"cssnano\", export: \"cssnano\", cssOnly: true },\n { name: \"csso\", export: \"csso\", cssOnly: true },\n { name: \"lightningcss\", export: \"lightningCss\", cssOnly: true },\n // Deprecated CSS compressors\n { name: \"crass\", export: \"crass\", cssOnly: true },\n { name: \"sqwish\", export: \"sqwish\", cssOnly: true },\n // HTML compressors\n { name: \"html-minifier\", export: \"htmlMinifier\" },\n { name: \"minify-html\", export: \"minifyHtml\" },\n // JSON compressors\n { name: \"jsonminify\", export: \"jsonMinify\" },\n // Image compressors\n { name: \"imagemin\", export: \"imagemin\" },\n { name: \"sharp\", export: \"sharp\" },\n { name: \"svgo\", export: \"svgo\" },\n // Other\n { name: \"no-compress\", export: \"noCompress\" },\n] as const;\n","/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { Result, Settings } from \"@node-minify/types\";\nimport chalk from \"chalk\";\nimport ora from \"ora\";\n\nconst spinner = ora();\n\n/**\n * Formats a compression message with the compressor label\n */\nfunction formatCompressionMessage(\n status: string,\n compressorLabel?: string\n): string {\n return `${status} with ${chalk.green(compressorLabel)}`;\n}\n\n/**\n * Start spinner for compression process\n */\nfunction start({ compressorLabel }: Settings): void {\n spinner.text = `Compressing file(s) ${formatCompressionMessage(\n \"...\",\n compressorLabel\n )}`;\n spinner.start();\n}\n\n/**\n * Stop spinner with success message\n */\nfunction stop({ compressorLabel, size, sizeGzip }: Result): void {\n spinner.text = [\n \"File(s) compressed successfully\",\n formatCompressionMessage(\"\", compressorLabel),\n `(${chalk.green(size)} minified,`,\n `${chalk.green(sizeGzip)} gzipped)`,\n ].join(\" \");\n spinner.succeed();\n}\n\n/**\n * Stop spinner with error message\n */\nfunction error({ compressorLabel }: Settings): void {\n spinner.text = `Error - file(s) not compressed ${formatCompressionMessage(\n \"\",\n compressorLabel\n )}`;\n spinner.fail();\n}\n\nexport { start as spinnerStart, stop as spinnerStop, error as spinnerError };\n","/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { Result, Settings } from \"@node-minify/types\";\nimport { resolveCompressor } from \"@node-minify/utils\";\nimport chalk from \"chalk\";\nimport { compress } from \"./compress.ts\";\nimport { AVAILABLE_MINIFIER } from \"./config.ts\";\nimport { spinnerError, spinnerStart, spinnerStop } from \"./spinner.ts\";\n\nexport type SettingsWithCompressor = Omit<Settings, \"compressor\"> & {\n compressor: string;\n};\n\n/**\n * Module variables.\n */\nlet silence = false;\n\n/**\n * Runs a single compression task using the compressor specified in the CLI settings.\n *\n * Loads and validates the requested compressor, constructs the runtime Settings object\n * (including parsed input, output, type, and options), executes compression, and\n * manages CLI spinner state when not silenced.\n *\n * @param cli - CLI settings identifying the compressor and its runtime options\n * @returns The compression Result produced by the compressor\n * @throws Error if the specified compressor is not found\n * @throws Error if the compressor implementation is missing or not a function\n * @throws Error if the compressor only supports CSS but a non-`css` type is provided\n */\nasync function runOne(cli: SettingsWithCompressor): Promise<Result> {\n const resolution = await resolveCompressor(cli.compressor);\n const { compressor: minifierImplementation, label: compressorLabel } =\n resolution;\n\n if (resolution.isBuiltIn) {\n const minifierDefinition = AVAILABLE_MINIFIER.find(\n (c) => c.name === cli.compressor\n );\n if (\n minifierDefinition &&\n \"cssOnly\" in minifierDefinition &&\n cli.type &&\n cli.type !== \"css\"\n ) {\n throw new Error(`${cli.compressor} only supports type 'css'`);\n }\n }\n\n const inputValue = cli.input;\n\n const settings: Settings = {\n compressorLabel,\n compressor: minifierImplementation,\n input: inputValue,\n output: cli.output,\n ...(cli.type && { type: cli.type }),\n ...(cli.option && { options: JSON.parse(cli.option) }),\n ...(cli.allowEmptyOutput && { allowEmptyOutput: cli.allowEmptyOutput }),\n };\n\n if (!silence) spinnerStart(settings);\n\n try {\n const result = await compress(settings);\n if (!silence) spinnerStop(result);\n return result;\n } catch (error) {\n if (!silence) spinnerError(settings);\n throw error;\n }\n}\n\n/**\n * Run cli.\n * @param cli Settings\n */\nexport async function run(cli: SettingsWithCompressor) {\n silence = !!cli.silence;\n\n if (!silence) {\n logMessage(\"INFO\", \"Starting compression...\", \"bgBlue\");\n }\n\n try {\n await runOne(cli);\n\n if (!silence) {\n logMessage(\"DONE\", \"Done!\", \"bgGreen\", \"green\");\n }\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n throw new Error(`Compression failed: ${errorMessage}`);\n }\n}\n\n// Helper function to handle consistent logging\nfunction logMessage(\n badge: \"INFO\" | \"DONE\",\n message: string,\n badgeColor: \"bgBlue\" | \"bgGreen\",\n messageColor?: \"green\"\n) {\n console.log(\"\");\n console.log(\n chalk[badgeColor].black(` ${badge} `),\n messageColor ? chalk[messageColor](message) : message\n );\n console.log(\"\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,eAAe,SACX,SACe;AACf,KAAI;AACA,QAAM,OAAO,QAAQ;EAErB,MAAM,gBAAwB;GAC1B,iBAAiB,QAAQ,mBAAmB;GAC5C,MAAM;GACN,UAAU;GACb;AAID,MACI,CAAC,QAAQ,UACT,MAAM,QAAQ,QAAQ,OAAO,IAC7B,QAAQ,OAAO,SAAS,KAAK,CAE7B,QAAO;AAKX,MAAI,CADe,MAAM,iBAAiB,QAAQ,OAAO,CAErD,QAAO;EAIX,MA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