@moneko/core 3.24.3 → 3.24.5-beta.0
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/common.mjs +1 -1
- package/lib/config.mjs +1 -1
- package/lib/utils/setup-env.d.mts +5 -2
- package/lib/utils/setup-env.mjs +1 -1
- package/lib/vm/modules.mjs +1 -1
- package/package.json +3 -4
- package/typings/global.d.ts +4 -1
package/lib/common.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CONFIG as e,PUBLICPATH as t}from"./config.mjs";import o,{CUSTOMCONFIG as a}from"./paths.mjs";import s from"./plugin/override-resolve.mjs";import n from"./plugins.config.mjs";import{PACKAGENAME as i,PACKAGEVERSION as r,isDev as l,isLibrary as m}from"./process-env.mjs";import{isObject as p,node_modules as c,resolveProgram as u}from"./utils/index.mjs";import{join as h,resolve as d,extname as f}from"path";import{exampleModuleName as g}from"./vm/example.mjs";import y from"./vm/info.mjs";export const outputConfig={path:u(m?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:`js/[${l?"name":"contenthash"}].js`,assetModuleFilename:e=>{let t=f(e.filename||"").substring(1);return`assets/${t?`${t}/`:""}[name]${"js"===t?"":"[hash]"}[ext]`},library:{name:`${y.projectName}`,type:"umd",umdNamedDefine:!0},globalObject:"window",chunkLoadingGlobal:`webpackJsonp_${i}`,pathinfo:l,clean:!0,publicPath:t,asyncChunks:!0,charset:!0,iife:!0,crossOriginLoading:"use-credentials",enabledWasmLoadingTypes:["fetch"],hotUpdateChunkFilename:"[id].[fullhash].hot.js",hotUpdateMainFilename:"[runtime].[fullhash].hot.json"};let b={main:[e.polyfill&&h(o.corePath,"./polyfills/replace-children.mjs"),c("@app/entry")].filter(Boolean)};e.entry&&("string"==typeof e.entry?b={main:[e.entry]}:Object.keys(e.entry)&&(b=Object.assign(b,e.entry))),"string"==typeof b.main&&(b.main=[b.main]),e.output&&("string"==typeof e.output?outputConfig.path=e.output:Object.keys(e.output)&&Object.assign(outputConfig,e.output));let j={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:o.webpackCachePath,memoryCacheUnaffected:!0,name:[a,process.env.NODE_ENV].filter(Boolean).join("-"),version:`${r}`}
|
|
1
|
+
import{CONFIG as e,PUBLICPATH as t}from"./config.mjs";import o,{CUSTOMCONFIG as a}from"./paths.mjs";import s from"./plugin/override-resolve.mjs";import n from"./plugins.config.mjs";import{PACKAGENAME as i,PACKAGEVERSION as r,isDev as l,isLibrary as m}from"./process-env.mjs";import{isObject as p,node_modules as c,resolveProgram as u}from"./utils/index.mjs";import{join as h,resolve as d,extname as f}from"path";import{exampleModuleName as g}from"./vm/example.mjs";import y from"./vm/info.mjs";export const outputConfig={path:u(m?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:`js/[${l?"name":"contenthash"}].js`,assetModuleFilename:e=>{let t=f(e.filename||"").substring(1);return`assets/${t?`${t}/`:""}[name]${"js"===t?"":"[hash]"}[ext]`},library:{name:`${y.projectName}`,type:"umd",umdNamedDefine:!0},globalObject:"window",chunkLoadingGlobal:`webpackJsonp_${i}`,pathinfo:l,clean:!0,publicPath:t,asyncChunks:!0,charset:!0,iife:!0,crossOriginLoading:"use-credentials",enabledWasmLoadingTypes:["fetch"],hotUpdateChunkFilename:"[id].[fullhash].hot.js",hotUpdateMainFilename:"[runtime].[fullhash].hot.json"};let b={main:[e.polyfill&&h(o.corePath,"./polyfills/replace-children.mjs"),c("@app/entry")].filter(Boolean)};e.entry&&("string"==typeof e.entry?b={main:[e.entry]}:Object.keys(e.entry)&&(b=Object.assign(b,e.entry))),"string"==typeof b.main&&(b.main=[b.main]),e.output&&("string"==typeof e.output?outputConfig.path=e.output:Object.keys(e.output)&&Object.assign(outputConfig,e.output));let j={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:o.webpackCachePath,memoryCacheUnaffected:!0,name:[a,process.env.NODE_ENV].filter(Boolean).join("-"),version:`${r}`};!1===e.cache?j=!1:p(e.cache)&&(j=Object.assign(j,e.cache));let v=Object.assign({original:e.alias["@"],override:a&&u(a)},e.overrideResolve);export const commonConfig={name:"client",target:"web",devtool:e.devtool,entry:b,mode:l?"development":"production",stats:"errors-only",cache:j,infrastructureLogging:{level:"error"},performance:e.performance,externalsPresets:e.externalsPresets,plugins:n,node:{global:!1},experiments:{topLevelAwait:!0,asyncWebAssembly:!0,cacheUnaffected:!0,layers:!0,lazyCompilation:e.lazyCompilation&&l&&{imports:!0,entries:!0,test:e=>{let t=e.nameForCondition();return!!(t&&(t.startsWith(c(g))||t.startsWith(c("@app/comment"))||t.startsWith(o.pagesPath)||t.startsWith(o.componentsPath)))}},buildHttp:p(e.buildHttp)?{allowedUris:[],lockfileLocation:d(o.httpCachePath,"http.lock"),cacheLocation:d(o.httpCachePath,"data"),upgrade:!0,...e.buildHttp}:e.buildHttp,backCompat:!0,futureDefaults:!0,css:!1,outputModule:!1},resolve:{extensions:["...",".jsx",".ts",".tsx"],alias:e.alias,modules:[o.nodeModules,o.pnpmNodeModules],mainFields:["browser","module","main"],mainFiles:["index"],plugins:[e.overrideResolve&&new s(v),...e.resolvePlugins].filter(Boolean),fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},externals:e.externals,output:outputConfig};
|
package/lib/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{merge as e}from"webpack-merge";import o from"./options/jsx-dom-expressions.mjs";import t from"./options/split-chunk.mjs";import s from"./paths.mjs";import{APPTYPE as n,FRAMEWORK as i,NODE_ENV as r,PACKAGENAME as
|
|
1
|
+
import{merge as e}from"webpack-merge";import o from"./options/jsx-dom-expressions.mjs";import t from"./options/split-chunk.mjs";import s from"./paths.mjs";import{APPTYPE as n,FRAMEWORK as i,NODE_ENV as r,PACKAGENAME as a,isDev as l,isLibrary as m,isMobile as p,jsxImportSource as u,mainDirectory as c}from"./process-env.mjs";import{isFunction as d,resolveProgram as f}from"./utils/index.mjs";import h from"./utils/setup-env.mjs";import{fileExists as g}from"@moneko/utils";import x from"./utils/require.mjs";let v=["@app","@moneko","neko-ui",".cache/http/data","@ant-design","@element-plus","ant-design-vue","antd","antd-mini","antd-mobile","antd-mobile-icons","element-plus","element-ui","ng-zorro-antd","@antv","@mui","@du","ahooks","rc-queue-anim","umi","@fontsource","@fortawesome","font-pingfang-sc","font-pingfang-tc","katex","react-markdown-editor-lite","react-photo-view","schema-design"],P={devtool:l?"eval-cheap-module-source-map":"cheap-module-source-map",seo:!1,mode:"csr",bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:""},env:await h(r,n,i),basename:"/",publicPath:"/",rem:{designSize:p?375:1920},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{"@":f(c)},moduleRules:[],prefixJsLoader:[],cssModules:[],cssModuleDefinition:!0,importOnDemand:{},proxy:{},devServer:{host:"localhost",port:3e3},htmlPluginOption:{},copy:{},routerMode:"browser",fixBrowserRouter:!1,plugins:[],resolvePlugins:[],overrideResolve:!1,splitChunk:t,runtimeChunk:"single",moduleFederation:[],rulesInclude:{css:v,js:v,media:v,font:v,wasm:[]},mdx:{jsx:!1,development:l,jsxImportSource:u,providerImportSource:`@moneko/${i}/mdx`},jsxDomExpressions:o,bar:{name:"Client",color:"#6f42c1"},normalizeCss:!0,externalsPresets:{},buildHttp:void 0,virtualModule:{},cssExtract:{},externals:["@swc/core"],lazyCompilation:!1,performance:{maxAssetSize:256e3,maxEntrypointSize:256e3,assetFilter:e=>!e.endsWith(".map")&&!e.endsWith("ce28377f3a428346.js")},refresh:!0};function j(e){if(g(e)){let o=x(e).default;return d(o)?o(process):o}return{}}m&&(P.alias=Object.assign(P.alias,{"@pkg":s.componentsPath,[a]:s.componentsPath}));let w=P;(!1===(w=e(w,j(s.configPath),j(s.customConfigPath))).devtool||!1===w.sourceMap)&&(w.sourceMap=!1,w.devtool=!1),w.fixBrowserRouter&&w.htmlPluginOption&&(w.htmlPluginOption.tags||(w.htmlPluginOption.tags=[]),w.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))"}));export const CONFIG=w;export const PUBLICPATH=CONFIG.publicPath;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare function setupEnv(mode: string, type: string, framework: string): Promise<{
|
|
2
|
+
NODE_ENV: string;
|
|
3
|
+
APPTYPE: string;
|
|
4
|
+
FRAMEWORK: string;
|
|
5
|
+
}>;
|
|
3
6
|
export default setupEnv;
|
package/lib/utils/setup-env.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{loadFile as r}from"@moneko/utils";import{relative as t}from"path";import e from"../paths.mjs";async function o(o,a,i){let n=[t(e.programPath,".env"),t(e.programPath,".env/.env"),t(e.programPath,`.env/.${"production"===o?"prod":"dev"}.env`)],m={NODE_ENV:o,APPTYPE:a,FRAMEWORK:i};return(await Promise.all(n.map(r))).forEach(r=>{r&&Object.assign(m,r.split("\n").reduce((r,t)=>{if(!t||t.trim().startsWith("#"))return r;let[e,...o]=t.split("=");if(!e)return r;let a=o.join("=").trim();return r[e.trim()]=a.replace(/^["']|["']$/g,""),r},{}))}),m}export default o;
|
package/lib/vm/modules.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as t}from"path";import{getAppEntry as e,getAppFallback as p,getAppMdxScope as r,getAppMergeRouter as o,getAppNormalizeCss as m,getAppPrefixRouter as s,getAppRem as a,getAppSuspense as i}from"@moneko/mdx";import
|
|
1
|
+
import{join as t}from"path";import{getAppEntry as e,getAppFallback as p,getAppMdxScope as r,getAppMergeRouter as o,getAppNormalizeCss as m,getAppPrefixRouter as s,getAppRem as a,getAppSuspense as i}from"@moneko/mdx";import n from"./coverage.mjs";import{docs as f,docsModuleName as l}from"./docs.mjs";import d from"./info.mjs";import{locales as u,localesModuleName as x}from"./locales.mjs";import{route as j,routesModuleName as c}from"./routes.mjs";import{CONFIG as g}from"../config.mjs";import v from"../paths.mjs";import{APPTYPE as y,FRAMEWORK as h}from"../process-env.mjs";import{node_modules as k}from"../utils/index.mjs";import{generateDeclaration as O}from"../utils/dts.mjs";import S from"../utils/has-pkg.mjs";import{updateFileSync as b}from"@moneko/utils";import z from"../plugin/module-federation.mjs";import D from"../utils/create-types.mjs";import J from"../rule.mjs";let N=S(t(g.alias["@"],"./mdx-scope.tsx"))||S(t(g.alias["@"],"./mdx-scope.ts")),$={[k("@app/env.ts")]:`export default ${JSON.stringify(g.env)}`,[k("@app/info.ts")]:`export default ${JSON.stringify(d)}`,[k("@app/entry.ts")]:e(t(g.alias["@"],"./index.ts"),!!z.length,!!g.rem,!!g.normalizeCss,y,h),[k("@app/rem")]:a(g.rem?.designSize||1680),[k("@app/fallback")]:p(g.fallbackCompPath),[k("@app/coverage")]:n(v.coveragePath),[k("@app/merge-router")]:o(),[k("@app/prefix-router")]:s(),[k("@app/normalize/index.css")]:m(),[k("@app/suspense/index.tsx")]:i(y,h),[k("@app/mdx-scope.tsx")]:N?r(N):"export default {}",[k(c)]:j.getData(c),[k(x)]:u.getData(x),[k(l)]:f.getData(l)};b(k("@types/@app/index.d.ts"),["@app/env.ts","@app/info.ts","@app/entry.ts","@app/mdx-scope.tsx"].map(t=>{let e=k(t);return D(t.replace(J.js,""),O($[e],e))}).join("\n")),b(k("@types/@vm/index.d.ts"),Object.keys(g.virtualModule).map(t=>{let e=g.virtualModule[t];return D(t.replace(J.js,""),O("string"==typeof e?e:`export default ${JSON.stringify(e)}`,k(t)))}).join("\n"));export default $;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.24.
|
|
3
|
+
"version": "3.24.5-beta.0",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"core-js": "3.39.0",
|
|
26
26
|
"core-js-compat": "3.39.0",
|
|
27
27
|
"css-loader": "7.1.2",
|
|
28
|
-
"dotenv": "16.4.5",
|
|
29
28
|
"express": "5.0.1",
|
|
30
29
|
"html-webpack-plugin": "5.6.3",
|
|
31
30
|
"http-proxy-middleware": "3.0.3",
|
|
@@ -57,9 +56,9 @@
|
|
|
57
56
|
"@types/multer": "1.4.12",
|
|
58
57
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
59
58
|
"@types/webpack-hot-middleware": "2.25.9",
|
|
60
|
-
"babel-plugin-react-compiler": "19.0.0-beta-
|
|
59
|
+
"babel-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",
|
|
61
60
|
"oxlint": "0.11.1",
|
|
62
|
-
"sass": "1.80.
|
|
61
|
+
"sass": "1.80.7",
|
|
63
62
|
"sass-loader": "16.0.3",
|
|
64
63
|
"solid-refresh": "0.7.5"
|
|
65
64
|
},
|
package/typings/global.d.ts
CHANGED
|
@@ -121,6 +121,9 @@ export interface Theme {
|
|
|
121
121
|
errorColor?: string;
|
|
122
122
|
warningColor?: string;
|
|
123
123
|
}
|
|
124
|
+
interface CacheConfig extends FileCacheOptions, MemoryCacheOptions {
|
|
125
|
+
type?: 'filesystem' | 'memory';
|
|
126
|
+
}
|
|
124
127
|
export declare type ConfigType = {
|
|
125
128
|
/**
|
|
126
129
|
* @default true
|
|
@@ -244,7 +247,7 @@ export declare type ConfigType = {
|
|
|
244
247
|
/**
|
|
245
248
|
* 缓存配置
|
|
246
249
|
*/
|
|
247
|
-
cache?:
|
|
250
|
+
cache?: CacheConfig | false;
|
|
248
251
|
/** 开发服务器设置 */
|
|
249
252
|
devServer: {
|
|
250
253
|
headers?: Record<string, string>;
|