@moneko/core 4.12.1 → 4.12.2
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 i}from"./commom/posix.mjs";import r from"./commom/setup-env.mjs";import a 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,isBuild as v,isCI as x,isDev as b,isLibrary as j,isMobile as C,isReact as P,jsxImportSource as k,mainDirectory as w,NODE_ENV as O,PACKAGENAME as y}from"./process-env.mjs";let S=[/(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","codemirror-json-schema"];export async function getConfig(e){let t=l(e).default;return(p(t)?await t(o):t)??{}}let I=await r(O,f,h,[],v,n),[z,F]=await Promise.all([getConfig(s.configPath),getConfig(s.customConfigPath)]),M={mode:O,strict:!1,devtool:!1,seo:!1,bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:(!!x||!b)&&{},sourceMap:{filename:"[file].map",publicPath:"",namespace:y,moduleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]",fallbackModuleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]"},env:I,basename:"/",publicPath:"auto",rem:{designSize:C?375:1920},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:Object.assign({"@":u(w)},P&&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:y.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:S,js:S,media:S,font:S,wasm:[]},mdx:{jsx:!1,development:b,jsxImportSource:k,providerImportSource:`@moneko/${h}/mdx`},jsxDomExpressions:a,bar:{name:"Client",nameColor:"68",msgColor:"242",barBgColor:"15",barColor:"69",quiet:x},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"};j&&(M.alias=Object.assign(M.alias,{"@pkg":s.componentsPath,[y]:s.componentsPath}));let A=M;if(A=t(A,z,F),"true"===o.env.CODESPACES&&A.devServer.https&&(A.devServer.https=!1),!1===A.devServer.https&&"darwin"===o.platform&&(A.devServer.open=!1),A.htmlPluginOption&&(A.htmlPluginOption.tags||(A.htmlPluginOption.tags=[]),A.fixBrowserRouter&&A.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))"}),A.manifest)){let o=A.manifest.publicPath??A.htmlPluginOption.publicPath??A.publicPath??"/";A.htmlPluginOption.tags.push({href:i("auto"===o?"/":o,A.manifest.filename).replaceAll(e,"/"),tag:"link",rel:"manifest"})}export const CONFIG=A;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 i}from"./commom/posix.mjs";import r from"./commom/setup-env.mjs";import a 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,isBuild as v,isCI as x,isDev as b,isLibrary as j,isMobile as C,isReact as P,jsxImportSource as k,mainDirectory as w,NODE_ENV as O,PACKAGENAME as y}from"./process-env.mjs";let S=[/(app|vm|docs|example):[a-zA-Z_0-9]/,"@moneko","neko-ui",".cache/http/data","@element-plus","@ant-design","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","codemirror-json-schema"];export async function getConfig(e){let t=l(e).default;return(p(t)?await t(o):t)??{}}let I=await r(O,f,h,[],v,n),[z,F]=await Promise.all([getConfig(s.configPath),getConfig(s.customConfigPath)]),M={mode:O,strict:!1,devtool:!1,seo:!1,bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:(!!x||!b)&&{},sourceMap:{filename:"[file].map",publicPath:"",namespace:y,moduleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]",fallbackModuleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]"},env:I,basename:"/",publicPath:"auto",rem:{designSize:C?375:1920},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:Object.assign({"@":u(w)},P&&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:y.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:S,js:S,media:S,font:S,wasm:[]},mdx:{jsx:!1,development:b,jsxImportSource:k,providerImportSource:`@moneko/${h}/mdx`},jsxDomExpressions:a,bar:{name:"Client",nameColor:"68",msgColor:"242",barBgColor:"15",barColor:"69",quiet:x},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"};j&&(M.alias=Object.assign(M.alias,{"@pkg":s.componentsPath,[y]:s.componentsPath}));let A=M;if(A=t(A,z,F),"true"===o.env.CODESPACES&&A.devServer.https&&(A.devServer.https=!1),!1===A.devServer.https&&"darwin"===o.platform&&(A.devServer.open=!1),A.htmlPluginOption&&(A.htmlPluginOption.tags||(A.htmlPluginOption.tags=[]),A.fixBrowserRouter&&A.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))"}),A.manifest)){let o=A.manifest.publicPath??A.htmlPluginOption.publicPath??A.publicPath??"/";A.htmlPluginOption.tags.push({href:i("auto"===o?"/":o,A.manifest.filename).replaceAll(e,"/"),tag:"link",rel:"manifest"})}export const CONFIG=A;export const PUBLICPATH="auto"===CONFIG.publicPath?"":CONFIG.publicPath;d(CONFIG);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as e,parse as t,relative as r,sep as o}from"node:path";import m from"webpack";import s from"../commom/log.mjs";import a from"../commom/module-resolve.mjs";import l from"../commom/paths.mjs";import{CONFIG as i}from"../config.mjs";import{re_export_schema as p}from"../process-env.mjs";import n from"../utils/fetch-module-federation-dts.mjs";import{resolveProgram as f}from"../utils/index.mjs";import{mf_vm as h}from"../vm/mf.mjs";import{re_export_vm as c}from"../vm/re-export.mjs";import{ModuleFederationExposesDeclarationPlugin as u}from"./exposes-declararion.mjs";import{ExternalRemotesPlugin as d}from"./external-remotes.mjs";let $=m.NormalModuleReplacementPlugin,
|
|
1
|
+
import{join as e,parse as t,relative as r,sep as o}from"node:path";import m from"webpack";import s from"../commom/log.mjs";import a from"../commom/module-resolve.mjs";import l from"../commom/paths.mjs";import{CONFIG as i}from"../config.mjs";import{re_export_schema as p}from"../process-env.mjs";import n from"../utils/fetch-module-federation-dts.mjs";import{resolveProgram as f}from"../utils/index.mjs";import{mf_vm as h}from"../vm/mf.mjs";import{re_export_vm as c}from"../vm/re-export.mjs";import{ModuleFederationExposesDeclarationPlugin as u}from"./exposes-declararion.mjs";import{ExternalRemotesPlugin as d}from"./external-remotes.mjs";let $=m.NormalModuleReplacementPlugin,y=m.container.ModuleFederationPlugin,j={},x=[];function g(e,r){let m=e.replaceAll(o,"/").replace(/\.tsx?$/i,""),s=t(r);h.setData(m,{type:".tsx",source:()=>{if(r.startsWith(l.nodeModules)){let e=r.substring(l.nodeModules.length).split("node_modules").pop()?.replaceAll(o,"/").replace(/^\//,"");return`export * from '${e}';`}return r.startsWith(i.alias["@"])?`export * from '@/${t(s.dir).name}/${s.name}'`:"export {};"}})}if(i.moduleFederation?.length)try{await Promise.allSettled(i.moduleFederation?.flatMap(e=>e.remotes?.map(e=>n(e.types||e.host,e.name,e.library||[],e.alias))))}catch(e){s(e)}let b=i.moduleFederation?.map(t=>{let o={},m={};if(Array.isArray(t.remotes))for(let e=0,r=t.remotes.length;e<r;e++){let r=t.remotes[e],o=r.alias||r.name,s=r.filename||"remote_entry.js";if(m[o]=`${r.name}@${r.host}/${s}`,Array.isArray(r.library))for(let e=0,t=r.library.length;e<t;e++)j[r.library[e]]=`${o}/${r.library[e]}`}if(Array.isArray(t.exposes)){t.exposes.length>0&&!t.exposes.find(e=>"public-path"===e)&&t.exposes.push({name:"public-path",path:`./${r(l.programPath,e(l.corePath,"./polyfills/public-path.mjs"))}`});for(let e=0,r=t.exposes.length;e<r;e++){let r=t.exposes[e];if("string"==typeof r){let e=r,m=r.startsWith(".");!m&&c.has(r)&&(e=`${p}:${r}`),o[`./${r}`]=a(m?f(e):e),m&&g(`${t.name}/${r}`,o[`./${r}`])}else if("[object Object]"===Object.prototype.toString.call(r)){let e=r.path.startsWith(".");o[`./${r.name}`]=a(e?f(r.path):r.path),e&&g(`${t.name}/${r.name}`,o[`./${r.name}`])}}t.exposes?.length&&x.push(new u({exposes:Object.fromEntries(t.exposes.map(e=>"string"==typeof e?[e,a(e)]:[`${t.name}/${e.name}`,o[`./${e.name}`]])),name:t.name}))}return new y({filename:"remote_entry.js",...t,remotes:m,exposes:o})});b.length>0&&(b.push(new d),b.push(new $(/(.*)/,e=>{j[e.request]&&(e.request=j[e.request])})),x.forEach(e=>b.push(e))),i.env.injectRemoteReactRefresh=Object.keys(j).includes("react-dom");export default b;
|
package/package.json
CHANGED
package/typings/global.d.ts
CHANGED