@moneko/core 2.0.53-beta.3 → 2.0.53-beta.5
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/build/common.js +1 -1
- package/build/module.config.js +1 -1
- package/build/swcrc.js +1 -1
- package/build/tsloader.config.js +1 -1
- package/build/utils.js +1 -1
- package/lib/components/fallback-comp.js +1 -1
- package/lib/menu.js +1 -1
- package/lib/packages/back-stage/app.js +1 -1
- package/lib/packages/single-spa/bootstrap.js +1 -1
- package/lib/react-router-dom/use-navgate.js +1 -1
- package/lib/router/index.js +1 -1
- package/package.json +4 -4
package/build/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _export(e,n){for(var t in n)Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}Object.defineProperty(exports,"__esModule",{value:!0}),_export(exports,{ENTRYPATH:function(){return ENTRYPATH},log:function(){return log},CONFIG:function(){return CONFIG},PUBLICPATH:function(){return PUBLICPATH}});var _customConf_minifier,_customConf_minifier_js,_customConf_minifier1,_customConf_minifier_css,_fs=
|
|
1
|
+
"use strict";function _export(e,n){for(var t in n)Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}Object.defineProperty(exports,"__esModule",{value:!0}),_export(exports,{ENTRYPATH:function(){return ENTRYPATH},log:function(){return log},CONFIG:function(){return CONFIG},PUBLICPATH:function(){return PUBLICPATH}});var _customConf_minifier,_customConf_minifier_js,_customConf_minifier1,_customConf_minifier_css,_fs=_interopRequireDefault(require("fs")),_path=_interopRequireDefault(require("path")),_readline=_interopRequireDefault(require("readline")),_chalk=_interopRequireDefault(require("chalk")),_webpackMerge=require("webpack-merge"),_processEnv=require("./process-env"),_utils=require("./utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var ENTRYPATH={mobile:"mobile",site:"site","back-stage":"back-stage","single-spa":"single-spa",library:"library","single-component":"single-component"},includeModule=[_processEnv.pkgName,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design"],defaultSplitChunk={chunks:"all",minSize:1024,minChunks:1};"single-component"===_processEnv.APPTYPE&&(defaultSplitChunk=!1);var defaultConfig={seo:!1,mode:"csr",compiler:"swc",emotion:{sourceMap:!0,autoLabel:"dev-only",labelFormat:"n-[local]"},bundleAnalyzer:{analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1},entry:{},minifier:{js:{},css:{}},sourceMap:{filename:"[file].map",publicPath:""},env:{},routeBaseName:"/",publicPath:"/",designSize:"mobile"===_processEnv.APPTYPE?375:1680,fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{},layoutSider:{},moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:_processEnv.PROGRAMPATH+"/node_modules/.temp_cache",devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:"./node_modules/"+_processEnv.pkgName+"/template/index.html",favicon:"./node_modules/"+_processEnv.pkgName+"/template/favicon.ico",tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],splitChunk:defaultSplitChunk,runtimeChunk:"single-component"!==_processEnv.APPTYPE&&"single",moduleFederation:[],rulesInclude:{less:includeModule,css:includeModule,js:includeModule,media:includeModule,fonts:includeModule}},log=function(e){_readline.default.cursorTo(process.stdout,0),process.stdout.write(e)},customConf=defaultConfig,configPath=null,normalConf={},envConf={};try{configPath=_path.default.join(_processEnv.PROGRAMPATH,"./config/index.ts"),_fs.default.accessSync(configPath,_fs.default.constants.R_OK)}catch(error){configPath=null}if(configPath)try{var conf=eval((0,_utils.tfc)(configPath)).default;normalConf=(0,_utils.isFunction)(conf)?conf(process):conf}catch(error){process.stdout.write(_chalk.default.red(error))}if(_processEnv.CUSTOMCONFIG){var customConfigPath=null;try{customConfigPath=_path.default.join(_processEnv.PROGRAMPATH,"./config/"+_processEnv.CUSTOMCONFIG+".ts"),_fs.default.accessSync(customConfigPath,_fs.default.constants.R_OK)}catch(error){customConfigPath=null}if(null!==customConfigPath)try{var conf=eval((0,_utils.tfc)(customConfigPath)).default;envConf=(0,_utils.isFunction)(conf)?conf(process):conf}catch(error){process.stdout.write(_chalk.default.red(error))}}customConf=(0,_webpackMerge.merge)(customConf,normalConf,envConf),customConf.minifier.js||(customConf.minifier.js={}),(null==customConf?void 0:null==(_customConf_minifier=customConf.minifier)?void 0:null==(_customConf_minifier_js=_customConf_minifier.js)?void 0:_customConf_minifier_js.type)||(customConf.minifier.js.type="swc"===customConf.compiler?"swc":"terser"),customConf.minifier.css||(customConf.minifier.css={}),(null==customConf?void 0:null==(_customConf_minifier1=customConf.minifier)?void 0:null==(_customConf_minifier_css=_customConf_minifier1.css)?void 0:_customConf_minifier_css.type)||(customConf.minifier.css.type="swc"===customConf.compiler?"swc":"cssnano"),!1===customConf.devtool&&(customConf.sourceMap=!1),!1===customConf.sourceMap&&(customConf.devtool=!1),customConf.fixBrowserRouter&&(customConf.htmlPluginOption.tags||(customConf.htmlPluginOption.tags=[]),customConf.htmlPluginOption.tags.push({textContent:"\n (function(l) {\n if (l.search[1] === '/' ) {\n var decoded = l.search.slice(1).split('&').map(function(s) { \n return s.replace(/~and~/g, '&')\n }).join('?');\n window.history.replaceState(null, null,\n l.pathname.slice(0, -1) + decoded + l.hash\n );\n }\n }(window.location))\n "}));var CONFIG=customConf,PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG:CONFIG,log:log};
|
package/build/module.config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return _}});var e,s,r,o,t,l,a,n,i,u,c,d,p=N(require("mini-css-extract-plugin")),m=N(require("mini-svg-data-uri")),f=require("./common"),y=require("./has-pkg"),v=N(require("./modifyVars")),g=require("./process-env"),h=N(require("./swcrc")),b=N(require("./tsloader.config")),x=require("./utils");function O(e,s){(null==s||s>e.length)&&(s=e.length);for(var r=0,o=Array(s);r<s;r++)o[r]=e[r];return o}function I(){return(I=Object.assign||function(e){for(var s=1;s<arguments.length;s++){var r=arguments[s];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function N(e){return e&&e.__esModule?e:{default:e}}function P(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,s){if(e){if("string"==typeof e)return O(e,s);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O(e,s)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var j="single-spa"===g.APPTYPE?f.PUBLICPATH:"../",$={loader:p.default.loader,options:{publicPath:"/"!==j?j:"../"}},C=(0,y.hasPkg)("@moneko/postcss"),q=C?require("@moneko/postcss"):{},M=C&&{loader:"postcss-loader",options:{postcssOptions:q}},F=C&&{loader:"postcss-loader",options:{postcssOptions:I({},q,{parser:"postcss-js"}),execute:!0}};g.DEV&&($="style-loader");var G=P(f.CONFIG.cssModules).concat([g.pkgName,"neko-ui"]).map(x.resolveNodeModulesPath),A=[(0,x.resolveNodeModulesPath)(""+g.pkgName+"/lib/styles/eval/*.less")].concat(P(["src/styles/variables/*.less","src/styles/mixins/*.less","site/styles/variables/*.less","site/styles/mixins/*.less"].map(x.resolveProgramPath))),k=["components","example","mock","site","src"].map(x.resolveProgramPath),w=[$,{loader:"css-loader",options:{modules:{auto:function(e){for(var s=0,r=G.length;s<r;s++)if(e&&(null==e?void 0:e.includes(G[s])))return RegExp("(.*(?<!\\.global\\.(le|c)ss)$)","i").test(e);return RegExp("(^(?!.*node_modules))(.*(?<!\\.global\\.(le|c)ss)$)","i").test(e)},localIdentName:"[path][name]__[local]",exportLocalsConvention:"dashesOnly"},importLoaders:2}},M,"css-unicode-loader",{loader:"less-loader",options:{sourceMap:!!f.CONFIG.sourceMap,lessOptions:{modifyVars:v.default,javascriptEnabled:!0}}},{loader:"style-resources-loader",options:{patterns:A}}].filter(Boolean),E={loader:"tsc"===f.CONFIG.compiler?"ts-loader":"swc-loader",options:"tsc"===f.CONFIG.compiler?b.default:(0,h.default)(g.DEV)},_={rules:[{oneOf:[{resourceQuery:/raw/,type:"asset/source"},{resourceQuery:/\.wasm$/,type:"webassembly/async"},{test:/\.less$/,use:w,include:k.concat((null==(e=f.CONFIG.rulesInclude)?void 0:null==(s=e.less)?void 0:s.map(x.resolveNodeModulesPath))||[])},{test:/\.css$/,use:[$,"css-loader",M,"css-unicode-loader"].filter(Boolean),include:k.concat((null==(r=f.CONFIG.rulesInclude)?void 0:null==(o=r.css)?void 0:o.map(x.resolveNodeModulesPath))||[])},{test:/\.(gif|png|jpe?g|ico|mp4)$/i,type:"asset",generator:{filename:"assets/images/[name][ext][query]"},include:k.concat((null==(t=f.CONFIG.rulesInclude)?void 0:null==(l=t.media)?void 0:l.map(x.resolveNodeModulesPath))||[])},{test:/\.(eot|ttf|otf|woff(|2))$/,type:"asset",generator:{filename:"assets/fonts/[name][ext][query]"},include:k.concat((null==(a=f.CONFIG.rulesInclude)?void 0:null==(n=a.fonts)?void 0:n.map(x.resolveNodeModulesPath))||[])},{test:/\.svg$/,type:"asset/inline",generator:{dataUrl:function(e){return(0,m.default)("string"!=typeof e?e.toString():e)}}},{test:/\.txt$/,type:"asset/source"},{test:/\.style.(j|t)s$/,use:[
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return _}});var e,s,r,o,t,l,a,n,i,u,c,d,p=N(require("mini-css-extract-plugin")),m=N(require("mini-svg-data-uri")),f=require("./common"),y=require("./has-pkg"),v=N(require("./modifyVars")),g=require("./process-env"),h=N(require("./swcrc")),b=N(require("./tsloader.config")),x=require("./utils");function O(e,s){(null==s||s>e.length)&&(s=e.length);for(var r=0,o=Array(s);r<s;r++)o[r]=e[r];return o}function I(){return(I=Object.assign||function(e){for(var s=1;s<arguments.length;s++){var r=arguments[s];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function N(e){return e&&e.__esModule?e:{default:e}}function P(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,s){if(e){if("string"==typeof e)return O(e,s);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O(e,s)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var j="single-spa"===g.APPTYPE?f.PUBLICPATH:"../",$={loader:p.default.loader,options:{publicPath:"/"!==j?j:"../"}},C=(0,y.hasPkg)("@moneko/postcss"),q=C?require("@moneko/postcss"):{},M=C&&{loader:"postcss-loader",options:{postcssOptions:q}},F=C&&{loader:"postcss-loader",options:{postcssOptions:I({},q,{parser:"postcss-js"}),execute:!0}};g.DEV&&($="style-loader");var G=P(f.CONFIG.cssModules).concat([g.pkgName,"neko-ui"]).map(x.resolveNodeModulesPath),A=[(0,x.resolveNodeModulesPath)(""+g.pkgName+"/lib/styles/eval/*.less")].concat(P(["src/styles/variables/*.less","src/styles/mixins/*.less","site/styles/variables/*.less","site/styles/mixins/*.less"].map(x.resolveProgramPath))),k=["components","example","mock","site","src"].map(x.resolveProgramPath),w=[$,{loader:"css-loader",options:{modules:{auto:function(e){for(var s=0,r=G.length;s<r;s++)if(e&&(null==e?void 0:e.includes(G[s])))return RegExp("(.*(?<!\\.global\\.(le|c)ss)$)","i").test(e);return RegExp("(^(?!.*node_modules))(.*(?<!\\.global\\.(le|c)ss)$)","i").test(e)},localIdentName:"[path][name]__[local]",exportLocalsConvention:"dashesOnly"},importLoaders:2}},M,"css-unicode-loader",{loader:"less-loader",options:{sourceMap:!!f.CONFIG.sourceMap,lessOptions:{modifyVars:v.default,javascriptEnabled:!0}}},{loader:"style-resources-loader",options:{patterns:A}}].filter(Boolean),E={loader:"tsc"===f.CONFIG.compiler?"ts-loader":"swc-loader",options:"tsc"===f.CONFIG.compiler?b.default:(0,h.default)(g.DEV)},_={rules:[{oneOf:[{resourceQuery:/raw/,type:"asset/source"},{resourceQuery:/\.wasm$/,type:"webassembly/async"},{test:/\.less$/,use:w,include:k.concat((null==(e=f.CONFIG.rulesInclude)?void 0:null==(s=e.less)?void 0:s.map(x.resolveNodeModulesPath))||[])},{test:/\.css$/,use:[$,"css-loader",M,"css-unicode-loader"].filter(Boolean),include:k.concat((null==(r=f.CONFIG.rulesInclude)?void 0:null==(o=r.css)?void 0:o.map(x.resolveNodeModulesPath))||[])},{test:/\.(gif|png|jpe?g|ico|mp4)$/i,type:"asset",generator:{filename:"assets/images/[name][ext][query]"},include:k.concat((null==(t=f.CONFIG.rulesInclude)?void 0:null==(l=t.media)?void 0:l.map(x.resolveNodeModulesPath))||[])},{test:/\.(eot|ttf|otf|woff(|2))$/,type:"asset",generator:{filename:"assets/fonts/[name][ext][query]"},include:k.concat((null==(a=f.CONFIG.rulesInclude)?void 0:null==(n=a.fonts)?void 0:n.map(x.resolveNodeModulesPath))||[])},{test:/\.svg$/,type:"asset/inline",generator:{dataUrl:function(e){return(0,m.default)("string"!=typeof e?e.toString():e)}}},{test:/\.txt$/,type:"asset/source"},{test:/\.style.(j|t)s$/,use:[E,$,"css-loader",F,"css-unicode-loader"].filter(Boolean),include:k.concat((null==(i=f.CONFIG.rulesInclude)?void 0:null==(u=i.js)?void 0:u.map(x.resolveNodeModulesPath))||[])},{test:/\.(cj|mj|t|j)s(|x)$/,use:P(f.CONFIG.prefixJsLoader).concat([E]).filter(Boolean),include:k.concat((null==(c=f.CONFIG.rulesInclude)?void 0:null==(d=c.js)?void 0:d.map(x.resolveNodeModulesPath))||[])},{test:/\.mdx?$/,use:P(f.CONFIG.prefixJsLoader).concat([E,{loader:"@mdx-js/loader",options:{rehypePlugins:[[require("@mapbox/rehype-prism"),{ignore:!0}],require("rehype-accessible-emojis").rehypeAccessibleEmojis,require("rehype-figure")],remarkPlugins:[]}}]).filter(Boolean),include:k,exclude:[/(.+)\/examples\/(.+).mdx?$/i]},{test:/\.mdx?$/,type:"asset/source",include:[/(.+)\/examples\/(.+).mdx?$/i]},{type:"asset/source",include:[/(.+)\/examples\/(.+).*?$/i]}]}].concat(P(f.CONFIG.moduleRules))};
|
package/build/swcrc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,r){for(var o in r)Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}(exports,{swcMinifyOption:function(){return n},default:function(){return s}});var e=require("webpack-merge"),r=require("./common"),o=function(e){return e&&e.__esModule?e:{default:e}}(require("./envFlags")),t={env:{targets:["last 2 version","> 0.5%","ie 11","not dead"],mode:"entry",coreJs:"3"}},n={compress:{top_retain:[],keep_infinity:!0,global_defs:{"@alert":"console.log"},pure_funcs:["console.log","console.warn","console.error","console.info"],toplevel:!1,drop_console:!0,drop_debugger:!0,module:!1,ecma:2015,ie8:!1,keep_classnames:void 0,keep_fnames:!1},mangle:!0},s=function(n){void 0===n&&(n=!1);var s=Object.assign({module:{type:"es6",ignoreDynamic:!0,strict:!0,strictMode:!0,lazy:!0,noInterop:!0},jsc:{parser:{syntax:"typescript",decorators:!0,dynamicImport:!0,tsx:!0},loose:!0,target:"es2022",externalHelpers:!0,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,useBuiltins:!0,refresh:n,development:n},constModules:{globals:{"env-flags":o.default}},optimizer:{simplify:!1}},experimental:{plugins:[["@swc/plugin-emotion",r.CONFIG.emotion]]}},sourceMaps:!0},!n&&t);return r.CONFIG.swcrc&&(s=(0,e.merge)(s,"function"==typeof r.CONFIG.swcrc?r.CONFIG.swcrc(n):r.CONFIG.swcrc)),s};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,r){for(var o in r)Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}(exports,{swcMinifyOption:function(){return n},default:function(){return s}});var e=require("webpack-merge"),r=require("./common"),o=function(e){return e&&e.__esModule?e:{default:e}}(require("./envFlags")),t={env:{targets:["last 2 version","> 0.5%","ie 11","not dead"],mode:"entry",coreJs:"3"}},n={compress:{top_retain:[],keep_infinity:!0,global_defs:{"@alert":"console.log"},pure_funcs:["console.log","console.warn","console.error","console.info"],toplevel:!1,drop_console:!0,drop_debugger:!0,module:!1,ecma:2015,ie8:!1,keep_classnames:void 0,keep_fnames:!1},mangle:!0},s=function(n){void 0===n&&(n=!1);var s=Object.assign({module:{type:"es6",ignoreDynamic:!0,strict:!0,strictMode:!0,lazy:!0,noInterop:!0},jsc:{parser:{syntax:"typescript",decorators:!0,dynamicImport:!0,tsx:!0},loose:!0,target:"es2022",externalHelpers:!0,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,useBuiltins:!0,refresh:n,development:n},constModules:{globals:{"env-flags":o.default}},optimizer:{simplify:!1}},experimental:{plugins:[["swc-plugin-another-transform-imports",function(e){for(var r=0,o=Object.keys(e),t=o.length;r<t;r++)e[o[r]].transform=o[r]+"/"+e[o[r]].transform,e[o[r]].style&&(e[o[r]].style=o[r]+"/"+e[o[r]].style);return e}(r.CONFIG.importOnDemand||{})],["@swc/plugin-emotion",r.CONFIG.emotion]]}},sourceMaps:!0},!n&&t);return r.CONFIG.swcrc&&(s=(0,e.merge)(s,"function"==typeof r.CONFIG.swcrc?r.CONFIG.swcrc(n):r.CONFIG.swcrc)),s};
|
package/build/tsloader.config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return _default}});var _fs=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return _default}});var _fs=_interopRequireDefault(require("fs")),_reactRefreshTypescript=_interopRequireDefault(require("react-refresh-typescript")),_tsImportPlugin=_interopRequireDefault(require("ts-import-plugin")),_webpackMerge=_interopRequireDefault(require("webpack-merge")),_common=require("./common"),_processEnv=require("./process-env"),_utils=require("./utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var importOnDemand=[];Array.isArray(_common.CONFIG.importOnDemand)&&Object.assign(importOnDemand,_common.CONFIG.importOnDemand.map(function(e){return(0,_tsImportPlugin.default)(e)}));var beforeTransformers=[].concat(importOnDemand);_processEnv.DEV&&_processEnv.hasReact&&beforeTransformers.push((0,_reactRefreshTypescript.default)());var tsLoaderConfig={transpileOnly:!0,getCustomTransformers:function(){return{before:beforeTransformers}}};try{var customTsloaderConfigPath=(0,_utils.resolveProgramPath)("tsloader.config.ts");_fs.default.accessSync(customTsloaderConfigPath,_fs.default.constants.R_OK);var customTsloaderConfig=eval((0,_utils.tfc)(customTsloaderConfigPath)).default;tsLoaderConfig=(0,_webpackMerge.default)(tsLoaderConfig,(0,_utils.isFunction)(customTsloaderConfig)?customTsloaderConfig(process):customTsloaderConfig)}catch(error){}var _default=tsLoaderConfig;
|
package/build/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _export(e,r){for(var n in r)Object.defineProperty(e,n,{enumerable:!0,get:r[n]})}Object.defineProperty(exports,"__esModule",{value:!0}),_export(exports,{tfc:function(){return tfc},toUpperCaseString:function(){return toUpperCaseString},getIPAdress:function(){return getIPAdress},resolveProgramPath:function(){return resolveProgramPath},resolveNodeModulesPath:function(){return resolveNodeModulesPath},resolve:function(){return resolve},isObject:function(){return isObject},isFunction:function(){return isFunction}});var _os=require("os"),_path=
|
|
1
|
+
"use strict";function _export(e,r){for(var n in r)Object.defineProperty(e,n,{enumerable:!0,get:r[n]})}Object.defineProperty(exports,"__esModule",{value:!0}),_export(exports,{tfc:function(){return tfc},toUpperCaseString:function(){return toUpperCaseString},getIPAdress:function(){return getIPAdress},resolveProgramPath:function(){return resolveProgramPath},resolveNodeModulesPath:function(){return resolveNodeModulesPath},resolve:function(){return resolve},isObject:function(){return isObject},isFunction:function(){return isFunction}});var _os=require("os"),_path=_interopRequireDefault(require("path")),_core=require("@swc/core"),_resolverSync=_interopRequireDefault(require("./resolver-sync"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _typeof=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},swcOption={inputSourceMap:!1,sourceMaps:!1,module:{type:"commonjs"},jsc:{parser:{syntax:"typescript"},loose:!1}},tfc=function(filepath){var out=(0,_core.transformFileSync)(filepath,swcOption).code||"{}";try{return eval(out)}catch(error){return out}};function toUpperCaseString(e){return null==e?void 0:e.replace(/\b\w/g,function(e){return e.toUpperCase()}).replace(/\./g," ")}function getIPAdress(){var e=(0,_os.networkInterfaces)();for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))for(var n=e[r],t=0;t<n.length;t++){var o=n[t];if("IPv4"===o.family&&"127.0.0.1"!==o.address&&!o.address.startsWith("169.254")&&!o.internal)return o.address}}function resolveProgramPath(e){return _path.default.resolve(process.cwd(),"./"+e)}var resolveNodeModulesPath=function(e){return resolveProgramPath("node_modules/"+e)},resolve=function(e){return _resolverSync.default.resolveSync({},process.cwd(),e)||e},funcTag="[object Function]",asyncTag="[object AsyncFunction]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isObject(e){var r=void 0===e?"undefined":_typeof(e);return null!==e&&("object"==r||"function"==r)}function isFunction(e){if(!isObject(e))return!1;var r=Object.prototype.toString.call(e);return r==funcTag||r==asyncTag||r==genTag||r==proxyTag}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
function e(){return(e=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}import*as r from"react";export default r.memo(function(t){var n=t.directory,o=void 0===n?"components":n,a=t.compName,c=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r.indexOf(t=a[n])>=0||(o[t]=e[t]);return o}(t,["directory","compName"]),i=r.Fragment;try{i=require("@/"+o+"/"+a).default}catch(e){console.info(a+" 组件不存在, 请在 @/"+o+"/"+a+" 目录下新建 index.tsx, 并导出默认组件")}return r.isValidElement(i)?null:r.createElement(i,e({},c))});
|
package/lib/menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function r(){return(r=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function t(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}
|
|
1
|
+
function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function r(){return(r=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function t(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}import{isEqual as n,isFunction as o,persistence as a}from"@moneko/common";import i from"shared-store-object";import u from"./persistentKey";var l=a.load,f=i({activeKey:l(u.menuActiveKey,"home"),expandKey:l(u.menuExpandKey,[]),menus:l(u.menuMenus,[]),kv:l(u.menuKv,{}),tabs:l(u.menuTabs,[])}),c=function(e,r){if(void 0===r&&(r=[]),0===e.length)return r;var n=e[0],o=n.children,a=void 0===o?[]:o,i=n.i18n,u=n.label,l=n.hideMenu,f=t(n,["children","i18n","label","hideMenu"]),s=Object.create(null);return Object.assign(s,f,{label:i||u,props:void 0,element:void 0}),a.length&&(s.children=c(a)),l||r.push(s),c(e.slice(1),r)},s=function(e,r){for(var n,o=function(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=unsupportedIterableToArray(e))){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(n=o()).done;){var a=n.value,i=a.children,u=t(a,["children"]);r[a.key]=u,(null==i?void 0:i.length)&&s(i,r)}};export function setMenu(e){var r=c(e),t={};s(r,t),f.menus=r,f.kv=t}export function addTab(t){var o=f.kv[t.key];if(o&&!f.tabs.find(function(e){return e.key===t.key})){var a,i=((function(r){if(Array.isArray(r))return e(r)})(a=f.tabs)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(r,t){if(r){if("string"==typeof r)return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if("Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}}(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([r({},o,{i18n:o.i18n||"route-"+o.key},t)]);n(i,f.tabs)||(f.tabs=i)}}export function openTab(e){f.activeKey=e.key,addTab(e)}export function closeTab(e,r,t){if(void 0===r&&(r="self"),e){for(var n,a=f.tabs,i=f.activeKey,u=[],l=[],c="self"===r,s=a.findIndex(function(r){return r.key===e}),y=0,d=a.length;y<d;y++){var b,p=a[y],v=(b=y,!1===p.closable||({left:b>=s,right:b<=s,other:b===s,self:e!==p.key})[r]);if(c){if(!v&&e===i){var m=y?y-1:y+1;a[m]&&(i=a[m].key,n=a[m])}}else v&&p.key===e&&i!==e&&(i=e,n=p);v||u.push(p),v&&l.push(p)}if(f.tabs=l,f.activeKey=i,o(t)){t(u,n);return}}}export function expandMenu(e){n(e,f.expandKey)||(f.expandKey=e)}export default f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(){return(e=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(this,arguments)}import r,{useMemo as o}from"react";import{ConfigProvider as t}from"antd";import a from"antd/es/locale/en_US";import l from"antd/es/locale/zh_CN";import n from"dayjs";import i from"dayjs/plugin/relativeTime";import{RouterProvider as m}from"react-router-dom";import{createRouter as p,prefixRouter as f,routerData as c,RouterFragment as s}from"../../components/app-router";import u from"../../components/fallback";import d from"../../localizable";import{onlyLoginRouter as g}from"../../router";import"dayjs/locale/zh.js";import"dayjs/locale/en.js";import{global as h}from"@/store";var v={zh_CN:l,en_US:a};n.extend(i),t.config({prefixCls:providerConfig.prefixCls,iconPrefixCls:providerConfig.iconPrefixCls,theme:providerConfig.theme});export default function(){var a=h.isLogin,n=d.language,i=d.t,C=o(function(){return e({validateMessages:{required:""+i["ph:please-fill"]+"${label}!",types:{email:"${label}"+i["wrong-format"]},pattern:{mismatch:""+i["ph:fill-correct"]+"${label}!"}},locale:v[n]||l},providerConfig)},[n,i]);return r.createElement(s,null,r.createElement(t,C,r.createElement(m,{router:p(a?c:f(g,r.createElement(u,null)),{basename:programInfo.routeBaseName,window:window}),fallbackElement:r.createElement(u,null)})))};
|
|
1
|
+
function e(){return(e=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(this,arguments)}import r,{useMemo as o}from"react";import{ConfigProvider as t}from"antd";import a from"antd/es/locale/en_US";import l from"antd/es/locale/zh_CN";import n from"dayjs";import i from"dayjs/plugin/relativeTime";import{RouterProvider as m}from"react-router-dom";import{createRouter as p,prefixRouter as f,routerData as c,RouterFragment as s}from"../../components/app-router";import u from"../../components/fallback";import d from"../../localizable";import{onlyLoginRouter as g}from"../../router";import"dayjs/locale/zh.js";import"dayjs/locale/en.js";import{global as h}from"@/store";var v={zh_CN:l,en_US:a};n.extend(i),t.config({prefixCls:providerConfig.prefixCls,iconPrefixCls:providerConfig.iconPrefixCls,theme:providerConfig.theme});export default function(){var a=h.isLogin,n=d.language,i=d.t,C=o(function(){return e({validateMessages:{required:""+i["ph:please-fill"]+"${label}!",types:{email:"${label}"+i["wrong-format"]},pattern:{mismatch:""+i["ph:fill-correct"]+"${label}!"}},locale:v[n]||l},providerConfig)},[n,i]);return r.createElement(s,null,r.createElement(t,e({},C),r.createElement(m,{router:p(a?c:f(g,r.createElement(u,null)),{basename:programInfo.routeBaseName,window:window}),fallbackElement:r.createElement(u,null)})))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n,t,r,e,o,u,a){try{var i=n[u](a),l=i.value}catch(n){r(n);return}i.done?t(l):Promise.resolve(l).then(e,o)}function t(t){return function(){var r=this,e=arguments;return new Promise(function(o,u){var a=t.apply(r,e);function i(t){n(a,o,u,i,l,"next",t)}function l(t){n(a,o,u,i,l,"throw",t)}i(void 0)})}}function r(){return(r=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e])}return n}).apply(this,arguments)}var e=this&&this.__generator||function(n,t){var r,e,o,u,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function i(u){return function(i){return function(u){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,e&&(o=2&u[0]?e.return:u[0]?e.throw||((o=e.return)&&o.call(e),0):e.next)&&!(o=o.call(e,u[1])).done)return o;switch(e=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,e=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(n,a)}catch(n){u=[6,n],e=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,i])}}};import o from"react";import{isFunction as u}from"@moneko/common";import a from"./app";hasPersist&&require("../../persist");var i=APPENTRY?require(APPENTRY):null,l=require(ReactDOMPath),c=parseFloat(o.version);function s(n){var t=n.container,e=n.basename,u=n.fallback,i=n.language,s=function(n,t){if(null==n)return{};var r,e,o={},u=Object.keys(n);for(e=0;e<u.length;e++)t.indexOf(r=u[e])>=0||(o[r]=n[r]);return o}(n,["container","basename","fallback","language"]),f=(null==t?void 0:t.querySelector("#root"))||document.querySelector("#root"),p={basename:e,fallback:u,language:i};window.primaryApp=r({},s,{container:f}),c>=18?"ssr"===programInfo.renderMode?window.rootInstance=l.hydrateRoot(f,o.createElement(a,p)):(window.rootInstance=l.createRoot(f),window.rootInstance.render(o.createElement(a,p))):(module.hot?l.render:l.hydrate)(o.createElement(a,p),f)}window.__POWERED_BY_QIANKUN__||s({});export function bootstrap(){return f.apply(this,arguments)}function f(){return(f=t(function(){return e(this,function(n){return u(null==i?void 0:i.bootstrap)&&(null==i||i.bootstrap()),[2]})})).apply(this,arguments)}export function unmount(n){return p.apply(this,arguments)}function p(){return(p=t(function(n){var t,r;return e(this,function(e){return u(null==i?void 0:i.unmount)&&(null==i||i.unmount(n)),t=n.container,c>=18?window.rootInstance.unmount():(r=(null==t?void 0:t.querySelector("#root"))||document.querySelector("#root"),l.unmountComponentAtNode(r)),[2]})})).apply(this,arguments)}export function mount(n){return h.apply(this,arguments)}function h(){return(h=t(function(n){return e(this,function(t){return u(null==i?void 0:i.mount)&&(null==i||i.mount(n)),s(n),[2]})})).apply(this,arguments)}
|
|
1
|
+
function n(n,t,r,e,o,u,a){try{var i=n[u](a),l=i.value}catch(n){r(n);return}i.done?t(l):Promise.resolve(l).then(e,o)}function t(t){return function(){var r=this,e=arguments;return new Promise(function(o,u){var a=t.apply(r,e);function i(t){n(a,o,u,i,l,"next",t)}function l(t){n(a,o,u,i,l,"throw",t)}i(void 0)})}}function r(){return(r=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e])}return n}).apply(this,arguments)}var e=this&&this.__generator||function(n,t){var r,e,o,u,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function i(u){return function(i){return function(u){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,e&&(o=2&u[0]?e.return:u[0]?e.throw||((o=e.return)&&o.call(e),0):e.next)&&!(o=o.call(e,u[1])).done)return o;switch(e=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,e=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(n,a)}catch(n){u=[6,n],e=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,i])}}};import o from"react";import{isFunction as u}from"@moneko/common";import a from"./app";hasPersist&&require("../../persist");var i=APPENTRY?require(APPENTRY):null,l=require(ReactDOMPath),c=parseFloat(o.version);function s(n){var t=n.container,e=n.basename,u=n.fallback,i=n.language,s=function(n,t){if(null==n)return{};var r,e,o={},u=Object.keys(n);for(e=0;e<u.length;e++)t.indexOf(r=u[e])>=0||(o[r]=n[r]);return o}(n,["container","basename","fallback","language"]),f=(null==t?void 0:t.querySelector("#root"))||document.querySelector("#root"),p={basename:e,fallback:u,language:i};window.primaryApp=r({},s,{container:f}),c>=18?"ssr"===programInfo.renderMode?window.rootInstance=l.hydrateRoot(f,o.createElement(a,r({},p))):(window.rootInstance=l.createRoot(f),window.rootInstance.render(o.createElement(a,r({},p)))):(module.hot?l.render:l.hydrate)(o.createElement(a,r({},p)),f)}window.__POWERED_BY_QIANKUN__||s({});export function bootstrap(){return f.apply(this,arguments)}function f(){return(f=t(function(){return e(this,function(n){return u(null==i?void 0:i.bootstrap)&&(null==i||i.bootstrap()),[2]})})).apply(this,arguments)}export function unmount(n){return p.apply(this,arguments)}function p(){return(p=t(function(n){var t,r;return e(this,function(e){return u(null==i?void 0:i.unmount)&&(null==i||i.unmount(n)),t=n.container,c>=18?window.rootInstance.unmount():(r=(null==t?void 0:t.querySelector("#root"))||document.querySelector("#root"),l.unmountComponentAtNode(r)),[2]})})).apply(this,arguments)}export function mount(n){return h.apply(this,arguments)}function h(){return(h=t(function(n){return e(this,function(t){return u(null==i?void 0:i.mount)&&(null==i||i.mount(n)),s(n),[2]})})).apply(this,arguments)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function r(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}function t(
|
|
1
|
+
function r(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}function t(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(e)return(e=e.call(r)).next.bind(e);if(Array.isArray(r)||(e=unsupportedIterableToArray(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}import{useNavigate as e,useSearchParams as n}from"react-router-dom";export default function(o){var a,i=Array.from(new Set(["menuId","dynamicTitle"].concat(function(t){if(Array.isArray(t))return r(t)}(a=o||[])||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(a)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}}(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))).filter(Boolean),u=e(),l=n()[0];return function(r,e){if(-1===r){u(-1);return}for(var n,o={},a=r.split("?"),f=new URLSearchParams(a[1]||""),c=t(l);!(n=c()).done;){var m=n.value,y=m[0],d=m[1];i.includes(y)&&(o[y]=d)}for(var s,b=t(f);!(s=b()).done;){var p=s.value,v=p[0],h=p[1];i.includes(v)&&(o[v]=h)}var S=new URLSearchParams(o).toString();u(S?a[0]+"?"+S:a[0],e)}};
|
package/lib/router/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(){return(e=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e}).apply(this,arguments)}import{createElement as r,lazy as n}from"react";import{isUndefined as t}from"@moneko/common";import{pathToRegexp as o}from"path-to-regexp";import{Outlet as i}from"react-router-dom";export function lazyImport(e){return n(function(){return new Promise(function(r){return import("@/pages/"+e.replace(/:/g,"$").replace(/^\//,"")).then(r).catch(function(){return Promise.resolve({default:i})})})})}export var myPkgs=[];export var myDemoKv={};export var mdxComponents={};function a(n,t){return r("h"+t,e({"data-prefix":"# ",role:"heading","aria-level":t},n))}if("library"===APPTYPE){var l,u,c=require.context("@pkg/",!0,/README\.mdx?$/),p={};try{p=require("@/components/components").default}catch(e){}Object.assign(mdxComponents,e({h1:function(e){return a(e,1)},h2:function(e){return a(e,2)},h3:function(e){return a(e,3)},h4:function(e){return a(e,4)},h5:function(e){return a(e,5)},h6:function(e){return a(e,6)},pre:function(e){var n=r("code",e);return e.className?r(mdxComponents.CodeBlock||"pre",{lang:e.className.replace("language-","").replace(/ .*$/,"")},n):n}},p)),null==(l=c.keys())||l.forEach(function(r){var n=r.substring(2).split("/").slice(0,-1).join("/"),t=c(r),o=t.basic,i=t.default;myPkgs.push(e({key:n,path:n,element:i},o,{props:{components:mdxComponents,path:n}}))});var s=require.context("@pkg/",!0,/\/examples\/(.+)\.mdx$/);null==(u=s.keys())||u.forEach(function(e){var r=e.substring(2).split("/"),n=r[0];Array.isArray(myDemoKv[n])||(myDemoKv[n]=[]);for(var t,o,i=s(e),a=i.matchAll(/```([^\r\n]+)?\r?\n([\s\S]*?)\r?\n```/g),l="",u="",c=null,p=function(e,r){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=unsupportedIterableToArray(e))){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(a);!(o=p()).done;){var h=o.value;u=h[1]||"tsx",l=h[2],c=i.replace(h[0],"")}myDemoKv[n].push({language:u,code:l,description:c,title:null==(t=r.pop())?void 0:t.replace(/\.mdx$/,""),noInline:/render\([^\\)]*\);?(?=\s*$)/.test(l)})})}var h=[];try{h=require("@/router").default}catch(e){console.info("自定义路由请在 router 目录下新建 index.ts, 类型: RouterProps[]",e)}function d(e,r){return["*"===r&&"*"!==e?void 0:r,e].filter(Boolean).join("/")}var f=function(e){for(var r=[],n=0;n<e.length;n++)for(var t=e[n].split("/").slice(0,-1),o=r,i=0;i<t.length;i++){var a=t[i];if(""!==a){"."===a&&(a="*");var l=o;if(Array.isArray(o)){for(var u=0;u<o.length;u++)if(o[u].path===a){o=o[u].children;break}}if(l===o){var c=i===t.length-1?e[n]:t.slice(0,i+1).join("/")+"/",p={key:c=c.substring(2,c.lastIndexOf("/")),path:a,i18n:"route-"+c,children:[],alive:!1,element:lazyImport(c),hideMenu:c.includes(":"),props:{path:c}};Array.isArray(o)&&o.push(p),o=p.children}}}return r}(require.context("@/pages/",!0,/\.(t|j)sx$/,"lazy").keys().map(function(e){return e.replace(/\$/g,":")}));function m(r,n,t){return void 0===r&&(r=[]),r.map(function(r){var o=e({},r);return void 0===o.key&&(o.key=d(r.path,t)),void 0===o.i18n&&(o.i18n="route-"+o.key),void 0===o.alive&&(o.alive=!1),"*"===o.path&&void 0===o.hideMenu&&(o.hideMenu=!0),Array.isArray(o.children)&&(o.children=o.children.length?m(o.children,n,o.key):void 0),o.element||(o.element=lazyImport(o.key),o.props={path:o.key}),!!o.onlyLogin!==n||o.root?o:null}).filter(Boolean)}for(var y=[].concat(h),v=0,g=f.length;v<g;v++)!function r(n,o,i){var a,l=n.find(function(e){return e.path===o.path});l?(l.key=d(l.path,i),t(l.i18n)&&(l.i18n="route-"+l.key),t(l.alive)&&(l.alive=!1),t(l.element)&&o.element&&(l.element=o.element,l.props=o.props),t(l.hideMenu)&&(l.hideMenu="*"===l.path||l.key.includes(":")),Object.assign(l,e({},o,l)),o.children&&(!l.children&&Array.isArray(o.children)&&(l.children=o.children),null==(a=o.children)||a.forEach(function(e){r(null==l?void 0:l.children,e,null==l?void 0:l.key)}))):n.push(o)}(y,f[v]);export var onlyLoginRouter=m(y,!1);export var router=m(y,!0);export function matchUtil(e){var r={key:""};return!function n(t){for(var i=0,a=t.length;i<a;i++){if(t[i].path&&"*"!==t[i].path&&t[i].key)try{if(o(t[i].key).exec(e.substring(1))){r=t[i];return}}catch(e){}Array.isArray(t[i].children)&&n(t[i].children)}}(router),r}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "2.0.53-beta.
|
|
3
|
+
"version": "2.0.53-beta.5",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"@moneko/common": "1.0.32",
|
|
22
22
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
|
|
23
23
|
"@soda/friendly-errors-webpack-plugin": "1.8.1",
|
|
24
|
-
"@swc/core": "1.3.
|
|
24
|
+
"@swc/core": "1.3.37",
|
|
25
25
|
"@swc/css": "0.0.20",
|
|
26
|
-
"@swc/helpers": "0.
|
|
27
|
-
"@swc/plugin-emotion": "2.5.
|
|
26
|
+
"@swc/helpers": "0.4.14",
|
|
27
|
+
"@swc/plugin-emotion": "2.5.46",
|
|
28
28
|
"add-asset-html-webpack-plugin": "5.0.2",
|
|
29
29
|
"core-js": "3.30.0",
|
|
30
30
|
"cross-env": "7.0.3",
|