@moneko/core 3.56.14-beta.5 → 3.56.14-beta.6

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 e from"mini-css-extract-plugin";import i from"webpack";import{merge as n}from"webpack-merge";import{commonConfig as t}from"../common.mjs";import{CONFIG as r}from"../config.mjs";import{LightningCssMinifyPlugin as s}from"../plugin/lightningcss-plugin.mjs";import{SwcMinifyPlugin as m}from"../plugin/swc-minify-plugin.mjs";import{getLightningCssTargets as l}from"../polyfills/targets.mjs";import{isDev as p,isReact as o,refresh as a}from"../process-env.mjs";let u=[];r.minifier&&(u.push(new m(r.minifier)),u.push(new s({targets:l()})));let c={maxAssetSize:256e3,maxEntrypointSize:256e3,assetFilter:e=>!e.endsWith(".map")&&!e.endsWith("ce28377f3a428346.js"),...r.performance},h=n(t,{performance:r.performance&&c,plugins:[new e({filename:"style/[contenthash].css",chunkFilename:"style/[contenthash].css",ignoreOrder:!0})],optimization:Object.assign({splitChunks:r.splitChunk,runtimeChunk:r.runtimeChunk,minimize:!0,minimizer:u},{chunkIds:"deterministic",moduleIds:"deterministic",concatenateModules:!0,emitOnErrors:!1,removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,sideEffects:!0,providedExports:!0,flagIncludedChunks:!0,innerGraph:!1,mangleExports:"deterministic",portableRecords:!0,realContentHash:!1})});if(p&&a&&(h.plugins.push(new i.HotModuleReplacementPlugin),o)){let e=(await import("@pmmmwh/react-refresh-webpack-plugin")).default;h.plugins.push(new e({overlay:!1}))}if(r.splitChunk&&h.plugins?.push(new i.optimize.MinChunkSizePlugin({minChunkSize:r.minChunkSize||1e3})),r.bundleAnalyzer){let e=(await import("webpack-bundle-analyzer")).BundleAnalyzerPlugin;h.plugins?.push(new e({analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1,defaultSizes:"gzip",logLevel:"silent",...r.bundleAnalyzer}))}export default h;
1
+ import e from"mini-css-extract-plugin";import i from"webpack";import{merge as n}from"webpack-merge";import{commonConfig as t}from"../common.mjs";import{CONFIG as r}from"../config.mjs";import{LightningCssMinifyPlugin as m}from"../plugin/lightningcss-plugin.mjs";import{SwcMinifyPlugin as s}from"../plugin/swc-minify-plugin.mjs";import{getLightningCssTargets as l}from"../polyfills/targets.mjs";import{isDev as p,isReact as o,refresh as a}from"../process-env.mjs";let u=[];r.minifier&&(u.push(new s(r.minifier)),u.push(new m({targets:l()})));let c={maxAssetSize:256e3,maxEntrypointSize:256e3,assetFilter:e=>!e.endsWith(".map")&&!e.endsWith("ce28377f3a428346.js"),...r.performance},h=n(t,{performance:r.performance&&c,plugins:[new e({filename:"style/[contenthash].css",chunkFilename:"style/[contenthash].css",ignoreOrder:!0})],optimization:{splitChunks:r.splitChunk,runtimeChunk:r.runtimeChunk,minimize:u.length>0,minimizer:u,chunkIds:"deterministic",moduleIds:"deterministic",concatenateModules:!0,emitOnErrors:!1,removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,sideEffects:!0,providedExports:!0,flagIncludedChunks:!0,innerGraph:!1,mangleExports:"deterministic",portableRecords:!0,realContentHash:!1}});if(p&&a&&(h.plugins.push(new i.HotModuleReplacementPlugin),o)){let e=(await import("@pmmmwh/react-refresh-webpack-plugin")).default;h.plugins.push(new e({overlay:!1}))}if(r.splitChunk&&h.plugins?.push(new i.optimize.MinChunkSizePlugin({minChunkSize:r.minChunkSize||1e3})),r.bundleAnalyzer){let e=(await import("webpack-bundle-analyzer")).BundleAnalyzerPlugin;h.plugins?.push(new e({analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1,defaultSizes:"gzip",logLevel:"silent",...r.bundleAnalyzer}))}export default h;
package/lib/build-dev.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{relative as o}from"node:path";import r from"node:process";import{analyzeBundleSize as m,completedInfo as t,ink as e,println as i,progressBar as a}from"@moneko/utils";import n from"webpack";import{merge as s}from"webpack-merge";import p from"./commom/paths.mjs";import{empty as l}from"./utils/index.mjs";import{commonConfig as u}from"./common.mjs";import{CONFIG as c}from"./config.mjs";import f from"./module.config.mjs";import{isReact as g,refresh as h}from"./process-env.mjs";let w=s(u,{module:f(!1),plugins:[new n.HotModuleReplacementPlugin]});if(c.bar){let o=c.bar,m=o.name||"Build";w.plugins.push(new n.ProgressPlugin({handler(t,e,...i){let n=i.length?`[${e}] ${i.join(" ")}`:" ";o.quiet?r.stdout.write(`${n}
2
- `):(a(t||0,1,{msg:n,name:m,barColor:o.barColor,nameColor:o.nameColor,barBgColor:o.barBgColor,msgColor:o.msgColor}),1===t&&r.stdout.write("\r\x1b[2K"))}}))}if(g&&h){let o=(await import("@pmmmwh/react-refresh-webpack-plugin")).default;w.plugins.push(new o({overlay:!1}))}let d=n(w);async function b(){let r=await new Promise((o,r)=>{d?.run((m,t)=>{m&&r(m),t?o(t):r(Error("编译过程中没有生成统计信息"))})});(r.hasErrors()||r.hasWarnings())&&function(o){let{warnings:r,errors:m}=o.compilation;r.forEach(o=>{i(e(o.message,"178"))}),m.forEach(o=>{i(e(o.message,"red"))})}(r),await new Promise(a=>{r.compilation.compiler.cache.shutdown(n=>{n&&i(e(n.toString(),"red")),m(r.compilation.outputOptions.path,["\\.js$"]),t(~~((r.endTime-r.startTime)/10)/100,o(p.programPath,r.compilation.outputOptions.path)),a()})})}r.on("exit",l),await b();
1
+ import{relative as o}from"node:path";import r from"node:process";import{analyzeBundleSize as t,completedInfo as e,ink as i,println as n,progressBar as m}from"@moneko/utils";import a from"mini-css-extract-plugin";import s from"webpack";import l from"./commom/paths.mjs";import{empty as p}from"./utils/index.mjs";import{CONFIG as c}from"./config.mjs";import{createDevelopmentConfiguration as u}from"./create-development-configuration.mjs";let g=await u({plugins:[new a({filename:"style/[contenthash].css",chunkFilename:"style/[contenthash].css",ignoreOrder:!0})]});if(c.bar){let o=c.bar,t=o.name||"Build";g.plugins.push(new s.ProgressPlugin({handler(e,i,...n){let a=n.length?`[${i}] ${n.join(" ")}`:" ";o.quiet?r.stdout.write(`${a}
2
+ `):(m(e||0,1,{msg:a,name:t,barColor:o.barColor,nameColor:o.nameColor,barBgColor:o.barBgColor,msgColor:o.msgColor}),1===e&&r.stdout.write("\r\x1b[2K"))}}))}let h=s(g);async function f(){let r=await new Promise((o,r)=>{h?.run((t,e)=>{t&&r(t),e?o(e):r(Error("编译过程中没有生成统计信息"))})});(r.hasErrors()||r.hasWarnings())&&function(o){let{warnings:r,errors:t}=o.compilation;r.forEach(o=>{n(i(o.message,"178"))}),t.forEach(o=>{n(i(o.message,"red"))})}(r),await new Promise(m=>{r.compilation.compiler.cache.shutdown(a=>{a&&n(i(a.toString(),"red")),t(r.compilation.outputOptions.path,["\\.js$"]),e(~~((r.endTime-r.startTime)/10)/100,o(l.programPath,r.compilation.outputOptions.path)),m()})})}r.on("exit",p),await f();
package/lib/common.mjs CHANGED
@@ -1 +1 @@
1
- import{extname as e,join as t,resolve as o}from"node:path";import{argv as s}from"node:process";import a,{config_files as i,CUSTOMCONFIG as n,TMP_DIR as r}from"./commom/paths.mjs";import{OverrideResolverPlugin as l}from"./plugin/override-resolve.mjs";import{digest as m,isObject as c,node_modules as p,resolveProgram as u}from"./utils/index.mjs";import{exampleModuleName as h}from"./vm/example.mjs";import d from"./vm/info.mjs";import{CONFIG as f}from"./config.mjs";import b from"./plugins.config.mjs";import{isCI as g,isDev as y,isLibrary as j,NODE_ENV as v,packageJson as P}from"./process-env.mjs";let C=f.mode??(y?"development":"production");export const outputConfig={path:u(j?"docs":"dist"),filename:"js/[name].[contenthash].bundle.js",chunkFilename:"js/[contenthash].chunk.js",assetModuleFilename:t=>{let o=e(t.filename||"").substring(1);return`assets/${o}/[hash][ext]`},library:{name:`${d.projectName}`,type:"umd",umdNamedDefine:!0},globalObject:"self",chunkLoadingGlobal:`webpackJsonp_${P.name}`,pathinfo:y,clean:!y,publicPath:f.publicPath,workerPublicPath:f.publicPath,asyncChunks:!0,charset:!0,iife:!0,crossOriginLoading:"use-credentials",enabledWasmLoadingTypes:["fetch"],uniqueName:`${d.projectName}`};let x={main:[p("@app/entry")]},k=[t(a.corePath,"./polyfills/public-path.mjs")];if(y&&f.refresh&&f.env.injectRemoteReactRefresh&&k.push(t(a.corePath,"./polyfills/inject-react-refresh.mjs")),f.polyfill&&k.push(t(a.corePath,"./polyfills/replace-children.mjs")),f.entry&&("string"==typeof f.entry?x={...x,main:[f.entry]}:Object.keys(f.entry)&&(x=Object.assign(x,f.entry))),"string"==typeof x.main?x.main=[...k,x.main]:Array.isArray(x.main)&&(x.main=[...k,...x.main]),f.output){if("string"==typeof f.output)outputConfig.path=f.output;else if(Object.keys(f.output)){let e=f.output,t={...outputConfig.library};Object.assign(outputConfig,e),"object"==typeof f.output&&e.library&&(outputConfig.library=Object.assign(t,e.library))}}let M={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:a.webpackCachePath,memoryCacheUnaffected:!("true"===process.env.IS_BUILD&&y),name:await m([s[2],n,v].join("-"),"SHA-256"),version:`${P.version}`,buildDependencies:{config:i},maxMemoryGenerations:1};!1===f.cache?M=!1:c(f.cache)&&(M=Object.assign(M,f.cache)),g&&(void 0===f.cache||f.cache&&!f.cache.cacheDirectory)&&(M.cacheDirectory=o(r,P.name));let w={},D={imports:!0,entries:!0,test:e=>{let t=e.nameForCondition();return!!(t&&(t.startsWith(p(h))||t.startsWith(p("@app/comment"))||t.startsWith(a.pagesPath)||t.startsWith(a.componentsPath)))}};f.lazyCompilation&&y&&"true"!==process.env.IS_BUILD?c(f.lazyCompilation)?Object.assign(w,D,f.lazyCompilation):Object.assign(w,D):w=!1;export const commonConfig={name:"client",target:"web",devtool:f.devtool,entry:x,mode:C,stats:"errors-only",cache:M,snapshot:{immutablePaths:[a.pnpmNodeModules,a.denoNodeModules,/node_modules\/(?!(@app)\/)/],managedPaths:[a.pnpmNodeModules,a.denoNodeModules,/node_modules\/(?!(@app)\/)/],resolveBuildDependencies:{timestamp:!0,hash:!0},resolve:{timestamp:!0,hash:!0},module:{timestamp:!0,hash:!0},buildDependencies:{timestamp:!0,hash:!0},contextModule:{timestamp:!0,hash:!0}},infrastructureLogging:{level:"error"},externalsPresets:f.externalsPresets,plugins:b,node:{global:!1,__filename:!1,__dirname:!1},experiments:{asyncWebAssembly:!0,cacheUnaffected:!("true"===process.env.IS_BUILD&&y),lazyCompilation:w,buildHttp:c(f.buildHttp)?{allowedUris:[],lockfileLocation:o(a.httpCachePath,"http.lock"),cacheLocation:o(a.httpCachePath,"data"),upgrade:!0,...f.buildHttp}:f.buildHttp,backCompat:!0,futureDefaults:!0,css:!1,outputModule:!1},resolve:{extensions:[".mts",".mjs",".ts",".tsx",".js",".jsx",".json",".wasm"],alias:f.alias,modules:[a.nodeModules,a.pnpmNodeModules,a.denoNodeModules],mainFields:["browser","module","main"],mainFiles:["index"],plugins:f.resolvePlugins,preferAbsolute:!0,cache:!0,fallback:{}},externals:f.externals,output:outputConfig,recordsPath:f.recordsPath?t(a.programPath,f.recordsPath):t(a.webpackCachePath,"records.json")};f.overrideResolve&&commonConfig.resolve.plugins.push(new l(Object.assign({original:f.alias["@"],override:n&&u(n)},f.overrideResolve)));
1
+ import{extname as e,join as t,resolve as o}from"node:path";import{argv as s}from"node:process";import a,{config_files as i,CUSTOMCONFIG as n,TMP_DIR as r}from"./commom/paths.mjs";import{OverrideResolverPlugin as l}from"./plugin/override-resolve.mjs";import{digest as m,isObject as c,node_modules as p,resolveProgram as u}from"./utils/index.mjs";import{exampleModuleName as h}from"./vm/example.mjs";import d from"./vm/info.mjs";import{CONFIG as f}from"./config.mjs";import b from"./plugins.config.mjs";import{isCI as g,isDev as y,isLibrary as j,NODE_ENV as v,packageJson as P}from"./process-env.mjs";export const outputConfig={path:u(j?"docs":"dist"),filename:"js/[name].[contenthash].bundle.js",chunkFilename:"js/[contenthash].chunk.js",assetModuleFilename:t=>{let o=e(t.filename||"").substring(1);return`assets/${o}/[hash][ext]`},library:{name:`${d.projectName}`,type:"umd",umdNamedDefine:!0},globalObject:"self",chunkLoadingGlobal:`webpackJsonp_${P.name}`,pathinfo:y,clean:!0,publicPath:f.publicPath,workerPublicPath:f.publicPath,asyncChunks:!0,charset:!0,iife:!0,crossOriginLoading:"use-credentials",enabledWasmLoadingTypes:["fetch"],uniqueName:`${d.projectName}`};let C={main:[p("@app/entry")]},x=[t(a.corePath,"./polyfills/public-path.mjs")];if(y&&f.refresh&&f.env.injectRemoteReactRefresh&&x.push(t(a.corePath,"./polyfills/inject-react-refresh.mjs")),f.polyfill&&x.push(t(a.corePath,"./polyfills/replace-children.mjs")),f.entry&&("string"==typeof f.entry?C={...C,main:[f.entry]}:Object.keys(f.entry)&&(C=Object.assign(C,f.entry))),"string"==typeof C.main?C.main=[...x,C.main]:Array.isArray(C.main)&&(C.main=[...x,...C.main]),f.output){if("string"==typeof f.output)outputConfig.path=f.output;else if(Object.keys(f.output)){let e=f.output,t={...outputConfig.library};Object.assign(outputConfig,e),"object"==typeof f.output&&e.library&&(outputConfig.library=Object.assign(t,e.library))}}let k={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:a.webpackCachePath,memoryCacheUnaffected:!("true"===process.env.IS_BUILD&&y),name:await m([s[2],n,v].join("-"),"SHA-256"),version:`${P.version}`,buildDependencies:{config:i},maxMemoryGenerations:1};!1===f.cache?k=!1:c(f.cache)&&(k=Object.assign(k,f.cache)),g&&(void 0===f.cache||f.cache&&!f.cache.cacheDirectory)&&(k.cacheDirectory=o(r,P.name));let M={},w={imports:!0,entries:!0,test:e=>{let t=e.nameForCondition();return!!(t&&(t.startsWith(p(h))||t.startsWith(p("@app/comment"))||t.startsWith(a.pagesPath)||t.startsWith(a.componentsPath)))}};f.lazyCompilation&&y&&"true"!==process.env.IS_BUILD?c(f.lazyCompilation)?Object.assign(M,w,f.lazyCompilation):Object.assign(M,w):M=!1;export const commonConfig={name:"client",target:"web",devtool:f.devtool,entry:C,mode:f.mode??"production",stats:"errors-only",cache:k,snapshot:{immutablePaths:[a.pnpmNodeModules,a.denoNodeModules,/node_modules\/(?!(@app)\/)/],managedPaths:[a.pnpmNodeModules,a.denoNodeModules,/node_modules\/(?!(@app)\/)/],resolveBuildDependencies:{timestamp:!0,hash:!0},resolve:{timestamp:!0,hash:!0},module:{timestamp:!0,hash:!0},buildDependencies:{timestamp:!0,hash:!0},contextModule:{timestamp:!0,hash:!0}},infrastructureLogging:{level:"error"},externalsPresets:f.externalsPresets,plugins:b,node:{global:!1,__filename:!1,__dirname:!1},experiments:{asyncWebAssembly:!0,cacheUnaffected:!("true"===process.env.IS_BUILD&&y),lazyCompilation:M,buildHttp:c(f.buildHttp)?{allowedUris:[],lockfileLocation:o(a.httpCachePath,"http.lock"),cacheLocation:o(a.httpCachePath,"data"),upgrade:!0,...f.buildHttp}:f.buildHttp,backCompat:!0,futureDefaults:!0,css:!1,outputModule:!1},resolve:{extensions:[".mts",".mjs",".ts",".tsx",".js",".jsx",".json",".wasm"],alias:f.alias,modules:[a.nodeModules,a.pnpmNodeModules,a.denoNodeModules],mainFields:["browser","module","main"],mainFiles:["index"],plugins:f.resolvePlugins,preferAbsolute:!0,cache:!0,fallback:{}},externals:f.externals,output:outputConfig,recordsPath:f.recordsPath?t(a.programPath,f.recordsPath):t(a.webpackCachePath,"records.json")};f.overrideResolve&&commonConfig.resolve.plugins.push(new l(Object.assign({original:f.alias["@"],override:n&&u(n)},f.overrideResolve)));
package/lib/config.mjs CHANGED
@@ -1 +1 @@
1
- import{join as e,relative as o}from"node:path";import t from"node:process";import{fileExists as r}from"@moneko/utils";import{merge as n}from"webpack-merge";import a from"./commom/paths.mjs";import s from"./commom/require.mjs";import i from"./commom/setup-env.mjs";import l from"./options/jsx-dom-expressions.mjs";import m from"./options/split-chunk.mjs";import{isFunction as p,node_modules as c,resolveProgram as u}from"./utils/index.mjs";import{APPTYPE as d,FRAMEWORK as f,frameworkVersion as h,isCI as g,isDev as v,isLibrary as x,isMobile as j,isReact as C,jsxImportSource as P,mainDirectory as k,NODE_ENV as b,PACKAGENAME as w}from"./process-env.mjs";let O=["@app","@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 function getConfig(e){return delete s.cache[e],new Promise(o=>{if(r(e)){let r=s(e).default;return o(p(r)?r(t):r)}return o({})})}let S=await Promise.all([i(b,d,f,[],"true"===t.env.IS_BUILD),getConfig(a.configPath),getConfig(a.customConfigPath)]),I=S[0],y=S[1],M=S[2],D={mode:b,strict:!1,devtool:v?"eval-cheap-module-source-map":"cheap-module-source-map",seo:!1,bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:"",namespace:w,moduleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]",fallbackModuleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]"},env:I,basename:"/",publicPath:"auto",rem:{designSize:j?375:1920},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:Object.assign({"@":u(k)},C&&h<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:w.toLocaleUpperCase(),favicon:o(a.programPath,`${a.corePath}/options/favicon.ico`)},copy:{},routerMode:"browser",fixBrowserRouter:!1,plugins:[],resolvePlugins:[],overrideResolve:!1,splitChunk:m,runtimeChunk:"single",moduleFederation:[],rulesInclude:{css:O,js:O,media:O,font:O,wasm:[]},mdx:{jsx:!1,development:v,jsxImportSource:P,providerImportSource:`@moneko/${f}/mdx`},jsxDomExpressions:l,bar:{name:"Client",nameColor:"68",msgColor:"242",barBgColor:"15",barColor:"69",quiet:g},normalizeCss:!0,externalsPresets:{},buildHttp:void 0,virtualModule:{},cssExtract:{},externals:["@swc/core"],lazyCompilation:!1,performance:!1,refresh:!0,bundleId:"com.moneko.bid",bundles:[],stylelint:{},eslint:{lintDirtyModulesOnly:!1},minChunkSize:1e3,compression:"true"!==t.env.IS_BUILD,manifest:{filename:"manifest.json"},corepack:!0,reactJsxRuntime:"automatic"};x&&(D.alias=Object.assign(D.alias,{"@pkg":a.componentsPath,[w]:a.componentsPath}));let z=D;(!1===(z=n(z,y,M)).devtool||!1===z.sourceMap)&&(z.sourceMap=!1,z.devtool=!1),"true"===t.env.CODESPACES&&(z.devServer.https=!1),!1===z.devServer.https&&"darwin"===t.platform&&(z.devServer.open=!1),z.htmlPluginOption&&(z.htmlPluginOption.tags||(z.htmlPluginOption.tags=[]),z.fixBrowserRouter&&z.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))"}),z.manifest&&z.htmlPluginOption.tags.push({href:e(z.basename,z.manifest.filename).replaceAll(/\\/g,"/"),tag:"link",rel:"manifest"}));export const CONFIG=z;export const PUBLICPATH="auto"===CONFIG.publicPath?"":CONFIG.publicPath;
1
+ import{join as e,relative as o}from"node:path";import t from"node:process";import{fileExists as r}from"@moneko/utils";import{merge as n}from"webpack-merge";import a from"./commom/paths.mjs";import s from"./commom/require.mjs";import i from"./commom/setup-env.mjs";import l from"./options/jsx-dom-expressions.mjs";import m from"./options/split-chunk.mjs";import{isFunction as p,node_modules as c,resolveProgram as u}from"./utils/index.mjs";import{APPTYPE as d,FRAMEWORK as f,frameworkVersion as h,isCI as g,isDev as v,isLibrary as x,isMobile as j,isReact as C,jsxImportSource as P,mainDirectory as k,NODE_ENV as b,PACKAGENAME as w}from"./process-env.mjs";let I=["@app","@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 function getConfig(e){return delete s.cache[e],new Promise(o=>{if(r(e)){let r=s(e).default;return o(p(r)?r(t):r)}return o({})})}let O=await Promise.all([i(b,d,f,[],"true"===t.env.IS_BUILD),getConfig(a.configPath),getConfig(a.customConfigPath)]),S=O[0],y=O[1],M=O[2],D={mode:b,strict:!1,devtool:"true"!==t.env.IS_BUILD&&v?"eval-cheap-module-source-map":"cheap-module-source-map",seo:!1,bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:"",namespace:w,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&&h<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:w.toLocaleUpperCase(),favicon:o(a.programPath,`${a.corePath}/options/favicon.ico`)},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:v,jsxImportSource:P,providerImportSource:`@moneko/${f}/mdx`},jsxDomExpressions:l,bar:{name:"Client",nameColor:"68",msgColor:"242",barBgColor:"15",barColor:"69",quiet:g},normalizeCss:!0,externalsPresets:{},buildHttp:void 0,virtualModule:{},cssExtract:{},externals:["@swc/core"],lazyCompilation:!1,performance:!1,refresh:!0,bundleId:"com.moneko.bid",bundles:[],stylelint:{},eslint:{lintDirtyModulesOnly:!1},minChunkSize:1e3,compression:"true"!==t.env.IS_BUILD,manifest:{filename:"manifest.json"},corepack:!0,reactJsxRuntime:"automatic"};x&&(D.alias=Object.assign(D.alias,{"@pkg":a.componentsPath,[w]:a.componentsPath}));let B=D;(!1===(B=n(B,y,M)).devtool||!1===B.sourceMap)&&(B.sourceMap=!1,B.devtool=!1),"true"===t.env.CODESPACES&&(B.devServer.https=!1),!1===B.devServer.https&&"darwin"===t.platform&&(B.devServer.open=!1),B.htmlPluginOption&&(B.htmlPluginOption.tags||(B.htmlPluginOption.tags=[]),B.fixBrowserRouter&&B.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))"}),B.manifest&&B.htmlPluginOption.tags.push({href:e(B.basename,B.manifest.filename).replaceAll(/\\/g,"/"),tag:"link",rel:"manifest"}));export const CONFIG=B;export const PUBLICPATH="auto"===CONFIG.publicPath?"":CONFIG.publicPath;
@@ -0,0 +1,2 @@
1
+ import webpack, { type Configuration } from 'webpack';
2
+ export declare function createDevelopmentConfiguration(override?: Configuration): Promise<webpack.Configuration>;
@@ -0,0 +1 @@
1
+ import e from"webpack";import{merge as i}from"webpack-merge";import{LightningCssMinifyPlugin as m}from"./plugin/lightningcss-plugin.mjs";import{SwcMinifyPlugin as n}from"./plugin/swc-minify-plugin.mjs";import{getLightningCssTargets as r}from"./polyfills/targets.mjs";import{commonConfig as t}from"./common.mjs";import{CONFIG as o}from"./config.mjs";import p from"./module.config.mjs";import{isReact as s,refresh as l}from"./process-env.mjs";export async function createDevelopmentConfiguration(u={}){let a=[];o.minifier&&(a.push(new n({compress:{ecma:2015,toplevel:!1,module:!1,ie8:!1,keep_fnames:!1,top_retain:[],keep_infinity:!0},...o.minifier})),a.push(new m({targets:r()})));let c=i(t,{module:p(!1),plugins:[new e.HotModuleReplacementPlugin],optimization:{runtimeChunk:o.runtimeChunk,minimize:a.length>0,minimizer:a,chunkIds:"deterministic",moduleIds:"deterministic",concatenateModules:!0,emitOnErrors:!1,removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,sideEffects:!0,providedExports:!0,flagIncludedChunks:!0,innerGraph:!1,mangleExports:"deterministic",portableRecords:!0,realContentHash:!1}});if(s&&l){let e=(await import("@pmmmwh/react-refresh-webpack-plugin")).default;c.plugins.push(new e({overlay:!1}))}return i(c,u)}
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{join as r,relative as i}from"node:path";import n from"node:process";import{URL as s}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 w from"./commom/sigint-exit.mjs";import{devLog as y,PORT as j}from"./dev/config.mjs";import $ from"./dev/generate-progress-html.mjs";import v from"./dev/server.mjs";import b from"./options/reslove.mjs";import{ESLintPlugin as C}from"./plugin/eslint.mjs";import{generateManifest as x}from"./plugin/manifest.mjs";import{StylelintPlugin as _}from"./plugin/stylelint.mjs";import{empty as P}from"./utils/index.mjs";import{commonConfig as S}from"./common.mjs";import{CONFIG as k,getConfig as H}from"./config.mjs";import{outputFileSystem as E}from"./file-system.mjs";import O from"./module.config.mjs";import{isLibrary as T,isReact as B,refresh as I}from"./process-env.mjs";let q=!1,G="/____progress____",L={percentage:0,info:""},N="/__hmr__",R=new URLSearchParams({name:"client",path:N.substring(1),dynamicPublicPath:!0,timeout:2e3,reload:!I,quiet:!0,noInfo:!0,overlay:!1,autoConnect:!0}).toString(),U=h(S,{watchOptions:{stdin:!0,aggregateTimeout:300,ignored:/node_modules\/(?!(@app)\/)/},entry:{main:[`${b.hotMiddlewareClient}?${R}`]},module:O(!1),plugins:[new c.HotModuleReplacementPlugin,new c.WatchIgnorePlugin({paths:[/node_modules\/(?!(@app)\/)/,/\.d\.ts$/]}),new c.ProgressPlugin({handler(e,t,...o){let r=o.length?`[${t}] ${o.join(" ")}`:" ";q||(L.info=r,L.percentage=e,q=1===e);let i=k.bar;if(i){let t=i.name||"Build";i.quiet?n.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&&n.stdout.write("\r\x1b[2K"))}}})]});if(B&&I){let e=(await import("@pmmmwh/react-refresh-webpack-plugin")).default;U.plugins.push(new e({overlay:!1}))}function F(e){let t=e.join(","),o=[i(d.programPath,`${k.alias["@"]}/**/*.{${t}}`).replace(/\\/g,"/")];return T&&o.push(i(d.programPath,`${k.alias["@pkg"]}/**/*.{${t}}`).replace(/\\/g,"/")),o}k.eslint&&U.plugins.push(new C({fix:!0,cache:!0,cacheLocation:`${d.lintCachePath}/.eslintcache`,cacheStrategy:"metadata",files:F(["js","jsx","ts","tsx","json","html","vue"]),...k.eslint})),k.stylelint&&U.plugins.push(new _({fix:!0,cache:!0,cacheLocation:`${d.lintCachePath}/.stylelintcache`,files:F(["css","scss","sass","less","ts","tsx","js","jsx"]),...k.stylelint}));let J=c(U);if(!J)throw Error("无法创建编译器");J.outputFileSystem=E;let M=J.watch(J.options.watchOptions,y);if(!M)throw Error("无法创建监视器");J.hooks.done.tap("client-log",e=>{y(null,e)});let A=`${k.basename}/${N}`.replace(/\/+/g,"/"),K=f(J,{log:!1,path:A,heartbeat:2e3}),W=!!k.manifest&&r(k.basename,k.manifest.filename).replaceAll(/\\/g,"/"),z=await v({port:j,root_dir:J.options.output.path,fileSystem:J.outputFileSystem,headers:k.devServer.headers,https:k.devServer.https,host:k.devServer.host,open:k.devServer.open,basename:k.basename,onRequest(e,t){if(!t.writableEnded){if("GET"===e.method){let o=new s(`${k.devServer.https?"https":"http"}://${e.headers.host}${e.url}`);if(W&&o.pathname===W)return t.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}),t.end(JSON.stringify(x({}))),!0;if(o.pathname===G)return t.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}),t.end(JSON.stringify(L)),!0;if(!q)return t.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),t.end($(G,L)),!0;if(o.pathname===A&&"text/event-stream"===e.headers.accept)return K(e,t,P),!0}return!1}}});function D(){n.exit(0)}z.on("close",()=>{M.close(P),K.close()});let Q=await Promise.all(g.map(H)),V=h(Q[0]||{},Q[1]||{});g.forEach(function(t){o(t,async function(){var o;let[r,i]=await Promise.all(g.map(H)),s=h(r||{},i||{}),p=u(V,s);1===Object.keys(p).length&&"proxy"in p?(m(a(`代理更新中...`,"yellow"),!0),m(a(`代理更新完成...`,"green"),!0),k.proxy=s.proxy,V.proxy=s.proxy,V=s):(V=s,l(a(`检测到工程配置${a(`[${t}]`,"blue")}变更, 程序即将重启...`,"yellow"),!0),o=j,e(X?`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=X?r[0]?.split(/\s+/).pop()?.trim():r[0]?.trim();if(!i)return void l(a(`未找到占用端口 ${o} 的进程, 请尝试手动重启程序`,"yellow"));try{n.kill(Number(i),"SIGHUP")}catch(e){l(a(`终止进程 ${i} 时发生错误: ${e.message}`,"red"))}}))})});let X="win32"===n.platform;n.on("SIGHUP",function(){z.close(P);let e=t(n.argv[0],n.argv.slice(1),{detached:!1,stdio:"inherit"});e.unref(),e.on("close",D)}),n.on("exit",function(){z.close(P)}),w(D);
1
+ import{exec as e,spawn as t}from"node:child_process";import{watchFile as o}from"node:fs";import{join as r,relative as i}from"node:path";import n from"node:process";import{URL as s}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 w from"./commom/sigint-exit.mjs";import{devLog as y,PORT as j}from"./dev/config.mjs";import $ from"./dev/generate-progress-html.mjs";import v from"./dev/server.mjs";import b from"./options/reslove.mjs";import{ESLintPlugin as C}from"./plugin/eslint.mjs";import{generateManifest as x}from"./plugin/manifest.mjs";import{StylelintPlugin as _}from"./plugin/stylelint.mjs";import{empty as S}from"./utils/index.mjs";import{CONFIG as P,getConfig as k}from"./config.mjs";import{createDevelopmentConfiguration as E}from"./create-development-configuration.mjs";import{outputFileSystem as H}from"./file-system.mjs";import{isLibrary as O,refresh as T}from"./process-env.mjs";let B=!1,I="/____progress____",q={percentage:0,info:""},G="/__hmr__",L=new URLSearchParams({name:"client",path:G.substring(1),dynamicPublicPath:!0,timeout:2e3,reload:!T,quiet:!0,noInfo:!0,overlay:!1,autoConnect:!0}).toString(),N=await E({watchOptions:{stdin:!0,aggregateTimeout:300,ignored:/node_modules\/(?!(@app)\/)/},entry:{main:[`${b.hotMiddlewareClient}?${L}`]},plugins:[new c.WatchIgnorePlugin({paths:[/node_modules\/(?!(@app)\/)/,/\.d\.ts$/]}),new c.ProgressPlugin({handler(e,t,...o){let r=o.length?`[${t}] ${o.join(" ")}`:" ";B||(q.info=r,q.percentage=e,B=1===e);let i=P.bar;if(i){let t=i.name||"Build";i.quiet?n.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&&n.stdout.write("\r\x1b[2K"))}}})]});function U(e){let t=e.join(","),o=[i(u.programPath,`${P.alias["@"]}/**/*.{${t}}`).replace(/\\/g,"/")];return O&&o.push(i(u.programPath,`${P.alias["@pkg"]}/**/*.{${t}}`).replace(/\\/g,"/")),o}P.eslint&&N.plugins.push(new C({fix:!0,cache:!0,cacheLocation:`${u.lintCachePath}/.eslintcache`,cacheStrategy:"metadata",files:U(["js","jsx","ts","tsx","json","html","vue"]),...P.eslint})),P.stylelint&&N.plugins.push(new _({fix:!0,cache:!0,cacheLocation:`${u.lintCachePath}/.stylelintcache`,files:U(["css","scss","sass","less","ts","tsx","js","jsx"]),...P.stylelint}));let F=c(N);if(!F)throw Error("无法创建编译器");F.outputFileSystem=H;let J=F.watch(F.options.watchOptions,y);if(!J)throw Error("无法创建监视器");F.hooks.done.tap("client-log",e=>{y(null,e)});let R=`${P.basename}/${G}`.replace(/\/+/g,"/"),A=f(F,{log:!1,path:R,heartbeat:2e3}),K=!!P.manifest&&r(P.basename,P.manifest.filename).replaceAll(/\\/g,"/"),M=await v({port:j,root_dir:F.options.output.path,fileSystem:F.outputFileSystem,headers:P.devServer.headers,https:P.devServer.https,host:P.devServer.host,open:P.devServer.open,basename:P.basename,onRequest(e,t){if(!t.writableEnded){if("GET"===e.method){let o=new s(`${P.devServer.https?"https":"http"}://${e.headers.host}${e.url}`);if(K&&o.pathname===K)return t.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}),t.end(JSON.stringify(x({}))),!0;if(o.pathname===I)return t.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}),t.end(JSON.stringify(q)),!0;if(!B)return t.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),t.end($(I,q)),!0;if(o.pathname===R&&"text/event-stream"===e.headers.accept)return A(e,t,S),!0}return!1}}});function W(){n.exit(0)}M.on("close",()=>{J.close(S),A.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)),s=h(r||{},i||{}),p=d(D,s);1===Object.keys(p).length&&"proxy"in p?(m(a(`代理更新中...`,"yellow"),!0),m(a(`代理更新完成...`,"green"),!0),P.proxy=s.proxy,D.proxy=s.proxy,D=s):(D=s,l(a(`检测到工程配置${a(`[${t}]`,"blue")}变更, 程序即将重启...`,"yellow"),!0),o=j,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{n.kill(Number(i),"SIGHUP")}catch(e){l(a(`终止进程 ${i} 时发生错误: ${e.message}`,"red"))}}))})});let Q="win32"===n.platform;n.on("SIGHUP",function(){M.close(S);let e=t(n.argv[0],n.argv.slice(1),{detached:!1,stdio:"inherit"});e.unref(),e.on("close",W)}),n.on("exit",function(){M.close(S)}),w(W);
@@ -1 +1 @@
1
- let e=function(){let e={priority:-10,reuseExistingChunk:!0};return function(n){return{...e,test:n}}}(),n={chunks:"all",minChunks:1,minSize:2e4,maxSize:25e4,enforceSizeThreshold:5e4,maxAsyncRequests:30,maxInitialRequests:30,minRemainingSize:0,hidePathInfo:!0,cacheGroups:{CHANGELOG:e(/CHANGELOG\.md/),site:e(/site/),vendors:{test:/[\\/]node_modules[\\/]/,priority:-10,reuseExistingChunk:!0},"monaco-editor":{test:/[\\/]node_modules[\\/]monaco-editor/,name:"monaco-editor",chunks:"all"},common:{minChunks:2,priority:-20,reuseExistingChunk:!0}}};export default n;
1
+ let e=function(){let e={priority:-10,reuseExistingChunk:!0};return function(n){return{...e,test:n}}}(),n={chunks:"all",minChunks:1,minSize:2e4,maxSize:25e4,enforceSizeThreshold:5e4,maxAsyncRequests:30,maxInitialRequests:30,minRemainingSize:0,hidePathInfo:!0,cacheGroups:{json:{type:"json"},CHANGELOG:e(/CHANGELOG\.md/),site:e(/site/),vendors:{test:/[\\/]node_modules[\\/]/,priority:-10,reuseExistingChunk:!0},"monaco-editor":{test:/[\\/]node_modules[\\/]monaco-editor/,name:"monaco-editor",chunks:"all"},common:{minChunks:2,priority:-20,reuseExistingChunk:!0}}};export default n;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.56.14-beta.5",
3
+ "version": "3.56.14-beta.6",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",
@@ -137,7 +137,7 @@
137
137
  "@moneko/transform-imports": "1.2.1",
138
138
  "@moneko/utils": "0.3.3",
139
139
  "@swc/core": "1.13.5",
140
- "browserslist": "4.26.3",
140
+ "browserslist": "4.27.0",
141
141
  "chokidar": "4.0.3",
142
142
  "core-js": "3.46.0",
143
143
  "core-js-compat": "3.46.0",
@@ -176,5 +176,5 @@
176
176
  "lib",
177
177
  "typings"
178
178
  ],
179
- "packageManager": "pnpm@10.15.0"
179
+ "packageManager": "pnpm@10.19.0"
180
180
  }