@node-minify/yui 8.0.1-beta.0 → 8.0.3-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/dist/binaries/yuicompressor-2.4.7.jar +0 -0
- package/dist/index.d.ts +4 -8
- package/dist/index.js +10 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -8
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -6,13 +6,9 @@ import { MinifierOptions } from '@node-minify/types';
|
|
|
6
6
|
* MIT Licensed
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* @param {String} content
|
|
14
|
-
* @param {Function} callback
|
|
15
|
-
*/
|
|
16
|
-
declare const minifyYUI: ({ settings, content, callback, index }: MinifierOptions) => any;
|
|
9
|
+
declare const minifyYUI: {
|
|
10
|
+
({ settings, content, callback, index }: MinifierOptions): void | null;
|
|
11
|
+
default: any;
|
|
12
|
+
};
|
|
17
13
|
|
|
18
14
|
export { minifyYUI as default };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
8
|
var __copyProps = (to, from, except, desc) => {
|
|
12
9
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
10
|
for (let key of __getOwnPropNames(from))
|
|
@@ -17,21 +14,19 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
14
|
return to;
|
|
18
15
|
};
|
|
19
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.
|
|
20
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
22
|
mod
|
|
22
23
|
));
|
|
23
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
24
|
|
|
25
25
|
// src/index.ts
|
|
26
|
-
var
|
|
27
|
-
__export(src_exports, {
|
|
28
|
-
default: () => src_default
|
|
29
|
-
});
|
|
30
|
-
module.exports = __toCommonJS(src_exports);
|
|
31
|
-
var import_path = __toESM(require("path"));
|
|
26
|
+
var import_es_dirname = __toESM(require("es-dirname"));
|
|
32
27
|
var import_utils = require("@node-minify/utils");
|
|
33
28
|
var import_run = require("@node-minify/run");
|
|
34
|
-
var binYui =
|
|
29
|
+
var binYui = `${(0, import_es_dirname.default)()}/binaries/yuicompressor-2.4.7.jar`;
|
|
35
30
|
var minifyYUI = ({ settings, content, callback, index }) => {
|
|
36
31
|
return (0, import_run.runCommandLine)({
|
|
37
32
|
args: yuiCommand(settings && settings.type, settings && settings.options),
|
|
@@ -45,7 +40,7 @@ var minifyYUI = ({ settings, content, callback, index }) => {
|
|
|
45
40
|
throw err;
|
|
46
41
|
}
|
|
47
42
|
}
|
|
48
|
-
if (settings && !settings.content) {
|
|
43
|
+
if (settings && !settings.content && settings.output) {
|
|
49
44
|
import_utils.utils.writeFile({ file: settings.output, content: content2, index });
|
|
50
45
|
}
|
|
51
46
|
if (callback) {
|
|
@@ -58,9 +53,8 @@ var minifyYUI = ({ settings, content, callback, index }) => {
|
|
|
58
53
|
var yuiCommand = (type = "js", options) => {
|
|
59
54
|
return ["-jar", "-Xss2048k", binYui, "--type", type].concat(import_utils.utils.buildArgs(options || {}));
|
|
60
55
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
0 && (module.exports = {});
|
|
56
|
+
minifyYUI.default = minifyYUI;
|
|
57
|
+
module.exports = minifyYUI;
|
|
64
58
|
/*!
|
|
65
59
|
* node-minify
|
|
66
60
|
* Copyright(c) 2011-2022 Rodolphe Stoclin
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2022 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\n\
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2022 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
|
@@ -1,38 +1,46 @@
|
|
|
1
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
3
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4
|
+
};
|
|
5
|
+
|
|
1
6
|
// src/index.ts
|
|
2
|
-
import
|
|
7
|
+
import dirname from "es-dirname";
|
|
3
8
|
import { utils } from "@node-minify/utils";
|
|
4
9
|
import { runCommandLine } from "@node-minify/run";
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
var require_src = __commonJS({
|
|
11
|
+
"src/index.ts"(exports, module) {
|
|
12
|
+
var binYui = `${dirname()}/binaries/yuicompressor-2.4.7.jar`;
|
|
13
|
+
var minifyYUI = ({ settings, content, callback, index }) => {
|
|
14
|
+
return runCommandLine({
|
|
15
|
+
args: yuiCommand(settings && settings.type, settings && settings.options),
|
|
16
|
+
data: content,
|
|
17
|
+
settings,
|
|
18
|
+
callback: (err, content2) => {
|
|
19
|
+
if (err) {
|
|
20
|
+
if (callback) {
|
|
21
|
+
return callback(err);
|
|
22
|
+
} else {
|
|
23
|
+
throw err;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (settings && !settings.content && settings.output) {
|
|
27
|
+
utils.writeFile({ file: settings.output, content: content2, index });
|
|
28
|
+
}
|
|
29
|
+
if (callback) {
|
|
30
|
+
return callback(null, content2);
|
|
31
|
+
}
|
|
32
|
+
return content2;
|
|
17
33
|
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
var yuiCommand = (type = "js", options) => {
|
|
30
|
-
return ["-jar", "-Xss2048k", binYui, "--type", type].concat(utils.buildArgs(options || {}));
|
|
31
|
-
};
|
|
32
|
-
var src_default = minifyYUI;
|
|
33
|
-
export {
|
|
34
|
-
src_default as default
|
|
35
|
-
};
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
var yuiCommand = (type = "js", options) => {
|
|
37
|
+
return ["-jar", "-Xss2048k", binYui, "--type", type].concat(utils.buildArgs(options || {}));
|
|
38
|
+
};
|
|
39
|
+
minifyYUI.default = minifyYUI;
|
|
40
|
+
module.exports = minifyYUI;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export default require_src();
|
|
36
44
|
/*!
|
|
37
45
|
* node-minify
|
|
38
46
|
* Copyright(c) 2011-2022 Rodolphe Stoclin
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2022 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\n\
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2022 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.3-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.3-beta.0",
|
|
50
|
+
"@node-minify/utils": "8.0.3-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": "f79e146eed24ca117756cf029eb5005631f12892"
|
|
55
57
|
}
|