@node-minify/core
Advanced tools
Comparing version 9.0.2 to 10.0.0-next.0
@@ -15,1 +15,2 @@ import { Settings } from '@node-minify/types'; | ||
export { minify as default }; | ||
export = minify |
@@ -1,29 +0,5 @@ | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
// src/compress.ts | ||
var import_node_fs = __toESM(require("fs")); | ||
var import_utils = require("@node-minify/utils"); | ||
var import_mkdirp = require("mkdirp"); | ||
import fs from "node:fs"; | ||
import { utils } from "@node-minify/utils"; | ||
import { mkdirp } from "mkdirp"; | ||
var compress = (settings) => { | ||
@@ -41,8 +17,8 @@ if (typeof settings.compressor !== "function") { | ||
} | ||
return import_utils.utils.compressSingleFile(settings); | ||
return utils.compressSingleFile(settings); | ||
}; | ||
var compressArrayOfFilesSync = (settings) => { | ||
return Array.isArray(settings.input) && settings.input.forEach((input, index) => { | ||
const content = import_utils.utils.getContentFromFiles(input); | ||
return import_utils.utils.runSync({ settings, content, index }); | ||
const content = utils.getContentFromFiles(input); | ||
return utils.runSync({ settings, content, index }); | ||
}); | ||
@@ -53,5 +29,5 @@ }; | ||
Array.isArray(settings.input) && settings.input.forEach((input, index) => { | ||
const content = import_utils.utils.getContentFromFiles(input); | ||
const content = utils.getContentFromFiles(input); | ||
sequence = sequence.then( | ||
() => import_utils.utils.runAsync({ settings, content, index }) | ||
() => utils.runAsync({ settings, content, index }) | ||
); | ||
@@ -69,4 +45,4 @@ }); | ||
} | ||
if (!import_node_fs.default.statSync(dir).isDirectory()) { | ||
import_mkdirp.mkdirp.sync(dir); | ||
if (!fs.statSync(dir).isDirectory()) { | ||
mkdirp.sync(dir); | ||
} | ||
@@ -76,3 +52,3 @@ }; | ||
// src/compressInMemory.ts | ||
var import_utils2 = require("@node-minify/utils"); | ||
import { utils as utils2 } from "@node-minify/utils"; | ||
var compressInMemory = (settings) => { | ||
@@ -84,9 +60,9 @@ if (typeof settings.compressor !== "function") { | ||
} | ||
return import_utils2.utils.compressSingleFile(settings); | ||
return utils2.compressSingleFile(settings); | ||
}; | ||
// src/setup.ts | ||
var import_node_path = __toESM(require("path")); | ||
var import_utils3 = require("@node-minify/utils"); | ||
var import_glob = require("glob"); | ||
import path from "node:path"; | ||
import { utils as utils3 } from "@node-minify/utils"; | ||
import fg from "fast-glob"; | ||
var defaultSettings = { | ||
@@ -100,3 +76,3 @@ sync: false, | ||
let settings = Object.assign( | ||
import_utils3.utils.clone(defaultSettings), | ||
utils3.clone(defaultSettings), | ||
inputSettings | ||
@@ -139,3 +115,3 @@ ); | ||
const outputMin = input.map( | ||
(file) => import_utils3.utils.setFileNameMin( | ||
(file) => utils3.setFileNameMin( | ||
file, | ||
@@ -150,3 +126,3 @@ output, | ||
return { | ||
output: import_utils3.utils.setFileNameMin( | ||
output: utils3.setFileNameMin( | ||
input, | ||
@@ -184,3 +160,3 @@ output, | ||
if (isWildcardsPresent) { | ||
output.input = (0, import_glob.globSync)(inputWithPublicFolder); | ||
output.input = fg.globSync(inputWithPublicFolder); | ||
} | ||
@@ -198,3 +174,3 @@ for (let i = 0; i < output.input.length; i++) { | ||
if (input.indexOf("*") > -1) { | ||
output = (0, import_glob.globSync)((publicFolder || "") + input); | ||
output = fg.globSync((publicFolder || "") + input); | ||
} | ||
@@ -208,13 +184,13 @@ return output; | ||
} | ||
publicFolder = import_node_path.default.normalize(publicFolder); | ||
publicFolder = path.normalize(publicFolder); | ||
if (Array.isArray(input)) { | ||
output.input = input.map((item) => { | ||
if (import_node_path.default.normalize(item).indexOf(publicFolder) > -1) { | ||
if (path.normalize(item).indexOf(publicFolder) > -1) { | ||
return item; | ||
} | ||
return import_node_path.default.normalize(publicFolder + item); | ||
return path.normalize(publicFolder + item); | ||
}); | ||
return output; | ||
} | ||
input = import_node_path.default.normalize(input); | ||
input = path.normalize(input); | ||
if (input.indexOf(publicFolder) > -1) { | ||
@@ -224,3 +200,3 @@ output.input = input; | ||
} | ||
output.input = import_node_path.default.normalize(publicFolder + input); | ||
output.input = path.normalize(publicFolder + input); | ||
return output; | ||
@@ -271,3 +247,6 @@ }; | ||
minify.default = minify; | ||
module.exports = minify; | ||
var src_default = minify; | ||
export { | ||
src_default as default | ||
}; | ||
/*! | ||
@@ -278,2 +257,1 @@ * node-minify | ||
*/ | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@node-minify/core", | ||
"version": "9.0.2", | ||
"version": "10.0.0-next.0", | ||
"description": "core of @node-minify", | ||
@@ -11,6 +11,7 @@ "keywords": [ | ||
"author": "Rodolphe Stoclin <srodolphe@gmail.com>", | ||
"homepage": "https://github.com/srod/node-minify/tree/master/packages/core#readme", | ||
"homepage": "https://github.com/srod/node-minify/tree/main/packages/core#readme", | ||
"license": "MIT", | ||
"type": "module", | ||
"engines": { | ||
"node": ">=18.0.0" | ||
"node": ">=22.0.0" | ||
}, | ||
@@ -21,10 +22,8 @@ "directories": { | ||
}, | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"main": "./dist/index.cjs", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js" | ||
"import": "./dist/index.js", | ||
"default": "./dist/index.cjs" | ||
} | ||
@@ -45,19 +44,21 @@ }, | ||
}, | ||
"dependencies": { | ||
"glob": "10.3.3", | ||
"mkdirp": "3.0.1", | ||
"@node-minify/utils": "9.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/mkdirp": "^1.0.2", | ||
"@node-minify/types": "9.0.0" | ||
}, | ||
"scripts": { | ||
"clean": "pnpm dlx rimraf dist", | ||
"build": "pnpm clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap", | ||
"build": "tsup src/index.ts --format cjs,esm --dts --clean && bunx fix-tsup-cjs", | ||
"check-exports": "attw --pack .", | ||
"format:check": "biome check .", | ||
"lint": "biome lint .", | ||
"prepublishOnly": "bun run build", | ||
"test": "vitest run", | ||
"test:ci": "vitest run --coverage", | ||
"test:watch": "vitest" | ||
}, | ||
"dependencies": { | ||
"@node-minify/utils": "workspace:*", | ||
"fast-glob": "^3.3.2", | ||
"mkdirp": "3.0.1" | ||
}, | ||
"devDependencies": { | ||
"@node-minify/types": "workspace:*", | ||
"@types/mkdirp": "^2.0.0" | ||
} | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Yes
19077
7
528
1
1
+ Addedfast-glob@^3.3.2
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedfast-glob@3.3.3(transitive)
+ Addedfastq@1.18.0(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedmerge2@1.4.1(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrun-parallel@1.2.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)
- Removedglob@10.3.3
- Removed@isaacs/cliui@8.0.2(transitive)
- Removed@node-minify/utils@9.0.1(transitive)
- Removed@pkgjs/parseargs@0.11.0(transitive)
- Removedansi-regex@5.0.16.1.0(transitive)
- Removedansi-styles@4.3.06.2.1(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@2.0.1(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedcross-spawn@7.0.6(transitive)
- Removedduplexer@0.1.2(transitive)
- Removedeastasianwidth@0.2.0(transitive)
- Removedemoji-regex@8.0.09.2.2(transitive)
- Removedforeground-child@3.3.0(transitive)
- Removedglob@10.3.3(transitive)
- Removedgzip-size@6.0.0(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedjackspeak@2.3.6(transitive)
- Removedlru-cache@10.4.3(transitive)
- Removedminimatch@9.0.5(transitive)
- Removedminipass@7.1.2(transitive)
- Removedpath-key@3.1.1(transitive)
- Removedpath-scurry@1.11.1(transitive)
- Removedshebang-command@2.0.0(transitive)
- Removedshebang-regex@3.0.0(transitive)
- Removedsignal-exit@4.1.0(transitive)
- Removedstring-width@4.2.35.1.2(transitive)
- Removedstrip-ansi@6.0.17.1.0(transitive)
- Removedwhich@2.0.2(transitive)
- Removedwrap-ansi@7.0.08.1.0(transitive)