@moneko/core 3.56.11 → 3.56.12

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.
@@ -1 +1 @@
1
- import{isUint8Array as e}from"node:util/types";import{parentPort as r}from"node:worker_threads";import{compression as o}from"@moneko/utils";r?.setMaxListeners(0),r?.on("message",async({input:s,filename:t,algorithm:m})=>{let f=o(Buffer.isBuffer(s)||e(s)?Array.from(s):s,m);r?.postMessage([t,f])});
1
+ import{isUint8Array as e}from"node:util/types";import{parentPort as r}from"node:worker_threads";import{compression as s}from"@moneko/utils";r?.setMaxListeners(0),r?.on("message",async({input:o,filename:t,algorithm:m})=>{try{let a=s(Buffer.isBuffer(o)||e(o)?Array.from(o):o,m);r?.postMessage([t,a])}catch{r?.postMessage([t,o])}});
@@ -1 +1 @@
1
- let a,r;import{relative as e}from"node:path";import{parentPort as t}from"node:worker_threads";import{ESLint as o}from"@moneko/eslint";import i from"../commom/paths.mjs";if(!t)throw Error("This file must be run as a worker");t?.setMaxListeners(0),t.on("message",async({options:s})=>{a||(a=new o({cache:s.cache,cacheLocation:s.cacheLocation,cacheStrategy:s.cacheStrategy,fix:s.fix}),r=await a.loadFormatter("stylish"));let m=s.files.map(a=>(s.lintDirtyModulesOnly?e(i.programPath,a):a).replace(/\\/g,"/")),c=await a.lintFiles(m),n=[],l=[];s.fix&&await o.outputFixes(c),c.forEach(a=>{a.errorCount?l.push(a):a.warningCount&&n.push(a)});let h=await Promise.all([r.format(n,{cwd:i.programPath,rulesMeta:{}}),r.format(l,{cwd:i.programPath,rulesMeta:{}})]);t.postMessage(h.map(a=>a.replace(/[^\r\n]*(\r?\n)*$/,"")))});
1
+ let a,t;import{relative as e}from"node:path";import{parentPort as r}from"node:worker_threads";import{ESLint as o}from"@moneko/eslint";import s from"../commom/paths.mjs";if(!r)throw Error("This file must be run as a worker");r?.setMaxListeners(0),r.on("message",async({options:i})=>{try{a||(a=new o({cache:i.cache,cacheLocation:i.cacheLocation,cacheStrategy:i.cacheStrategy,fix:i.fix}),t=await a.loadFormatter("stylish"));let m=i.files.map(a=>(i.lintDirtyModulesOnly?e(s.programPath,a):a).replace(/\\/g,"/")),c=await a.lintFiles(m),n=[],h=[];i.fix&&await o.outputFixes(c),c.forEach(a=>{a.errorCount?h.push(a):a.warningCount&&n.push(a)});let l=await Promise.all([t.format(n,{cwd:s.programPath,rulesMeta:{}}),t.format(h,{cwd:s.programPath,rulesMeta:{}})]);r.postMessage(l.map(a=>a.replace(/[^\r\n]*(\r?\n)*$/,"")))}catch{r.postMessage(["",""])}});
@@ -1 +1 @@
1
- import{parentPort as e}from"node:worker_threads";import{stylelint as r}from"@moneko/stylelint";if(!e)throw Error("This file must be run as a worker");let t=await r.formatters.string;e?.setMaxListeners(0),e.on("message",async({options:a})=>{try{let i=await r.lint({cache:a.cache,cacheLocation:a.cacheLocation,fix:a.fix,files:a.files.map(e=>e.replace(/\\/g,"/")),quietDeprecationWarnings:a.quietDeprecationWarnings,quiet:a.quiet});delete i.output;let n=[],s=[];i.results.forEach(e=>{if(!e.ignored&&(e.errored||e.parseErrors.length||e.invalidOptionWarnings.length||e.deprecations.length)){let r=[],t=[];e.warnings.forEach(e=>{"error"===e.severity?r.push(e):"warning"===e.severity&&t.push(e)}),r.length>0&&n.push({...e,warnings:r}),t.length>0&&s.push({...e,warnings:t})}});let o=[t(s,i),t(n,i)];e.postMessage(o.map(e=>e.replace(/[^\r\n]*(\r?\n)*$/,"")))}catch{e.postMessage([])}});
1
+ import{parentPort as e}from"node:worker_threads";import{stylelint as r}from"@moneko/stylelint";if(!e)throw Error("This file must be run as a worker");let t=await r.formatters.string;e?.setMaxListeners(0),e.on("message",async({options:a})=>{try{let i=await r.lint({cache:a.cache,cacheLocation:a.cacheLocation,fix:a.fix,files:a.files.map(e=>e.replace(/\\/g,"/")),quietDeprecationWarnings:a.quietDeprecationWarnings,quiet:a.quiet});delete i.output;let n=[],s=[];i.results.forEach(e=>{if(!e.ignored&&(e.errored||e.parseErrors.length||e.invalidOptionWarnings.length||e.deprecations.length)){let r=[],t=[];e.warnings.forEach(e=>{"error"===e.severity?r.push(e):"warning"===e.severity&&t.push(e)}),r.length>0&&n.push({...e,warnings:r}),t.length>0&&s.push({...e,warnings:t})}});let o=[t(s,i),t(n,i)];e.postMessage(o.map(e=>e.replace(/[^\r\n]*(\r?\n)*$/,"")))}catch{e.postMessage(["",""])}});
@@ -1 +1 @@
1
- import{parentPort as r}from"node:worker_threads";import{minify as e}from"@swc/core";if(!r)throw Error("This file must be run as a worker");r?.setMaxListeners(0),r.on("message",async({buffer:o,options:s})=>{let{code:t}=await e(Buffer.from(o).toString().replace(/\r\n/g,"\n"),s);r.postMessage(t)});
1
+ import{parentPort as r}from"node:worker_threads";import{minify as e}from"@swc/core";if(!r)throw Error("This file must be run as a worker");r?.setMaxListeners(0),r.on("message",async({buffer:o,options:s})=>{try{let t=Buffer.from(o).toString().replace(/\r\n/g,"\n"),{code:a}=await e(t,s);r.postMessage(a)}catch{r.postMessage(Buffer.from(o).toString())}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.56.11",
3
+ "version": "3.56.12",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",