@moneko/core 3.55.2-beta.0 → 3.55.2-beta.1
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/lib/loader/react-compiler.cjs +1 -1
- package/lib/loader/react-compiler.d.cts +1 -1
- package/lib/loader/solid.cjs +1 -1
- package/lib/plugin/eslint.mjs +1 -1
- package/lib/plugin/exposes-declararion.mjs +1 -1
- package/lib/plugin/stylelint.mjs +1 -1
- package/lib/worker/dts.mjs +1 -1
- package/lib/worker/eslint.mjs +1 -1
- package/lib/worker/react-compiler.mjs +1 -1
- package/lib/worker/solid.mjs +1 -1
- package/lib/worker/stylelint.mjs +1 -1
- package/lib/worker/swc-minify.mjs +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return s}});const e=require("node:path"),t=require("node:worker_threads");function s(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return s}});const e=require("node:path"),t=new(require("node:worker_threads")).Worker((0,e.join)(__dirname,"../worker/react-compiler.mjs"));function s(e){let s,r=this.async(),o=this.resourcePath,i=this.getOptions();this.cacheable&&this.cacheable(),this._compiler?.hooks.done.tap("react-compiler-loader",()=>{t.terminate()}),s="annotation"===i.compilationMode?e.includes("use memo")||e.includes("use forget"):e.includes("react")||this.resourcePath.endsWith(".tsx")||this.resourcePath.endsWith(".jsx"),this.resourcePath.endsWith(".d.ts")||!s?r(null,e):(t.postMessage({sourceCode:e,resourcePath:o,options:i}),t.once("message",e=>{o===e[0]&&r(e[1],e[2],e[3])}))}t.setMaxListeners(0);
|
|
@@ -23,4 +23,4 @@ export interface ReactCompilerOption extends PluginOptions {
|
|
|
23
23
|
*/
|
|
24
24
|
compilationMode: 'annotation' | 'infer' | 'syntax' | 'all';
|
|
25
25
|
}
|
|
26
|
-
export default function reactCompilerLoader(this: LoaderContext<ReactCompilerOption>, sourceCode: string):
|
|
26
|
+
export default function reactCompilerLoader(this: LoaderContext<ReactCompilerOption>, sourceCode: string): void;
|
package/lib/loader/solid.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=exports,t={get custom(){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=exports,t={get custom(){return i},get default(){return a}};for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:Object.getOwnPropertyDescriptor(t,r).get});const s=require("node:path"),o=new(require("node:worker_threads")).Worker((0,s.join)(__dirname,"../worker/solid.mjs"));async function n(e,t){this.cacheable&&this.cacheable(),this._compiler?.hooks.done.tap("solid-loader",()=>{o.terminate()});let r=this.async(),s=this.getOptions(),n=this.resourcePath;o.postMessage({...s,sourceCode:e,filename:n,inputSourceMap:t}),o.on("message",e=>{n===e[0]&&r(e[1],e[2],e[3])})}function i(e,t){return n.bind(this,e,t)}o.setMaxListeners(0);const a=n;
|
package/lib/plugin/eslint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileURLToPath as t}from"node:url";import e
|
|
1
|
+
import{fileURLToPath as t}from"node:url";import{Worker as e}from"node:worker_threads";import s from"webpack";class o extends s.WebpackError{constructor(t){super(`[ESLint] ${t}`),this.name="ESLintError",this.stack=""}}export class ESLintPlugin{constructor(s={files:[]}){this.name="ESLintPlugin",this.options=s,this.worker=new e(t(new URL("../worker/eslint.mjs",import.meta.url))),this.worker.setMaxListeners(0)}apply(t){t.hooks.thisCompilation.tap(this.name,e=>{let s=t.modifiedFiles||new Set;e.hooks.finishModules.tap(this.name,t=>{let o=this.options;if(this.options?.lintDirtyModulesOnly){let e=[];for(let o of t){let t=o.resource;s.has(t)&&e.push(t)}o.files=e}this.worker.postMessage({options:o}),this.worker.once("message",t=>{this.report(e,t)})})}),t.hooks.shutdown.tap(this.name,()=>{this.worker.terminate()})}report(t,e){e?.length&&t&&(e[0]?.length&&t.warnings.push(new o(e[0])),e[1]?.length&&t.errors.push(new o(e[1])))}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as e,parse as t,resolve as o}from"node:path";import{fileURLToPath as s}from"node:url";import{
|
|
1
|
+
import{join as e,parse as t,resolve as o}from"node:path";import{fileURLToPath as s}from"node:url";import{Worker as i}from"node:worker_threads";import{loadFile as r}from"@moneko/utils";import a from"webpack";import n from"../utils/create-types.mjs";let m="ModuleFederationExposesDeclarationPlugin";export class ModuleFederationExposesDeclarationPlugin{constructor(e){this.name="ModuleFederationExposesDeclarationPlugin",this.assetName="module-federation.d.ts",this.dts="",this.option=e,this.worker=new i(s(new URL("../worker/dts.mjs",import.meta.url))),this.worker.setMaxListeners(0),this.worker.postMessage({options:{compilerOptions:{outFile:this.assetName},include:Object.values(e.exposes)}}),this.worker.once("message",e=>{this.dts=e,this.worker.terminate()})}apply(s){let{exposes:i}=this.option,p=Object.keys(i).map(e=>{let t=e.replace(/\.tsx?$/i,"");return{key:e,name:t,path:o(`types/${this.option.name}/${t}.d.ts`),originPath:i[e]}});s.hooks.thisCompilation.tap({name:m,stage:s.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},o=>{o.hooks.processAssets.tapPromise(m,async()=>{let s=p.map(async o=>{if(null!==await r(o.originPath)){let s=t(o.originPath);return`${n(e(this.option.name,o.name),`export * from '${t(s.dir).name}/${s.name}'`)}`}return""}),i=await Promise.all(s);i.unshift(this.dts),o.emitAsset("module-federation.d.ts",new a.sources.RawSource(i.join("\n")),{javascriptModule:!1})})})}}
|
package/lib/plugin/stylelint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileURLToPath as t}from"node:url";import
|
|
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=>{this.worker.postMessage({options:this.options}),this.worker.once("message",e=>{this.report(e,t)})}),t.hooks.shutdown.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])))}}
|
package/lib/worker/dts.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parentPort as
|
|
1
|
+
import{parentPort as s}from"node:worker_threads";import{compileDts as e}from"../utils/compile-dts.mjs";if(!s)throw Error("This file must be run as a worker");s?.setMaxListeners(0),s.on("message",async({options:r})=>{let o=e(r);s.postMessage(o)});
|
package/lib/worker/eslint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
let e,t;import{relative as a}from"node:path";import{
|
|
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 +1 @@
|
|
|
1
|
-
import{parentPort as e}from"node:worker_threads";import{runBabelPluginReactCompiler as o}from"@moneko/eslint/react-compiler";e?.on("message",({sourceCode:r,resourcePath:
|
|
1
|
+
import{parentPort as e}from"node:worker_threads";import{runBabelPluginReactCompiler as o}from"@moneko/eslint/react-compiler";e?.setMaxListeners(0),e?.on("message",({sourceCode:r,resourcePath:s,options:t})=>{let m=o(r,s,"typescript",t);e?.postMessage([s,null,m.code??r,m.map??void 0])});
|
package/lib/worker/solid.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parentPort as e}from"node:worker_threads";import{transformSolidJs as o}from"@moneko/convert/solid";e?.on("message",({sourceCode:s,filename:r,inputSourceMap:t,...a})=>{o(s,{...a,filename:r
|
|
1
|
+
import{parentPort as e}from"node:worker_threads";import{transformSolidJs as o}from"@moneko/convert/solid";e?.setMaxListeners(0),e?.on("message",({sourceCode:s,filename:r,inputSourceMap:t,...a})=>{o(s,{...a,filename:r,inputSourceMap:t}).then(o=>{null===o?e?.postMessage([r,Error(`Failed to transform "${r}"`),s,t]):e?.postMessage([r,null,o.code??s,o.map??t])}).catch(o=>{e?.postMessage([r,o,s,t])})});
|
package/lib/worker/stylelint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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 +1 @@
|
|
|
1
|
-
import{
|
|
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)});
|