@node-minify/sqwish 9.0.1 → 10.0.0-next.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/index.cjs ADDED
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ default: () => src_default
34
+ });
35
+ module.exports = __toCommonJS(src_exports);
36
+ var import_utils = require("@node-minify/utils");
37
+ var import_sqwish = __toESM(require("sqwish"), 1);
38
+ var minifySqwish = ({
39
+ settings,
40
+ content,
41
+ callback,
42
+ index
43
+ }) => {
44
+ const contentMinified = import_sqwish.default.minify(content, settings?.options?.strict);
45
+ if (settings && !settings.content && settings.output) {
46
+ import_utils.utils.writeFile({
47
+ file: settings.output,
48
+ content: contentMinified,
49
+ index
50
+ });
51
+ }
52
+ if (callback) {
53
+ return callback(null, contentMinified);
54
+ }
55
+ return contentMinified;
56
+ };
57
+ minifySqwish.default = minifySqwish;
58
+ var src_default = minifySqwish;
59
+ /*!
60
+ * node-minify
61
+ * Copyright(c) 2011-2024 Rodolphe Stoclin
62
+ * MIT Licensed
63
+ */
64
+
65
+ // fix-cjs-exports
66
+ if (module.exports.default) {
67
+ Object.assign(module.exports.default, module.exports);
68
+ module.exports = module.exports.default;
69
+ delete module.exports.default;
70
+ }
@@ -12,3 +12,4 @@ declare const minifySqwish: {
12
12
  };
13
13
 
14
14
  export { minifySqwish as default };
15
+ export = minifySqwish
package/dist/index.d.ts CHANGED
@@ -12,3 +12,4 @@ declare const minifySqwish: {
12
12
  };
13
13
 
14
14
  export { minifySqwish as default };
15
+ export = minifySqwish
package/dist/index.js CHANGED
@@ -1,39 +1,15 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- }
14
- return to;
15
- };
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.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
-
25
1
  // src/index.ts
26
- var import_utils = require("@node-minify/utils");
27
- var import_sqwish = __toESM(require("sqwish"));
2
+ import { utils } from "@node-minify/utils";
3
+ import sqwish from "sqwish";
28
4
  var minifySqwish = ({
29
5
  settings,
30
6
  content,
31
7
  callback,
32
8
  index
33
9
  }) => {
34
- const contentMinified = import_sqwish.default.minify(content, settings?.options?.strict);
10
+ const contentMinified = sqwish.minify(content, settings?.options?.strict);
35
11
  if (settings && !settings.content && settings.output) {
36
- import_utils.utils.writeFile({
12
+ utils.writeFile({
37
13
  file: settings.output,
38
14
  content: contentMinified,
39
15
  index
@@ -45,10 +21,12 @@ var minifySqwish = ({
45
21
  return contentMinified;
46
22
  };
47
23
  minifySqwish.default = minifySqwish;
48
- module.exports = minifySqwish;
24
+ var src_default = minifySqwish;
25
+ export {
26
+ src_default as default
27
+ };
49
28
  /*!
50
29
  * node-minify
51
30
  * Copyright(c) 2011-2024 Rodolphe Stoclin
52
31
  * MIT Licensed
53
32
  */
54
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-minify/sqwish",
3
- "version": "9.0.1",
3
+ "version": "10.0.0-next.0",
4
4
  "description": "sqwish plugin for @node-minify",
5
5
  "keywords": [
6
6
  "compressor",
@@ -9,23 +9,22 @@
9
9
  "sqwish"
10
10
  ],
11
11
  "author": "Rodolphe Stoclin <srodolphe@gmail.com>",
12
- "homepage": "https://github.com/srod/node-minify/tree/master/packages/sqwish#readme",
12
+ "homepage": "https://github.com/srod/node-minify/tree/main/packages/sqwish#readme",
13
13
  "license": "MIT",
14
+ "type": "module",
14
15
  "engines": {
15
- "node": ">=18.0.0"
16
+ "node": ">=22.0.0"
16
17
  },
17
18
  "directories": {
18
19
  "lib": "dist",
19
20
  "test": "__tests__"
20
21
  },
21
- "main": "./dist/index.js",
22
- "module": "./dist/index.mjs",
23
- "types": "./dist/index.d.ts",
22
+ "main": "./dist/index.cjs",
24
23
  "exports": {
24
+ "./package.json": "./package.json",
25
25
  ".": {
26
- "types": "./dist/index.d.ts",
27
- "import": "./dist/index.mjs",
28
- "require": "./dist/index.js"
26
+ "import": "./dist/index.js",
27
+ "default": "./dist/index.cjs"
29
28
  }
30
29
  },
31
30
  "files": [
@@ -41,19 +40,21 @@
41
40
  "bugs": {
42
41
  "url": "https://github.com/srod/node-minify/issues"
43
42
  },
44
- "dependencies": {
45
- "sqwish": "0.2.2",
46
- "@node-minify/utils": "9.0.1"
47
- },
48
- "devDependencies": {
49
- "@node-minify/types": "9.0.0"
50
- },
51
43
  "scripts": {
52
- "clean": "pnpm dlx rimraf dist",
53
- "build": "pnpm clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
44
+ "build": "tsup src/index.ts --format cjs,esm --dts --clean && bunx fix-tsup-cjs",
45
+ "check-exports": "attw --pack .",
46
+ "format:check": "biome check .",
54
47
  "lint": "biome lint .",
48
+ "prepublishOnly": "bun run build",
55
49
  "test": "vitest run",
56
50
  "test:ci": "vitest run --coverage",
57
51
  "test:watch": "vitest"
52
+ },
53
+ "dependencies": {
54
+ "@node-minify/utils": "workspace:*",
55
+ "sqwish": "0.2.2"
56
+ },
57
+ "devDependencies": {
58
+ "@node-minify/types": "workspace:*"
58
59
  }
59
- }
60
+ }
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2024 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { MinifierOptions } from \"@node-minify/types\";\nimport { utils } from \"@node-minify/utils\";\nimport sqwish from \"sqwish\";\n\n/**\n * Run sqwish.\n * @param settings Sqwish options\n * @param content Content to minify\n * @param callback Callback\n * @param index Index of current file in array\n * @returns Minified content\n */\nconst minifySqwish = ({\n settings,\n content,\n callback,\n index,\n}: MinifierOptions) => {\n const contentMinified = sqwish.minify(content, settings?.options?.strict);\n if (settings && !settings.content && settings.output) {\n utils.writeFile({\n file: settings.output,\n content: contentMinified,\n index,\n });\n }\n if (callback) {\n return callback(null, contentMinified);\n }\n return contentMinified;\n};\n\n/**\n * Expose `minifySqwish()`.\n */\nminifySqwish.default = minifySqwish;\nexport = minifySqwish;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAUA,mBAAsB;AACtB,oBAAmB;AAUnB,IAAM,eAAe,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,MAAuB;AACnB,QAAM,kBAAkB,cAAAA,QAAO,OAAO,SAAS,UAAU,SAAS,MAAM;AACxE,MAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AAClD,uBAAM,UAAU;AAAA,MACZ,MAAM,SAAS;AAAA,MACf,SAAS;AAAA,MACT;AAAA,IACJ,CAAC;AAAA,EACL;AACA,MAAI,UAAU;AACV,WAAO,SAAS,MAAM,eAAe;AAAA,EACzC;AACA,SAAO;AACX;AAKA,aAAa,UAAU;AACvB,iBAAS;","names":["sqwish"]}
package/dist/index.mjs DELETED
@@ -1,40 +0,0 @@
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
-
6
- // src/index.ts
7
- import { utils } from "@node-minify/utils";
8
- import sqwish from "sqwish";
9
- var require_src = __commonJS({
10
- "src/index.ts"(exports, module) {
11
- var minifySqwish = ({
12
- settings,
13
- content,
14
- callback,
15
- index
16
- }) => {
17
- const contentMinified = sqwish.minify(content, settings?.options?.strict);
18
- if (settings && !settings.content && settings.output) {
19
- utils.writeFile({
20
- file: settings.output,
21
- content: contentMinified,
22
- index
23
- });
24
- }
25
- if (callback) {
26
- return callback(null, contentMinified);
27
- }
28
- return contentMinified;
29
- };
30
- minifySqwish.default = minifySqwish;
31
- module.exports = minifySqwish;
32
- }
33
- });
34
- export default require_src();
35
- /*!
36
- * node-minify
37
- * Copyright(c) 2011-2024 Rodolphe Stoclin
38
- * MIT Licensed
39
- */
40
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2024 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { MinifierOptions } from \"@node-minify/types\";\nimport { utils } from \"@node-minify/utils\";\nimport sqwish from \"sqwish\";\n\n/**\n * Run sqwish.\n * @param settings Sqwish options\n * @param content Content to minify\n * @param callback Callback\n * @param index Index of current file in array\n * @returns Minified content\n */\nconst minifySqwish = ({\n settings,\n content,\n callback,\n index,\n}: MinifierOptions) => {\n const contentMinified = sqwish.minify(content, settings?.options?.strict);\n if (settings && !settings.content && settings.output) {\n utils.writeFile({\n file: settings.output,\n content: contentMinified,\n index,\n });\n }\n if (callback) {\n return callback(null, contentMinified);\n }\n return contentMinified;\n};\n\n/**\n * Expose `minifySqwish()`.\n */\nminifySqwish.default = minifySqwish;\nexport = minifySqwish;\n"],"mappings":";;;;;;AAUA,SAAS,aAAa;AACtB,OAAO,YAAY;AAXnB;AAAA;AAqBA,QAAM,eAAe,CAAC;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ,MAAuB;AACnB,YAAM,kBAAkB,OAAO,OAAO,SAAS,UAAU,SAAS,MAAM;AACxE,UAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AAClD,cAAM,UAAU;AAAA,UACZ,MAAM,SAAS;AAAA,UACf,SAAS;AAAA,UACT;AAAA,QACJ,CAAC;AAAA,MACL;AACA,UAAI,UAAU;AACV,eAAO,SAAS,MAAM,eAAe;AAAA,MACzC;AACA,aAAO;AAAA,IACX;AAKA,iBAAa,UAAU;AACvB,qBAAS;AAAA;AAAA;","names":[]}