@moneko/core 3.56.1 → 3.56.3
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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{extname as e,join as t,resolve as o}from"node:path";import s,{config_files as a,CUSTOMCONFIG as n,TMP_DIR as i}from"./commom/paths.mjs";import{OverrideResolverPlugin as r}from"./plugin/override-resolve.mjs";import{isObject as l,node_modules as m,resolveProgram as
|
|
1
|
+
import{extname as e,join as t,resolve as o}from"node:path";import s,{config_files as a,CUSTOMCONFIG as n,TMP_DIR as i}from"./commom/paths.mjs";import{OverrideResolverPlugin as r}from"./plugin/override-resolve.mjs";import{isObject as l,node_modules as m,resolveProgram as c}from"./utils/index.mjs";import{exampleModuleName as p}from"./vm/example.mjs";import u from"./vm/info.mjs";import{CONFIG as d}from"./config.mjs";import h from"./plugins.config.mjs";import{isCI as f,isDev as g,isLibrary as b,NODE_ENV as y,packageJson as j}from"./process-env.mjs";export const outputConfig={path:c(b?"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:`${u.projectName}`,type:"umd",umdNamedDefine:!0},globalObject:"self",chunkLoadingGlobal:`webpackJsonp_${j.name}`,pathinfo:g,clean:!g,publicPath:d.publicPath,asyncChunks:!0,charset:!0,iife:!0,crossOriginLoading:"use-credentials",enabledWasmLoadingTypes:["fetch"],uniqueName:`${u.projectName}`};let v={main:[m("@app/entry")]},C=[g&&d.refresh&&d.env.injectRemoteReactRefresh&&"@moneko/react/lib/inject-react-refresh.js",t(s.corePath,"./polyfills/public-path.mjs")].filter(Boolean);if(d.polyfill&&C.push(t(s.corePath,"./polyfills/replace-children.mjs")),d.entry&&("string"==typeof d.entry?v={...v,main:[d.entry]}:Object.keys(d.entry)&&(v=Object.assign(v,d.entry))),"string"==typeof v.main?v.main=[...C,v.main]:Array.isArray(v.main)&&(v.main=[...C,...v.main]),d.output){if("string"==typeof d.output)outputConfig.path=d.output;else if(Object.keys(d.output)){let e=d.output,t={...outputConfig.library};Object.assign(outputConfig,e),"object"==typeof d.output&&e.library&&(outputConfig.library=Object.assign(t,e.library))}}let P={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:s.webpackCachePath,memoryCacheUnaffected:!0,name:`.${[n,y].filter(Boolean).join("-")}`,version:`${j.version}`,buildDependencies:{config:a},maxMemoryGenerations:1};!1===d.cache?P=!1:l(d.cache)&&(P=Object.assign(P,d.cache)),f&&(void 0===d.cache||d.cache&&!d.cache.cacheDirectory)&&(P.cacheDirectory=o(i,j.name));export const commonConfig={name:"client",target:"web",devtool:d.devtool,entry:v,mode:g?"development":"production",stats:"errors-only",cache:P,snapshot:{immutablePaths:[s.pnpmNodeModules,s.denoNodeModules,/node_modules\/(?!(@app)\/)/],managedPaths:[s.pnpmNodeModules,s.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:d.externalsPresets,plugins:h,node:{global:!1,__filename:!1,__dirname:!1},experiments:{asyncWebAssembly:!0,cacheUnaffected:!0,lazyCompilation:d.lazyCompilation&&g&&{imports:!0,entries:!0,test:e=>{let t=e.nameForCondition();return!!(t&&(t.startsWith(m(p))||t.startsWith(m("@app/comment"))||t.startsWith(s.pagesPath)||t.startsWith(s.componentsPath)))}},buildHttp:l(d.buildHttp)?{allowedUris:[],lockfileLocation:o(s.httpCachePath,"http.lock"),cacheLocation:o(s.httpCachePath,"data"),upgrade:!0,...d.buildHttp}:d.buildHttp,backCompat:!0,futureDefaults:!0,css:!1,outputModule:!1},resolve:{extensions:[".mts",".mjs",".ts",".tsx",".js",".jsx",".json",".wasm"],alias:d.alias,modules:[s.nodeModules,s.pnpmNodeModules,s.denoNodeModules],mainFields:["browser","module","main"],mainFiles:["index"],plugins:d.resolvePlugins,preferAbsolute:!0,cache:!0,fallback:{}},externals:d.externals,output:outputConfig,recordsPath:d.recordsPath?t(s.programPath,d.recordsPath):t(s.webpackCachePath,"records.json")};d.overrideResolve&&commonConfig.resolve.plugins.push(new r(Object.assign({original:d.alias["@"],override:n&&c(n)},d.overrideResolve)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as e,relative as t}from"node:path";import r from"webpack";import o from"../commom/module-resolve.mjs";import s from"../commom/paths.mjs";import{CONFIG as m}from"../config.mjs";import a from"../utils/fetch-module-federation-dts.mjs";import{resolveProgram as l}from"../utils/index.mjs";import{ModuleFederationExposesDeclarationPlugin as i}from"./exposes-declararion.mjs";import{ExternalRemotesPlugin as
|
|
1
|
+
import{join as e,relative as t}from"node:path";import r from"webpack";import o from"../commom/module-resolve.mjs";import s from"../commom/paths.mjs";import{CONFIG as m}from"../config.mjs";import a from"../utils/fetch-module-federation-dts.mjs";import{resolveProgram as l}from"../utils/index.mjs";import{ModuleFederationExposesDeclarationPlugin as i}from"./exposes-declararion.mjs";import{ExternalRemotesPlugin as p}from"./external-remotes.mjs";let n=r.NormalModuleReplacementPlugin,h=r.container.ModuleFederationPlugin,f={},u=[],c=m.moduleFederation?.map(r=>{let m={},p={},n={};if(Array.isArray(r.remotes))for(let e=0,t=r.remotes.length;e<t;e++){let t=r.remotes[e],o=t.alias||t.name,s=t.filename||"remote_entry.js";if(p[o]=`${t.name}@${t.host}/${s}`,Array.isArray(t.library))for(let e=0,r=t.library.length;e<r;e++)f[t.library[e]]=`${o}/${t.library[e]}`;a(t.host,t.name)}if(Array.isArray(r.exposes)){r.exposes.length>0&&!r.exposes.find(e=>"public-path"===e)&&r.exposes.push({name:"public-path",path:`./${t(s.programPath,e(s.corePath,"./polyfills/public-path.mjs"))}`});for(let e=0,t=r.exposes.length;e<t;e++){let t=r.exposes[e];if("string"==typeof t){let e=t.startsWith(".");m[`./${t}`]=o(e?l(t):t),e&&(n[t]=m[`./${t}`])}else if("[object Object]"===Object.prototype.toString.call(t)){let e=t.path.startsWith(".");m[`./${t.name}`]=o(e?l(t.path):t.path),e&&(n[`./${t.name}`]=m[`./${t.name}`])}}r.exposes?.length&&u.push(new i({exposes:n,name:r.name}))}return new h({filename:"remote_entry.js",...r,remotes:p,exposes:m})});c.length>0&&(c.push(new p),c.push(new n(/(.*)/,e=>{f[e.request]&&(e.request=f[e.request])})),u.forEach(e=>c.push(e))),m.env.injectRemoteReactRefresh=Object.keys(f).includes("react-dom");export default c;
|
package/lib/vm/render-app.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CONFIG as e}from"../config.mjs";import{APPTYPE as r,frameworkVersion as t,isDev as o}from"../process-env.mjs";let n=t<18,a="hash"===e.routerMode,c=a?"HashRouter":"BrowserRouter",
|
|
1
|
+
import{CONFIG as e}from"../config.mjs";import{APPTYPE as r,frameworkVersion as t,isDev as o}from"../process-env.mjs";let n=t<18,a="hash"===e.routerMode,c=a?"HashRouter":"BrowserRouter",p=e.strict?"StrictMode":"",s=`<${p}><${c} basename={${a?'"/"':"basename"}} window={window}><ErrorBoundary><App /></ErrorBoundary></${c}></${p}>`,m=`import React, { StrictMode, type ReactElement } from 'react';
|
|
2
2
|
import { ErrorBoundary } from '@moneko/react';
|
|
3
3
|
import routes from '@app/routes';
|
|
4
4
|
import ReactDOM from '${n?"react-dom":"react-dom/client"}';
|
|
@@ -22,7 +22,7 @@ function renderApp(props: RenderAppProps = {}) {
|
|
|
22
22
|
const { container, basename = "${e.basename}", language, ...args } = props;
|
|
23
23
|
const _container = container?.querySelector('#root') || document.getElementById('root');
|
|
24
24
|
${"micro"===r?"window.mainApp = { ...args, container: _container as HTMLElement };":""}
|
|
25
|
-
${n?`ReactDOM.${o?"render":"hydrate"}(${
|
|
25
|
+
${n?`ReactDOM.${o?"render":"hydrate"}(${s}, _container);return () => ReactDOM.unmountComponentAtNode(_container as Element);`:`const instance = ReactDOM.createRoot(_container as HTMLElement);instance.render(${s});return instance.unmount;`}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export default renderApp;`;export default
|
|
28
|
+
export default renderApp;`;export default m;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.56.
|
|
3
|
+
"version": "3.56.3",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -109,29 +109,29 @@
|
|
|
109
109
|
"license": "MIT",
|
|
110
110
|
"dependencies": {
|
|
111
111
|
"@moneko/convert": "1.1.3",
|
|
112
|
-
"@moneko/eslint": "1.9.
|
|
112
|
+
"@moneko/eslint": "1.9.5",
|
|
113
113
|
"@moneko/mdx": "0.1.44",
|
|
114
114
|
"@moneko/raw-import": "1.1.1",
|
|
115
115
|
"@moneko/request": "1.6.2",
|
|
116
|
-
"@moneko/stylelint": "1.
|
|
116
|
+
"@moneko/stylelint": "1.6.0",
|
|
117
117
|
"@moneko/transform-imports": "1.2.1",
|
|
118
118
|
"@moneko/utils": "0.3.3",
|
|
119
119
|
"@swc/core": "1.13.5",
|
|
120
|
-
"browserslist": "4.26.
|
|
120
|
+
"browserslist": "4.26.3",
|
|
121
121
|
"chokidar": "4.0.3",
|
|
122
122
|
"core-js": "3.45.1",
|
|
123
123
|
"core-js-compat": "3.45.1",
|
|
124
124
|
"husky": "9.1.7",
|
|
125
|
-
"less": "4.4.
|
|
125
|
+
"less": "4.4.2",
|
|
126
126
|
"less-loader": "12.3.0",
|
|
127
127
|
"lightningcss": "1.30.2",
|
|
128
128
|
"marked-completed": "1.2.14",
|
|
129
|
-
"memfs": "4.
|
|
129
|
+
"memfs": "4.49.0",
|
|
130
130
|
"mini-css-extract-plugin": "2.9.4",
|
|
131
131
|
"style-loader": "4.0.0",
|
|
132
132
|
"swc-loader": "0.2.6",
|
|
133
|
-
"typescript": "5.9.
|
|
134
|
-
"webpack": "5.102.
|
|
133
|
+
"typescript": "5.9.3",
|
|
134
|
+
"webpack": "5.102.1",
|
|
135
135
|
"webpack-hot-middleware": "2.26.1",
|
|
136
136
|
"webpack-merge": "6.0.1",
|
|
137
137
|
"webpack-virtual-modules": "0.6.2"
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"@moneko/css": "1.2.0",
|
|
141
141
|
"@types/stylis": "4.2.7",
|
|
142
142
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
143
|
-
"@types/webpack-hot-middleware": "2.25.
|
|
143
|
+
"@types/webpack-hot-middleware": "2.25.11",
|
|
144
144
|
"sass": "1.93.2",
|
|
145
145
|
"sass-loader": "16.0.5",
|
|
146
146
|
"solid-refresh": "0.7.5",
|