@moneko/core 3.55.6 → 3.55.7

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{fileURLToPath as e}from"node:url";import{Worker as t}from"node:worker_threads";import s from"webpack";class o extends s.WebpackError{constructor(e){super(`[ESLint] ${e}`),this.name="ESLintError",this.stack=""}}export class ESLintPlugin{constructor(s={files:[]}){this.name="ESLintPlugin",this.options=s,this.worker=new t(e(new URL("../worker/eslint.mjs",import.meta.url))),this.worker.setMaxListeners(0)}apply(e){e.hooks.thisCompilation.tap(this.name,t=>{let s=e.modifiedFiles||new Set;t.hooks.finishModules.tap(this.name,e=>{let o=this.options;if(this.options?.lintDirtyModulesOnly){let t=[];for(let o of e){let e=o.resource;s.has(e)&&t.push(e)}o.files=t}let r=e=>{this.report(t,e)};this.worker.off("message",r),this.worker.postMessage({options:o}),this.worker.on("message",r)})}),"development"!==e.options.mode&&e.hooks.done.tap(this.name,()=>{this.worker.terminate()})}report(e,t){t?.length&&e&&(t[0]?.length&&e.warnings.push(new o(t[0])),t[1]?.length&&e.errors.push(new o(t[1])))}}
1
+ import{fileURLToPath as e}from"node:url";import{Worker as t}from"node:worker_threads";import s from"webpack";class o extends s.WebpackError{constructor(e){super(`[ESLint] ${e}`),this.name="ESLintError",this.stack=""}}export class ESLintPlugin{constructor(s={files:[]}){this.name="ESLintPlugin",this.options=s,this.worker=new t(e(new URL("../worker/eslint.mjs",import.meta.url))),this.worker.setMaxListeners(0)}apply(e){e.hooks.thisCompilation.tap(this.name,t=>{let s=e.modifiedFiles||new Set,o=e=>{this.report(t,e)};this.worker.on("message",o),t.hooks.finishModules.tap(this.name,e=>{let t=this.options;if(this.options?.lintDirtyModulesOnly){let o=[];for(let t of e){let e=t.resource;s.has(e)&&o.push(e)}t.files=o}this.worker.postMessage({options:t})})}),"development"!==e.options.mode&&e.hooks.done.tap(this.name,()=>{this.worker.terminate()})}report(e,t){t?.length&&e&&(t[0]?.length&&e.warnings.push(new o(t[0])),t[1]?.length&&e.errors.push(new o(t[1])))}}
@@ -1 +1 @@
1
- import{fileURLToPath as t}from"node:url";import{Worker as e}from"node:worker_threads";import r from"webpack";class s extends r.WebpackError{constructor(t){super(`[Stylelint] ${t}`),this.name="StylelintError",this.stack=""}}export class StylelintPlugin{constructor(r={files:[]}){this.name="StylelintPlugin",this.options=r,this.worker=new e(t(new URL("../worker/stylelint.mjs",import.meta.url))),this.worker.setMaxListeners(0)}apply(t){t.hooks.thisCompilation.tap(this.name,t=>{let e=e=>{this.report(e,t)};this.worker.off("message",e),this.worker.postMessage({options:this.options}),this.worker.on("message",e)}),"development"!==t.options.mode&&t.hooks.done.tap(this.name,()=>{this.worker.terminate()})}report(t,e){t?.length&&e&&(t[0]?.length&&e.warnings.push(new s(t[0])),t[1]?.length&&e.errors.push(new s(t[1])))}}
1
+ import{fileURLToPath as t}from"node:url";import{Worker as e}from"node:worker_threads";import r from"webpack";class o extends r.WebpackError{constructor(t){super(`[Stylelint] ${t}`),this.name="StylelintError",this.stack=""}}export class StylelintPlugin{constructor(r={files:[]}){this.name="StylelintPlugin",this.options=r,this.worker=new e(t(new URL("../worker/stylelint.mjs",import.meta.url))),this.worker.setMaxListeners(0)}apply(t){t.hooks.thisCompilation.tap(this.name,t=>{let e=e=>{this.report(e,t)};this.worker.postMessage({options:this.options}),this.worker.on("message",e)}),"development"!==t.options.mode&&t.hooks.done.tap(this.name,()=>{this.worker.terminate()})}report(t,e){t?.length&&e&&(t[0]?.length&&e.warnings.push(new o(t[0])),t[1]?.length&&e.errors.push(new o(t[1])))}}
@@ -1 +1 @@
1
- let e,t;import{relative as a}from"node:path";import{parentPort as r}from"node:worker_threads";import{ESLint as o}from"@moneko/eslint";import i from"../commom/paths.mjs";if(!r)throw Error("This file must be run as a worker");let s=null;r?.setMaxListeners(0),r.on("message",async({options:c})=>{s&&clearTimeout(s),s=setTimeout(async()=>{s&&(clearTimeout(s),s=null);try{e||(e=new o({cache:c.cache,cacheLocation:c.cacheLocation,cacheStrategy:c.cacheStrategy,fix:c.fix}),t=await e.loadFormatter("stylish"));let s=c.files.map(e=>(c.lintDirtyModulesOnly?a(i.programPath,e):e).replace(/\\/g,"/")),l=await e.lintFiles(s),m=[],n=[];c.fix&&await o.outputFixes(l),l.forEach(e=>{e.errorCount?n.push(e):e.warningCount&&m.push(e)});let h=await Promise.all([t.format(m),t.format(n)]);r.postMessage(h.map(e=>e.replace(/[^\r\n]*(\r?\n)*$/,"")))}catch(e){r.postMessage(e)}},2)}),r.on("close",()=>{s&&clearTimeout(s)});
1
+ let a,e;import{relative as t}from"node:path";import{parentPort as r}from"node:worker_threads";import{ESLint as o}from"@moneko/eslint";import i from"../commom/paths.mjs";if(!r)throw Error("This file must be run as a worker");r?.setMaxListeners(0),r.on("message",async({options:s})=>{a||(a=new o({cache:s.cache,cacheLocation:s.cacheLocation,cacheStrategy:s.cacheStrategy,fix:s.fix}),e=await a.loadFormatter("stylish"));let m=s.files.map(a=>(s.lintDirtyModulesOnly?t(i.programPath,a):a).replace(/\\/g,"/")),n=await a.lintFiles(m),c=[],l=[];s.fix&&await o.outputFixes(n),n.forEach(a=>{a.errorCount?l.push(a):a.warningCount&&c.push(a)});let h=await Promise.all([e.format(c),e.format(l)]);r.postMessage(h.map(a=>a.replace(/[^\r\n]*(\r?\n)*$/,"")))});
@@ -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=null,a=await r.formatters.string;e?.setMaxListeners(0),e.on("message",async({options:i})=>{t&&clearTimeout(t),t=setTimeout(async()=>{t&&(clearTimeout(t),t=null);try{let t=await r.lint({cache:i.cache,cacheLocation:i.cacheLocation,fix:i.fix,files:i.files.map(e=>e.replace(/\\/g,"/")),quietDeprecationWarnings:i.quietDeprecationWarnings,quiet:i.quiet});delete t.output;let n=[],s=[];t.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=[a(s,t),a(n,t)];e.postMessage(o.map(e=>e.replace(/[^\r\n]*(\r?\n)*$/,"")))}catch(r){e.postMessage(r)}},4)}),e.on("close",()=>{t&&clearTimeout(t)});
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:i})=>{let n=await r.lint({cache:i.cache,cacheLocation:i.cacheLocation,fix:i.fix,files:i.files.map(e=>e.replace(/\\/g,"/")),quietDeprecationWarnings:i.quietDeprecationWarnings,quiet:i.quiet});delete n.output;let a=[],s=[];n.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&&a.push({...e,warnings:r}),t.length>0&&s.push({...e,warnings:t})}});let o=[t(s,n),t(a,n)];e.postMessage(o.map(e=>e.replace(/[^\r\n]*(\r?\n)*$/,"")))});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.55.6",
3
+ "version": "3.55.7",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",