@node-minify/yui 8.0.2-beta.0 → 8.0.5-beta.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/LICENSE +1 -1
- package/dist/binaries/yuicompressor-2.4.7.jar +0 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -8
package/LICENSE
CHANGED
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { MinifierOptions } from '@node-minify/types';
|
|
|
2
2
|
|
|
3
3
|
/*!
|
|
4
4
|
* node-minify
|
|
5
|
-
* Copyright(c) 2011-
|
|
5
|
+
* Copyright(c) 2011-2023 Rodolphe Stoclin
|
|
6
6
|
* MIT Licensed
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
declare const minifyYUI: {
|
|
10
|
-
({ settings, content, callback, index }: MinifierOptions):
|
|
10
|
+
({ settings, content, callback, index }: MinifierOptions): void | null;
|
|
11
11
|
default: any;
|
|
12
12
|
};
|
|
13
13
|
|
package/dist/index.js
CHANGED
|
@@ -14,15 +14,19 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
16
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
17
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
22
|
mod
|
|
19
23
|
));
|
|
20
24
|
|
|
21
25
|
// src/index.ts
|
|
22
|
-
var
|
|
26
|
+
var import_es_dirname = __toESM(require("es-dirname"));
|
|
23
27
|
var import_utils = require("@node-minify/utils");
|
|
24
28
|
var import_run = require("@node-minify/run");
|
|
25
|
-
var binYui =
|
|
29
|
+
var binYui = `${(0, import_es_dirname.default)()}/binaries/yuicompressor-2.4.7.jar`;
|
|
26
30
|
var minifyYUI = ({ settings, content, callback, index }) => {
|
|
27
31
|
return (0, import_run.runCommandLine)({
|
|
28
32
|
args: yuiCommand(settings && settings.type, settings && settings.options),
|
|
@@ -36,7 +40,7 @@ var minifyYUI = ({ settings, content, callback, index }) => {
|
|
|
36
40
|
throw err;
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
|
-
if (settings && !settings.content) {
|
|
43
|
+
if (settings && !settings.content && settings.output) {
|
|
40
44
|
import_utils.utils.writeFile({ file: settings.output, content: content2, index });
|
|
41
45
|
}
|
|
42
46
|
if (callback) {
|
|
@@ -53,7 +57,7 @@ minifyYUI.default = minifyYUI;
|
|
|
53
57
|
module.exports = minifyYUI;
|
|
54
58
|
/*!
|
|
55
59
|
* node-minify
|
|
56
|
-
* Copyright(c) 2011-
|
|
60
|
+
* Copyright(c) 2011-2023 Rodolphe Stoclin
|
|
57
61
|
* MIT Licensed
|
|
58
62
|
*/
|
|
59
63
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2023 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\n\n// import path from 'path';\nimport dirname from 'es-dirname';\nimport { utils } from '@node-minify/utils';\nimport { runCommandLine } from '@node-minify/run';\nimport { MinifierOptions } from '@node-minify/types';\n\n/**\n * Module variables.\n */\nconst binYui = `${dirname()}/binaries/yuicompressor-2.4.7.jar`;\n\n/**\n * Run YUI Compressor.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyYUI = ({ settings, content, callback, index }: MinifierOptions) => {\n return runCommandLine({\n args: yuiCommand(settings && settings.type, settings && settings.options),\n data: content,\n settings,\n callback: (err: unknown, content?: string) => {\n if (err) {\n if (callback) {\n return callback(err);\n } else {\n throw err;\n }\n }\n if (settings && !settings.content && settings.output) {\n utils.writeFile({ file: settings.output, content, index });\n }\n if (callback) {\n return callback(null, content);\n }\n return content;\n }\n });\n};\n\n/**\n * YUI Compressor CSS command line.\n */\nconst yuiCommand = (type = 'js', options: any) => {\n return ['-jar', '-Xss2048k', binYui, '--type', type].concat(utils.buildArgs(options || {}));\n};\n\n/**\n * Expose `minifyYUI()`.\n */\nminifyYUI.default = minifyYUI;\nexport = minifyYUI;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAWA,wBAAoB;AACpB,mBAAsB;AACtB,iBAA+B;AAM/B,IAAM,SAAS,OAAG,kBAAAA,SAAQ;AAS1B,IAAM,YAAY,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AAC7E,aAAO,2BAAe;AAAA,IACpB,MAAM,WAAW,YAAY,SAAS,MAAM,YAAY,SAAS,OAAO;AAAA,IACxE,MAAM;AAAA,IACN;AAAA,IACA,UAAU,CAAC,KAAcC,aAAqB;AAC5C,UAAI,KAAK;AACP,YAAI,UAAU;AACZ,iBAAO,SAAS,GAAG;AAAA,QACrB,OAAO;AACL,gBAAM;AAAA,QACR;AAAA,MACF;AACA,UAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AACpD,2BAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAAA,UAAS,MAAM,CAAC;AAAA,MAC3D;AACA,UAAI,UAAU;AACZ,eAAO,SAAS,MAAMA,QAAO;AAAA,MAC/B;AACA,aAAOA;AAAA,IACT;AAAA,EACF,CAAC;AACH;AAKA,IAAM,aAAa,CAAC,OAAO,MAAM,YAAiB;AAChD,SAAO,CAAC,QAAQ,aAAa,QAAQ,UAAU,IAAI,EAAE,OAAO,mBAAM,UAAU,WAAW,CAAC,CAAC,CAAC;AAC5F;AAKA,UAAU,UAAU;AACpB,iBAAS;","names":["dirname","content"]}
|
package/dist/index.mjs
CHANGED
|
@@ -4,12 +4,12 @@ var __commonJS = (cb, mod) => function __require() {
|
|
|
4
4
|
};
|
|
5
5
|
|
|
6
6
|
// src/index.ts
|
|
7
|
-
import
|
|
7
|
+
import dirname from "es-dirname";
|
|
8
8
|
import { utils } from "@node-minify/utils";
|
|
9
9
|
import { runCommandLine } from "@node-minify/run";
|
|
10
10
|
var require_src = __commonJS({
|
|
11
11
|
"src/index.ts"(exports, module) {
|
|
12
|
-
var binYui =
|
|
12
|
+
var binYui = `${dirname()}/binaries/yuicompressor-2.4.7.jar`;
|
|
13
13
|
var minifyYUI = ({ settings, content, callback, index }) => {
|
|
14
14
|
return runCommandLine({
|
|
15
15
|
args: yuiCommand(settings && settings.type, settings && settings.options),
|
|
@@ -23,7 +23,7 @@ var require_src = __commonJS({
|
|
|
23
23
|
throw err;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
if (settings && !settings.content) {
|
|
26
|
+
if (settings && !settings.content && settings.output) {
|
|
27
27
|
utils.writeFile({ file: settings.output, content: content2, index });
|
|
28
28
|
}
|
|
29
29
|
if (callback) {
|
|
@@ -43,7 +43,7 @@ var require_src = __commonJS({
|
|
|
43
43
|
export default require_src();
|
|
44
44
|
/*!
|
|
45
45
|
* node-minify
|
|
46
|
-
* Copyright(c) 2011-
|
|
46
|
+
* Copyright(c) 2011-2023 Rodolphe Stoclin
|
|
47
47
|
* MIT Licensed
|
|
48
48
|
*/
|
|
49
49
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2023 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\n\n// import path from 'path';\nimport dirname from 'es-dirname';\nimport { utils } from '@node-minify/utils';\nimport { runCommandLine } from '@node-minify/run';\nimport { MinifierOptions } from '@node-minify/types';\n\n/**\n * Module variables.\n */\nconst binYui = `${dirname()}/binaries/yuicompressor-2.4.7.jar`;\n\n/**\n * Run YUI Compressor.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyYUI = ({ settings, content, callback, index }: MinifierOptions) => {\n return runCommandLine({\n args: yuiCommand(settings && settings.type, settings && settings.options),\n data: content,\n settings,\n callback: (err: unknown, content?: string) => {\n if (err) {\n if (callback) {\n return callback(err);\n } else {\n throw err;\n }\n }\n if (settings && !settings.content && settings.output) {\n utils.writeFile({ file: settings.output, content, index });\n }\n if (callback) {\n return callback(null, content);\n }\n return content;\n }\n });\n};\n\n/**\n * YUI Compressor CSS command line.\n */\nconst yuiCommand = (type = 'js', options: any) => {\n return ['-jar', '-Xss2048k', binYui, '--type', type].concat(utils.buildArgs(options || {}));\n};\n\n/**\n * Expose `minifyYUI()`.\n */\nminifyYUI.default = minifyYUI;\nexport = minifyYUI;\n"],"mappings":";;;;;;AAWA,OAAO,aAAa;AACpB,SAAS,aAAa;AACtB,SAAS,sBAAsB;AAb/B;AAAA;AAmBA,QAAM,SAAS,GAAG,QAAQ;AAS1B,QAAM,YAAY,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AAC7E,aAAO,eAAe;AAAA,QACpB,MAAM,WAAW,YAAY,SAAS,MAAM,YAAY,SAAS,OAAO;AAAA,QACxE,MAAM;AAAA,QACN;AAAA,QACA,UAAU,CAAC,KAAcA,aAAqB;AAC5C,cAAI,KAAK;AACP,gBAAI,UAAU;AACZ,qBAAO,SAAS,GAAG;AAAA,YACrB,OAAO;AACL,oBAAM;AAAA,YACR;AAAA,UACF;AACA,cAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AACpD,kBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAAA,UAAS,MAAM,CAAC;AAAA,UAC3D;AACA,cAAI,UAAU;AACZ,mBAAO,SAAS,MAAMA,QAAO;AAAA,UAC/B;AACA,iBAAOA;AAAA,QACT;AAAA,MACF,CAAC;AAAA,IACH;AAKA,QAAM,aAAa,CAAC,OAAO,MAAM,YAAiB;AAChD,aAAO,CAAC,QAAQ,aAAa,QAAQ,UAAU,IAAI,EAAE,OAAO,MAAM,UAAU,WAAW,CAAC,CAAC,CAAC;AAAA,IAC5F;AAKA,cAAU,UAAU;AACpB,qBAAS;AAAA;AAAA;","names":["content"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-minify/yui",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.5-beta.0",
|
|
4
4
|
"description": "yui - yahoo compressor plugin for @node-minify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compressor",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"homepage": "https://github.com/srod/node-minify/tree/master/packages/yui#readme",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"engines": {
|
|
15
|
-
"node": ">=
|
|
15
|
+
"node": ">=16.0.0"
|
|
16
16
|
},
|
|
17
17
|
"directories": {
|
|
18
18
|
"lib": "dist",
|
|
@@ -41,15 +41,17 @@
|
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"clean": "pnpm dlx rimraf dist",
|
|
44
|
-
"build": "
|
|
45
|
-
"
|
|
44
|
+
"build": "pnpm clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
|
|
45
|
+
"postbuild": "pnpm dlx copyfiles -u 1 src/binaries/*.jar dist/",
|
|
46
|
+
"prepublishOnly": "pnpm build"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@node-minify/run": "8.0.
|
|
49
|
-
"@node-minify/utils": "8.0.
|
|
49
|
+
"@node-minify/run": "8.0.5-beta.0",
|
|
50
|
+
"@node-minify/utils": "8.0.5-beta.0",
|
|
51
|
+
"es-dirname": "0.1.0"
|
|
50
52
|
},
|
|
51
53
|
"devDependencies": {
|
|
52
|
-
"@node-minify/types": "8.0.
|
|
54
|
+
"@node-minify/types": "8.0.3-beta.0"
|
|
53
55
|
},
|
|
54
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "22a7b887ea22743702b1dc5a613755ae20838a73"
|
|
55
57
|
}
|