@moneko/core 3.55.11 → 3.55.13

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{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";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,m=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:this.name,stage:s.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},o=>{o.hooks.processAssets.tapPromise(this.name,async()=>{let s=m.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})})})}}
1
+ import{join as e,parse as t,resolve as s}from"node:path";import{fileURLToPath as o}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";export class ModuleFederationExposesDeclarationPlugin{constructor(e){this.name="ModuleFederationExposesDeclarationPlugin",this.assetName="module-federation.d.ts",this.dts="",this.option=e,this.worker=new i(o(new URL("../worker/dts.mjs",import.meta.url))),this.worker.setMaxListeners(0),this.worker.postMessage({options:{compilerOptions:{isolatedModules:!1,outFile:this.assetName,verbatimModuleSyntax:!1},include:[...Object.values(e.exposes),"typings/**/*.d.ts"]}}),this.worker.once("message",e=>{this.dts=e,this.worker.terminate()})}apply(o){let{exposes:i}=this.option,m=Object.keys(i).map(e=>{let t=e.replace(/\.tsx?$/i,"");return{key:e,name:t,path:s(`types/${this.option.name}/${t}.d.ts`),originPath:i[e]}});o.hooks.thisCompilation.tap({name:this.name,stage:o.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},s=>{s.hooks.processAssets.tapPromise(this.name,async()=>{let o=m.map(async s=>{if(null!==await r(s.originPath)){let o=t(s.originPath);return`${n(e(this.option.name,s.name),`export * from '${t(o.dir).name}/${o.name}'`)}`}return""}),i=await Promise.all(o);i.unshift(this.dts),s.emitAsset("module-federation.d.ts",new a.sources.RawSource(i.join("\n")),{javascriptModule:!1})})})}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.55.11",
3
+ "version": "3.55.13",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",