@adamlui/minify.js 1.8.3 → 1.8.4

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/README.md CHANGED
@@ -23,7 +23,7 @@
23
23
 
24
24
  <a href="https://www.npmjs.com/package/@adamlui/minify.js"><img height=31 src="https://img.shields.io/npm/dm/%40adamlui%2Fminify.js?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
25
25
  <a href="#%EF%B8%8F-mit-license"><img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
26
- <a href="https://github.com/adamlui/minify.js/releases/tag/node-v1.8.3"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.8.3-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
26
+ <a href="https://github.com/adamlui/minify.js/releases/tag/node-v1.8.4"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.8.4-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
27
27
  <a href="https://www.npmjs.com/package/@adamlui/minify.js?activeTab=code"><img height=31 src="https://img.shields.io/npm/unpacked-size/%40adamlui%2Fminify.js?style=for-the-badge&logo=ebox&logoColor=white&labelColor=464646&color=blue"></a>
28
28
  <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_minify.js:node.js/src/minify.js"><img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_minify.js%3Anode.js%2Fsrc%2Fminify.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
29
29
  <a href="https://github.com/toolleeo/cli-apps#programming"><img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
package/dist/cli.min.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Source: https://code.minify-js.org/node.js
5
5
  * Documentation: https://docs.minify-js.org/node.js
6
6
  */
7
- let pkgName="@adamlui/minify.js",copyright="© 2024 Adam Lui & contributors under the MIT license.",cmdFormat="minify-js [inputPath] [outputPath] [options]",srcURL="https://code.minify-js.org/node.js",docURL="https://docs.minify-js.org/node.js/#-command-line-usage";(async()=>{let r=require(__dirname.match(/src/)?"./minify":"./minify.min"),t=require("fs"),l=require("path"),i=require("node-clipboardy"),o=require("child_process").execSync,a="",c="",m="",f="",d="",p="en";if("win32"==process.platform)try{p=o("(Get-Culture).TwoLetterISOLanguageName",{shell:"powershell",encoding:"utf-8"}).trim()}catch(e){}else{var g=process.env;p=(g.LANG||g.LANGUAGE||g.LC_ALL||g.LC_MESSAGES||g.LC_NAME||"en").split(".")[0]}let h={};g=new Promise((s,r)=>{let t="https://cdn.jsdelivr.net/gh/adamlui/minify.js@31bd8ada68dcca95df8ae6b45d213d74147e7932/_locales/",e=(p?p.replace("-","_"):"en")+"/",l=t+e+"messages.json",a=0;$(l).then(async function i(o){try{let e=await o.json(),i={};for(var n in e)"object"==typeof e[n]&&"message"in e[n]&&(i[n]=e[n].message);s(i)}catch(e){if(3==++a)return s({});$(l=p.includes("-")&&1==a?l.replace(/([^_]*)_[^/]*(\/.*)/,"$1$2"):t+"en/messages.json").then(i).catch(r)}}).catch(r)});try{h=await g}catch(e){}let u={},s={flags:{dryRun:/^--?(?:n|dry-?run)$/,includeDotFolders:/^--?(?:dd?|(?:include-?)?dot-?(?:folder|dir(?:ector(?:y|ie))?)s?=?(?:true|1)?)$/,includeDotFiles:/^--?(?:df|D|(?:include-?)?dot-?files?=?(?:true|1)?)$/,noRecursion:/^--?(?:R|(?:disable|no)-?recursi(?:on|ve)|recursi(?:on|ve)=(?:false|0))$/,noMangle:/^--?(?:M|(?:disable|no)-?mangle|mangle=(?:false|0))$/,noFilenameChange:/^--?(?:X|(?:disable|no)-?(?:file)?name-?change|(?:file)?name-?change=(?:false|0))$/,copy:/^--?c(?:opy)?$/,quietMode:/^--?q(?:uiet)?(?:-?mode)?$/},paramOptions:{ignoreFiles:/^--?(?:ignore|skip|exclude)(?:d?-?files?)?(?:=.*|$)/,comment:/^--?comments?(?:=.*|$)/},infoCmds:{help:/^--?h(?:elp)?$/,version:/^--?ve?r?s?i?o?n?$/}};if(process.argv.forEach(i=>{var e,o,n;i.startsWith("-")&&(n=Object.keys(s.flags).find(e=>s.flags[e].test(i)),e=Object.keys(s.paramOptions).find(e=>s.paramOptions[e].test(i)),o=Object.keys(s.infoCmds).find(e=>s.infoCmds[e].test(i)),n?u[n]=!0:e?(/=.+/.test(i)||(console.error(`
7
+ let pkgName="@adamlui/minify.js",copyright="© 2024 Adam Lui & contributors under the MIT license.",cmdFormat="minify-js [inputPath] [outputPath] [options]",srcURL="https://code.minify-js.org/node.js",docURL="https://docs.minify-js.org/node.js/#-command-line-usage";(async()=>{let r=require(__dirname.match(/src/)?"./minify":"./minify.min"),t=require("fs"),l=require("path"),i=require("node-clipboardy"),o=require("child_process").execSync,a="",c="",m="",f="",d="",p="en";if("win32"==process.platform)try{p=o("(Get-Culture).TwoLetterISOLanguageName",{shell:"powershell",encoding:"utf-8"}).trim()}catch(e){}else{var g=process.env;p=(g.LANG||g.LANGUAGE||g.LC_ALL||g.LC_MESSAGES||g.LC_NAME||"en").split(".")[0]}let h={};g=new Promise((s,r)=>{let t="https://cdn.jsdelivr.net/gh/adamlui/minify.js@dcb54b5f09ff44d9b68431328b7baaa7240a4a9e/_locales/",e=(p?p.replace("-","_"):"en")+"/",l=t+e+"messages.json",a=0;$(l).then(async function i(o){try{let e=await o.json(),i={};for(var n in e)"object"==typeof e[n]&&"message"in e[n]&&(i[n]=e[n].message);s(i)}catch(e){if(3==++a)return s({});$(l=p.includes("-")&&1==a?l.replace(/([^_]*)_[^/]*(\/.*)/,"$1$2"):t+"en/messages.json").then(i).catch(r)}}).catch(r)});try{h=await g}catch(e){}let u={},s={flags:{dryRun:/^--?(?:n|dry-?run)$/,includeDotFolders:/^--?(?:dd?|(?:include-?)?dot-?(?:folder|dir(?:ector(?:y|ie))?)s?=?(?:true|1)?)$/,includeDotFiles:/^--?(?:df|D|(?:include-?)?dot-?files?=?(?:true|1)?)$/,noRecursion:/^--?(?:R|(?:disable|no)-?recursi(?:on|ve)|recursi(?:on|ve)=(?:false|0))$/,noMangle:/^--?(?:M|(?:disable|no)-?mangle|mangle=(?:false|0))$/,noFilenameChange:/^--?(?:X|(?:disable|no)-?(?:file)?name-?change|(?:file)?name-?change=(?:false|0))$/,copy:/^--?c(?:opy)?$/,quietMode:/^--?q(?:uiet)?(?:-?mode)?$/},paramOptions:{ignoreFiles:/^--?(?:ignore|skip|exclude)(?:d?-?files?)?(?:=.*|$)/,comment:/^--?comments?(?:=.*|$)/},infoCmds:{help:/^--?h(?:elp)?$/,version:/^--?ve?r?s?i?o?n?$/}};if(process.argv.forEach(i=>{var e,o,n;i.startsWith("-")&&(n=Object.keys(s.flags).find(e=>s.flags[e].test(i)),e=Object.keys(s.paramOptions).find(e=>s.paramOptions[e].test(i)),o=Object.keys(s.infoCmds).find(e=>s.infoCmds[e].test(i)),n?u[n]=!0:e?(/=.+/.test(i)||(console.error(`
8
8
  ${c+(h.prefix_error||"ERROR")}: `+`Arg [--${i.replace(/-/g,"")}] `+`${h.error_noEqual||"requires '=' followed by a value"}.${a}`),_(),process.exit(1)),n=i.split("=")[1],u[e]=parseInt(n)||n):o||(console.error(`
9
9
  ${c+(h.prefix_error||"ERROR")}: `+`Arg [${i}] ${h.error_notRecognized||"not recognized"}.`),console.info(`
10
10
  ${m+(h.info_validArgs||"Valid arguments are below")}.`),y(["flags","paramOptions","infoCmds"]),process.exit(1)))}),process.argv.some(e=>s.infoCmds.help.test(e)))y();else if(process.argv.some(e=>s.infoCmds.version.test(e))){g=o(`npm view ${pkgName} version`).toString().trim()||"none";let e,i=process.cwd();for(;"/"!=i;){var n=l.join(i,"package.json");if(t.existsSync(n)){n=require(n);e=(n.dependencies?.[pkgName]||n.devDependencies?.[pkgName])?.match(/(\d+\.\d+\.\d+)/)[0]||"none";break}i=l.dirname(i)}console.info(`
@@ -17,9 +17,9 @@ ${m+(h.info_filesToBeMinned||"JS files to be minified")}:`),g.forEach(e=>con
17
17
  ${m+(h.info_noFilesWillBeMinned||"No JS files will be minified")}.`);else{let o=[];g=g.map(e=>{var i=r.minify(e,{verbose:!u.quietMode,mangle:!u.noMangle,comment:u.comment?.replace(/\\n/g,"\n")});return i.error&&o.push(e),i}).filter(e=>!e.error);0<g?.length?(v(`
18
18
  ${f+(h.info_minComplete||"Minification complete")}!`),v(d+g.length+" "+(h.info_file||"file")+`${1<g.length?"s":""} ${h.info_minified||"minified"}.${a}`)):v(`
19
19
  ${m+(h.info_noFilesProcessed||"No unminified JavaScript files processed")}.`),0<o.length&&(v(`
20
- ${c+o.length} `+(h.info_file||"file")+`${1<o.length?"s":""} ${h.info_failedToMinify||"failed to minify"}:${a}`),o.forEach(e=>v(e))),0!=g?.length&&(1==g?.length?(console.log(`
21
- `+d+g[0].code+a),u.copy&&(v(`
22
- ${h.info_copying||"Copying to clipboard"}...`),i.writeSync(g[0].code))):(v(`
20
+ ${c+o.length} `+(h.info_file||"file")+`${1<o.length?"s":""} ${h.info_failedToMinify||"failed to minify"}:${a}`),o.forEach(e=>v(e))),0!=g?.length&&(u.copy&&1==g?.length?(console.log(`
21
+ `+d+g[0].code+a),v(`
22
+ ${h.info_copying||"Copying to clipboard"}...`),i.writeSync(g[0].code)):(v(`
23
23
  ${h.info_writing||"Writing to file"}${1<g?.length?"s":""}...`),g?.forEach(({code:e,srcPath:i})=>{var o=l.join(l.dirname(i),(/so?u?rce?$/.test(l.dirname(i))?"../":"")+(s.endsWith(".js")?l.dirname(s):s||"min")),i=(s.endsWith(".js")&&n.endsWith(".js")?l.basename(s).replace(/(\.min)?\.js$/,""):l.basename(i,".js"))+`${u.noFilenameChange?"":".min"}.js`,i=l.join(o,i);t.existsSync(o)||t.mkdirSync(o,{recursive:!0}),t.writeFileSync(i,e,"utf8")})))}}function $(n){return new Promise((o,e)=>{var i=n.match(/^([^:]+):\/\//)[1];/^https?$/.test(i)||e(new Error(`${h.error_invalidURL||"Invalid URL"}.`)),require(i).get(n,e=>{let i="";e.on("data",e=>i+=e),e.on("end",()=>o({json:()=>JSON.parse(i)}))}).on("error",e)})}function y(e=["header","usage","pathArgs","flags","paramOptions","infoCmds"]){var i=` ${pkgName.replace(/^@[^/]+\//,"")}  `;let o={header:["\n├ "+i+(h.appCopyright||copyright),i+(h.prefix_source||"Source")+": "+srcURL],usage:[`
24
24
  ${d}o ${h.helpSection_usage||"Usage"}:`,` ${d}» `+f+cmdFormat+a],pathArgs:[`
25
25
  ${d}o ${h.helpSection_pathArgs||"Path arguments"}:`," [inputPath] "+`${h.inputPathDesc_main||"Path to JS file or directory containing JS files to be minified"}, `+`${h.inputPathDesc_extra||"relative to the current working directory"}.`," [outputPath] "+`${h.outputPathDesc_main||"Path to file or directory where minified files will be stored"}, `+`${h.outputPathDesc_extra||"relative to original file location (if not provided, min/ is used)"}.`],flags:[`
package/docs/README.md CHANGED
@@ -23,7 +23,7 @@
23
23
 
24
24
  <a href="https://www.npmjs.com/package/@adamlui/minify.js"><img height=31 src="https://img.shields.io/npm/dm/%40adamlui%2Fminify.js?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
25
25
  <a href="#%EF%B8%8F-mit-license"><img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
26
- <a href="https://github.com/adamlui/minify.js/releases/tag/node-v1.8.3"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.8.3-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
26
+ <a href="https://github.com/adamlui/minify.js/releases/tag/node-v1.8.4"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.8.4-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
27
27
  <a href="https://www.npmjs.com/package/@adamlui/minify.js?activeTab=code"><img height=31 src="https://img.shields.io/npm/unpacked-size/%40adamlui%2Fminify.js?style=for-the-badge&logo=ebox&logoColor=white&labelColor=464646&color=blue"></a>
28
28
  <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_minify.js:node.js/src/minify.js"><img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_minify.js%3Anode.js%2Fsrc%2Fminify.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
29
29
  <a href="https://github.com/toolleeo/cli-apps#programming"><img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamlui/minify.js",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
4
4
  "description": "Recursively minify all JavaScript files",
5
5
  "author": {
6
6
  "name": "Adam Lui",