@moneko/core 3.0.0-beta.4 → 3.0.0-beta.40

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.
Files changed (84) hide show
  1. package/{build → lib}/common.d.ts +1 -1
  2. package/lib/common.js +12 -0
  3. package/{build → lib}/coverage.d.ts +1 -1
  4. package/lib/coverage.js +1 -0
  5. package/lib/done.js +1 -0
  6. package/lib/envFlags.js +1 -0
  7. package/lib/esm.d.ts +1 -0
  8. package/lib/esm.js +1 -0
  9. package/lib/has-pkg.js +1 -0
  10. package/lib/html-add-entry-attr.js +1 -0
  11. package/{build → lib}/html-plugin-option.d.ts +1 -1
  12. package/lib/html-plugin-option.js +1 -0
  13. package/lib/index.d.ts +4 -36
  14. package/lib/index.js +1 -1
  15. package/{build → lib}/minify.d.ts +1 -1
  16. package/lib/minify.js +1 -0
  17. package/lib/modifyVars.js +1 -0
  18. package/lib/module-federation.d.ts +5 -0
  19. package/lib/module-federation.js +1 -0
  20. package/lib/module.config.js +1 -0
  21. package/{build → lib}/process-env.d.ts +5 -2
  22. package/lib/process-env.js +1 -0
  23. package/{build → lib}/resolver-sync.d.ts +2 -1
  24. package/lib/resolver-sync.js +1 -0
  25. package/lib/routes.d.ts +1 -0
  26. package/lib/routes.js +1 -0
  27. package/lib/seo.js +1 -0
  28. package/lib/swcrc.js +1 -0
  29. package/lib/tsloader.config.js +1 -0
  30. package/{build → lib}/utils.d.ts +4 -3
  31. package/lib/utils.js +1 -0
  32. package/lib/webpack.common.js +1 -0
  33. package/lib/webpack.dev.js +4 -0
  34. package/lib/webpack.prod.d.ts +3 -0
  35. package/lib/webpack.prod.js +1 -0
  36. package/lib/yarn-argv.js +1 -0
  37. package/package.json +23 -31
  38. package/typings/global.d.ts +36 -17
  39. package/build/common.js +0 -1
  40. package/build/coverage.js +0 -1
  41. package/build/done.js +0 -1
  42. package/build/envFlags.js +0 -1
  43. package/build/has-pkg.js +0 -1
  44. package/build/html-add-entry-attr.js +0 -1
  45. package/build/html-plugin-option.js +0 -1
  46. package/build/index.d.ts +0 -2
  47. package/build/index.js +0 -1
  48. package/build/minify.js +0 -1
  49. package/build/modifyVars.js +0 -1
  50. package/build/module-federation.d.ts +0 -4
  51. package/build/module-federation.js +0 -1
  52. package/build/module.config.js +0 -1
  53. package/build/process-env.js +0 -1
  54. package/build/resolver-sync.js +0 -1
  55. package/build/seo.js +0 -1
  56. package/build/swcrc.js +0 -1
  57. package/build/tsloader.config.js +0 -1
  58. package/build/utils.js +0 -1
  59. package/build/webpack.common.js +0 -1
  60. package/build/webpack.dev.js +0 -1
  61. package/build/webpack.prod.d.ts +0 -3
  62. package/build/webpack.prod.js +0 -1
  63. package/build/yarn-argv.js +0 -1
  64. package/lib/normalize.css +0 -254
  65. package/lib/packages/library/bootstrap.d.ts +0 -1
  66. package/lib/packages/library/bootstrap.js +0 -1
  67. package/lib/packages/library/index.d.ts +0 -4
  68. package/lib/packages/library/index.js +0 -1
  69. package/lib/refresh-rem.d.ts +0 -0
  70. package/lib/refresh-rem.js +0 -1
  71. package/lib/router/index.d.ts +0 -51
  72. package/lib/router/index.js +0 -1
  73. /package/{build → lib}/done.d.ts +0 -0
  74. /package/{build → lib}/envFlags.d.ts +0 -0
  75. /package/{build → lib}/has-pkg.d.ts +0 -0
  76. /package/{build → lib}/html-add-entry-attr.d.ts +0 -0
  77. /package/{build → lib}/modifyVars.d.ts +0 -0
  78. /package/{build → lib}/module.config.d.ts +0 -0
  79. /package/{build → lib}/seo.d.ts +0 -0
  80. /package/{build → lib}/swcrc.d.ts +0 -0
  81. /package/{build → lib}/tsloader.config.d.ts +0 -0
  82. /package/{build → lib}/webpack.common.d.ts +0 -0
  83. /package/{build → lib}/webpack.dev.d.ts +0 -0
  84. /package/{build → lib}/yarn-argv.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import type { AppType, ConfigType } from '../typings/global';
1
+ import type { AppType, ConfigType } from '../typings/global.js';
2
2
  export declare const ENTRYPATH: Record<AppType, string>;
3
3
  export declare const log: (msg: string) => void;
4
4
  export declare const CONFIG: ConfigType<"swc">;
package/lib/common.js ADDED
@@ -0,0 +1,12 @@
1
+ import e from"fs";import t from"path";import o from"readline";import s from"chalk";import{merge as i}from"webpack-merge";import{APPTYPE as n,CUSTOMCONFIG as r,FRAMEWORK as l,jsxImportSource as a,pkgName as c,PROGRAMPATH as m}from"./process-env.js";import{isFunction as p,readConf as u}from"./utils.js";export const ENTRYPATH={mobile:"mobile",site:"site","back-stage":"back-stage","single-spa":"single-spa",library:"library","single-component":"single-component"};let d=[`@moneko/${l}`,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design"],h={chunks:"all",minSize:1024,minChunks:1,cacheGroups:{route:{test:/[\\/].git[\\/]router/,priority:-10,reuseExistingChunk:!0,name:"route"},example:{test:/[\\/].git[\\/]example/,priority:-10,reuseExistingChunk:!0,name:"example"}}};"single-component"===n&&(h=!1);let f={seo:!1,mode:"csr",compiler:"swc",bundleAnalyzer:{analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1},entry:{},minifier:{js:{},css:{}},sourceMap:{filename:"[file].map",publicPath:""},env:{},routeBaseName:"/",publicPath:"/",designSize:"mobile"===n?375:1680,fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{},layoutSider:{},moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:m+"/node_modules/.temp_cache",devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:`./node_modules/${c}/template/index.html`,favicon:`./node_modules/${c}/template/favicon.ico`,tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],splitChunk:h,runtimeChunk:"single-component"!==n&&"single",moduleFederation:[],rulesInclude:{less:d,css:d,js:d,media:d,fonts:d},mdx:{jsxImportSource:a,remarkPlugins:[],rehypePlugins:[]},jsxDomExpressions:{moduleName:"solid-js/web",builtIns:["For","Show","Switch","Match","Suspense","SuspenseList","Portal","Index","Dynamic","ErrorBoundary"],contextToCustomElements:!0,wrapConditionals:!0,generate:"dom",hydratable:!1},bar:{name:"编译中",color:"#6f42c1"}};export const log=e=>{o.cursorTo(process.stdout,0),process.stdout.write(e)};let g=f,x=null,y={},b={};try{x=t.join(m,"./config/index.ts"),e.accessSync(x,e.constants.R_OK)}catch(e){x=null}if(x)try{let e=(await u(x,"index")).default;y=p(e)?e(process):e}catch(e){process.stdout.write(s.red(e))}if(r){let o=null;try{o=t.join(m,`./config/${r}.ts`),e.accessSync(o,e.constants.R_OK)}catch(e){o=null}if(null!==o)try{let e=(await u(o,r)).default;b=p(e)?e(process):e}catch(e){process.stdout.write(s.red(e))}}"tsc"===(g=i(g,y,b)).compiler&&g.minifier&&(g.minifier.js||Object.assign(g.minifier,{js:{type:"terser"}}),g.minifier.css||Object.assign(g.minifier,{css:{type:"cssnano"}})),!1===g.devtool&&(g.sourceMap=!1),!1===g.sourceMap&&(g.devtool=!1),g.fixBrowserRouter&&(g.htmlPluginOption.tags||(g.htmlPluginOption.tags=[]),g.htmlPluginOption.tags.push({textContent:`
2
+ (function(l) {
3
+ if (l.search[1] === '/' ) {
4
+ var decoded = l.search.slice(1).split('&').map(function(s) {
5
+ return s.replace(/~and~/g, '&')
6
+ }).join('?');
7
+ window.history.replaceState(null, null,
8
+ l.pathname.slice(0, -1) + decoded + l.hash
9
+ );
10
+ }
11
+ }(window.location))
12
+ `}));export const CONFIG=g;export const PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG,log};
@@ -1,2 +1,2 @@
1
- import type { CoverageType, ProjectCoverageType } from '../typings/global';
1
+ import type { CoverageType, ProjectCoverageType } from '../typings/global.js';
2
2
  export declare const coverage: Record<string, CoverageType & Partial<ProjectCoverageType>>;
@@ -0,0 +1 @@
1
+ import{readFileSync as e,accessSync as r,constants as c}from"fs";import{join as o}from"path";import{Parser as t}from"xml2js";import{PACKAGENAME as a,PROGRAMPATH as s}from"./process-env.js";export const coverage={};try{let i=o(s,"./coverage/clover.xml");r(i,c.R_OK);let m=new t({explicitArray:!1,async:!1}),p=e(i,{encoding:"utf-8"});m.parseString(p,(e,r)=>{if(!e){let e=r.coverage.project.metrics.$,c=r.coverage.project.package;Object.assign(coverage,{[a]:e}),c.forEach(e=>{Object.assign(coverage,{[e.$.name]:e.metrics.$})})}})}catch(e){}
package/lib/done.js ADDED
@@ -0,0 +1 @@
1
+ export default class{constructor(o){this.options=Object.assign({},o)}apply(o){let t=this;o.hooks.done.tap("DoneWebpackPlugin",function(){t.options.done?.()})}};
@@ -0,0 +1 @@
1
+ import i from"fs";import r from"path";import{CONFIG as t}from"./common.js";import{coverage as e}from"./coverage.js";import o from"./html-plugin-option.js";import{APPTYPE as s,NODE_ENV as n,PACKAGENAME as f,programInfo as a,PROGRAMPATH as c,hasAntd as m}from"./process-env.js";import{toUpperCaseString as p}from"./utils.js";let l="library"===s?"site":"src",g=!1;try{let t=r.join(c,"./src/index.ts");i.accessSync(t,i.constants.R_OK),g=t}catch(i){g=!1}let y={projectName:JSON.stringify(p(f)),projectCoverage:JSON.stringify(e),providerConfig:JSON.stringify({prefixCls:t.prefixCls,iconPrefixCls:t.prefixCls+"-icon",theme:t.theme}),fallbackCompPath:JSON.stringify(t.fallbackCompPath),ReactDOMPath:JSON.stringify("react-dom/client"),favicon:JSON.stringify(o.favicon),hasLocales:JSON.stringify(i.existsSync(r.join(c,`./${l}/locales`))),hasPersist:JSON.stringify(i.existsSync(r.join(c,`./${l}/persist.ts`))),layoutSider:JSON.stringify(t.layoutSider),hasAntd:JSON.stringify(m),APPTYPE:JSON.stringify(s),APPENTRY:JSON.stringify(g),programInfo:JSON.stringify({...a,routeBaseName:t.routeBaseName,designSize:t.designSize,routerMode:t.routerMode,renderMode:t.mode}),"process.env":JSON.stringify({NODE_ENV:n,iconfont:t.iconfont,...t.env})};export default y;
package/lib/esm.d.ts ADDED
@@ -0,0 +1 @@
1
+ export default function esm(templateStrings: TemplateStringsArray, ...substitutions: unknown[]): string;
package/lib/esm.js ADDED
@@ -0,0 +1 @@
1
+ export default function t(t,...e){let r=t.raw[0];for(let a=0;a<e.length;a++)r+=e[a]+t.raw[a+1];return`data:text/javascript;base64,${Buffer.from(r).toString("base64")}`}
package/lib/has-pkg.js ADDED
@@ -0,0 +1 @@
1
+ import{accessSync as o,constants as r}from"fs";import t from"path";import{PROGRAMPATH as e}from"./process-env.js";export function hasPkg(m){let n=!1;try{let p=t.join(e,`./node_modules/${m}/package.json`);o(p,r.R_OK),n=!0}catch(o){n=!1}return n}
@@ -0,0 +1 @@
1
+ export default class{constructor(t){this.entryMatchCallback=t}apply(t){t.hooks.compilation.tap("AddEntryAttributeWebpackPlugin",a=>{let e=t.options.plugins.map(({constructor:t})=>t).find(t=>t&&"HtmlWebpackPlugin"===t.name);if(e){let t=e.getHooks(a);t.alterAssetTagGroups.tap("AddEntryAttributeWebpackPlugin",t=>(t.headTags.forEach(t=>{"script"===t.tagName&&"string"==typeof t.attributes?.src&&this.entryMatchCallback(t.attributes.src)&&(t.attributes.entry=!0)}),t))}})}};
@@ -1,3 +1,3 @@
1
- import type { HtmlWebpackOption } from '../typings/global';
1
+ import type { HtmlWebpackOption } from '../typings/global.js';
2
2
  declare const htmlPluginOption: HtmlWebpackOption;
3
3
  export default htmlPluginOption;
@@ -0,0 +1 @@
1
+ import e from"path";import{merge as t}from"webpack-merge";import{CONFIG as i}from"./common.js";import{PROGRAMPATH as o,PACKAGENAME as r,programInfo as a}from"./process-env.js";let{template:p,favicon:m,...n}=i.htmlPluginOption,l=t({title:i.env?.PROJECTNAME||r.toLocaleUpperCase()||"Title",filename:"index.html",hash:!1,minify:{collapseWhitespace:!0,removeComments:!0,removeRedundantAttributes:!1,removeScriptTypeAttributes:!1,removeStyleLinkTypeAttributes:!1,removeAttributeQuotes:!0,useShortDoctype:!0},meta:{charset:"UTF-8","X-UA-Compatible":{"http-equiv":"X-UA-Compatible",content:"IE=edge,Chrome=1"},HandheldFriendly:"true",MobileOptimized:"320","screen-orientation":"portrait","x5-orientation":"portrait",browsermode:"application","x5-page-mode":"app","msapplication-tap-highlight":"no",viewport:"width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no","apple-mobile-web-app-capable":"yes",renderer:"webkit",description:a.description||""},tags:[],template:e.join(o,p),favicon:e.join(o,m)},n);export default l;
package/lib/index.d.ts CHANGED
@@ -1,36 +1,4 @@
1
- export { pathToRegexp } from 'path-to-regexp';
2
- export type { ConfigType, AppType, CommomType, ProgramInfoType, MemberTransformer, CoverageType, TerserOptions, MinifierType, SourceMapDevToolPluginOptions, ProjectCoverageType, SharedConfig, SwcOptions, OptimizationSplitChunksOptions, SwcImportOnDemandTransform, Theme, } from '../typings/global';
3
- import type { ConfigType, CommomType, CoverageType, ProjectCoverageType } from '../typings/global';
4
- export type PartialConfigType<T = 'swc'> = Partial<ConfigType<T>>;
5
- export type PartialCommomType<T = 'swc'> = Partial<CommomType<T>>;
6
- /** 一些项目基本信息 */
7
- export declare const projectBasicInfo: {
8
- projectName: string;
9
- providerConfig: {
10
- [key: string]: any;
11
- prefixCls: string;
12
- iconPrefixCls: string;
13
- input: React.InputHTMLAttributes<HTMLInputElement>;
14
- };
15
- programInfo: {
16
- name: string;
17
- description: string;
18
- version: string;
19
- type: "mobile" | "site" | "back-stage" | "single-spa" | "library";
20
- author: {
21
- name: string;
22
- url?: string | undefined;
23
- email?: string | undefined;
24
- };
25
- repository: {
26
- type?: string | undefined;
27
- url?: string | undefined;
28
- directory?: string | undefined;
29
- };
30
- routerMode: "hash" | "browser" | "memory";
31
- routeBaseName: string;
32
- designSize: number;
33
- renderMode: "ssr" | "csr";
34
- };
35
- coverage: Record<string, CoverageType & Partial<ProjectCoverageType>>;
36
- };
1
+ export * from './process-env.js';
2
+ export * from './utils.js';
3
+ export * from '../typings/global.js';
4
+ export { default as envFlags } from './envFlags.js';
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- export{pathToRegexp}from"path-to-regexp";export var projectBasicInfo={projectName:projectName,providerConfig:providerConfig,programInfo:programInfo,coverage:projectCoverage};
1
+ export*from"./process-env.js";export*from"./utils.js";export*from"../typings/global.js";export{default as envFlags}from"./envFlags.js";
@@ -1,5 +1,5 @@
1
1
  import TerserPlugin from 'terser-webpack-plugin';
2
- import type { MinifierType, SwcOptions, TerserOptions } from '../typings/global';
2
+ import type { MinifierType, SwcOptions, TerserOptions } from '../typings/global.d.ts';
3
3
  import type { JsMinifyOptions } from '@swc/core/types';
4
4
  type MinifyObject = {
5
5
  terser: {
package/lib/minify.js ADDED
@@ -0,0 +1 @@
1
+ import e from"terser-webpack-plugin";import{merge as o}from"webpack-merge";import{swcMinifyOption as r}from"./swcrc.js";export const minify={terser:{minify:e.terserMinify,terserOptions:{ecma:2015,parse:{},compress:{global_defs:{"@alert":"console.log"},drop_console:!0,drop_debugger:!0,pure_funcs:["console.log","console.warn","console.error","console.info"]},toplevel:!1,mangle:!0,module:!1,format:{comments:!1},ie8:!1,keep_classnames:void 0,keep_fnames:!1,safari10:!1},extractComments:!1},swc:{minify:e.swcMinify,terserOptions:r}};export const getMinifyOption=(e,r={})=>{let s=minify[e];return Object.assign(s,{terserOptions:o(s.terserOptions,r)})};
@@ -0,0 +1 @@
1
+ import{CONFIG as i}from"./common.js";import o from"./html-plugin-option.js";let f=i.prefixCls||"n",n={};Object.assign(n,{"@prefix-cls":f,"@ant-prefix":f,"@iconfont-css-prefix":f+"-icon","@favicon":JSON.stringify(o.favicon)},i.modifyVars||{});export default n;
@@ -0,0 +1,5 @@
1
+ import webpack from 'webpack';
2
+ import ModuleFederationPlugin from 'webpack/lib/container/ModuleFederationPlugin.js';
3
+ declare const NormalModuleReplacementPlugin: typeof webpack.NormalModuleReplacementPlugin;
4
+ export declare const moduleFederation: (typeof ModuleFederationPlugin | typeof NormalModuleReplacementPlugin)[];
5
+ export {};
@@ -0,0 +1 @@
1
+ import e from"external-remotes-plugin";import r from"webpack";import t from"webpack/lib/container/ModuleFederationPlugin.js";import{CONFIG as o}from"./common.js";import{resolve as l}from"./utils.js";let a=r.NormalModuleReplacementPlugin,i={},m={},n={};export const moduleFederation=o.moduleFederation?.map(e=>{if(Array.isArray(e.remotes))for(let r=0,t=e.remotes.length;r<t;r++){let t=e.remotes[r],o=t.alias||t.name,l=t.filename||"remote_entry.js";if(n[o]=`${t.name}@${t.host}/${l}`,Array.isArray(t.library))for(let e=0,r=t.library.length;e<r;e++)i[t.library[e]]=`${o}/${t.library[e]}`}if(Array.isArray(e.exposes))for(let r=0,t=e.exposes.length;r<t;r++){let t=e.exposes[r];"string"==typeof t?m[`./${t}`]=l(t):"[object Object]"===Object.prototype.toString.call(t)&&(m[`./${t.name}`]=l(t.path))}return new t({filename:"remote_entry.js",...e,remotes:n,exposes:m})});moduleFederation.length&&(moduleFederation.push(new e),moduleFederation.push(new a(/(.*)/,e=>{i[e.request]&&(e.request=i[e.request])})));
@@ -0,0 +1 @@
1
+ import e from"mini-css-extract-plugin";import s from"mini-svg-data-uri";import{CONFIG as o,PUBLICPATH as t}from"./common.js";import{hasPkg as l}from"./has-pkg.js";import r from"./modifyVars.js";import{APPTYPE as a,DEV as i,FRAMEWORK as n}from"./process-env.js";import c from"./swcrc.js";import m from"./tsloader.config.js";import{resolveNodeModulesPath as p,resolveProgramPath as d}from"./utils.js";let u="single-spa"===a?t:"../",f={loader:e.loader,options:{publicPath:"/"!==u?u:"../"}},y=l("@moneko/postcss")&&{loader:"postcss-loader",options:{postcssOptions:await import("@moneko/postcss")}};i&&(f="style-loader");let x=[...o.cssModules,`@moneko/${n}`,"neko-ui"].map(p),g=[...["src/styles/variables/*.less","src/styles/mixins/*.less","site/styles/variables/*.less","site/styles/mixins/*.less"].map(d)],$=["components","example","mock","site","src"].map(d),j=[f,{loader:"css-loader",options:{modules:{auto:e=>{for(let s=0,o=x.length;s<o;s++)if(e&&e?.includes(x[s]))return/(.*(?<!\.global\.(le|c)ss)$)/i.test(e);return/(^(?!.*node_modules))(.*(?<!\.global\.(le|c)ss)$)/i.test(e)},localIdentName:"[path][name]__[local]",exportLocalsConvention:"dashesOnly"},importLoaders:2}},y,"css-unicode-loader",{loader:"less-loader",options:{sourceMap:!!o.sourceMap,lessOptions:{modifyVars:r,javascriptEnabled:!0}}},{loader:"style-resources-loader",options:{patterns:g}}].filter(Boolean),b={loader:"tsc"===o.compiler?"ts-loader":"swc-loader",options:"tsc"===o.compiler?m:c(i)},v={rules:[{oneOf:[{resourceQuery:/raw/,type:"asset/source"},{resourceQuery:/\.wasm$/,type:"webassembly/async"},{test:/\.less$/,use:j,include:$.concat(o.rulesInclude?.less?.map(p)||[])},{test:/\.css$/,use:[f,"css-loader",y,"css-unicode-loader"].filter(Boolean),include:$.concat(o.rulesInclude?.css?.map(p)||[])},{test:/\.(gif|png|jpe?g|ico|mp4)$/i,type:"asset",generator:{filename:"assets/images/[name][ext][query]"},include:$.concat(o.rulesInclude?.media?.map(p)||[])},{test:/\.(eot|ttf|otf|woff(|2))$/,type:"asset",generator:{filename:"assets/fonts/[name][ext][query]"},include:$.concat(o.rulesInclude?.fonts?.map(p)||[])},{test:/\.svg$/,type:"asset/inline",generator:{dataUrl:e=>s("string"!=typeof e?e.toString():e)}},{test:/\.txt$/,type:"asset/source"},{test:/\.(cj|mj|t|j)s(|x)$/,use:[...o.prefixJsLoader,b].filter(Boolean),include:$.concat(o.rulesInclude?.js?.map(p)||[])},{test:/\.mdx?$/,use:[...o.prefixJsLoader,b,{loader:"@mdx-js/loader",options:o.mdx}].filter(Boolean),include:$,exclude:[/(.+)\/examples\/(.+).mdx?$/i]},{test:/\.mdx?$/,type:"asset/source",include:[/(.+)\/examples\/(.+).mdx?$/i]},{type:"asset/source",include:[/(.+)\/examples\/(.+).*?$/i]}]},...o.moduleRules]};export default v;
@@ -1,15 +1,18 @@
1
- import type { AppType } from '../typings/global';
1
+ import type { AppType, Framework } from '../typings/global.js';
2
+ export declare const __dirname: string;
2
3
  export declare const APPTYPE: AppType;
4
+ export declare const FRAMEWORK: Framework;
5
+ export declare const jsxImportSource: string;
3
6
  export declare const PROGRAMPATH: string;
4
7
  export declare const PACKAGENAME: string;
5
8
  export declare const PACKAGEVERSION: string;
9
+ export declare const cacheDir: string;
6
10
  export declare const pkgName: string;
7
11
  export declare const NODE_ENV: string | undefined;
8
12
  export declare const CUSTOMCONFIG: string | undefined;
9
13
  export declare const DEV: boolean;
10
14
  export declare let hasEslintConfig: boolean;
11
15
  export declare let hasStylelintConfig: boolean;
12
- export declare const hasReact: boolean;
13
16
  export declare const hasAntd: boolean;
14
17
  export declare const programInfo: {
15
18
  name: string;
@@ -0,0 +1 @@
1
+ import{readFileSync as e,existsSync as o,mkdirSync as r}from"fs";import{join as s}from"path";import t from"url";import{hasPkg as n}from"./has-pkg.js";import{resolveProgramPath as p}from"./utils.js";import c from"./yarn-argv.js";export const __dirname=t.fileURLToPath(new URL(".",import.meta.url));export const APPTYPE=process.env.APPTYPE;export const FRAMEWORK=process.env.FRAMEWORK;export const jsxImportSource={react:"react","solid-js":"solid-js/h"}[FRAMEWORK];export const PROGRAMPATH=process.cwd();export const PACKAGENAME=process.env.npm_package_name;export const PACKAGEVERSION=process.env.npm_package_version;let a=e(s(__dirname,"../package.json"),{encoding:"utf-8"});export const cacheDir=s(PROGRAMPATH,"./node_modules/.cache/@moneko/cli/");o(cacheDir)||r(cacheDir,{recursive:!0});export const pkgName=JSON.parse(a).name;export const NODE_ENV=process.env.NODE_ENV;export const CUSTOMCONFIG=process.env.npm_config_config||c.config;export const DEV="development"===process.env.NODE_ENV;export let hasEslintConfig=!!Object.keys(process.env).filter(e=>e.startsWith("npm_package_eslintConfig_")).length;export let hasStylelintConfig=!!Object.keys(process.env).filter(e=>e.startsWith("npm_package_stylelint_")).length;export const hasAntd=n("antd");export const programInfo={name:PACKAGENAME,version:PACKAGEVERSION,type:APPTYPE,description:process.env.npm_package_description,author:{name:process.env.npm_package_author_name,email:process.env.npm_package_author_email,url:process.env.npm_package_author_url},repository:{type:process.env.npm_package_repository_type,url:process.env.npm_package_repository_url,directory:process.env.npm_package_repository_directory}};if(parseInt(process.versions.node)>14){let o=e(p("package.json"),{encoding:"utf-8"}),{description:r,author:s,repository:t,eslintConfig:n,stylelint:c}=JSON.parse(o);programInfo.author="string"==typeof s?{name:s}:s,programInfo.repository="string"==typeof s?{url:t}:t,programInfo.description=r,hasEslintConfig=!!n,hasStylelintConfig=!!c}
@@ -1,3 +1,4 @@
1
+ import enhancedResolve from 'enhanced-resolve';
1
2
  /**
2
3
  * @examples
3
4
  * ```javascript
@@ -5,5 +6,5 @@
5
6
  * resolverSync.resolveSync({}, process.cwd(), "react")
6
7
  * ```
7
8
  */
8
- declare const resolverSync: import("enhanced-resolve").Resolver;
9
+ declare const resolverSync: enhancedResolve.Resolver;
9
10
  export default resolverSync;
@@ -0,0 +1 @@
1
+ import*as e from"fs";import s from"enhanced-resolve";let{CachedInputFileSystem:o,ResolverFactory:n}=s,m=n.createResolver({fileSystem:new o(e,4e3),conditionNames:["node"],extensions:[".js",".json",".node"],useSyncFileSystemCalls:!0,mainFields:["esm","module","main"]});export default m;
@@ -0,0 +1 @@
1
+ export declare const frameworkCacheDir: ".git/";
package/lib/routes.js ADDED
@@ -0,0 +1 @@
1
+ let e,t;import{readdirSync as r,statSync as o,writeFile as i,readFileSync as n,existsSync as s,mkdirSync as c,unlinkSync as a}from"fs";import{join as m,relative as l}from"path";import{watch as p}from"chokidar";import{load as f}from"js-yaml";import{PROGRAMPATH as u,APPTYPE as h,FRAMEWORK as d,DEV as k}from"./process-env.js";import{resolveProgramPath as g}from"./utils.js";let j=/^---\n([\s\S]+?)\n---\n/;function x(e,t){let{regex:i,alia:s,base:c=e,outputSource:a}=t,p=r(e);return p.reduce((r,p)=>{let u=m(e,p),h=o(u);if(h.isDirectory()){let e=x(u,{...t,base:c});if(e.length>0){let t={},o={path:p,key:l(c,u)};if(a)Object.assign(t,{children:e});else{let r=e.splice(0,1)[0];e.length?Object.assign(t,{children:[{...r,path:"/",key:o.key},...e]}):Object.assign(t,r)}r.push(Object.assign(t,o))}}else if(i.test(u)){let e=n(u,{encoding:"utf-8"}),t=function(e){let t=e.match(j);return t&&t[1]?t[1].trim():null}(e),o=t?f(t):{},i=l(c,u);r.push(Object.assign({path:p,key:i,meta:{...o}},s&&{component:`rr(() => import(/* webpackChunkName: '${i}' */'${m(s,i)}'))rr`},a&&{codes:function(e){let t;let r={},o=/```(.+?)\n([\s\S]*?)\n```/g;for(;null!==(t=o.exec(e));){let[,e="jsx",o]=t,i=e.split(" ").pop()||"jsx";r[i]=o.trim()}return Object.keys(r).length?r:{jsx:e}}(e.replace(j,"").replace(/^\n+|\n+$/g,""))}))}return r},[])}let $=m(u,"./components");export const frameworkCacheDir=g(".git/");function y(e){if(e)throw e}function C(){e&&clearTimeout(e),e=setTimeout(()=>{let e={react:"createElement","solid-js":"createComponent"}[d],t=`() => ${e}(SuspenseComp, { comp: $1 })`,r=`import { ${e} } from "${d}";import { SuspenseComp } from "@moneko/${d}";`;["react","solid-js"].includes(d)||(t="$1",r="");let o=JSON.stringify(x($,{regex:/README\.mdx?$/,alia:"@pkg"})).replace(/"rr\((.+?)\)rr"/g,t);s(frameworkCacheDir)||c(frameworkCacheDir),i(m(frameworkCacheDir,"route.js"),`${r}export default ${o}`,"utf-8",y)},100)}function D(){t&&clearTimeout(t),t=setTimeout(()=>{let e=Object.fromEntries(x($,{regex:/\/examples\/(.+)\.mdx$/,outputSource:!0}).map(e=>[e.key,e.children?.[0].children?.map(e=>({title:e.path,...e.meta,codes:e.codes}))]));s(frameworkCacheDir)||c(frameworkCacheDir),i(m(frameworkCacheDir,"example.js"),`export default ${JSON.stringify(e)}`,"utf-8",y)},100)}function w(e,t,r){let o=p(e,{ignored:(e,r)=>{if(r)return!r?.isDirectory()&&t.test(e)},persistent:!0});o.on("add",()=>{r()}).on("change",()=>{r()}).on("unlink",()=>{r()})}"library"===h&&(k?(w($,/(?<!README\.mdx?)$/,C),w($,/(?<!\/examples\/(.+)\.mdx)$/,D)):(C(),D())),process.on("SIGINT",function(){try{a(m(frameworkCacheDir,"example.js"))}catch(e){}try{a(m(frameworkCacheDir,"route.js"))}catch(e){}process.exit()});
package/lib/seo.js ADDED
@@ -0,0 +1 @@
1
+ import{existsSync as t,mkdirSync as o,writeFile as e,readdirSync as r,statSync as s}from"fs";import{join as m}from"path";import{CONFIG as p}from"./common.js";import{APPTYPE as i,PROGRAMPATH as n}from"./process-env.js";import{resolveProgramPath as c}from"./utils.js";import{outputConfig as f}from"./webpack.common.js";export const seo=()=>{let{domain:a,nojekyll:u,path:l}=p.seo||{};if(!a)return;let h=l&&c(l)||f?.path||process.cwd(),j=t=>{if(t)throw t};t(h)||o(h),e(m(h,"CNAME"),a,"utf-8",j),e(m(h,"robots"),`Sitemap: https://${a}${p.routeBaseName}sitemap.txt`,"utf-8",j);let E="";"library"===i&&(E=(function t(o,e,m){let p=[],i=r(o);return i.forEach(function(r){if("static"===r)return!1;let i=o+"/"+r,c=s(i);c&&c.isDirectory()?p=p.concat(t(i,e,m)):i.endsWith("README.mdx")&&p.push("https://"+e+m+i.replace(n+"/components/","").replace("/README.mdx",""))}),p})(m(n,"./components"),a,p.routeBaseName).join("\n")),e(m(h,"sitemap.txt"),E,"utf-8",j),u&&e(m(h,".nojekyll"),"","utf-8",j)};
package/lib/swcrc.js ADDED
@@ -0,0 +1 @@
1
+ import{merge as e}from"webpack-merge";import{CONFIG as o}from"./common.js";import r from"./envFlags.js";import{FRAMEWORK as s,jsxImportSource as t}from"./process-env.js";let n={env:{targets:["last 2 version","> 0.5%","ie 11","not dead"],mode:"entry",coreJs:"3"}};export const swcMinifyOption={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};export default((a=!1)=>{let c={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:"react"===s&&a,development:a,importSource:t},constModules:{globals:{"env-flags":r}},optimizer:{simplify:!1}},experimental:{plugins:[["swc-plugin-another-transform-imports",function(e){for(let o=0,r=Object.keys(e),s=r.length;o<s;o++)e[r[o]].transform=`${r[o]}/${e[r[o]].transform}`,e[r[o]].style&&(e[r[o]].style=`${r[o]}/${e[r[o]].style}`);return e}(o.importOnDemand||{})],["@moneko/jsx-dom-expressions",o.jsxDomExpressions||{}]]}},sourceMaps:!0,parseMap:!0},l=Object.assign(c,!a&&n);return o.swcrc&&(l=e(l,"function"==typeof o.swcrc?o.swcrc(a):o.swcrc)),l});
@@ -0,0 +1 @@
1
+ import t from"fs";import r from"ts-import-plugin";import o from"webpack-merge";import{CONFIG as e}from"./common.js";import{isFunction as m,resolveProgramPath as s,readConf as a}from"./utils.js";let i=[];Array.isArray(e.importOnDemand)&&Object.assign(i,e.importOnDemand.map(t=>r(t)));let n=[...i],p={transpileOnly:!0,getCustomTransformers:()=>({before:n})};try{let r=s("tsloader.config.ts");t.accessSync(r,t.constants.R_OK);let e=(await a(r,"tsloader.config")).default;p=o(p,m(e)?e(process):e)}catch(t){}export default p;
@@ -1,7 +1,8 @@
1
- export declare const tfc: (filepath: string) => any;
1
+ export declare function tfc(filepath: string): string;
2
+ export declare function readConf(src: string, name: string): Promise<any>;
2
3
  export declare function toUpperCaseString(string: string): string;
3
4
  export declare function getIPAdress(): string | undefined | void;
4
- type ProgramPath<T extends string> = `~/${T extends string ? T : string}`;
5
+ type ProgramPath<T extends string> = `${T extends string ? T : string}`;
5
6
  type NodeModulesPath<T> = ProgramPath<`node_modules/${T extends string ? T : string}`>;
6
7
  /** 位于项目根目录下的位置
7
8
  * @param {string} src 路径
@@ -12,7 +13,7 @@ export declare function resolveProgramPath<T extends string>(src: T): ProgramPat
12
13
  * @param {string} src 路径
13
14
  * @returns {string} 位于项目根目录node_modules下的位置
14
15
  */
15
- export declare const resolveNodeModulesPath: <T extends string>(src: T) => `~/${`node_modules/${T extends string ? T : string}` extends infer T_1 ? T_1 extends `node_modules/${T extends string ? T : string}` ? T_1 extends string ? T_1 : string : never : never}`;
16
+ export declare const resolveNodeModulesPath: <T extends string>(src: T) => `${`node_modules/${T extends string ? T : string}` extends infer T_1 ? T_1 extends `node_modules/${T extends string ? T : string}` ? T_1 extends string ? T_1 : string : never : never}`;
16
17
  /** 获取模块真实入口位置
17
18
  * @param {string} url 路径
18
19
  * @returns {string} 模块真实入口路径
package/lib/utils.js ADDED
@@ -0,0 +1 @@
1
+ import{writeFileSync as e}from"fs";import{networkInterfaces as t}from"os";import r from"path";import{transformFileSync as o}from"@swc/core";import{cacheDir as n}from"./process-env.js";import s from"./resolver-sync.js";let c={inputSourceMap:!1,sourceMaps:!1,module:{type:"es6"},jsc:{parser:{syntax:"typescript"},loose:!1}};export function tfc(e){return o(e,c).code||"{}"}export function readConf(t,o){let s=r.join(n,`${o}.mjs`);return e(s,tfc(t),"utf-8"),import(s)}export function toUpperCaseString(e){return e?.replace(/\b\w/g,e=>e.toUpperCase()).replace(/\./g," ")}export function getIPAdress(){let e=t();for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];for(let e=0;e<r.length;e++){let t=r[e];if("IPv4"===t.family&&"127.0.0.1"!==t.address&&!t.address.startsWith("169.254")&&!t.internal)return t.address}}}export function resolveProgramPath(e){return r.resolve(process.cwd(),"./"+e)}export const resolveNodeModulesPath=e=>resolveProgramPath(`node_modules/${e}`);export const resolve=e=>s.resolveSync({},process.cwd(),e)||e;export function isObject(e){let t=typeof e;return null!==e&&("object"==t||"function"==t)}export function isFunction(e){if(!isObject(e))return!1;let t=Object.prototype.toString.call(e);return"[object Function]"==t||"[object AsyncFunction]"==t||"[object GeneratorFunction]"==t||"[object Proxy]"==t}
@@ -0,0 +1 @@
1
+ import e from"fs";import t from"add-asset-html-webpack-plugin";import s from"html-webpack-plugin";import n from"webpack";import o from"webpackbar";import{CONFIG as l,ENTRYPATH as i,PUBLICPATH as r}from"./common.js";import a from"./done.js";import p from"./envFlags.js";import m from"./html-add-entry-attr.js";import c from"./html-plugin-option.js";import{moduleFederation as u}from"./module-federation.js";import f from"./module.config.js";import{APPTYPE as d,DEV as g,hasEslintConfig as j,hasStylelintConfig as h,PACKAGENAME as b,PROGRAMPATH as y,FRAMEWORK as w}from"./process-env.js";import{frameworkCacheDir as x}from"./routes.js";import{seo as k}from"./seo.js";import{resolveNodeModulesPath as v,resolveProgramPath as C}from"./utils.js";let O=[".eslintrc.js",".eslintrc.json",".eslintrc.yaml",".eslintrc.json"],P=[".stylelintrc",".stylelintrc.json",".stylelintrc.yaml",".stylelintrc.yml",".stylelintrc.js","stylelint.config.js","stylelint.config.cjs"],$=e.readdirSync(y),T=!1,A=!1;for(let e=0,t=$.length;e<t;e++)P.includes($[e])&&(A=!0),O.includes($[e])&&(T=!0);T||(T=j),A||(A=h);let B=A?(await import("stylelint-webpack-plugin")).default:null,S=T?(await import("eslint-webpack-plugin")).default:null,M={"@":C("src"),"@framework-cache-dir":x};Object.assign(M,l.alias),"library"===d&&Object.assign(M,{"@":C("site"),"@pkg":C("components"),[b]:C("components")});let F=l.assetHtml.map(e=>({publicPath:"",...e}));export const outputConfig={path:C("library"===d?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:"js/[name].chunk.js",assetModuleFilename:"assets/[name].[hash][ext]",library:b,libraryTarget:"window",globalObject:"window",chunkLoadingGlobal:`webpackJsonp_${b}`,pathinfo:!1,clean:!0,publicPath:r};let K=v(`@moneko/${w}/lib/packages/${i[d]}/index.js`);"single-component"===d&&(Object.assign(M,{[b]:C("umd")}),K=C(g?"example/index.ts":"src/index.ts"),outputConfig.path=C(g?"dist":"umd"),outputConfig.filename="index.js",outputConfig.library=b,outputConfig.libraryTarget="umd",outputConfig.libraryExport="default");let L={main:K};l.entry&&("string"==typeof l.entry?L=l.entry:Object.keys(l.entry)&&Object.assign(L,l.entry)),l.output&&("string"==typeof l.output?outputConfig.path=l.output:Object.keys(l.output)&&Object.assign(outputConfig,l.output));let W=l.routeBaseName.split("/").filter(Boolean).length,D=Array(W).fill("..").join("/")+(W?"/":"")+"404.html",{pathSegmentsToKeep:R=W,path:_=D}=l.fixBrowserRouter||{},E={entry:L,stats:"errors-only",infrastructureLogging:{level:"none"},target:"web",plugins:[new n.AutomaticPrefetchPlugin,...u,S&&new S({fix:!0,threads:!0,extensions:["js","md","mdx","cjs","ejs","mjs","jsx","ts","tsx","json","html","coffee","vue"]}),B&&new B({fix:!0,threads:!0,extensions:["css","scss","sass","less","ts","tsx","js","jsx"],exclude:["node_modules/","es/","lib/","docs/","coverage/","dist/"]}),new s(c),l.fixBrowserRouter&&new s({filename:_,inject:!1,templateContent:()=>`<html html><head><title>${c.title}</title><script>var pathSegmentsToKeep = ${R||W};var l = window.location;l.replace(l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') + l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' + l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') + (l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') + l.hash);</script></head><body></body></html>`}),new t(F),"single-spa"===d&&new m(e=>!!(e.match(/main\.(.*)\.bundle.js$/)||e.match("main.bundle.js"))),new n.DefinePlugin(p),new n.WatchIgnorePlugin({paths:[/\.d\.ts$/]}),l.sourceMap&&new n.SourceMapDevToolPlugin(l.sourceMap),l.bar&&new o(l.bar),new a({done:()=>{!g&&l.seo&&k(),l.done?.()}}),...l.plugins].filter(Boolean),experiments:{topLevelAwait:!0,syncWebAssembly:!0,asyncWebAssembly:!0},resolve:{extensions:[".tsx",".ts",".js",".jsx"],alias:M,fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},module:f,externals:l.externals,output:outputConfig};export default E;
@@ -0,0 +1,4 @@
1
+ import e from"@soda/friendly-errors-webpack-plugin";import o from"chalk";import{getPort as r}from"portfinder";import t from"webpack";import{merge as s}from"webpack-merge";import{CONFIG as p}from"./common.js";import{hasPkg as i}from"./has-pkg.js";import{CUSTOMCONFIG as a,FRAMEWORK as l}from"./process-env.js";import{getIPAdress as m,isFunction as n,resolveProgramPath as c}from"./utils.js";import d from"./webpack.common.js";let v=i("@moneko/mock"),h=v&&await import("@moneko/mock"),w="react"===l&&(await import("@pmmmwh/react-refresh-webpack-plugin")).default,f=!1;p.cacheDirectory&&(f={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:p.cacheDirectory,name:a});let u=!1===p.devtool||p.devtool?p.devtool:"eval-cheap-module-source-map",g=new Promise(i=>{r({port:p.devServer.port,stopPort:9999},(r,a)=>{let l=[];p.devServer.port!==a&&l.push(`Port ${o.yellow(p.devServer.port)} is in use, trying ${o.green(a)} instead`),p.devServer.port=a;let v="/"===p.routeBaseName,g=p.devServer.https?"https:":"http:",k=v?"":p.routeBaseName,y=s(d,{devtool:u,mode:"development",cache:f,devServer:{headers:{"Access-Control-Allow-Origin":"*"},compress:p.devServer.compress,host:"0.0.0.0",port:a,historyApiFallback:v||{index:k,disableDotRule:!0},https:p.devServer.https,proxy:p.proxy,allowedHosts:p.devServer.allowedHosts,client:{progress:!1,logging:"info",overlay:!1},static:{watch:{ignored:e=>e.endsWith(".d.ts")||/\/node_modules\//.test(e)}},setupMiddlewares:(e,o)=>{if(!o)throw Error("webpack-dev-server is not defined");return o.app&&n(h)&&h(o.app,c("mock/")),e},open:!1,hot:!0},plugins:[new t.HotModuleReplacementPlugin,w&&new w,new e({compilationSuccessInfo:{messages:[`You application is running here:
2
+
3
+ local: ${o.cyan(`${g}//${p.devServer.host}:${a}${k}`)}
4
+ network: ${o.cyan(`${g}//${m()}:${a}${k}`)}`],notes:l},clearConsole:!0})].filter(Boolean)});i(y)})});export default g;
@@ -0,0 +1,3 @@
1
+ import webpack from 'webpack';
2
+ declare const _default: webpack.Configuration;
3
+ export default _default;
@@ -0,0 +1 @@
1
+ import e from"css-minimizer-webpack-plugin";import i from"mini-css-extract-plugin";import m from"terser-webpack-plugin";import n from"webpack";import{BundleAnalyzerPlugin as o}from"webpack-bundle-analyzer";import{merge as r}from"webpack-merge";import{CONFIG as s}from"./common.js";import{getMinifyOption as t}from"./minify.js";import{CUSTOMCONFIG as c}from"./process-env.js";import p from"./webpack.common.js";let{cssnanoMinify:l,swcMinify:a}=e,u="swc"===s.compiler?"swc":"terser",f="swc"===s.compiler?"swc":"cssnano",d=[];s.minifier&&(s.minifier.js&&d.push(new m(t(s.minifier.js?.type||u,s.minifier.js?.options))),s.minifier.css&&d.push(new e({minify:{swc:a,cssnano:l}[s.minifier.css?.type||f],minimizerOptions:s.minifier.css?.options})));let h={splitChunks:s.splitChunk,runtimeChunk:s.runtimeChunk,chunkIds:"named",moduleIds:"named",removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,minimize:!0,minimizer:d},k=!1;s.cacheDirectory&&(k={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:s.cacheDirectory,name:c});export default r(p,{devtool:!1===s.devtool||s.devtool?s.devtool:"cheap-module-source-map",mode:"production",cache:k,optimization:h,plugins:[new i({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",experimentalUseImportModule:!0}),s.bundleAnalyzer&&new o(s.bundleAnalyzer),s.splitChunk&&new n.optimize.MinChunkSizePlugin({minChunkSize:1e4})].filter(Boolean)});
@@ -0,0 +1 @@
1
+ let e=JSON.parse(process.env.npm_config_argv||"{}")?.original,a={};e?.forEach(e=>{let r=e.split("=");Object.assign(a,{[r[0]]:r[1]||!0})});export default a;
package/package.json CHANGED
@@ -1,75 +1,67 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.0.0-beta.4",
3
+ "version": "3.0.0-beta.40",
4
4
  "description": "core",
5
5
  "main": "lib/index.js",
6
+ "type": "module",
6
7
  "scripts": {
7
- "build": "npm run build-conf && npm run build-src && npm run build:types",
8
- "build-conf": "swc config -d build -C module.type=es6 -C jsc.target=es5 -C jsc.loose=true -C jsc.minify.mangle=true -C jsc.minify.compress=true -C minify=true --copy-files",
9
- "build-src": "swc src -d lib -C module.type=es6 -C jsc.loose=true -C jsc.minify.mangle=true -C jsc.minify.compress=true -C minify=true --copy-files",
10
- "build:types": "tsc && tsc --project cli.json",
11
- "postbuild": "node ./copy.js ./prefix ./lib",
12
- "prebuild": "rm -rf ./build && rm -rf ./lib"
8
+ "build": "swc src -d lib -C module.type=nodenext -C jsc.target=esnext -C jsc.loose=true -C jsc.minify.mangle=true -C jsc.minify.compress=true -C minify=true -D",
9
+ "prebuild": "rm -rf ./lib && tsc"
13
10
  },
14
11
  "keywords": [],
15
12
  "author": "moneko",
16
13
  "license": "MIT",
17
14
  "dependencies": {
18
- "@emotion/css": "11.11.0",
19
- "@mapbox/rehype-prism": "0.8.0",
20
15
  "@mdx-js/loader": "2.3.0",
21
- "@moneko/common": "1.1.0",
22
- "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
16
+ "@moneko/jsx-dom-expressions": "0.1.0",
23
17
  "@soda/friendly-errors-webpack-plugin": "1.8.1",
24
- "@swc/core": "1.3.56",
18
+ "@swc/core": "1.3.62",
25
19
  "@swc/css": "0.0.20",
26
20
  "@swc/helpers": "0.5.1",
27
21
  "add-asset-html-webpack-plugin": "6.0.0",
28
- "core-js": "3.30.2",
22
+ "core-js": "3.31.0",
29
23
  "cross-env": "7.0.3",
30
- "css-loader": "6.7.3",
31
- "css-minimizer-webpack-plugin": "5.0.0",
24
+ "css-loader": "6.8.1",
25
+ "css-minimizer-webpack-plugin": "5.0.1",
32
26
  "css-unicode-loader": "1.0.3",
33
27
  "external-remotes-plugin": "1.0.0",
34
- "html-webpack-plugin": "5.5.1",
28
+ "html-webpack-plugin": "5.5.3",
35
29
  "less": "4.1.3",
36
- "less-loader": "11.1.0",
37
- "mini-css-extract-plugin": "2.7.5",
30
+ "less-loader": "11.1.3",
31
+ "mini-css-extract-plugin": "2.7.6",
38
32
  "mini-svg-data-uri": "1.4.4",
39
33
  "path-to-regexp": "6.2.1",
40
34
  "portfinder": "1.0.32",
41
- "rehype-accessible-emojis": "0.3.2",
42
- "rehype-figure": "1.0.1",
43
- "style-loader": "3.3.2",
35
+ "style-loader": "3.3.3",
44
36
  "style-resources-loader": "1.5.0",
45
37
  "swc-loader": "0.2.3",
46
- "swc-plugin-another-transform-imports": "0.2.3",
38
+ "swc-plugin-another-transform-imports": "0.2.4",
47
39
  "ts-import-plugin": "3.0.0",
48
- "ts-loader": "9.4.2",
49
- "typescript": "^5.0.4",
40
+ "ts-loader": "9.4.3",
41
+ "typescript": "5.0.4",
50
42
  "webpack": "5.76.1",
51
- "webpack-bundle-analyzer": "4.8.0",
43
+ "webpack-bundle-analyzer": "4.9.0",
52
44
  "webpack-cli": "5.1.1",
53
45
  "webpack-dev-server": "4.15.0",
54
- "webpack-merge": "5.8.0",
46
+ "webpack-merge": "5.9.0",
55
47
  "webpackbar": "5.0.2",
56
- "xml2js": "0.5.0"
48
+ "xml2js": "0.6.0"
57
49
  },
58
50
  "devDependencies": {
59
- "@solidjs/router": "^0.8.2",
51
+ "@moneko/mock": "^1.0.10",
52
+ "@moneko/postcss": "^1.0.30",
60
53
  "@swc/cli": "0.1.62",
54
+ "@types/js-yaml": "^4.0.5",
61
55
  "@types/mini-css-extract-plugin": "^2.5.1",
62
56
  "@types/shelljs": "^0.8.12",
63
57
  "@types/webpack-bundle-analyzer": "^4.6.0",
64
- "@types/webpack-env": "^1.18.0",
58
+ "@types/webpack-env": "^1.18.1",
65
59
  "eslint-config-neko": "^1.0.23",
66
60
  "shelljs": "^0.8.5",
67
- "solid-js": "^1.7.5",
68
61
  "stylelint-config-moneko": "^1.0.15"
69
62
  },
70
63
  "files": [
71
64
  "lib",
72
- "build",
73
65
  "template",
74
66
  "typings/global.d.ts"
75
67
  ]
@@ -2,6 +2,7 @@
2
2
  import { Options as AssetHtmlOptions } from 'add-asset-html-webpack-plugin';
3
3
  import { Options as HtmlWebpackPluginOptions } from 'html-webpack-plugin';
4
4
  import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
5
+ import type { Options as MDXOptions } from '@mdx-js/loader';
5
6
  import type { JsMinifyOptions, Config as SwcConfig } from '@swc/core';
6
7
  import type { CssNanoOptionsExtended } from 'css-minimizer-webpack-plugin';
7
8
  import type { MinifyOptions } from 'terser';
@@ -13,6 +14,7 @@ import type {
13
14
  ProxyConfigMap,
14
15
  WebpackConfiguration,
15
16
  } from 'webpack-dev-server';
17
+ import type { State } from 'webpackbar';
16
18
 
17
19
  export type MinifierType = 'swc' | 'terser';
18
20
  export declare type AppType =
@@ -22,6 +24,7 @@ export declare type AppType =
22
24
  | 'back-stage'
23
25
  | 'single-spa'
24
26
  | 'library';
27
+ export declare type Framework = 'react' | 'solid-js';
25
28
  export type TerserOptions = MinifyOptions;
26
29
  export type SwcOptions = JsMinifyOptions;
27
30
  export type HtmlWebpackOption = HtmlWebpackPluginOptions & {
@@ -41,7 +44,7 @@ export interface Theme {
41
44
  errorColor?: string;
42
45
  warningColor?: string;
43
46
  }
44
- export declare type ConfigType<T = 'tsc'> = {
47
+ export declare type ConfigType<T extends 'tsc' | 'swc' = 'swc'> = {
45
48
  /** 渲染模式
46
49
  * @default 'csr'
47
50
  */
@@ -67,22 +70,28 @@ export declare type ConfigType<T = 'tsc'> = {
67
70
  **/
68
71
  entry?: Record<string, string> | string;
69
72
  /** 压缩配置 */
70
- minifier: {
71
- js?: {
72
- /**
73
- * @default 'swc'
74
- */
75
- type?: MinifierType;
76
- options?: SwcOptions | TerserOptions;
77
- };
78
- css?: {
79
- /**
80
- * @default 'swc'
81
- */
82
- type?: CssMinify;
83
- options?: CssNanoOptionsExtended;
84
- };
85
- };
73
+ minifier:
74
+ | {
75
+ js?:
76
+ | {
77
+ /**
78
+ * @default 'swc'
79
+ */
80
+ type?: MinifierType;
81
+ options?: SwcOptions | TerserOptions;
82
+ }
83
+ | false;
84
+ css?:
85
+ | {
86
+ /**
87
+ * @default 'swc'
88
+ */
89
+ type?: CssMinify;
90
+ options?: CssNanoOptionsExtended;
91
+ }
92
+ | false;
93
+ }
94
+ | false;
86
95
  /** 环境变量, 可通过 process.env 获取 */
87
96
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
88
97
  env?: Record<string, any>;
@@ -255,6 +264,16 @@ export declare type ConfigType<T = 'tsc'> = {
255
264
  | false;
256
265
  /** 📦 打包完成 */
257
266
  done?: () => void;
267
+ mdx?: MDXOptions;
268
+ jsxDomExpressions?: {
269
+ moduleName?: string;
270
+ builtIns?: string[];
271
+ contextToCustomElements?: boolean;
272
+ wrapConditionals?: boolean;
273
+ generate?: 'ssr' | 'dom';
274
+ hydratable?: boolean;
275
+ };
276
+ bar?: Partial<State>;
258
277
  };
259
278
  export declare interface ModuleFederationOption {
260
279
  /** 模块名称,唯一性,不能重名 */
package/build/common.js DELETED
@@ -1 +0,0 @@
1
- import fs from"fs";import path from"path";import readline from"readline";import chalk from"chalk";import{merge}from"webpack-merge";import{APPTYPE,CUSTOMCONFIG,pkgName,PROGRAMPATH}from"./process-env";import{tfc,isFunction}from"./utils";export var ENTRYPATH={mobile:"mobile",site:"site","back-stage":"back-stage","single-spa":"single-spa",library:"library","single-component":"single-component"};var includeModule=[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"===APPTYPE&&(defaultSplitChunk=!1);var defaultConfig={seo:!1,mode:"csr",compiler:"swc",bundleAnalyzer:{analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1},entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:""},env:{},routeBaseName:"/",publicPath:"/",designSize:"mobile"===APPTYPE?375:1680,fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{},layoutSider:{},moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:PROGRAMPATH+"/node_modules/.temp_cache",devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:"./node_modules/"+pkgName+"/template/index.html",favicon:"./node_modules/"+pkgName+"/template/favicon.ico",tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],splitChunk:defaultSplitChunk,runtimeChunk:"single-component"!==APPTYPE&&"single",moduleFederation:[],rulesInclude:{less:includeModule,css:includeModule,js:includeModule,media:includeModule,fonts:includeModule}};export var log=function(e){readline.cursorTo(process.stdout,0),process.stdout.write(e)};var customConf=defaultConfig,configPath=null,normalConf={},envConf={};try{configPath=path.join(PROGRAMPATH,"./config/index.ts"),fs.accessSync(configPath,fs.constants.R_OK)}catch(error){configPath=null}if(configPath)try{var conf=eval(tfc(configPath)).default;normalConf=isFunction(conf)?conf(process):conf}catch(error){process.stdout.write(chalk.red(error))}if(CUSTOMCONFIG){var customConfigPath=null;try{customConfigPath=path.join(PROGRAMPATH,"./config/"+CUSTOMCONFIG+".ts"),fs.accessSync(customConfigPath,fs.constants.R_OK)}catch(error){customConfigPath=null}if(null!==customConfigPath)try{var conf=eval(tfc(customConfigPath)).default;envConf=isFunction(conf)?conf(process):conf}catch(error){process.stdout.write(chalk.red(error))}}customConf=merge(customConf,normalConf,envConf),!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 "}));export var CONFIG=customConf;export var PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG:CONFIG,log:log};
package/build/coverage.js DELETED
@@ -1 +0,0 @@
1
- import{readFileSync as r,accessSync as e,constants as c}from"fs";import{join as o}from"path";import{Parser as a}from"xml2js";import{PACKAGENAME as t,PROGRAMPATH as i}from"./process-env";export var coverage={};try{var m=o(i,"./coverage/clover.xml");e(m,c.R_OK);var n=new a({explicitArray:!1,async:!1}),v=r(m,{encoding:"utf-8"});n.parseString(v,function(r,e){if(!r){var c,o=e.coverage.project.metrics.$,a=e.coverage.project.package;Object.assign(coverage,((c={})[t]=o,c)),a.forEach(function(r){var e;Object.assign(coverage,((e={})[r.$.name]=r.metrics.$,e))})}})}catch(r){}
package/build/done.js DELETED
@@ -1 +0,0 @@
1
- var n=function(){"use strict";function n(n){this.options=Object.assign({},n)}return n.prototype.apply=function(n){var o=this;n.hooks.done.tap("DoneWebpackPlugin",function(){null==o.options.done||o.options.done()})},n}();export default n;
package/build/envFlags.js DELETED
@@ -1 +0,0 @@
1
- function r(){return(r=Object.assign||function(r){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])}return r}).apply(this,arguments)}import i from"fs";import t from"path";import{CONFIG as e}from"./common";import{coverage as o}from"./coverage";import s from"./html-plugin-option";import{APPTYPE as n,NODE_ENV as a,PACKAGENAME as f,programInfo as c,PROGRAMPATH as p,hasAntd as m,hasReact as g}from"./process-env";import{toUpperCaseString as l}from"./utils";var y=parseFloat(g?require("react/package.json").version:"18")>=18?"react-dom/client":"react-dom",S="library"===n?"site":"src",N=!1;try{var O=t.join(p,"./src/index.ts");i.accessSync(O,i.constants.R_OK),N=O}catch(r){N=!1}var d={projectName:JSON.stringify(l(f)),projectCoverage:JSON.stringify(o),providerConfig:JSON.stringify({prefixCls:e.prefixCls,iconPrefixCls:e.prefixCls+"-icon",theme:e.theme}),fallbackCompPath:JSON.stringify(e.fallbackCompPath),ReactDOMPath:JSON.stringify(y),favicon:JSON.stringify(s.favicon),hasLocales:JSON.stringify(i.existsSync(t.join(p,"./"+S+"/locales"))),hasPersist:JSON.stringify(i.existsSync(t.join(p,"./"+S+"/persist.ts"))),layoutSider:JSON.stringify(e.layoutSider),hasAntd:JSON.stringify(m),APPTYPE:JSON.stringify(n),APPENTRY:JSON.stringify(N),programInfo:JSON.stringify(r({},c,{routeBaseName:e.routeBaseName,designSize:e.designSize,routerMode:e.routerMode,renderMode:e.mode})),"process.env":JSON.stringify(r({NODE_ENV:a,iconfont:e.iconfont},e.env))};export default d;
package/build/has-pkg.js DELETED
@@ -1 +0,0 @@
1
- import{accessSync as o,constants as r}from"fs";import t from"path";import{PROGRAMPATH as a}from"./process-env";export function hasPkg(e){var m=!1;try{var n=t.join(a,"./node_modules/"+e+"/package.json");o(n,r.R_OK),m=!0}catch(o){m=!1}return m}
@@ -1 +0,0 @@
1
- var t=function(){"use strict";function t(t){this.entryMatchCallback=t}return t.prototype.apply=function(t){var n=this;t.hooks.compilation.tap("AddEntryAttributeWebpackPlugin",function(r){var a=t.options.plugins.map(function(t){return t.constructor}).find(function(t){return t&&"HtmlWebpackPlugin"===t.name});a&&a.getHooks(r).alterAssetTagGroups.tap("AddEntryAttributeWebpackPlugin",function(t){return t.headTags.forEach(function(t){var r;"script"===t.tagName&&"string"==typeof(null==(r=t.attributes)?void 0:r.src)&&n.entryMatchCallback(t.attributes.src)&&(t.attributes.entry=!0)}),t})})},t}();export default t;
@@ -1 +0,0 @@
1
- import e from"path";import{merge as t}from"webpack-merge";import{CONFIG as i}from"./common";import{PROGRAMPATH as o,PACKAGENAME as r,programInfo as a}from"./process-env";var n,p=i.htmlPluginOption,m=p.template,l=p.favicon,c=function(e,t){if(null==e)return{};var i,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)t.indexOf(i=a[o])>=0||(r[i]=e[i]);return r}(p,["template","favicon"]),s=t({title:(null==(n=i.env)?void 0:n.PROJECTNAME)||r.toLocaleUpperCase()||"Title",filename:"index.html",hash:!1,minify:{collapseWhitespace:!0,removeComments:!0,removeRedundantAttributes:!1,removeScriptTypeAttributes:!1,removeStyleLinkTypeAttributes:!1,removeAttributeQuotes:!0,useShortDoctype:!0},meta:{charset:"UTF-8","X-UA-Compatible":{"http-equiv":"X-UA-Compatible",content:"IE=edge,Chrome=1"},HandheldFriendly:"true",MobileOptimized:"320","screen-orientation":"portrait","x5-orientation":"portrait",browsermode:"application","x5-page-mode":"app","msapplication-tap-highlight":"no",viewport:"width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no","apple-mobile-web-app-capable":"yes",renderer:"webkit",description:a.description||""},tags:[],template:e.join(o,m),favicon:e.join(o,l)},c);export default s;
package/build/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './process-env';
2
- export * from './utils';
package/build/index.js DELETED
@@ -1 +0,0 @@
1
- export*from"./process-env";export*from"./utils";
package/build/minify.js DELETED
@@ -1 +0,0 @@
1
- import e from"terser-webpack-plugin";import{merge as r}from"webpack-merge";import{swcMinifyOption as o}from"./swcrc";export var minify={terser:{minify:e.terserMinify,terserOptions:{ecma:2015,parse:{},compress:{global_defs:{"@alert":"console.log"},drop_console:!0,drop_debugger:!0,pure_funcs:["console.log","console.warn","console.error","console.info"]},toplevel:!1,mangle:!0,module:!1,format:{comments:!1},ie8:!1,keep_classnames:void 0,keep_fnames:!1,safari10:!1},extractComments:!1},swc:{minify:e.swcMinify,terserOptions:o}};export var getMinifyOption=function(e,o){void 0===o&&(o={});var s=minify[e];return Object.assign(s,{terserOptions:r(s.terserOptions,o)})};
@@ -1 +0,0 @@
1
- import{CONFIG as i}from"./common";import o from"./html-plugin-option";var f=i.prefixCls||"n",n={};Object.assign(n,{"@prefix-cls":f,"@ant-prefix":f,"@iconfont-css-prefix":f+"-icon","@favicon":JSON.stringify(o.favicon)},i.modifyVars||{});export default n;
@@ -1,4 +0,0 @@
1
- import ExternalTemplateRemotesPlugin from 'external-remotes-plugin';
2
- import { NormalModuleReplacementPlugin } from 'webpack';
3
- import ModuleFederationPlugin from 'webpack/lib/container/ModuleFederationPlugin.js';
4
- export declare const moduleFederation: (typeof ExternalTemplateRemotesPlugin | typeof ModuleFederationPlugin | typeof NormalModuleReplacementPlugin)[];
@@ -1 +0,0 @@
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 from"external-remotes-plugin";import{NormalModuleReplacementPlugin as o}from"webpack";import t from"webpack/lib/container/ModuleFederationPlugin.js";import{CONFIG as a}from"./common";import{resolve as n}from"./utils";var i,s={},l={},m={};export var moduleFederation=null==(i=a.moduleFederation)?void 0:i.map(function(r){if(Array.isArray(r.remotes))for(var o=0,a=r.remotes.length;o<a;o++){var i=r.remotes[o],p=i.alias||i.name,u=i.filename||"remote_entry.js";if(m[p]=i.name+"@"+i.host+"/"+u,Array.isArray(i.library))for(var f=0,y=i.library.length;f<y;f++)s[i.library[f]]=p+"/"+i.library[f]}if(Array.isArray(r.exposes))for(var c=0,d=r.exposes.length;c<d;c++){var b=r.exposes[c];"string"==typeof b?l["./"+b]=n(b):"[object Object]"===Object.prototype.toString.call(b)&&(l["./"+b.name]=n(b.path))}return new t(e({filename:"remote_entry.js"},r,{remotes:m,exposes:l}))});moduleFederation.length&&(moduleFederation.push(new r),moduleFederation.push(new o(/(.*)/,function(e){s[e.request]&&(e.request=s[e.request])})));
@@ -1 +0,0 @@
1
- function e(e,s){(null==s||s>e.length)&&(s=e.length);for(var o=0,r=Array(s);o<s;o++)r[o]=e[o];return r}function s(s){return function(s){if(Array.isArray(s))return e(s)}(s)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||function(s,o){if(s){if("string"==typeof s)return e(s,o);var r=Object.prototype.toString.call(s).slice(8,-1);if("Object"===r&&s.constructor&&(r=s.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(s,o)}}(s)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}import o from"mini-css-extract-plugin";import r from"mini-svg-data-uri";import{CONFIG as t,PUBLICPATH as l}from"./common";import{hasPkg as n}from"./has-pkg";import a from"./modifyVars";import{APPTYPE as i,DEV as c,pkgName as u}from"./process-env";import p from"./swcrc";import m from"./tsloader.config";import{resolveNodeModulesPath as d,resolveProgramPath as f}from"./utils";var y,g,v,x,b,h,$,j,I,A,w="single-spa"===i?l:"../",S={loader:o.loader,options:{publicPath:"/"!==w?w:"../"}},k=n("@moneko/postcss")&&{loader:"postcss-loader",options:{postcssOptions:require("@moneko/postcss")}};c&&(S="style-loader");var q=s(t.cssModules).concat([u,"neko-ui"]).map(d),O=[d(""+u+"/lib/styles/eval/*.less")].concat(s(["src/styles/variables/*.less","src/styles/mixins/*.less","site/styles/variables/*.less","site/styles/mixins/*.less"].map(f))),E=["components","example","mock","site","src"].map(f),B=[S,{loader:"css-loader",options:{modules:{auto:function(e){for(var s=0,o=q.length;s<o;s++)if(e&&(null==e?void 0:e.includes(q[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}},k,"css-unicode-loader",{loader:"less-loader",options:{sourceMap:!!t.sourceMap,lessOptions:{modifyVars:a,javascriptEnabled:!0}}},{loader:"style-resources-loader",options:{patterns:O}}].filter(Boolean),L={loader:"tsc"===t.compiler?"ts-loader":"swc-loader",options:"tsc"===t.compiler?m:p(c)},M={rules:[{oneOf:[{resourceQuery:/raw/,type:"asset/source"},{resourceQuery:/\.wasm$/,type:"webassembly/async"},{test:/\.less$/,use:B,include:E.concat((null==(y=t.rulesInclude)?void 0:null==(g=y.less)?void 0:g.map(d))||[])},{test:/\.css$/,use:[S,"css-loader",k,"css-unicode-loader"].filter(Boolean),include:E.concat((null==(v=t.rulesInclude)?void 0:null==(x=v.css)?void 0:x.map(d))||[])},{test:/\.(gif|png|jpe?g|ico|mp4)$/i,type:"asset",generator:{filename:"assets/images/[name][ext][query]"},include:E.concat((null==(b=t.rulesInclude)?void 0:null==(h=b.media)?void 0:h.map(d))||[])},{test:/\.(eot|ttf|otf|woff(|2))$/,type:"asset",generator:{filename:"assets/fonts/[name][ext][query]"},include:E.concat((null==($=t.rulesInclude)?void 0:null==(j=$.fonts)?void 0:j.map(d))||[])},{test:/\.svg$/,type:"asset/inline",generator:{dataUrl:function(e){return r("string"!=typeof e?e.toString():e)}}},{test:/\.txt$/,type:"asset/source"},{test:/\.(cj|mj|t|j)s(|x)$/,use:s(t.prefixJsLoader).concat([L]).filter(Boolean),include:E.concat((null==(I=t.rulesInclude)?void 0:null==(A=I.js)?void 0:A.map(d))||[])},{test:/\.mdx?$/,use:s(t.prefixJsLoader).concat([L,{loader:"@mdx-js/loader",options:{jsxImportSource:"solid-js/h",rehypePlugins:[[require("@mapbox/rehype-prism"),{ignore:!0}],require("rehype-accessible-emojis").rehypeAccessibleEmojis,require("rehype-figure")],remarkPlugins:[]}}]).filter(Boolean),include:E,exclude:[/(.+)\/examples\/(.+).mdx?$/i]},{test:/\.mdx?$/,type:"asset/source",include:[/(.+)\/examples\/(.+).mdx?$/i]},{type:"asset/source",include:[/(.+)\/examples\/(.+).*?$/i]}]}].concat(s(t.moduleRules))};export default M;
@@ -1 +0,0 @@
1
- import{hasPkg as e}from"./has-pkg";import{resolveProgramPath as r}from"./utils";import o from"./yarn-argv";export var APPTYPE=process.env.APPTYPE;export var PROGRAMPATH=process.cwd();export var PACKAGENAME=process.env.npm_package_name;export var PACKAGEVERSION=process.env.npm_package_version;export var pkgName=require("../package.json").name;export var NODE_ENV=process.env.NODE_ENV;export var CUSTOMCONFIG=process.env.npm_config_config||o.config;export var DEV="development"===process.env.NODE_ENV;export var hasEslintConfig=!!Object.keys(process.env).filter(function(e){return e.startsWith("npm_package_eslintConfig_")}).length;export var hasStylelintConfig=!!Object.keys(process.env).filter(function(e){return e.startsWith("npm_package_stylelint_")}).length;export var hasReact=e("react");export var hasAntd=e("antd");export var programInfo={name:PACKAGENAME,version:PACKAGEVERSION,type:APPTYPE,description:process.env.npm_package_description,author:{name:process.env.npm_package_author_name,email:process.env.npm_package_author_email,url:process.env.npm_package_author_url},repository:{type:process.env.npm_package_repository_type,url:process.env.npm_package_repository_url,directory:process.env.npm_package_repository_directory}};if(parseInt(process.versions.node)>14){var p=require(r("package.json")),n=p.description,t=p.author,a=p.repository,s=p.eslintConfig,i=p.stylelint;programInfo.author="string"==typeof t?{name:t}:t,programInfo.repository="string"==typeof t?{url:a}:a,programInfo.description=n,hasEslintConfig=!!s,hasStylelintConfig=!!i}
@@ -1 +0,0 @@
1
- import*as e from"fs";import{CachedInputFileSystem as s,ResolverFactory as o}from"enhanced-resolve";var n=o.createResolver({fileSystem:new s(e,4e3),conditionNames:["node"],extensions:[".js",".json",".node"],useSyncFileSystemCalls:!0,mainFields:["esm","module","main"]});export default n;
package/build/seo.js DELETED
@@ -1 +0,0 @@
1
- import{existsSync as t,mkdirSync as o,writeFile as r,readdirSync as e,statSync as m}from"fs";import{join as i}from"path";import{CONFIG as n}from"./common";import{APPTYPE as a,PROGRAMPATH as p}from"./process-env";import{resolveProgramPath as s}from"./utils";import{outputConfig as c}from"./webpack.common";export var seo=function(){var f=n.seo||{},u=f.domain,l=f.nojekyll,h=f.path;if(u){var v=h&&s(h)||(null==c?void 0:c.path)||process.cwd(),d=function(t){if(t)throw t};t(v)||o(v),r(i(v,"CNAME"),u,"utf-8",d),r(i(v,"robots"),"Sitemap: https://"+u+n.routeBaseName+"sitemap.txt","utf-8",d);var E="";"library"===a&&(E=(function t(o,r,i){var n=[];return e(o).forEach(function(e){if("static"===e)return!1;var a=o+"/"+e,s=m(a);s&&s.isDirectory()?n=n.concat(t(a,r,i)):a.endsWith("README.mdx")&&n.push("https://"+r+i+a.replace(p+"/components/","").replace("/README.mdx",""))}),n})(i(p,"./components"),u,n.routeBaseName).join("\n")),r(i(v,"sitemap.txt"),E,"utf-8",d),l&&r(i(v,".nojekyll"),"","utf-8",d)}};
package/build/swcrc.js DELETED
@@ -1 +0,0 @@
1
- import{merge as e}from"webpack-merge";import{CONFIG as o}from"./common";import r from"./envFlags";var t={env:{targets:["last 2 version","> 0.5%","ie 11","not dead"],mode:"entry",coreJs:"3"}};export var swcMinifyOption={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};export default function(s){void 0===s&&(s=!1);var n=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:s,development:s},constModules:{globals:{"env-flags":r}},optimizer:{simplify:!1}},experimental:{plugins:[["swc-plugin-another-transform-imports",function(e){for(var o=0,r=Object.keys(e),t=r.length;o<t;o++)e[r[o]].transform=r[o]+"/"+e[r[o]].transform,e[r[o]].style&&(e[r[o]].style=r[o]+"/"+e[r[o]].style);return e}(o.importOnDemand||{})]]}},sourceMaps:!0,parseMap:!0},!s&&t);return o.swcrc&&(n=e(n,"function"==typeof o.swcrc?o.swcrc(s):o.swcrc)),n};
@@ -1 +0,0 @@
1
- import fs from"fs";import transformerFactory from"ts-import-plugin";import merge from"webpack-merge";import{CONFIG}from"./common";import{tfc,isFunction,resolveProgramPath}from"./utils";var importOnDemand=[];Array.isArray(CONFIG.importOnDemand)&&Object.assign(importOnDemand,CONFIG.importOnDemand.map(function(r){return transformerFactory(r)}));var beforeTransformers=[].concat(importOnDemand),tsLoaderConfig={transpileOnly:!0,getCustomTransformers:function(){return{before:beforeTransformers}}};try{var customTsloaderConfigPath=resolveProgramPath("tsloader.config.ts");fs.accessSync(customTsloaderConfigPath,fs.constants.R_OK);var customTsloaderConfig=eval(tfc(customTsloaderConfigPath)).default;tsLoaderConfig=merge(tsLoaderConfig,isFunction(customTsloaderConfig)?customTsloaderConfig(process):customTsloaderConfig)}catch(error){}export default tsLoaderConfig;
package/build/utils.js DELETED
@@ -1 +0,0 @@
1
- function _type_of(r){return r&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":typeof r}import{networkInterfaces}from"os";import path from"path";import{transformFileSync}from"@swc/core";import resolverSync from"./resolver-sync";var swcOption={inputSourceMap:!1,sourceMaps:!1,module:{type:"commonjs"},jsc:{parser:{syntax:"typescript"},loose:!1}};export var tfc=function(filepath){var out=transformFileSync(filepath,swcOption).code||"{}";try{return eval(out)}catch(error){return out}};export function toUpperCaseString(r){return null==r?void 0:r.replace(/\b\w/g,function(r){return r.toUpperCase()}).replace(/\./g," ")}export function getIPAdress(){var r=networkInterfaces();for(var e in r)if(Object.prototype.hasOwnProperty.call(r,e))for(var o=r[e],t=0;t<o.length;t++){var n=o[t];if("IPv4"===n.family&&"127.0.0.1"!==n.address&&!n.address.startsWith("169.254")&&!n.internal)return n.address}}export function resolveProgramPath(r){return path.resolve(process.cwd(),"./"+r)}export var resolveNodeModulesPath=function(r){return resolveProgramPath("node_modules/"+r)};export var resolve=function(r){return resolverSync.resolveSync({},process.cwd(),r)||r};var funcTag="[object Function]",asyncTag="[object AsyncFunction]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";export function isObject(r){var e=void 0===r?"undefined":_type_of(r);return null!==r&&("object"==e||"function"==e)}export function isFunction(r){if(!isObject(r))return!1;var e=Object.prototype.toString.call(r);return e==funcTag||e==asyncTag||e==genTag||e==proxyTag}
@@ -1 +0,0 @@
1
- function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function n(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(e,n){if(e){if("string"==typeof e)return t(e,n);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 t(e,n)}}(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.")}()}import r from"fs";import{join as o}from"path";import s from"url";import i from"add-asset-html-webpack-plugin";import l from"html-webpack-plugin";import{DefinePlugin as a,WatchIgnorePlugin as p,SourceMapDevToolPlugin as u,AutomaticPrefetchPlugin as c}from"webpack";import m from"webpackbar";import{CONFIG as f,ENTRYPATH as d,PUBLICPATH as y}from"./common";import g from"./done";import h from"./envFlags";import b from"./html-add-entry-attr";import j from"./html-plugin-option";import{moduleFederation as w}from"./module-federation";import x from"./module.config";import{APPTYPE as v,DEV as k,hasEslintConfig as O,hasStylelintConfig as A,PACKAGENAME as C,PROGRAMPATH as S}from"./process-env";import{seo as T}from"./seo";import{resolveProgramPath as B}from"./utils";for(var L,K,M=[".eslintrc.js",".eslintrc.json",".eslintrc.yaml",".eslintrc.json"],P=[".stylelintrc",".stylelintrc.json",".stylelintrc.yaml",".stylelintrc.yml",".stylelintrc.js","stylelint.config.js","stylelint.config.cjs"],R=r.readdirSync(S),F=!1,I=!1,U=0,$=R.length;U<$;U++)P.includes(R[U])&&(I=!0),M.includes(R[U])&&(F=!0);F||(F=O),I||(I=A);var q=I?require("stylelint-webpack-plugin"):null,E=F?require("eslint-webpack-plugin"):null,W={"@":B("src")};Object.assign(W,f.alias),"library"===v&&Object.assign(W,((L={"@":B("site"),"@pkg":B("components")})[C]=B("components"),L));var _=f.assetHtml.map(function(t){return e({publicPath:""},t)});export var outputConfig={path:B("library"===v?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:"js/[name].chunk.js",assetModuleFilename:"assets/[name].[hash][ext]",library:C,libraryTarget:"window",globalObject:"window",chunkLoadingGlobal:"webpackJsonp_"+C,pathinfo:!1,clean:!0,publicPath:y};var G=s.fileURLToPath(new URL(".",import.meta.url)),H=o(G,"../lib/packages/"+d[v]+"/index.js");"single-component"===v&&(Object.assign(W,((K={})[C]=B("umd"),K)),H=B(k?"example/index.ts":"src/index.ts"),outputConfig.path=B(k?"dist":"umd"),outputConfig.filename="index.js",outputConfig.library=C,outputConfig.libraryTarget="umd",outputConfig.libraryExport="default");var J={main:H};f.entry&&("string"==typeof f.entry?J=f.entry:Object.keys(f.entry)&&Object.assign(J,f.entry)),f.output&&("string"==typeof f.output?outputConfig.path=f.output:Object.keys(f.output)&&Object.assign(outputConfig,f.output));var N=f.routeBaseName.split("/").filter(Boolean).length,z=Array(N).fill("..").join("/")+(N?"/":"")+"404.html",D=f.fixBrowserRouter||{},Q=D.pathSegmentsToKeep,V=void 0===Q?N:Q,X=D.path,Y={entry:J,stats:"errors-only",infrastructureLogging:{level:"none"},target:"web",plugins:[new c].concat(n(w),[E&&new E({threads:!0,extensions:["js","md","mdx","cjs","ejs","mjs","jsx","ts","tsx","json","html","coffee","vue"]}),q&&new q({fix:!0,threads:!0,extensions:["css","scss","sass","less","ts","tsx","js","jsx"],exclude:["node_modules/","es/","lib/","docs/","coverage/","dist/"]}),new l(j),f.fixBrowserRouter&&new l({filename:void 0===X?z:X,inject:!1,templateContent:function(){return"<html html><head><title>"+j.title+"</title><script>var pathSegmentsToKeep = "+(V||N)+";var l = window.location;l.replace(l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') + l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' + l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') + (l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') + l.hash);</script></head><body></body></html>"}}),new i(_),"single-spa"===v&&new b(function(t){return!!(t.match(/main\.(.*)\.bundle.js$/)||t.match("main.bundle.js"))}),new a(h),new p({paths:[/\.d\.ts$/]}),f.sourceMap&&new u(f.sourceMap),new m({name:"编译中",color:"#6f42c1"}),new g({done:function(){!k&&f.seo&&T(),null==f.done||f.done()}})],n(f.plugins)).filter(Boolean),experiments:{topLevelAwait:!0,syncWebAssembly:!0,asyncWebAssembly:!0},resolve:{extensions:[".tsx",".ts",".js",".jsx"],alias:W,fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},module:x,externals:f.externals,output:outputConfig};export default Y;
@@ -1 +0,0 @@
1
- import e from"@soda/friendly-errors-webpack-plugin";import r from"chalk";import{getPort as o}from"portfinder";import{HotModuleReplacementPlugin as t}from"webpack";import{merge as n}from"webpack-merge";import{CONFIG as p}from"./common";import{hasPkg as i}from"./has-pkg";import{hasReact as s}from"./process-env";import{getIPAdress as a,resolveProgramPath as l}from"./utils";import c from"./webpack.common";var m=i("@moneko/mock"),d=m?require("@moneko/mock").default:null,v=s?require("@pmmmwh/react-refresh-webpack-plugin").default:null,u=!1;p.cacheDirectory&&(u={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:p.cacheDirectory});var f=!1===p.devtool||p.devtool?p.devtool:"eval-cheap-module-source-map",h=new Promise(function(i){o({port:p.devServer.port,stopPort:9999},function(o,h){var w=[];p.devServer.port!==h&&w.push("Port "+r.yellow(p.devServer.port)+" is in use, trying "+r.green(h)+" instead"),p.devServer.port=h;var g="/"===p.routeBaseName,k=p.devServer.https?"https:":"http:",y=g?"":p.routeBaseName,S=n(c,{devtool:f,mode:"development",cache:u,devServer:{headers:{"Access-Control-Allow-Origin":"*"},compress:p.devServer.compress,host:"0.0.0.0",port:h,historyApiFallback:g||{index:y,disableDotRule:!0},https:p.devServer.https,proxy:p.proxy,allowedHosts:p.devServer.allowedHosts,client:{progress:!1,logging:"info",overlay:!1},static:{watch:{ignored:function(e){return e.endsWith(".d.ts")}}},setupMiddlewares:function(e,r){if(!r)throw Error("webpack-dev-server is not defined");return r.app&&m&&d(r.app,l("mock/")),e},open:!1,hot:!0},plugins:[new t,s&&new v,new e({compilationSuccessInfo:{messages:["You application is running here:\n\n local: "+r.cyan(k+"//"+p.devServer.host+":"+h+y)+"\n network: "+r.cyan(k+"//"+a()+":"+h+y)],notes:w},clearConsole:!0})].filter(Boolean)});i(S)})});export default h;
@@ -1,3 +0,0 @@
1
- import type { Configuration } from 'webpack';
2
- declare const _default: Configuration;
3
- export default _default;
@@ -1 +0,0 @@
1
- import e,{cssnanoMinify as i,swcMinify as n}from"css-minimizer-webpack-plugin";import o from"mini-css-extract-plugin";import m from"terser-webpack-plugin";import{optimize as r}from"webpack";import{BundleAnalyzerPlugin as l}from"webpack-bundle-analyzer";import{merge as t}from"webpack-merge";import{CONFIG as s}from"./common";import{getMinifyOption as c}from"./minify";import p from"./webpack.common";var u,a,d,f,k="swc"===s.compiler?"swc":"terser",h="swc"===s.compiler?"swc":"cssnano",w={splitChunks:s.splitChunk,runtimeChunk:s.runtimeChunk,chunkIds:"named",moduleIds:"named",removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,minimize:!0,minimizer:[new m(c((null==(u=s.minifier.js)?void 0:u.type)||k,null==(a=s.minifier.js)?void 0:a.options)),new e({minify:{swc:n,cssnano:i}[(null==(d=s.minifier.css)?void 0:d.type)||h],minimizerOptions:null==(f=s.minifier.css)?void 0:f.options})]},y=!1;s.cacheDirectory&&(y={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:s.cacheDirectory});export default t(p,{devtool:!1===s.devtool||s.devtool?s.devtool:"cheap-module-source-map",mode:"production",cache:y,optimization:w,plugins:[new o({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",experimentalUseImportModule:!0}),s.bundleAnalyzer&&new l(s.bundleAnalyzer),s.splitChunk&&new r.MinChunkSizePlugin({minChunkSize:1e4})].filter(Boolean)});
@@ -1 +0,0 @@
1
- var n,a=null==(n=JSON.parse(process.env.npm_config_argv||"{}"))?void 0:n.original,r={};null==a||a.forEach(function(n){var a,i=n.split("=");Object.assign(r,((a={})[i[0]]=i[1]||!0,a))});export default r;
package/lib/normalize.css DELETED
@@ -1,254 +0,0 @@
1
- @import url('tailwindcss/utilities');
2
-
3
- html,
4
- body {
5
- margin: 0;
6
- padding: 0;
7
- inline-size: 100vi;
8
- font-size: var(--font-size, 14px);
9
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
10
- Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
11
- 'Noto Color Emoji', Helvetica, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans';
12
- color: var(--text-color, rgb(0 0 0 / 65%));
13
- line-height: 1.8;
14
- transition-duration: var(--transition-duration, 0.3s);
15
- transition-property: background-color, color;
16
- transition-timing-function: var(--transition-timing-function, cubic-bezier(0.94, -0.1, 0.1, 1.2));
17
- }
18
-
19
- #root {
20
- display: flex;
21
- -webkit-overflow-scrolling: touch;
22
- }
23
-
24
- #root > main {
25
- animation: route-in var(--transition-duration, 0.3s);
26
- }
27
-
28
- input,
29
- textarea {
30
- caret-color: inherit;
31
- }
32
-
33
- h1 {
34
- margin: 0.67em 0;
35
- font-size: 2em;
36
- }
37
-
38
- hr {
39
- overflow: visible;
40
- block-size: 0;
41
- box-sizing: content-box;
42
- }
43
-
44
- pre {
45
- font-size: 1em;
46
- font-family: monospace;
47
- }
48
-
49
- a {
50
- text-decoration: none;
51
- background-color: transparent;
52
- cursor: pointer;
53
- }
54
-
55
- abbr[title] {
56
- border-block-end: none;
57
- text-decoration: underline;
58
- text-decoration: underline dotted;
59
- }
60
-
61
- b,
62
- strong {
63
- font-weight: bolder;
64
- }
65
-
66
- code,
67
- kbd,
68
- samp {
69
- font-size: 1em;
70
- font-family: monospace;
71
- }
72
-
73
- small {
74
- font-size: 80%;
75
- }
76
-
77
- sub,
78
- sup {
79
- position: relative;
80
- font-size: 75%;
81
- line-height: 0;
82
- vertical-align: baseline;
83
- }
84
-
85
- sub {
86
- inset-block-end: -0.25em;
87
- }
88
-
89
- sup {
90
- inset-block-start: -0.5em;
91
- }
92
-
93
- img {
94
- border-style: none;
95
- }
96
-
97
- img,
98
- button {
99
- outline: 1px solid transparent;
100
- }
101
-
102
- button,
103
- input,
104
- optgroup,
105
- select,
106
- textarea {
107
- margin: 0;
108
- font-size: 100%;
109
- font-family: inherit;
110
- line-height: 1.15;
111
- }
112
-
113
- button,
114
- input {
115
- overflow: visible;
116
- }
117
-
118
- button,
119
- select {
120
- text-transform: none;
121
- }
122
-
123
- button,
124
- [type='button'],
125
- [type='reset'],
126
- [type='submit'] {
127
- appearance: button;
128
- }
129
-
130
- button::-moz-focus-inner,
131
- [type='button']::-moz-focus-inner,
132
- [type='reset']::-moz-focus-inner,
133
- [type='submit']::-moz-focus-inner {
134
- border-style: none;
135
- padding: 0;
136
- }
137
-
138
- button:-moz-focusring,
139
- [type='button']:-moz-focusring,
140
- [type='reset']:-moz-focusring,
141
- [type='submit']:-moz-focusring {
142
- outline: 1px dotted var(--primary-outline);
143
- }
144
-
145
- fieldset {
146
- padding: 0.35em 0.75em 0.625em;
147
- }
148
-
149
- legend {
150
- display: table;
151
- padding: 0;
152
- max-inline-size: 100%;
153
- white-space: normal;
154
- color: inherit;
155
- box-sizing: border-box;
156
- }
157
-
158
- progress {
159
- vertical-align: baseline;
160
- }
161
-
162
- textarea {
163
- overflow: auto;
164
- }
165
-
166
- details {
167
- display: block;
168
- }
169
-
170
- summary {
171
- display: list-item;
172
- }
173
-
174
- template,
175
- [hidden] {
176
- display: none;
177
- }
178
-
179
- [type='checkbox'],
180
- [type='radio'] {
181
- box-sizing: border-box;
182
- padding: 0;
183
- }
184
-
185
- [type='number']::-webkit-inner-spin-button,
186
- [type='number']::-webkit-outer-spin-button {
187
- block-size: auto;
188
- }
189
-
190
- [type='search'] {
191
- appearance: textfield;
192
- outline-offset: -2px;
193
- }
194
-
195
- [type='search']::-webkit-search-decoration {
196
- appearance: none;
197
- }
198
-
199
- ::-webkit-file-upload-button {
200
- appearance: button;
201
- font: inherit;
202
- }
203
-
204
- ::-webkit-scrollbar {
205
- inline-size: 4px;
206
- block-size: 4px;
207
- }
208
-
209
- ::-webkit-scrollbar-track,
210
- ::-webkit-scrollbar-thumb {
211
- border-radius: 5px;
212
- background-color: transparent;
213
- }
214
-
215
- :hover::-webkit-scrollbar-thumb {
216
- background-color: var(--primary-selection);
217
- }
218
-
219
- ::-webkit-scrollbar-thumb:hover {
220
- background-color: var(--primary-hover);
221
- }
222
-
223
- ::-webkit-scrollbar-thumb:active {
224
- background-color: var(--primary-active);
225
- }
226
-
227
- ::-webkit-scrollbar-button {
228
- display: none;
229
- }
230
-
231
- @keyframes route-in {
232
- from {
233
- transform: translate3d(0, 16px, 0);
234
- opacity: 0;
235
- }
236
-
237
- to {
238
- transform: translate3d(0, 0, 0);
239
- opacity: 1;
240
- }
241
- }
242
-
243
- @keyframes route-out {
244
- from {
245
- transform: translate3d(0, 0, 0);
246
- opacity: 1;
247
- }
248
-
249
- to {
250
- z-index: -1;
251
- transform: translate3d(0, 1rem, 0);
252
- opacity: 0;
253
- }
254
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- import{isFunction as o}from"@moneko/common";import{Router as n}from"@solidjs/router";import{render as t}from"solid-js/web";import r from"@/index";var e=APPENTRY?require(APPENTRY):null,u=document.getElementById("root");e&&o(e.bootstrap)&&(null==e.bootstrap||e.bootstrap());var m=function(){return React.createElement(n,null,React.createElement(r,null))};window.rootInstance={unmount:function(){return null},render:function(){window.rootInstance.unmount=t(m,u)}},window.rootInstance.render(m),e&&o(e.mount)&&(null==e.mount||e.mount());
@@ -1,4 +0,0 @@
1
- import '../../refresh-rem';
2
- import '../../normalize.css';
3
- declare const bootstrap: typeof import("./bootstrap");
4
- export default bootstrap;
@@ -1 +0,0 @@
1
- import"../../refresh-rem";import"../../normalize.css";var r=await import("./bootstrap");export default r;
File without changes
@@ -1 +0,0 @@
1
- !function(o,n){var t=function(){var n=o.documentElement,t=n.clientWidth||o.body.clientWidth,e=t<=375?375:programInfo.designSize,i=t;i=t<=375?t:t<=programInfo.designSize?e:t;var l=16/e*i+"px";l!==n.style.fontSize&&(n.style.fontSize=l)};t(),"addEventListener"in o&&n.addEventListener("orientationchange"in n?"orientationchange":"resize",t,!1),window.scrollTo||(window.scrollTo=function(o){window.scrollLeft=o.left,window.scrollTop=o.top}),document.body.scrollTo||(Element.prototype.scrollTo=function(o){this.scrollLeft=o.left,this.scrollTop=o.top})}(document,window);
@@ -1,51 +0,0 @@
1
- type Any = any;
2
- type MDXComponents = Record<string, Any>;
3
- export interface RouterProps {
4
- /** 菜单id */
5
- key: string;
6
- alive?: boolean;
7
- /** 菜单图标 */
8
- icon?: string;
9
- dynamicTitle?: string;
10
- /** 菜单名 */
11
- i18n?: string | null;
12
- hideMenu?: boolean;
13
- hideTabs?: boolean;
14
- onlyLogin?: boolean;
15
- /** 菜单父id */
16
- parentId?: string;
17
- root?: boolean;
18
- path?: string;
19
- element?: Any;
20
- fallback?: Any;
21
- /** 可否关闭标签 */
22
- closable?: boolean;
23
- /** 子菜单 */
24
- children?: RouterProps[];
25
- props?: {
26
- path: string;
27
- components?: MDXComponents;
28
- [key: string]: Any;
29
- };
30
- }
31
- export declare function lazyImport(filePath: string): Promise<unknown>;
32
- export interface ExampleModule {
33
- code: string;
34
- title?: string;
35
- description?: string | null;
36
- noInline: boolean;
37
- language: never;
38
- }
39
- export type MyPkg = RouterProps & {
40
- type: string;
41
- title: string;
42
- subtitle?: string;
43
- icon?: string;
44
- };
45
- export declare const myPkgs: MyPkg[];
46
- export declare const myDemoKv: Record<string, ExampleModule[]>;
47
- export declare const mdxComponents: MDXComponents;
48
- export declare const onlyLoginRouter: RouterProps[];
49
- export declare const router: RouterProps[];
50
- export declare function matchUtil(pathname: string): RouterProps;
51
- export {};
@@ -1 +0,0 @@
1
- function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n<r;n++)t[n]=e[n];return t}function r(){return(r=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{isUndefined as n}from"@moneko/common";import{pathToRegexp as t}from"path-to-regexp";export function lazyImport(e){return new Promise(function(r){return import("@/pages/"+e.replace(/:/g,"$").replace(/^\//,"")).then(r).catch(function(){return Promise.resolve({default:null})})})}export var myPkgs=[];export var myDemoKv={};export var mdxComponents={};if("library"===APPTYPE){var o,i,a=require.context("@pkg/",!0,/README\.mdx?$/),l={};try{l=require("@/components/components").default}catch(e){}Object.assign(mdxComponents,r({},l)),null==(o=a.keys())||o.forEach(function(e){var n=e.substring(2).split("/").slice(0,-1).join("/"),t=a(e),o=t.basic,i=t.default;myPkgs.push(r({key:n,path:n,element:i},o,{props:{components:mdxComponents,path:n}}))});var u=require.context("@pkg/",!0,/\/examples\/(.+)\.mdx$/);null==(i=u.keys())||i.forEach(function(r){var n=r.substring(2).split("/"),t=n[0];Array.isArray(myDemoKv[t])||(myDemoKv[t]=[]);for(var o,i,a=u(r),l=a.matchAll(/```([^\r\n]+)?\r?\n([\s\S]*?)\r?\n```/g),c="",p="",s=null,h=function(r,n){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=function(r,n){if(r){if("string"==typeof r)return e(r,n);var t=Object.prototype.toString.call(r).slice(8,-1);if("Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e(r,n)}}(r))){t&&(r=t);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(l);!(i=h()).done;){var y=i.value;p=y[1]||"tsx",c=y[2],s=a.replace(y[0],"")}myDemoKv[t].push({language:p,code:c,description:s,title:null==(o=n.pop())?void 0:o.replace(/\.mdx$/,""),noInline:/render\([^\\)]*\);?(?=\s*$)/.test(c)})})}var c=[];try{c=require("@/router").default}catch(e){console.info("自定义路由请在 router 目录下新建 index.ts, 类型: RouterProps[]",e)}function p(e,r){return["*"===r&&"*"!==e?void 0:r,e].filter(Boolean).join("/")}var s=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 h(e,n,t){return void 0===e&&(e=[]),e.map(function(e){var o=r({},e);return void 0===o.key&&(o.key=p(e.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?h(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(c),f=0,d=s.length;f<d;f++)!function e(t,o,i){var a,l=t.find(function(e){return e.path===o.path});l?(l.key=p(l.path,i),n(l.i18n)&&(l.i18n="route-"+l.key),n(l.alive)&&(l.alive=!1),n(l.element)&&o.element&&(l.element=o.element,l.props=o.props),n(l.hideMenu)&&(l.hideMenu="*"===l.path||l.key.includes(":")),Object.assign(l,r({},o,l)),o.children&&(!l.children&&Array.isArray(o.children)&&(l.children=o.children),null==(a=o.children)||a.forEach(function(r){e(null==l?void 0:l.children,r,null==l?void 0:l.key)}))):t.push(o)}(y,s[f]);export var onlyLoginRouter=h(y,!1);export var router=h(y,!0);export function matchUtil(e){var r={key:""};return!function n(o){for(var i=0,a=o.length;i<a;i++){if(o[i].path&&"*"!==o[i].path&&o[i].key)try{if(t(o[i].key).exec(e.substring(1))){r=o[i];return}}catch(e){}Array.isArray(o[i].children)&&n(o[i].children)}}(router),r}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes