@moneko/core 4.8.6-beta.6 → 4.8.6-beta.8

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/config.mjs CHANGED
@@ -1 +1 @@
1
- import{sep as e}from"node:path";import o from"node:process";import{merge as t}from"webpack-merge";import{CUSTOMCONFIG as n}from"./commom/custom-config.mjs";import s from"./commom/paths.mjs";import{join as a}from"./commom/posix.mjs";import i from"./commom/setup-env.mjs";import r from"./options/jsx-dom-expressions.mjs";import m from"./options/split-chunk.mjs";import{getConfigWithTypescript as l,isFunction as p,node_modules as c,resolveProgram as u}from"./utils/index.mjs";import{initDts as d}from"./vm/dts.mjs";import{APPTYPE as f,FRAMEWORK as h,frameworkVersion as g,isCI as v,isDev as x,isLibrary as b,isMobile as j,isReact as C,jsxImportSource as P,mainDirectory as k,NODE_ENV as w,PACKAGENAME as O}from"./process-env.mjs";let I=[/(app|vm|docs|example):[a-zA-Z_0-9]/,"@moneko","neko-ui",".cache/http/data","@element-plus","ant-design-vue","element-plus","element-ui","ng-zorro-antd","@mui","@du","@fontsource","@fortawesome","font-pingfang-sc","font-pingfang-tc","katex","react-markdown-editor-lite","react-photo-view","schema-design","monaco-editor"];export async function getConfig(e){let t=l(e).default;return(p(t)?await t(o):t)??{}}let S=await i(w,f,h,[],"true"===o.env.IS_BUILD,n),[y,M]=await Promise.all([getConfig(s.configPath),getConfig(s.customConfigPath)]),z={mode:w,strict:!1,devtool:"true"!==o.env.IS_BUILD&&x?"eval-cheap-module-source-map":"cheap-module-source-map",seo:!1,bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:"",namespace:O,moduleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]",fallbackModuleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]"},env:S,basename:"/",publicPath:"auto",rem:{designSize:j?375:1920},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:Object.assign({"@":u(k)},C&&g<18?{"react/package.json":c("react/package.json"),"react/jsx-runtime":c("react/jsx-runtime.js"),"react/jsx-dev-runtime":c("react/jsx-dev-runtime.js")}:{}),moduleRules:[],prefixJsLoader:[],cssModules:[],cssModuleDefinition:!0,importOnDemand:{},proxy:{},devServer:{host:"localhost",port:3e3,open:!0},htmlPluginOption:{title:O.toLocaleUpperCase(),favicon:"https://h5static.dewucdn.com/node-common/718d5e10-576d-8b14-b0b1-e4c58c3b3f40.webp"},copy:{},routerMode:"browser",fixBrowserRouter:!1,plugins:[],resolvePlugins:[],overrideResolve:!1,splitChunk:m,runtimeChunk:"single",moduleFederation:[],rulesInclude:{css:I,js:I,media:I,font:I,wasm:[]},mdx:{jsx:!1,development:x,jsxImportSource:P,providerImportSource:`@moneko/${h}/mdx`},jsxDomExpressions:r,bar:{name:"Client",nameColor:"68",msgColor:"242",barBgColor:"15",barColor:"69",quiet:v},normalizeCss:!0,externalsPresets:{},buildHttp:void 0,virtualModule:{},cssExtract:{},externals:["@swc/core"],lazyCompilation:!1,performance:!1,refresh:"solid"!==h,bundleId:"com.moneko.bid",bundles:[],stylelint:{},eslint:{lintDirtyModulesOnly:!1},minChunkSize:1e3,compression:!1,manifest:{filename:"site.webmanifest"},corepack:!0,reactJsxRuntime:"automatic"};b&&(z.alias=Object.assign(z.alias,{"@pkg":s.componentsPath,[O]:s.componentsPath}));let D=z;if((!1===(D=t(D,y,M)).devtool||!1===D.sourceMap)&&(D.sourceMap=!1,D.devtool=!1),"true"===o.env.CODESPACES&&(D.devServer.https=!1),!1===D.devServer.https&&"darwin"===o.platform&&(D.devServer.open=!1),D.htmlPluginOption&&(D.htmlPluginOption.tags||(D.htmlPluginOption.tags=[]),D.fixBrowserRouter&&D.htmlPluginOption.tags.push({textContent:"(function(l) {if (l.search[1] === '/' ) {var decoded = l.search.slice(1).split('&').map(function(s) {return s.replace(/~and~/g, '&')}).join('?');window.history.replaceState(null, null,l.pathname.slice(0, -1) + decoded + l.hash);}}(window.location))"}),D.manifest)){let o=D.manifest.publicPath??D.htmlPluginOption.publicPath??D.publicPath??"/";D.htmlPluginOption.tags.push({href:a("auto"===o?"/":o,D.manifest.filename).replaceAll(e,"/"),tag:"link",rel:"manifest"})}export const CONFIG=D;export const PUBLICPATH="auto"===CONFIG.publicPath?"":CONFIG.publicPath;d(CONFIG);
1
+ import{sep as e}from"node:path";import o from"node:process";import{merge as t}from"webpack-merge";import{CUSTOMCONFIG as n}from"./commom/custom-config.mjs";import s from"./commom/paths.mjs";import{join as a}from"./commom/posix.mjs";import i from"./commom/setup-env.mjs";import r from"./options/jsx-dom-expressions.mjs";import m from"./options/split-chunk.mjs";import{getConfigWithTypescript as l,isFunction as p,node_modules as c,resolveProgram as u}from"./utils/index.mjs";import{initDts as d}from"./vm/dts.mjs";import{APPTYPE as f,FRAMEWORK as h,frameworkVersion as g,isCI as v,isDev as x,isLibrary as b,isMobile as j,isReact as C,jsxImportSource as P,mainDirectory as k,NODE_ENV as w,PACKAGENAME as O}from"./process-env.mjs";let I=[/(app|vm|docs|example):[a-zA-Z_0-9]/,"@moneko","neko-ui",".cache/http/data","@element-plus","ant-design-vue","element-plus","element-ui","ng-zorro-antd","@mui","@du","@fontsource","@fortawesome","font-pingfang-sc","font-pingfang-tc","katex","react-markdown-editor-lite","react-photo-view","schema-design","monaco-editor"];export async function getConfig(e){let t=l(e).default;return(p(t)?await t(o):t)??{}}let S=await i(w,f,h,[],"true"===o.env.IS_BUILD,n),[y,M]=await Promise.all([getConfig(s.configPath),getConfig(s.customConfigPath)]),z={mode:w,strict:!1,devtool:"true"!==o.env.IS_BUILD&&x?"eval-cheap-module-source-map":"cheap-module-source-map",seo:!1,bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:!!v&&{},sourceMap:{filename:"[file].map",publicPath:"",namespace:O,moduleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]",fallbackModuleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]"},env:S,basename:"/",publicPath:"auto",rem:{designSize:j?375:1920},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:Object.assign({"@":u(k)},C&&g<18?{"react/package.json":c("react/package.json"),"react/jsx-runtime":c("react/jsx-runtime.js"),"react/jsx-dev-runtime":c("react/jsx-dev-runtime.js")}:{}),moduleRules:[],prefixJsLoader:[],cssModules:[],cssModuleDefinition:!0,importOnDemand:{},proxy:{},devServer:{host:"localhost",port:3e3,open:!0},htmlPluginOption:{title:O.toLocaleUpperCase(),favicon:"https://h5static.dewucdn.com/node-common/718d5e10-576d-8b14-b0b1-e4c58c3b3f40.webp"},copy:{},routerMode:"browser",fixBrowserRouter:!1,plugins:[],resolvePlugins:[],overrideResolve:!1,splitChunk:m,runtimeChunk:"single",moduleFederation:[],rulesInclude:{css:I,js:I,media:I,font:I,wasm:[]},mdx:{jsx:!1,development:x,jsxImportSource:P,providerImportSource:`@moneko/${h}/mdx`},jsxDomExpressions:r,bar:{name:"Client",nameColor:"68",msgColor:"242",barBgColor:"15",barColor:"69",quiet:v},normalizeCss:!0,externalsPresets:{},buildHttp:void 0,virtualModule:{},cssExtract:{},externals:["@swc/core"],lazyCompilation:!1,performance:!1,refresh:"solid"!==h,bundleId:"com.moneko.bid",bundles:[],stylelint:{},eslint:{lintDirtyModulesOnly:!1},minChunkSize:1e3,compression:!1,manifest:{filename:"site.webmanifest"},corepack:!0,reactJsxRuntime:"automatic"};b&&(z.alias=Object.assign(z.alias,{"@pkg":s.componentsPath,[O]:s.componentsPath}));let D=z;if((!1===(D=t(D,y,M)).devtool||!1===D.sourceMap)&&(D.sourceMap=!1,D.devtool=!1),"true"===o.env.CODESPACES&&(D.devServer.https=!1),!1===D.devServer.https&&"darwin"===o.platform&&(D.devServer.open=!1),D.htmlPluginOption&&(D.htmlPluginOption.tags||(D.htmlPluginOption.tags=[]),D.fixBrowserRouter&&D.htmlPluginOption.tags.push({textContent:"(function(l) {if (l.search[1] === '/' ) {var decoded = l.search.slice(1).split('&').map(function(s) {return s.replace(/~and~/g, '&')}).join('?');window.history.replaceState(null, null,l.pathname.slice(0, -1) + decoded + l.hash);}}(window.location))"}),D.manifest)){let o=D.manifest.publicPath??D.htmlPluginOption.publicPath??D.publicPath??"/";D.htmlPluginOption.tags.push({href:a("auto"===o?"/":o,D.manifest.filename).replaceAll(e,"/"),tag:"link",rel:"manifest"})}export const CONFIG=D;export const PUBLICPATH="auto"===CONFIG.publicPath?"":CONFIG.publicPath;d(CONFIG);
package/lib/dev.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{exec as e,spawn as t}from"node:child_process";import{watchFile as o}from"node:fs";import{relative as r,sep as i}from"node:path";import s from"node:process";import{URL as n}from"node:url";import{ink as a,print as m,println as l,progressBar as p}from"@moneko/utils";import c from"webpack";import f from"webpack-hot-middleware";import{merge as h}from"webpack-merge";import{diffObject as d}from"./commom/diff-object.mjs";import u,{config_files as g}from"./commom/paths.mjs";import*as w from"./commom/rule.mjs";import y from"./commom/sigint-exit.mjs";import{devLog as $,PORT as j}from"./dev/config.mjs";import v from"./dev/generate-progress-html.mjs";import b from"./dev/server.mjs";import x from"./options/reslove.mjs";import{ESLintPlugin as C}from"./plugin/eslint.mjs";import{StylelintPlugin as _}from"./plugin/stylelint.mjs";import{empty as P}from"./utils/index.mjs";import{CONFIG as S,getConfig as k}from"./config.mjs";import{createDevelopmentConfiguration as E}from"./create-development-configuration.mjs";import{outputFileSystem as B}from"./file-system.mjs";import{isLibrary as H,refresh as I}from"./process-env.mjs";let O=!1,T="/____progress____",q={percentage:0,info:""},G="/__hmr__",L=new URLSearchParams({name:"client",path:G.substring(1),dynamicPublicPath:!0,timeout:2e3,reload:!I,quiet:!0,noInfo:!0,overlay:!1,autoConnect:!0}).toString(),U=await E({watchOptions:{stdin:!0,aggregateTimeout:300,ignored:w.node_modules},entry:{main:[`${x.hotMiddlewareClient}?${L}`]},plugins:[new c.WatchIgnorePlugin({paths:[w.node_modules,/\.d\.ts$/]}),new c.ProgressPlugin({handler(e,t,...o){let r=o.length?`[${t}] ${o.join(" ")}`:" ";O||(q.info=r,q.percentage=e,O=1===e);let i=S.bar;if(i){let t=i.name||"Build";i.quiet?s.stdout.write(`${r}
2
- `):(p(e||0,1,{msg:r,name:t,barColor:i.barColor,nameColor:i.nameColor,barBgColor:i.barBgColor,msgColor:i.msgColor}),1===e&&s.stdout.write("\r\x1b[2K"))}}})]});function A(e){let t=e.join(","),o=[r(u.programPath,`${S.alias["@"]}/**/*.{${t}}`).replaceAll(i,"/")];return H&&o.push(r(u.programPath,`${S.alias["@pkg"]}/**/*.{${t}}`).replaceAll(i,"/")),o}S.eslint&&U.plugins.push(new C({fix:!0,cache:!0,cacheLocation:`${u.lintCachePath}/.eslintcache`,cacheStrategy:"metadata",files:A(["js","jsx","ts","tsx","json","html","vue"]),...S.eslint})),S.stylelint&&U.plugins.push(new _({fix:!0,cache:!0,cacheLocation:`${u.lintCachePath}/.stylelintcache`,files:A(["css","scss","sass","less","ts","tsx","js","jsx"]),...S.stylelint}));let F=c(U);if(!F)throw Error("无法创建编译器");F.outputFileSystem=B;let N=F.watch(F.options.watchOptions,$);if(!N)throw Error("无法创建监视器");F.hooks.done.tap("client-log",e=>{$(null,e)});let R=`${S.basename}/${G}`.replace(/\/+/g,"/"),J=f(F,{log:!1,path:R,heartbeat:2e3}),K=await b({port:j,root_dir:F.options.output.path,fileSystem:F.outputFileSystem,headers:S.devServer.headers,https:S.devServer.https,host:S.devServer.host,open:S.devServer.open,basename:S.basename,onRequest(e,t){if(!t.writableEnded){if("GET"===e.method){let o=new n(`${S.devServer.https?"https":"http"}://${e.headers.host}${e.url}`);if(o.pathname===T)return t.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}),t.end(JSON.stringify(q)),!0;if(!O)return t.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),t.end(v(T,q)),!0;if(o.pathname===R&&"text/event-stream"===e.headers.accept)return J(e,t,P),!0}return!1}}});function M(){s.exit(0)}K.on("close",()=>{N.close(P),J.close()});let W=await Promise.all(g.map(k)),z=h(W[0]||{},W[1]||{});g.forEach(function(t){o(t,async function(){var o;let[r,i]=await Promise.all(g.map(k)),n=h(r||{},i||{}),p=d(z,n);1===Object.keys(p).length&&"proxy"in p?(m(a("代理更新中...","yellow"),!0),m(a("代理更新完成...","green"),!0),S.proxy=n.proxy,z.proxy=n.proxy,z=n):(z=n,l(a(`检测到工程配置${a(`[${t}]`,"blue")}变更, 程序即将重启...`,"yellow"),!0),o=j,e(D?`netstat -ano | findstr :${o}`:`lsof -i :${o} -t`,(e,t)=>{if(e){l(a(`查找端口 ${o} 时发生错误: ${e.message}`,"red")),l(a("请尝试手动重启程序","yellow"));return}let r=t.trim().replace(/\r\n/g,"\n").split("\n").filter(Boolean),i=D?r[0]?.split(/\s+/).pop()?.trim():r[0]?.trim();if(!i)return void l(a(`未找到占用端口 ${o} 的进程, 请尝试手动重启程序`,"yellow"));try{s.kill(Number(i),"SIGHUP")}catch(e){l(a(`终止进程 ${i} 时发生错误: ${e.message}`,"red"))}}))})});let D="win32"===s.platform;s.on("SIGHUP",function(){let e;K.close(),(e=t(s.argv[0],s.argv.slice(1),{detached:!1,stdio:"inherit"})).unref(),e.on("close",M)}),s.on("exit",function(){K.close()}),y(M);
1
+ import{exec as e,spawn as t}from"node:child_process";import{watchFile as o}from"node:fs";import{relative as r,sep as i}from"node:path";import s from"node:process";import{URL as n}from"node:url";import{ink as a,print as m,println as l,progressBar as p}from"@moneko/utils";import c from"webpack";import f from"webpack-hot-middleware";import{merge as h}from"webpack-merge";import{diffObject as u}from"./commom/diff-object.mjs";import d,{config_files as g}from"./commom/paths.mjs";import*as w from"./commom/rule.mjs";import y from"./commom/sigint-exit.mjs";import{devLog as j,PORT as $}from"./dev/config.mjs";import v from"./dev/generate-progress-html.mjs";import b from"./dev/server.mjs";import x from"./options/reslove.mjs";import{ESLintPlugin as C}from"./plugin/eslint.mjs";import{StylelintPlugin as _}from"./plugin/stylelint.mjs";import{empty as P}from"./utils/index.mjs";import{CONFIG as S,getConfig as k}from"./config.mjs";import{createDevelopmentConfiguration as E}from"./create-development-configuration.mjs";import{outputFileSystem as B}from"./file-system.mjs";import{isLibrary as H,refresh as I}from"./process-env.mjs";import{pureCache as O}from"./pure-cache.mjs";let T=!1,q="/____progress____",G={percentage:0,info:""},L="/__hmr__",U=new URLSearchParams({name:"client",path:L.substring(1),dynamicPublicPath:!0,timeout:2e3,reload:!I,quiet:!0,noInfo:!0,overlay:!1,autoConnect:!0}).toString(),A=await E({watchOptions:{stdin:!0,aggregateTimeout:300,ignored:w.node_modules},entry:{main:[`${x.hotMiddlewareClient}?${U}`]},plugins:[new c.WatchIgnorePlugin({paths:[w.node_modules,/\.d\.ts$/]}),new c.ProgressPlugin({handler(e,t,...o){let r=o.length?`[${t}] ${o.join(" ")}`:" ";T||(G.info=r,G.percentage=e,T=1===e);let i=S.bar;if(i){let t=i.name||"Build";i.quiet?s.stdout.write(`${r}
2
+ `):(p(e||0,1,{msg:r,name:t,barColor:i.barColor,nameColor:i.nameColor,barBgColor:i.barBgColor,msgColor:i.msgColor}),1===e&&s.stdout.write("\r\x1b[2K"))}}})]});function F(e){let t=e.join(","),o=[r(d.programPath,`${S.alias["@"]}/**/*.{${t}}`).replaceAll(i,"/")];return H&&o.push(r(d.programPath,`${S.alias["@pkg"]}/**/*.{${t}}`).replaceAll(i,"/")),o}S.eslint&&A.plugins.push(new C({fix:!0,cache:!0,cacheLocation:`${d.lintCachePath}/.eslintcache`,cacheStrategy:"metadata",files:F(["js","jsx","ts","tsx","json","html","vue"]),...S.eslint})),S.stylelint&&A.plugins.push(new _({fix:!0,cache:!0,cacheLocation:`${d.lintCachePath}/.stylelintcache`,files:F(["css","scss","sass","less","ts","tsx","js","jsx"]),...S.stylelint}));let N=c(A);if(!N)throw Error("无法创建编译器");N.outputFileSystem=B;let R=N.watch(N.options.watchOptions,j);if(!R)throw Error("无法创建监视器");N.hooks.done.tap("client-log",e=>{O(e.compilation),j(null,e)});let J=`${S.basename}/${L}`.replace(/\/+/g,"/"),K=f(N,{log:!1,path:J,heartbeat:2e3}),M=await b({port:$,root_dir:N.options.output.path,fileSystem:N.outputFileSystem,headers:S.devServer.headers,https:S.devServer.https,host:S.devServer.host,open:S.devServer.open,basename:S.basename,onRequest(e,t){if(!t.writableEnded){if("GET"===e.method){let o=new n(`${S.devServer.https?"https":"http"}://${e.headers.host}${e.url}`);if(o.pathname===q)return t.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}),t.end(JSON.stringify(G)),!0;if(!T)return t.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),t.end(v(q,G)),!0;if(o.pathname===J&&"text/event-stream"===e.headers.accept)return K(e,t,P),!0}return!1}}});function W(){s.exit(0)}M.on("close",()=>{R.close(P),K.close()});let z=await Promise.all(g.map(k)),D=h(z[0]||{},z[1]||{});g.forEach(function(t){o(t,async function(){var o;let[r,i]=await Promise.all(g.map(k)),n=h(r||{},i||{}),p=u(D,n);1===Object.keys(p).length&&"proxy"in p?(m(a("代理更新中...","yellow"),!0),m(a("代理更新完成...","green"),!0),S.proxy=n.proxy,D.proxy=n.proxy,D=n):(D=n,l(a(`检测到工程配置${a(`[${t}]`,"blue")}变更, 程序即将重启...`,"yellow"),!0),o=$,e(Q?`netstat -ano | findstr :${o}`:`lsof -i :${o} -t`,(e,t)=>{if(e){l(a(`查找端口 ${o} 时发生错误: ${e.message}`,"red")),l(a("请尝试手动重启程序","yellow"));return}let r=t.trim().replace(/\r\n/g,"\n").split("\n").filter(Boolean),i=Q?r[0]?.split(/\s+/).pop()?.trim():r[0]?.trim();if(!i)return void l(a(`未找到占用端口 ${o} 的进程, 请尝试手动重启程序`,"yellow"));try{s.kill(Number(i),"SIGHUP")}catch(e){l(a(`终止进程 ${i} 时发生错误: ${e.message}`,"red"))}}))})});let Q="win32"===s.platform;s.on("SIGHUP",function(){let e;M.close(),(e=t(s.argv[0],s.argv.slice(1),{detached:!1,stdio:"inherit"})).unref(),e.on("close",W)}),s.on("exit",function(){M.close()}),y(W);
@@ -1,13 +1,17 @@
1
1
  import { type Compiler } from 'webpack';
2
2
  interface ModuleFederationExposesDeclarationPluginOptions {
3
3
  name: string;
4
- exposes?: Record<string, string>;
4
+ exposes: Record<string, string>;
5
5
  }
6
6
  export declare class ModuleFederationExposesDeclarationPlugin {
7
7
  private name;
8
8
  private assetName;
9
- private options;
9
+ private dts;
10
+ private compiler;
11
+ private worker;
10
12
  constructor(option: ModuleFederationExposesDeclarationPluginOptions);
13
+ final(err: NodeJS.ErrnoException | null): void;
14
+ writeDts(): void;
11
15
  apply(compiler: Compiler): void;
12
16
  }
13
17
  export { };
@@ -1 +1 @@
1
- import{join as e}from"node:path";import{fileURLToPath as t}from"node:url";import{Worker as o}from"node:worker_threads";import r from"../commom/log.mjs";export class ModuleFederationExposesDeclarationPlugin{constructor(e){this.name="ModuleFederationExposesDeclarationPlugin",this.assetName="module-federation.d.ts",this.options=e}apply(s){s.hooks.done.tapPromise(this.name,async i=>{if(i.hasErrors())return;let n=s.outputFileSystem,a=s.options.output.path;if(!n||!a)return;let m=new o(t(new URL("../worker/dts.mjs",import.meta.url)));m.setMaxListeners(0);try{let t=await new Promise((e,t)=>{m.once("message",e),m.once("error",t),m.postMessage({options:this.options})});s.outputFileSystem?.writeFile(e(a,this.assetName),t,{encoding:"utf-8"},e=>{e&&r(e)})}catch(e){r(e)}m.terminate()})}}
1
+ import{join as t}from"node:path";import{fileURLToPath as e}from"node:url";import{Worker as i}from"node:worker_threads";import s from"../commom/log.mjs";export class ModuleFederationExposesDeclarationPlugin{constructor(t){this.name="ModuleFederationExposesDeclarationPlugin",this.assetName="module-federation.d.ts",this.dts="",this.compiler=null,this.worker=new i(e(new URL("../worker/dts.mjs",import.meta.url))),this.worker.setMaxListeners(0),this.worker.postMessage({options:t}),this.worker.once("message",t=>{this.dts=t,this.writeDts(),this.worker.terminate()})}final(t){t&&s(t)}writeDts(){let e=this.compiler?.options.output.path,i=this.compiler?.outputFileSystem;if(e&&i){let s=t(e,this.assetName);i.mkdir(e,{recursive:!0},this.final),i.existsSync(s)?i.readFile(s,{encoding:"utf-8"},(t,e)=>{t?this.final(t):e!=this.dts&&i.writeFile(s,this.dts,{encoding:"utf-8"},this.final)}):i.writeFile(s,this.dts,{encoding:"utf-8"},this.final)}}apply(t){this.compiler=t,t.hooks.done.tap(this.name,t=>{t.hasErrors()||this.writeDts()})}}
@@ -1 +1 @@
1
- import{parentPort as e}from"node:worker_threads";import{bundleDts as s}from"../commom/bundle-dts.mjs";import{module_federation_schema as r}from"../process-env.mjs";if(!e)throw Error("This file must be run as a worker");e?.setMaxListeners(0),e.on("message",async({options:o})=>{try{let{name:t,exposes:m={}}=o,a=[],p=[];Object.keys(m).map(e=>{e.startsWith(t)?(p.push({[e]:m[e]}),a.push(`declare module "${r}:${e}" { export * from "${e}"; }`)):(p.push(e),a.push(`declare module "${t}/${e}" { export * from "${e}"; }`))});let i=await s(p,`_${t}_`);a.unshift(i);let n=a.join("\n\n");e.postMessage(n)}catch{e.postMessage("")}});
1
+ import{parentPort as e}from"node:worker_threads";import{bundleDts as r}from"../commom/bundle-dts.mjs";import{module_federation_schema as s}from"../process-env.mjs";if(!e)throw Error("This file must be run as a worker");e?.setMaxListeners(0),e.on("message",async({options:o})=>{try{let{name:t,exposes:m={}}=o,a=[],p=[];Object.keys(m).map(e=>{e.startsWith(t)?(p.push({[e]:m[e]}),a.push(`declare module "${s}:${e}" { export * from "${e}"; export { default } from "${e}"; }`)):(p.push(e),a.push(`declare module "${t}/${e}" { export * from "${e}"; export { default } from "${e}"; }`))});let f=await r(p,`_${t}_`);a.unshift(f);let u=a.join("\n\n");e.postMessage(u)}catch{e.postMessage("")}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "4.8.6-beta.6",
3
+ "version": "4.8.6-beta.8",
4
4
  "description": "@moneko/core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",
@@ -139,7 +139,7 @@
139
139
  "@moneko/stylelint": "1.8.3",
140
140
  "@moneko/transform-imports": "1.4.0",
141
141
  "@moneko/utils": "0.3.3",
142
- "@swc/core": "1.15.26",
142
+ "@swc/core": "1.15.30",
143
143
  "browserslist": "4.28.2",
144
144
  "core-js": "3.49.0",
145
145
  "core-js-compat": "3.49.0",