@moneko/core 3.0.0-beta.99 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app-entry.d.ts +2 -0
- package/lib/app-entry.js +1 -0
- package/lib/app.d.ts +4 -13
- package/lib/app.js +1 -1
- package/lib/common.d.ts +1 -0
- package/lib/common.js +1 -12
- package/lib/coverage.d.ts +31 -2
- package/lib/coverage.js +1 -1
- package/lib/docs.js +1 -1
- package/lib/fallback.d.ts +2 -0
- package/lib/fallback.js +1 -0
- package/lib/generate-api.js +1 -1
- package/lib/html-add-entry-attr.js +1 -1
- package/lib/html-plugin-option.js +1 -1
- package/lib/loader/css-unicode.cjs +10 -0
- package/lib/loader/frontmatter.cjs +4 -3
- package/lib/locales.d.ts +10 -0
- package/lib/locales.js +2 -0
- package/lib/merge-router.d.ts +2 -0
- package/lib/merge-router.js +1 -0
- package/lib/modify-vars.d.ts +7 -0
- package/lib/modify-vars.js +1 -0
- package/lib/module-federation.js +1 -1
- package/lib/module.config.js +1 -1
- package/lib/normalize-css.d.ts +2 -0
- package/lib/normalize-css.js +1 -0
- package/lib/prefix-router.d.ts +2 -0
- package/lib/prefix-router.js +1 -0
- package/lib/process-env.d.ts +7 -21
- package/lib/process-env.js +1 -1
- package/lib/rem.d.ts +2 -0
- package/lib/rem.js +1 -0
- package/lib/routes.js +1 -1
- package/lib/seo.js +1 -1
- package/lib/utils.d.ts +6 -1
- package/lib/utils.js +1 -1
- package/lib/virtual-module-plugin.js +1 -1
- package/lib/virtual-modules.js +1 -1
- package/lib/webpack.common.d.ts +1 -3
- package/lib/webpack.common.js +1 -1
- package/lib/webpack.dev.d.ts +1 -1
- package/lib/webpack.dev.js +3 -3
- package/lib/webpack.prod.d.ts +1 -1
- package/lib/webpack.prod.js +1 -1
- package/package.json +12 -16
- package/template/index.html +1 -5
- package/typings/global.d.ts +30 -103
- package/lib/define.d.ts +0 -4
- package/lib/define.js +0 -1
- package/lib/modifyVars.d.ts +0 -2
- package/lib/modifyVars.js +0 -1
package/lib/app-entry.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{existsSync as o}from"fs";import{join as p}from"path";import{CONFIG as n}from"./common.js";import{APPTYPE as t,FRAMEWORK as r,isMicro as e}from"./process-env.js";import i from"./rem.js";import{getExportTokens as m}from"./utils.js";let s=p(n.alias["@"],"./index.ts"),_=o(s),u="",a=`const renderApp = (await import('@moneko/${r}/lib/entry.js')).default;`,l=[];if(_){let o="";e&&(l=m(s).filter(Boolean)).length&&(o=`{${l.map(o=>`${o} as app${o}`).join(",")}} from `),u=`import ${o}"@/index.ts";`}u+=`import "@app/normalize/index.css";${i}`,e?(u+="if (window.__POWERED_BY_QIANKUN__) {__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;}",a+=`if (!window.__POWERED_BY_QIANKUN__) {renderApp();}let unmountApp = void 0;export async function bootstrap() {console.log('app bootstraped');}export async function mount(props) {${l.includes("mount")?"appmount(props);":""}unmountApp = renderApp(props);}export async function unmount(props) {${l.includes("unmount")?"appunmount(props);":""}unmountApp();}`):a+="renderApp();","mobile"===t&&(a+="window.H5RemoteRuntime = {bootstrap: renderApp};");let d=`${u}${a}`;export default d;
|
package/lib/app.d.ts
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
declare const app: {
|
|
2
|
+
name: string;
|
|
3
|
+
projectName: string;
|
|
4
|
+
version: string;
|
|
2
5
|
base: string;
|
|
3
|
-
|
|
6
|
+
type: import("./index.js").AppType;
|
|
4
7
|
routerMode: "browser" | "hash" | "memory";
|
|
5
|
-
mode: "csr" | "ssr";
|
|
6
|
-
locales: boolean;
|
|
7
|
-
favicon: string | false | undefined;
|
|
8
8
|
prefixCls: string | undefined;
|
|
9
9
|
theme: import("./index.js").Theme | undefined;
|
|
10
|
-
type: import("./index.js").AppType;
|
|
11
|
-
persist: boolean;
|
|
12
|
-
projectName: string;
|
|
13
|
-
iconfont: {
|
|
14
|
-
scriptUrl?: string | string[] | undefined;
|
|
15
|
-
extraCommonProps?: Record<string, any> | undefined;
|
|
16
|
-
} | undefined;
|
|
17
|
-
name: string;
|
|
18
|
-
version: string;
|
|
19
10
|
description: string | undefined;
|
|
20
11
|
author: {
|
|
21
12
|
name: string | undefined;
|
package/lib/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{readFileSync as e}from"fs";import{CONFIG as r}from"./common.js";import{APPTYPE as o,PACKAGENAME as p,PACKAGEVERSION as s}from"./process-env.js";import{resolveProgramPath as t,toUpperCaseString as a}from"./utils.js";let n={name:p,projectName:JSON.stringify(a(p).replace(/-/g," ")),version:s,base:r.basename,type:o,routerMode:r.routerMode,prefixCls:r.prefixCls,theme:r.theme,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 r=e(t("package.json"),{encoding:"utf-8"}),{description:o,author:p,repository:s}=JSON.parse(r);n.author="string"==typeof p?{name:p}:p,n.repository="string"==typeof p?{url:s}:s,n.description=o}export default n;
|
package/lib/common.d.ts
CHANGED
package/lib/common.js
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import e from"fs";import
|
|
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=f;export const PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG,log};
|
|
1
|
+
import{accessSync as e,constants as t}from"fs";import{join as o}from"path";import s from"readline";import r from"chalk";import{merge as i}from"webpack-merge";import{APPTYPE as n,CUSTOMCONFIG as a,FRAMEWORK as l,PACKAGENAME as c,PROGRAMPATH as m,jsxImportSource as p,pkgName as u}from"./process-env.js";import{isFunction as d,readConf as h,resolveProgramPath as f}from"./utils.js";export const ENTRYPATH={mobile:"mobile",site:"site",backstage:"backstage",micro:"micro",library:"library"};let g=["@moneko/core",`@moneko/${l}`,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design","@app"],x={library:{"@":f("site"),"@pkg":f("components"),[c]:f("components")},mobile:{},site:{},backstage:{},micro:{}},b={seo:!1,mode:"csr",compiler:"swc",bundleAnalyzer:!1,entry:{},minifier:{js:{},css:{}},sourceMap:{filename:"[file].map",publicPath:""},env:{},basename:"/",publicPath:"/",rem:{designSize:"mobile"===n?375:1680},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:Object.assign({"@":f("src")},x[n]),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/${u}/template/index.html`,favicon:`./node_modules/${u}/template/favicon.ico`,tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],splitChunk:{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"}}},runtimeChunk:"single",moduleFederation:[],rulesInclude:{less:g,css:g,js:g,media:g,fonts:g},mdx:{jsxImportSource:p,useDynamicImport:!0,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"},virtualModule:{},normalizeCss:!0,externalsPresets:{}};export const log=e=>{s.cursorTo(process.stdout,0),process.stdout.write(e)};let y=b,C=null,w={},k={};try{C=o(m,"./config/index.ts"),e(C,t.R_OK)}catch(e){C=null}if(C)try{let e=(await h(C,"index")).default;w=d(e)?e(process):e}catch(e){process.stdout.write(r.red(e))}if(a){let s=null;try{s=o(m,`./config/${a}.ts`),e(s,t.R_OK)}catch(e){s=null}if(null!==s)try{let e=(await h(s,a)).default;k=d(e)?e(process):e}catch(e){process.stdout.write(r.red(e))}}"tsc"===(y=i(y,w,k)).compiler&&y.minifier&&(y.minifier.js||Object.assign(y.minifier,{js:{type:"terser"}}),y.minifier.css||Object.assign(y.minifier,{css:{type:"cssnano"}})),!1===y.devtool&&(y.sourceMap=!1),!1===y.sourceMap&&(y.devtool=!1),y.fixBrowserRouter&&y.htmlPluginOption&&(y.htmlPluginOption.tags||(y.htmlPluginOption.tags=[]),y.htmlPluginOption.tags.push({textContent:'!function(n){var a=location.search.slice(1);if("/"===a[0]){for(var o=[],c=decodeURIComponent(a).split("&"),e=0,t=c.length;e<t;e++)o.push(c[e].replace(/~and~/g,"&"));var l=o.join("&");l!==a&&window.history.replaceState(null,null,"".concat(n.pathname.slice(0,-1),"?").concat(l).concat(n.hash))}}(window.location);'}));export const CONFIG=y;export const PUBLICPATH=CONFIG.publicPath||"/";export let hasCustomRouter=!1;try{e(o(CONFIG.alias["@"],"./router/index.ts"),t.R_OK),hasCustomRouter=!0}catch(e){hasCustomRouter=!1}global.NEKOCLICONFIG={CONFIG,log};
|
package/lib/coverage.d.ts
CHANGED
|
@@ -1,2 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type CoverageType = {
|
|
2
|
+
/** 语句(statement coverage) */
|
|
3
|
+
statements: string;
|
|
4
|
+
/** 语句覆盖: 是不是每个语句都执行了 */
|
|
5
|
+
coveredstatements: string;
|
|
6
|
+
/** 条件(branch coverage) */
|
|
7
|
+
conditionals: string;
|
|
8
|
+
/** 条件覆盖: 是不是每个条件代码块都执行了 */
|
|
9
|
+
coveredconditionals: string;
|
|
10
|
+
/** 函数(function coverage) */
|
|
11
|
+
methods: string;
|
|
12
|
+
/** 函数覆盖: 是不是每个函数都调用了 */
|
|
13
|
+
coveredmethods: string;
|
|
14
|
+
};
|
|
15
|
+
type ProjectCoverageType = {
|
|
16
|
+
/** 元素 */
|
|
17
|
+
elements: string;
|
|
18
|
+
/** 覆盖元素 */
|
|
19
|
+
coveredelements: string;
|
|
20
|
+
complexity: string;
|
|
21
|
+
loc: string;
|
|
22
|
+
ncloc: string;
|
|
23
|
+
/** 经过测试的组件 */
|
|
24
|
+
packages: string;
|
|
25
|
+
/** 经过测试的文件 */
|
|
26
|
+
files: string;
|
|
27
|
+
/** 经过测试的类 */
|
|
28
|
+
classes: string;
|
|
29
|
+
};
|
|
30
|
+
export declare const coverage: Record<string, CoverageType & ProjectCoverageType>;
|
|
31
|
+
export {};
|
package/lib/coverage.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{accessSync as e,constants as r,readFileSync 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
|
|
1
|
+
import{accessSync as e,constants as r,readFileSync as c}from"fs";import{join as o}from"path";import{Parser as t}from"xml2js";import{PACKAGENAME as a,PROGRAMPATH as i,isLibrary as s}from"./process-env.js";export const coverage={};if(s)try{let s=o(i,"./coverage/clover.xml");e(s,r.R_OK);let m=new t({explicitArray:!1,async:!1}),p=c(s,{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/docs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{statSync as e}from"fs";import{dirname as t,join as o}from"path";import{watch as r}from"chokidar";import n from"./generate-api.js";import s from"./object-listener.js";import{
|
|
1
|
+
import{statSync as e}from"fs";import{dirname as t,join as o}from"path";import{watch as r}from"chokidar";import{CONFIG as n}from"./common.js";import i from"./generate-api.js";import s from"./object-listener.js";import{FRAMEWORK as p,FRAMEWORKNAME as l,createElement as a,isLibrary as c,isReact as d,isSolid as m}from"./process-env.js";import{resolveProgramPath as f}from"./utils.js";let u="@app/comment";export const docs=s({});let $={[u]:{}},g=`() => ${a}(SuspenseComp, { comp: $1 })`,b=`import { ${a}${m?",Dynamic":""} } from "${l}${m?"/web":""}";import SuspenseComp from "@app/suspense";`;function h(e,r){let s=e.replace(RegExp(`^${n.alias["@pkg"]}`),""),p=t(s).replace(/^\//,""),l=[u,p].join("/"),c=s.split("/").pop()?.replace(/\.tsx?/,".md");if(!c)return;$[u][p]||($[u][p]={});let f=o(l,c);if("deleted"===r)$[u][p][c]&&delete $[u][p][c];else{let t=i(e);$[f]=t,t?$[u][p][c]=`rr(() => import(/* webpackChunkName: '${f}' */'${f}?raw').then((res) => ({default: ${d?"() =>":""}${a}(${m?"Dynamic":"'n-md'"}, {text: res.default, ${m?"component: 'n-md', ":""}css: 'table td a {display:inline-flex;align-items:center;gap:2px;}table td a n-img{display:inline-block;overflow:hidden;border-radius:var(--border-radius);inline-size:18px;block-size:18px;}'})})))rr`:$[u][p][c]&&delete $[u][p][c]}let h={};for(let e in $[u])Object.prototype.hasOwnProperty.call($[u],e)&&(h[e]=Object.values($[u][e]));let x={...$};delete x[u],Object.assign(docs.data,{...x,"@app/docs":`${b}export default ${JSON.stringify(h).replace(/"rr\((.+?)\)rr"/g,g)}`})}["react","solid"].includes(p)||(g="$1",b=""),c&&function(){let t=[],o=r(f("components"),{ignored:[/(^|[\\/\\])\../,/(^|[\\/\\])__tests__([\\/\\]|$)/],persistent:!0,ignoreInitial:!1});function n(t){return/\.tsx?$/.test(t)&&e(t).isFile()}o.on("add",e=>{n(e)&&(h(e,"added"),t.push(e))}),o.on("change",e=>{n(e)&&h(e,"change")}),o.on("unlink",e=>{n(e)&&(h(e,"deleted"),t.splice(t.indexOf(e),1))}),o.on("ready",()=>{t.forEach(e=>{h(e,"change")})}),process.on("SIGINT",function(){o.close()})}();
|
package/lib/fallback.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CONFIG as l}from"./common.js";let a="export default null";l.fallbackCompPath&&(a=`import Fallback from "${l.fallbackCompPath}";export default Fallback;`);export default a;
|
package/lib/generate-api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFileSync as e}from"fs";import{dirname as t}from"path";import n from"typescript";import{CONFIG as r}from"./common.js";
|
|
1
|
+
import{readFileSync as e}from"fs";import{dirname as t}from"path";import n from"typescript";import{CONFIG as r}from"./common.js";let{ScriptKind:l,ScriptTarget:o,SyntaxKind:i,createSourceFile:a,forEachChild:c,getLeadingCommentRanges:u,isInterfaceDeclaration:s,isQuestionToken:f,isPropertySignature:m,isFunctionTypeNode:p,isUnionTypeNode:$,isMethodSignature:g}=n,h={};function b(e){let t=u(e.getSourceFile().text,e.pos);if(t){let n=e.getSourceFile().text.substring(t[0].pos,t[0].end),r=n.match(/\/\*\*([\s\S]*?)\*\//);if(r){let e=r[1].replace(/^\s*\* ?/gm,"").replace(/\s+$/,"").trim();return e}}return null}function d(e){if(!e)return null;let t=e.match(/@since\s+([^\n]+)/);return t?t[1].trim():null}function y(e){if(!e)return null;let t=e.match(/@author (\w+)\s*(?:<([^>]+)>)?/);if(t?.length){let e=t[1].trim(),n=t[2]?.trim(),r=/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(n);return n?r&&(n=`mailto:${n}`):n=`https://github.com/${e}`,`[${e}](${n})`}return null}function x(e){if(!e)return null;let t=e.match(/@ignore\s+([^\n]+)/);return t?t[1].trim():null}let j=/(?<!['"])(unknown|any|void|bigint|object|undefined|null|boolean|number|string|symbol)(?!['"])/g;function T(e,t){if(!e)return null;let n=e.replace(/\b([A-Z][a-zA-Z0-9]*)\b/g,e=>{if(h[e]){let n=`/${[r.basename,h[e]].join("/").split("/").filter(Boolean).join("/")}`;return t?`[\\color{#009688}{${e}}](${n})`:`[${e}](${n})`}return t?`\\color{#009688}{${e}}`:e});return t&&(n=n.replace(j,e=>`\\color{#009688}{${e}}`)),n}function B(e){return(function(e){let t;if(!e)return null;let n=[];for(;t=/\\color{([^|}]*)\|?([^|}]*)\|?([^|}]*)\|?([^}]*)}{([^}]*)}/g.exec(e);)n.push(t[0]);return e.replace(/(\{|\}|\[|\]|\(|\)|=>|keyof|typeof|true|false)/g,e=>n.some(t=>t.includes(e))?e:`\\color{#569cd6}{${e}}`)})(e)?.replace(/^\s*\|\s*|\s*\|\s*$/gm,"").replace(/\n/g,"<br/>").replace(/\*/g,"\\*").replace(/\|/g,"\\|").replace(/(['"])((?:(?!\1).)*)\1/g,"\\color{#ce9178}{$1$2$1}")}function k(e){return e?e.replace(/^@[a-z].+/gm,"").replace(/(\n\s+)+/g,"<br />").replace(/\n/g,"<br />").replace(/(<br \/>)$/g,""):null}export default function w(u){let j=e(u,"utf-8"),w=a(u,j,o.Latest,!0,l.TS),E="";return c(w,e=>{s(e)?E+=function(e){let l=e.name.text;Object.assign(h,{[e.name.text]:t(e.getSourceFile().fileName).replace(r.alias["@pkg"],"")});let o=b(e),a=d(o),c=k(o),u=x(o)?.split("|")||[],s=u.includes("comment"),j=u.includes("initial"),w=u.includes("optional"),E=u.includes("version"),S=u.includes("author"),v=c?`\\color{|4||0.45}{${l}}`:l,F=(function(e){let t=[];if(e.heritageClauses){for(let r of e.heritageClauses)if(r.token===n.SyntaxKind.ExtendsKeyword)for(let e of r.types)t.push(e.getText())}return t})(e)?.map(e=>`<n-tag color="#4c81db" css=".tag{gap:0px;}">${T(B(e))}</n-tag>`),z=[c,v,a&&`\\color{#52c11b|1||0.9}{${a}}`,F.length>0&&`<sub>\`extends\`</sub> ${F.join(" ")}`].filter(Boolean).join(" "),K=`## ${z}`,N=e.members.filter(e=>m(e)&&e.type?.kind!==i.NeverKeyword||g(e)),q=[];if(N.length){N.forEach(e=>{let t=T(B(g(e)?`(${e.parameters.map(e=>`${e.name.getText()}: ${e.type?.getText()||"any"}`).join(", ")}): ${e.type?.getText()||"any"}`:e.type?.getText()||"any"),!0),n=b(e),r=B(e.name.getText());!r||r.startsWith("\\color")||(g(e)||function(e){if(e.type){if(!$(e.type))return p(e.type);for(let t of e.type.types)if(p(t))return!0}return!1}(e)||t?.includes("=>")?r=`\\color{#f9a913}{${r}}`:/^("|')(.+)("|')$/.test(r)||(r=`\\color{#4c81db}{${r}}`));let l=e.questionToken&&f(e.questionToken);q.push([r,!w&&`\\color{${l?"#f9a913":"#52c11b"}\\|\\|\\|0.9}{${l?"✘":"✔"}}`,!s&&B(k(n)),t,!j&&B(function(e){if(!e)return null;let t=e.match(/@default\s+([^\n]+)/);return t?t[1].trim():null}(n)),!E&&B(d(n)),!S&&(y(n)||y(o))])});let e=!1,t=!1,n=!1,r=!1;q.forEach(l=>{!s&&l[2]&&(r=!0),!j&&l[4]&&(n=!0),!E&&l[5]&&(t=!0),!S&&l[6]&&(e=!0)}),K+="\n";let l=["属性",!w&&"必要",r&&"说明","类型",n&&"默认值",t&&"版本",e&&"作者"].filter(Boolean).join("|");K+=`|${l}|`;let i=[":-",!w&&":-",r&&":-",":-",n&&":-",t&&":-",e&&":-"].filter(Boolean);K+="\n";let a=i.join("|");K+=`|${a}|`,q.forEach(l=>{K+="\n";let o=[l[0]||"-",!w&&(l[1]||"-"),r&&(l[2]||"-"),l[3]||"-",n&&(l[4]||"-"),t&&(l[5]||"-"),e&&(l[6]||"-")].filter(Boolean).join("|");K+=`|${o}|`}),K+="\n"}return K+="\n"}(e):n.isEnumDeclaration(e)&&(E+=function(e){let l=e.name.text,o=b(e),i=k(o),a=d(o);Object.assign(h,{[e.name.text]:t(e.getSourceFile().fileName).replace(r.alias["@pkg"],"")});let c=i?`\\color{|4||0.45}{${l}}`:l,u=[i,c,a&&`\\color{#52c11b|1||0.9}{${a}}`].filter(Boolean).join(" "),s=x(o)?.split("|")||[],f=s.includes("comment"),m=s.includes("version"),p=s.includes("author"),$=`## ${u}`;if(e.members.length){let t=[];e.members.forEach(e=>{let r=B(e.name.getText()),l=b(e),i=B(function(e){let t=e.initializer;return t&&n.isStringLiteral(t)?` '${t.text}'`:null}(e)),a=B(d(l)),c=B(k(l));!r||r.startsWith("\\color")||/^("|')(.+)("|')$/.test(r)||(r=`\\color{#4c81db}{${r}}`),t.push([r,!f&&c,i,!m&&a,!p&&(y(l)||y(o))])});let r=!1,l=!1,i=!1;t.forEach(e=>{!f&&e[1]&&(i=!0),!m&&e[3]&&(l=!0),!p&&e[4]&&(r=!0)}),$+="\n";let a=["属性",i&&"说明","值",l&&"版本",r&&"作者"].filter(Boolean).join("|");$+=`|${a}|`;let c=[":-",i&&":-",":-",l&&":-",r&&":-"].filter(Boolean);$+="\n";let u=c.join("|");$+=`|${u}|`,t.forEach(e=>{$+="\n";let t=[e[0]||"-",i&&(e[1]||"-"),e[2]||"-",l&&(e[3]||"-"),r&&(e[4]||"-")].filter(Boolean).join("|");$+=`|${t}|`})}return $+="\n\n"}(e))}),E}
|
|
@@ -1 +1 @@
|
|
|
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&&this.entryMatchCallback(t.attributes.src)&&(t.attributes.entry=!0)}),t))}})}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"path";import{merge as t}from"webpack-merge";import{CONFIG as
|
|
1
|
+
import e from"path";import{merge as t}from"webpack-merge";import i from"./app.js";import{CONFIG as o}from"./common.js";import{PACKAGENAME as a,PROGRAMPATH as m,pkgName as p}from"./process-env.js";let{template:r,favicon:n,...l}=Object.assign({template:`./node_modules/${p}/template/index.html`,favicon:`./node_modules/${p}/template/favicon.ico`},o.htmlPluginOption||{}),s=t({title:o.env?.PROJECTNAME||a.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:i.description||""},tags:[],template:e.join(m,r),favicon:e.join(m,n)},l);export default s;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const CONTENT_MATCH_REG = /(?<!-)content\s*:\s*([^;\\}]+)/g;
|
|
2
|
+
const UNICODE_MATCH_REG = /[\u4e00-\u9faF]+/g;
|
|
3
|
+
|
|
4
|
+
module.exports = function (source) {
|
|
5
|
+
return source.replace(CONTENT_MATCH_REG, function (m) {
|
|
6
|
+
return m.replace(UNICODE_MATCH_REG, function (s) {
|
|
7
|
+
return `\\${s.charCodeAt(0).toString(16)}`;
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const regExp = /^---\n([\s\S]+?)\n---\n/;
|
|
2
|
+
const linesExp = /^\n+|\n+$/g;
|
|
3
3
|
|
|
4
|
+
module.exports = function (source) {
|
|
4
5
|
// 返回处理后的结果
|
|
5
|
-
return
|
|
6
|
+
return source.replace(regExp, '').replace(linesExp, '');
|
|
6
7
|
};
|
package/lib/locales.d.ts
ADDED
package/lib/locales.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{existsSync as e}from"fs";import{basename as t,join as o}from"path";import{watch as a}from"chokidar";import{CONFIG as l}from"./common.js";import r from"./esm.js";import n from"./object-listener.js";import{FRAMEWORK as s,isLibrary as c}from"./process-env.js";import{resolveProgramPath as i,tfc as g}from"./utils.js";let p={react:'import sso from "shared-store-object";',solid:'import { createEffect, createRoot, getOwner } from "solid-js";import { createStore } from "solid-js/store";'},f={react:'let storageKey="localizable.language",language=localStorage.getItem(storageKey)||"zh_CN",{translation:a,...defaultLocale}=Object.assign({title:"简体中文",language:"zh_CN",translation:{}},resources[language]||resources.zh_CN),localizable=sso({lang:defaultLocale,t:a});export function setLang(a){let{translation:e,...l}=resources[a]||{};e&&(localizable.lang=l,localizable.t=e,localStorage.setItem(storageKey,l.language))}export default localizable;',solid:'let locale=createRoot(()=>{let e="localizable.language",a=localStorage.getItem(e)||"zh_CN",{translation:l,...o}=Object.assign({title:"简体中文",language:"zh_CN",translation:{}},resources[a]||resources.zh_CN),[n,c]=createStore({lang:o,t:l});return createEffect(()=>{let a=resources[n.lang.language]?.translation;a&&(c("t",a),localStorage.setItem(e,n.lang.language))}),{localizable:n,setLocalizable:c,setLang:function(e){let{translation:a,...l}=resources[e]||{};a&&c("lang",l)}}},getOwner());export const setLocalizable=locale.setLocalizable;export const t=locale.localizable.t;export const lang=locale.localizable.lang;export const setLang=locale.setLang;'}[s];export const locales=n({name:"@app/locales",data:"export const locales = [];"});let u={};async function d(e,o){let a=t(e).replace(/\.[^.]+$/,"");if("deleted"===o)delete u[a];else{let t=await import(r`${g(e)}`);Object.assign(u,{[a]:t.default})}let l=[],n={};for(let e in u)if(Object.prototype.hasOwnProperty.call(u,e)){let t=u[e],{language:o=a,title:r=o,icon:s,translation:c={}}=t;l.push({language:o,title:r,icon:s}),n[o]={language:o,title:r,icon:s,translation:c}}Object.assign(locales.data,{data:`${p[s]}
|
|
2
|
+
export function interpolateString(r,n){return r.replace(/\\\${\\w+}/g,function(r){var t=r.slice(2,-1);var e=n[t];return e!==void 0?e.toString():""})}function deepFreeze(o) { const p = Reflect.ownKeys(o);for (const k of p) {const v = o[k];if ((v && typeof v === "object") || typeof v === "function") {deepFreeze(v);}}return Object.freeze(o);}export const locales = ${JSON.stringify(l)};const _res = ${JSON.stringify(n)};const resources = deepFreeze(_res);${f}`})}e(o(l.alias["@"],"./locales"))&&function(e,t){let o=[],l=a(e,{ignored:t,persistent:!0,ignoreInitial:!1});l.on("add",e=>{d(e,"added"),o.push(e)}),l.on("change",e=>{d(e,"change")}),l.on("unlink",e=>{d(e,"deleted"),o.splice(o.indexOf(e),1)}),l.on("ready",()=>{o.forEach(e=>{d(e,"change")})}),process.on("SIGINT",function(){l.close()})}(i(c?"site/locales":"src/locales"),[/^\..*/,/!\.ts$/,/\.d\.ts$/]);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "function merge(e,r){if(!e.length)return void 0;const n=[];e.forEach(e=>{const t=n.findIndex(n=>n[r]==e[r]);if(t>-1){const i=[...n[t].children||[],...e.children||[]];n[t]=Object.assign(e,n[t],n[t].meta&&{meta:{...n[t].meta,...e.meta}});if(i.length){n[t].children=merge(i,r)}}else{n.push(Object.assign(e,Array.isArray(e.children)&&{children:merge(e.children,r)}))}});return n}export default merge;";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default"function merge(e,r){if(!e.length)return void 0;const n=[];e.forEach(e=>{const t=n.findIndex(n=>n[r]==e[r]);if(t>-1){const i=[...n[t].children||[],...e.children||[]];n[t]=Object.assign(e,n[t],n[t].meta&&{meta:{...n[t].meta,...e.meta}});if(i.length){n[t].children=merge(i,r)}}else{n.push(Object.assign(e,Array.isArray(e.children)&&{children:merge(e.children,r)}))}});return n}export default merge;";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CONFIG as i}from"./common.js";import o from"./html-plugin-option.js";let f=i.prefixCls||"n",n={"@prefix-cls":f,"@ant-prefix":f,"@iconfont-css-prefix":`${f}-icon`,"@favicon":JSON.stringify(o.favicon)};Object.assign(n,i.modifyVars);export default n;
|
package/lib/module-federation.js
CHANGED
|
@@ -1 +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{
|
|
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{realResolve 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])})));
|
package/lib/module.config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolve as e}from"path";import s from"mini-css-extract-plugin";import o from"mini-svg-data-uri";import{CONFIG as t,PUBLICPATH as l}from"./common.js";import{hasPkg as r}from"./has-pkg.js";import a from"./
|
|
1
|
+
import{resolve as e}from"path";import s from"mini-css-extract-plugin";import o from"mini-svg-data-uri";import{CONFIG as t,PUBLICPATH as l}from"./common.js";import{hasPkg as r}from"./has-pkg.js";import a from"./modify-vars.js";import{FRAMEWORK as i,__dirname as n,isDev as c,isMicro as m}from"./process-env.js";import p from"./swcrc.js";import d from"./tsloader.config.js";import{resolveNodeModulesPath as u,resolveProgramPath as f}from"./utils.js";let y={loader:e(n,"./loader/css-unicode.cjs")},x=m?l:"../",$={loader:s.loader,options:{publicPath:"/"!==x?x:"../"}},g=r("@moneko/postcss")&&{loader:"postcss-loader",options:{postcssOptions:await import("@moneko/postcss")}};c&&($="style-loader");let j=[...t.cssModules,`@moneko/${i}`,"neko-ui"].map(u),v=[...["src/styles/variables.less","src/styles/mixins.less","site/styles/variables.less","site/styles/mixins.less"].map(f)],b=["components","example","mock","site","src","server"].map(f),w=[$,c&&{loader:"@teamsupercell/typings-for-css-modules-loader",options:{verifyOnly:!c}},{loader:"css-loader",options:{modules:{auto:e=>{for(let s=0,o=j.length;s<o;s++)if(e&&e?.includes(j[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}},g,y,{loader:"less-loader",options:{sourceMap:!!t.sourceMap,lessOptions:{modifyVars:a,javascriptEnabled:!0}}},{loader:"style-resources-loader",options:{patterns:v}}].filter(Boolean),h={loader:"tsc"===t.compiler?"ts-loader":"swc-loader",options:"tsc"===t.compiler?d:p(c)},k=b.concat(t.rulesInclude?.media?.map(u)||[]),I=b.concat(t.rulesInclude?.fonts?.map(u)||[]),O=b.concat(t.rulesInclude?.less?.map(u)||[]),B=b.concat(t.rulesInclude?.css?.map(u)||[]),L=b.concat(t.rulesInclude?.js?.map(u)||[]),M={rules:[{test:/\.mdx?$/i,include:[f("components")],exclude:[/(.+)\/examples\/(.+).mdx?$/i],enforce:"pre",use:[{loader:e(n,"./loader/frontmatter.cjs")}]},{oneOf:[{resourceQuery:/raw/,type:"asset/source"},{test:/\.wasm$/i,type:"webassembly/async"},{test:/\.txt$/i,type:"asset/source"},{test:/\.ico$/i,type:"asset/inline",include:k},{test:/\.svg$/i,type:"asset/inline",generator:{dataUrl:e=>o("string"!=typeof e?e.toString():e)},include:k},{test:/\.(gif|png|jpe?g|mp4)$/i,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/images/[name][ext][query]"},include:k},{test:/\.(eot|ttf|otf|woff|woff2)$/i,type:"asset",generator:{filename:"assets/fonts/[name][ext][query]"},include:I},{test:/\.less$/i,use:w,include:O},{test:/\.css$/i,use:[$,"css-loader",g,y].filter(Boolean),include:B},{test:/\.(cj|mj|t|j)s(|x)$/i,use:[...t.prefixJsLoader,h].filter(Boolean),include:L},{test:/\.mdx?$/i,use:[...t.prefixJsLoader,h,{loader:"@mdx-js/loader",options:t.mdx}].filter(Boolean),include:b,exclude:[/(.+)\/examples\/(.+).mdx?$/i]},{test:/\.mdx?$/i,type:"asset/source",include:[/(.+)\/examples\/(.+).mdx?$/i]},{type:"asset/source",include:[/(.+)\/examples\/(.+).*?$/i]}]},...t.moduleRules]};export default M;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CONFIG as e}from"./common.js";let t="";e.normalizeCss&&(t='html,body{margin:0;padding:0;line-height:1.8}input,textarea{caret-color:inherit}h1{margin:0.67em 0;font-size:2em}hr{overflow:visible;block-size:0;box-sizing:content-box}pre{font-size:1em;font-family:monospace}a{text-decoration:none;background-color:transparent;cursor:pointer}abbr[title]{border-block-end:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-size:1em;font-family:monospace}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{inset-block-end:-0.25em}sup{inset-block-start:-0.5em}img{border-style:none}img,button{outline:1px solid transparent}button,input,optgroup,select,textarea{margin:0;font-size:100%;font-family:inherit;line-height:1.15}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted var(--primary-outline)}fieldset{padding:0.35em 0.75em 0.625em}legend{display:table;padding:0;max-inline-size:100%;white-space:normal;color:inherit;box-sizing:border-box}progress{vertical-align:baseline}textarea{overflow:auto}details{display:block}summary{display:list-item}template,[hidden]{display:none}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{block-size:auto}[type="search"]{appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}::-webkit-scrollbar{inline-size:5px;block-size:5px}::-webkit-scrollbar-track,::-webkit-scrollbar-thumb{background-color:transparent}:hover::-webkit-scrollbar-thumb{background-color:var(--primary-selection)}::-webkit-scrollbar-thumb:hover{background-color:var(--primary-hover)}::-webkit-scrollbar-thumb:active{background-color:var(--primary-active)}::-webkit-scrollbar-button{display:none}');export default t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isReact as e}from"./process-env.js";let r="";e&&(r='import {createElement,isValidElement} from "react";function prefix(list){return list.map(r=>{const _=Object.assign({key:r.path},r);if(_.element&&!isValidElement(_.element)){_.element=createElement(_.element,_.meta)}if(Array.isArray(_.children)){_.children=prefix(_.children)}return _})}export default prefix;');export default r;
|
package/lib/process-env.d.ts
CHANGED
|
@@ -2,33 +2,19 @@ import type { AppType, Framework } from '../typings/global.js';
|
|
|
2
2
|
export declare const __dirname: string;
|
|
3
3
|
export declare const APPTYPE: AppType;
|
|
4
4
|
export declare const FRAMEWORK: Framework;
|
|
5
|
+
export declare const isLibrary: boolean;
|
|
6
|
+
export declare const isMicro: boolean;
|
|
5
7
|
export declare const isReact: boolean;
|
|
6
8
|
export declare const isSolid: boolean;
|
|
7
9
|
export declare const jsxImportSource: string;
|
|
10
|
+
export declare const createElement: string;
|
|
11
|
+
export declare const FRAMEWORKNAME: string;
|
|
8
12
|
export declare const PROGRAMPATH: string;
|
|
9
13
|
export declare const PACKAGENAME: string;
|
|
10
14
|
export declare const PACKAGEVERSION: string;
|
|
11
15
|
export declare const pkgName: string;
|
|
12
|
-
export declare const
|
|
16
|
+
export declare const isDev: boolean;
|
|
13
17
|
export declare const cacheDir: string;
|
|
14
|
-
export declare const NODE_ENV: string | undefined;
|
|
15
18
|
export declare const CUSTOMCONFIG: string | undefined;
|
|
16
|
-
export declare
|
|
17
|
-
export declare
|
|
18
|
-
export declare const hasAntd: boolean;
|
|
19
|
-
export declare const programInfo: {
|
|
20
|
-
name: string;
|
|
21
|
-
version: string;
|
|
22
|
-
type: AppType;
|
|
23
|
-
description: string | undefined;
|
|
24
|
-
author: {
|
|
25
|
-
name: string | undefined;
|
|
26
|
-
email: string | undefined;
|
|
27
|
-
url: string | undefined;
|
|
28
|
-
};
|
|
29
|
-
repository: {
|
|
30
|
-
type: string | undefined;
|
|
31
|
-
url: string | undefined;
|
|
32
|
-
directory: string | undefined;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
19
|
+
export declare const hasEslintConfig: boolean;
|
|
20
|
+
export declare const hasStylelintConfig: boolean;
|
package/lib/process-env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as e,mkdirSync as o,readFileSync as
|
|
1
|
+
import{existsSync as e,mkdirSync as o,readFileSync as t}from"fs";import{join as r}from"path";import s from"url";import n from"./yarn-argv.js";export const __dirname=s.fileURLToPath(new URL(".",import.meta.url));export const APPTYPE=process.env.APPTYPE;export const FRAMEWORK=process.env.FRAMEWORK;export const isLibrary="library"===APPTYPE;export const isMicro="micro"===APPTYPE;export const isReact="react"===FRAMEWORK;export const isSolid="solid"===FRAMEWORK;export const jsxImportSource={react:"react",solid:"solid-js/h"}[FRAMEWORK];export const createElement={react:"createElement",solid:"createComponent"}[FRAMEWORK];export const FRAMEWORKNAME={react:"react",solid:"solid-js"}[FRAMEWORK];export const PROGRAMPATH=process.cwd();export const PACKAGENAME=process.env.npm_package_name;export const PACKAGEVERSION=process.env.npm_package_version;let c=t(r(__dirname,"../package.json"),{encoding:"utf-8"});export const pkgName=JSON.parse(c).name;export const isDev="development"===process.env.NODE_ENV;export const cacheDir=r(PROGRAMPATH,"./node_modules/.cache/.mo/");e(cacheDir)||o(cacheDir,{recursive:!0});export const CUSTOMCONFIG=process.env.npm_config_config||n.config;let p=Object.keys(process.env);export const hasEslintConfig=-1!==p.findIndex(e=>e.startsWith("npm_package_eslintConfig_"));export const hasStylelintConfig=-1!==p.findIndex(e=>e.startsWith("npm_package_stylelint_"));
|
package/lib/rem.d.ts
ADDED
package/lib/rem.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CONFIG as e}from"./common.js";let t="";e.rem.designSize&&(t=`!function(e,n){function t(){let n=e.documentElement,t=n.clientWidth||e.body.clientWidth,i=t<=375?375:${e.rem.designSize},o=t;o=t<=375?t:t<=${e.rem.designSize}?i:t;let d=16/i*o+"px";d!==n.style.fontSize&&(n.style.fontSize=d)}t(),"addEventListener"in e&&n.addEventListener("orientationchange"in n?"orientationchange":"resize",t,!1)}(document,window);`);export default t;
|
package/lib/routes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
let e,t;import{readFileSync as r,readdirSync as o,statSync as n}from"fs";import{join as s,relative as
|
|
1
|
+
let e,t;import{readFileSync as r,readdirSync as o,statSync as n}from"fs";import{join as s,relative as i}from"path";import{watch as a}from"chokidar";import{load as p}from"js-yaml";import{hasCustomRouter as l}from"./common.js";import c from"./object-listener.js";import{FRAMEWORK as m,FRAMEWORKNAME as u,PROGRAMPATH as f,createElement as d,isLibrary as x,isReact as g,isSolid as h}from"./process-env.js";let $=/^---\n([\s\S]+?)\n---\n/,j=h?"component":"element";function O(e){return e.replace(/\$/g,":").replace(/^index\.tsx?$/,"/").replace(/^README\.mdx?$/,"/")}function b(e,t){let{regex:a,alia:l,base:c=e,outputSource:m}=t,u=o(e);return u.reduce((o,u)=>{let f=s(e,u),d=n(f);if(d.isDirectory()){let e=b(f,{...t,base:c});if(e.length>0){let t={},r={path:O(u),key:O(i(c,f))};if(m)Object.assign(t,{children:e});else{let o=e.findIndex(e=>"/"===e.path||r.path===e.path),n=e.splice(o,1)[0];e.length?Object.assign(t,!h&&n,{children:[h&&{...n,path:r.path===n.path?"/":n.path},...e].filter(Boolean)}):Object.assign(t,n)}o.push(Object.assign(t,r))}}else if(a.test(f)){let e=r(f,{encoding:"utf-8"}),t=function(e){let t=e.match($);return t&&t[1]?t[1].trim():null}(e),n=t?p(t):{},a=i(c,f),u=O(a);o.push(Object.assign({path:u.split("/").slice(-2,-1)?.join("")||"/",key:u.replace(/\/?index.tsx?$/,"/").replace(/\/?README.mdx?$/,"/").split("/").filter(Boolean).join("/"),meta:{...n}},l&&{[j]:`rr(() => import(/* webpackChunkName: '${a}' */'${s(l,a)}'))rr`},m&&{codes:function(e){let t;let r={},o=/```(.+?)\n([\s\S]*?)\n```/g;for(;null!==(t=o.exec(e));){let[,e="jsx",o]=t,n=e.split(" ").pop()||"jsx";r[n]=o.trim()}return Object.keys(r).length?r:{jsx:e}}(e.replace($,"").replace(/^\n+|\n+$/g,""))}))}return o},[])}let y=s(f,"./components");export const route=c({name:"@app/routes",data:"export default []"});export const example=c({name:"@app/example",data:{}});let T=`${h?"() => ":""}${d}(SuspenseComp, { comp: $1 })`,k=`import { ${d} } from "${u}";import SuspenseComp from "@app/suspense";${g?'import prefix from "@app/prefix-router";':""}`;l&&(k+='import merge from "@app/merge-router";import customRouter from "@/router";'),["react","solid"].includes(m)||(T="$1",k="");export let routes=[];function E(e){return`${k}const routes = [{ path: "/", children: [${h?'{ path: "/" },':""} ${e}] }];const _routes = ${l?'merge([...routes, ...customRouter], "path")':"routes"};export default ${g?"prefix(_routes)":"_routes"};`}function S(e,t,r){let o=a(e,{ignored:(e,r)=>{if(r)return!r?.isDirectory()&&t.test(e)},persistent:!0,ignoreInitial:!1});o.on("add",()=>{r()}).on("change",()=>{r()}).on("unlink",()=>{r()}),process.on("SIGINT",function(){o.close()})}let D=s(f,"./src/pages");x?(S(y,/(?<!README\.mdx?)$/,function(){clearTimeout(e),e=setTimeout(()=>{clearTimeout(e),routes=b(y,{regex:/README\.mdx?$/,alia:"@pkg"});let t=JSON.stringify(routes).replace(/"rr\((.+?)\)rr"/g,T).slice(1,-1);Object.assign(route.data,{data:E(t)})},100)}),S(y,/(?<!\/examples\/(.+)\.md)$/,function(){clearTimeout(t),t=setTimeout(()=>{clearTimeout(t);let e={};b(y,{regex:/\/examples\/(.+)\.md$/,outputSource:!0}).forEach(t=>{let r=[example.data.name,t.key].filter(Boolean).join("/"),o=t.children?.[0].children?.filter(e=>e.codes)?.map(e=>({title:e.path.replace(/.md$/,""),order:0,...e.meta,codes:e.codes})).sort((e,t)=>e.order-t.order);Object.assign(e,{[r]:`export default ${JSON.stringify(o)};`})}),Object.assign(example.data,{data:e})},100)})):S(D,/(?<!index\.tsx?)$/,function(){clearTimeout(e),e=setTimeout(()=>{clearTimeout(e),routes=b(D,{regex:/index\.tsx?$/,alia:"@/pages"});let t=JSON.stringify(routes).replace(/"rr\((.+?)\)rr"/g,T).slice(1,-1);Object.assign(route.data,{data:E(t)})},100)});
|
package/lib/seo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as t,mkdirSync as o,writeFileSync as r}from"fs";import{join as
|
|
1
|
+
import{existsSync as t,mkdirSync as o,writeFileSync as r}from"fs";import{join as s}from"path";import{CONFIG as e}from"./common.js";import{routes as m}from"./routes.js";import{resolveProgramPath as i}from"./utils.js";import{outputConfig as p}from"./webpack.common.js";function n(t,o){try{r(t,o,"utf-8")}catch(t){}}export const seo=()=>{let{domain:r,nojekyll:c,path:a}=e.seo||{};if(!r)return;let f=e.basename,h=f.endsWith("/")?f:`${f}/`,l=a&&i(a)||p?.path||process.cwd();t(l)||o(l),n(s(l,"CNAME"),r),n(s(l,"robots"),`Sitemap: https://${r}${h}sitemap.txt`);let u=[];!function t(o){o.forEach(o=>{u.push(`https://${r}${h}${o.key}`),Array.isArray(o.children)&&t(o.children)})}(m),n(s(l,"sitemap.txt"),u.join("\n")),c&&n(s(l,".nojekyll"),"")};
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/** 获取导出标识
|
|
2
|
+
* @param {string} path 文件地址
|
|
3
|
+
* @returns {string[]} 包含的标识
|
|
4
|
+
*/
|
|
5
|
+
export declare function getExportTokens(path: string): string[];
|
|
1
6
|
export declare function tfc(filepath: string): string;
|
|
2
7
|
export declare function readConf(src: string, name: string): Promise<any>;
|
|
3
8
|
export declare function toUpperCaseString(string: string): string;
|
|
@@ -17,7 +22,7 @@ export declare const resolveNodeModulesPath: <T extends string>(src: T) => `${`n
|
|
|
17
22
|
* @param {string} url 路径
|
|
18
23
|
* @returns {string} 模块真实入口路径
|
|
19
24
|
*/
|
|
20
|
-
export declare const
|
|
25
|
+
export declare const realResolve: (url: string) => string;
|
|
21
26
|
export declare function isObject(target: unknown): target is object;
|
|
22
27
|
export declare function isFunction(target: unknown): target is (...args: unknown[]) => unknown;
|
|
23
28
|
export {};
|
package/lib/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{writeFileSync as
|
|
1
|
+
import{readFileSync as e,writeFileSync as t}from"fs";import{join as o,resolve as r}from"path";import{transformFileSync as n}from"@swc/core";import{cacheDir as c}from"./process-env.js";import s from"./resolver-sync.js";let p=/export\s+(?:async\s+)?(?:function|const)\s+(\w+)/g;export function getExportTokens(t){let o;let r=e(t,{encoding:"utf-8"}),n=[];for(;o=p.exec(r);)n.includes(o[1])||n.push(o[1]);return n}let u={inputSourceMap:!1,sourceMaps:!1,module:{type:"es6"},jsc:{parser:{syntax:"typescript"},loose:!1}};export function tfc(e){return n(e,u).code||"{}"}export function readConf(e,r){let n=o(c,`${r}.mjs`);return t(n,tfc(e),"utf-8"),import(n)}export function toUpperCaseString(e){return e?.replace(/\b\w/g,e=>e.toUpperCase()).replace(/\./g," ")}export function resolveProgramPath(e){return r(process.cwd(),`./${e}`)}export const resolveNodeModulesPath=e=>resolveProgramPath(`node_modules/${e}`);export const realResolve=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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"webpack-virtual-modules";import{docs as
|
|
1
|
+
import t from"webpack-virtual-modules";import{docs as e}from"./docs.js";import{locales as o}from"./locales.js";import{isLibrary as a}from"./process-env.js";import{example as r,route as i}from"./routes.js";import{resolveNodeModulesPath as l}from"./utils.js";export default class{constructor(t){this.options=t}apply(s){let p=new t({[l(i.data.name)]:i.data.data,[l(r.data.name)]:"export default []",[l(o.data.name)]:o.data.data});i.listener(t=>{t.data&&p.writeModule(l(t.name),t.data)}),o.listener(t=>{t.data&&p.writeModule(l(t.name),t.data)}),a&&(r.listener(t=>{let e=t.data;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t]&&p.writeModule(l(t),e[t])}),e.listener(t=>{for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&t[e]&&p.writeModule(l(e),t[e])})),p.apply(s),s.hooks.compilation.tap("VirtualModulePlugin",()=>{for(let t in this.options)if(Object.prototype.hasOwnProperty.call(this.options,t)){let e=this.options[t];"string"==typeof e?p.writeModule(l(t),e):p.writeModule(l(t),`export default ${JSON.stringify(e)}`)}})}};
|
package/lib/virtual-modules.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{accessSync as
|
|
1
|
+
import{accessSync as p,constants as o}from"fs";import{join as r}from"path";import e from"./app-entry.js";import s from"./app.js";import{CONFIG as m}from"./common.js";import{coverage as t}from"./coverage.js";import a from"./fallback.js";import c from"./merge-router.js";import f from"./normalize-css.js";import i from"./prefix-router.js";import{FRAMEWORKNAME as l,isLibrary as n,isReact as u}from"./process-env.js";import{resolveProgramPath as x}from"./utils.js";let j={...m.virtualModule,"@app":s,"@app/fallback":a,"@app/coverage":t,"@app/normalize/index.css":f,"@app/prefix-router":i,"@app/suspense/index.tsx":`import ${u?"React,":""}{Suspense,lazy} from "${l}";import Fallback from '@app/fallback';${n?'import scope from "@app/mdx-scope";':""}function SuspenseComp(props) {const Lazy = lazy(props.comp);return (<Suspense fallback={Fallback && <Fallback />}><Lazy ${n?"components={scope}":""}/></Suspense>);}export default SuspenseComp;`,"@app/entry":e,"@app/merge-router":c},d={};if(n)try{let e=r(x("site"),"./mdx-scope.ts");p(e,o.R_OK),d='import scope from "@/mdx-scope";export default scope;'}catch(p){d={}}Object.assign(j,{"@app/mdx-scope":d});export default j;
|
package/lib/webpack.common.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import './cleanup.js';
|
|
2
2
|
import type { WebpackConfiguration } from 'webpack-dev-server';
|
|
3
|
-
export declare const alias: Record<string, string>;
|
|
4
3
|
export declare const outputConfig: WebpackConfiguration['output'];
|
|
5
|
-
declare const
|
|
6
|
-
export default config;
|
|
4
|
+
export declare const clientConfig: WebpackConfiguration;
|
package/lib/webpack.common.js
CHANGED
|
@@ -1 +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"./cleanup.js";import{CONFIG as l,
|
|
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"./cleanup.js";import{CONFIG as l,PUBLICPATH as r}from"./common.js";import i from"./done.js";import a from"./html-add-entry-attr.js";import p from"./html-plugin-option.js";import{moduleFederation as c}from"./module-federation.js";import m from"./module.config.js";import{CUSTOMCONFIG as u,PACKAGENAME as f,PROGRAMPATH as d,hasEslintConfig as h,hasStylelintConfig as y,isDev as j,isLibrary as g,isMicro as b}from"./process-env.js";import{seo as w}from"./seo.js";import{resolveNodeModulesPath as x,resolveProgramPath as k}from"./utils.js";import v from"./virtual-module-plugin.js";import C from"./virtual-modules.js";let{AutomaticPrefetchPlugin:O,DefinePlugin:$,SourceMapDevToolPlugin:D,WatchIgnorePlugin:N}=n,P=[".eslintrc.js",".eslintrc.json",".eslintrc.yaml",".eslintrc.json"],S=[".stylelintrc",".stylelintrc.json",".stylelintrc.yaml",".stylelintrc.yml",".stylelintrc.js","stylelint.config.js","stylelint.config.cjs"],A=e.readdirSync(d),B=!1,E=!1;for(let e=0,t=A.length;e<t;e++)S.includes(A[e])&&(E=!0),P.includes(A[e])&&(B=!0);B||(B=h),E||(E=y);let M=E?(await import("stylelint-webpack-plugin")).default:null,T=B?(await import("eslint-webpack-plugin")).default:null,_=l.assetHtml.map(e=>({publicPath:"",...e}));export const outputConfig={path:k(g?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:"js/[chunkhash].js",assetModuleFilename:"assets/[hash][ext][query]",library:{name:f,type:"window"},globalObject:"window",chunkLoadingGlobal:`webpackJsonp_${f}`,pathinfo:j,clean:!0,publicPath:r,asyncChunks:!0};let K={main:x("@app/entry")};l.entry&&("string"==typeof l.entry?K=l.entry:Object.keys(l.entry)&&Object.assign(K,l.entry)),l.output&&("string"==typeof l.output?outputConfig.path=l.output:Object.keys(l.output)&&Object.assign(outputConfig,l.output));let L=l.basename.split("/").filter(Boolean).length,F=`${Array(L).fill("..").join("/")+(L?"/":"")}404.html`,{pathSegmentsToKeep:J=L,path:R=F}=l.fixBrowserRouter||{},V=!1;l.cacheDirectory&&(V={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:l.cacheDirectory,memoryCacheUnaffected:!0,name:`${u||"default"}-${j?"development":"production"}`});export const clientConfig={entry:K,stats:"errors-only",cache:V,infrastructureLogging:{level:"none"},target:"web",externalsPresets:l.externalsPresets,plugins:[new O,...c,T&&new T({fix:!0,threads:!0,extensions:["js","md","mdx","cjs","ejs","mjs","jsx","ts","tsx","json","html","coffee","vue"]}),M&&new M({fix:!0,threads:!0,extensions:["css","scss","sass","less","ts","tsx","js","jsx"],exclude:["node_modules/","es/","lib/","docs/","coverage/","dist/"]}),l.htmlPluginOption&&new s(p),l.fixBrowserRouter&&new s({filename:R,inject:!1,templateContent:()=>`<html html><head><title>${p.title}</title><script>var pathSegmentsToKeep = ${J||L};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(_),b&&new a(e=>!!(e.match(/main\.(.*)\.bundle.js$/)||e.match("main.bundle.js"))),new $({"process.env":JSON.stringify({...l.env,NODE_ENV:process.env.NODE_ENV})}),new N({paths:[/\.d\.ts$/]}),l.sourceMap&&new D(l.sourceMap),l.bar&&new o(l.bar),new i({done:()=>{!j&&l.seo&&w(),l.done?.(),j||setTimeout(()=>{process.exit(0)},2e3)}}),new v(C),...l.plugins].filter(Boolean),experiments:{topLevelAwait:!0,syncWebAssembly:!0,asyncWebAssembly:!0},resolve:{extensions:[".tsx",".ts",".js",".jsx"],alias:l.alias,fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},module:m,externals:l.externals,output:outputConfig};
|
package/lib/webpack.dev.d.ts
CHANGED
package/lib/webpack.dev.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from"@soda/friendly-errors-webpack-plugin";import o from"chalk";import r from"webpack";import{merge as t}from"webpack-merge";import{CONFIG as s}from"./common.js";import{hasPkg as
|
|
1
|
+
import e from"@soda/friendly-errors-webpack-plugin";import o from"chalk";import r from"webpack";import{merge as t}from"webpack-merge";import{CONFIG as s}from"./common.js";import{hasPkg as p}from"./has-pkg.js";import{getIPv4 as a,getPort as i}from"./net.js";import{isReact as m}from"./process-env.js";import{isFunction as n,resolveProgramPath as l}from"./utils.js";import{clientConfig as d}from"./webpack.common.js";let{HotModuleReplacementPlugin:c}=r,{yellow:v,green:h}=o,f=a(),w=s.devServer.port||3e3,u=await i(w,65535,s.devServer.host),k=s.devServer.port!==u,g=p("@moneko/mock"),$=g&&(await import("@moneko/mock")).default,S=m&&(await import("@pmmmwh/react-refresh-webpack-plugin")).default,b=!1===s.devtool||s.devtool?s.devtool:"eval-cheap-module-source-map";s.devServer.port=u;let y="/"===s.basename,j=s.devServer.https?"https:":"http:",x=y?"":s.basename,A=t(d,{devtool:b,mode:"development",devServer:{headers:{"Access-Control-Allow-Origin":"*"},compress:s.devServer.compress,host:"0.0.0.0",port:u,historyApiFallback:y||{index:x.endsWith("/")?x:`${x}/`,disableDotRule:!0},https:s.devServer.https,proxy:s.proxy,allowedHosts:s.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($)&&$(o.app,l("mock/")),e},open:!1,hot:!0},plugins:[new c,S&&new S,new e({compilationSuccessInfo:{messages:[`You application is running here:
|
|
2
2
|
|
|
3
|
-
Local: ${o.cyan(`${
|
|
4
|
-
Network: ${o.cyan(`${
|
|
3
|
+
Local: ${o.cyan(`${j}//${s.devServer.host}:${u}${x}`)}
|
|
4
|
+
Network: ${o.cyan(`${j}//${f}:${u}${x}`)}`],notes:k?[`Port ${v(w)} is in use, trying ${h(u)} instead`]:[]},clearConsole:!0})].filter(Boolean)});export default[A];
|
package/lib/webpack.prod.d.ts
CHANGED
package/lib/webpack.prod.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"css-minimizer-webpack-plugin";import i from"mini-css-extract-plugin";import n from"terser-webpack-plugin";import m 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{
|
|
1
|
+
import e from"css-minimizer-webpack-plugin";import i from"mini-css-extract-plugin";import n from"terser-webpack-plugin";import m 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{clientConfig as p}from"./webpack.common.js";let{optimize:l}=m,{cssnanoMinify:u,swcMinify:c}=e,a="swc"===s.compiler?"swc":"terser",f="swc"===s.compiler?"swc":"cssnano",d=[];s.minifier&&(s.minifier.js&&d.push(new n(t(s.minifier.js?.type||a,s.minifier.js?.options))),s.minifier.css&&d.push(new e({minify:{swc:c,cssnano:u}[s.minifier.css?.type||f],minimizerOptions:s.minifier.css?.options})));let k={splitChunks:s.splitChunk,runtimeChunk:s.runtimeChunk,chunkIds:"named",moduleIds:"named",removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,minimize:!0,minimizer:d},w=r(p,{devtool:!1===s.devtool||s.devtool?s.devtool:"cheap-module-source-map",mode:"production",optimization:k,plugins:[new i({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",experimentalUseImportModule:!0}),s.bundleAnalyzer&&new o(s.bundleAnalyzer),s.splitChunk&&new l.MinChunkSizePlugin({minChunkSize:1e4})].filter(Boolean)});export default[w];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -19,18 +19,16 @@
|
|
|
19
19
|
"@swc/helpers": "0.5.1",
|
|
20
20
|
"@teamsupercell/typings-for-css-modules-loader": "2.5.2",
|
|
21
21
|
"add-asset-html-webpack-plugin": "6.0.0",
|
|
22
|
-
"core-js": "3.
|
|
22
|
+
"core-js": "3.32.1",
|
|
23
23
|
"cross-env": "7.0.3",
|
|
24
24
|
"css-loader": "6.8.1",
|
|
25
25
|
"css-minimizer-webpack-plugin": "5.0.1",
|
|
26
|
-
"css-unicode-loader": "1.0.3",
|
|
27
26
|
"external-remotes-plugin": "1.0.0",
|
|
28
27
|
"html-webpack-plugin": "5.5.3",
|
|
29
|
-
"less": "4.
|
|
28
|
+
"less": "4.2.0",
|
|
30
29
|
"less-loader": "11.1.3",
|
|
31
30
|
"mini-css-extract-plugin": "2.7.6",
|
|
32
31
|
"mini-svg-data-uri": "1.4.4",
|
|
33
|
-
"path-to-regexp": "6.2.1",
|
|
34
32
|
"style-loader": "3.3.3",
|
|
35
33
|
"style-resources-loader": "1.5.0",
|
|
36
34
|
"swc-loader": "0.2.3",
|
|
@@ -45,20 +43,18 @@
|
|
|
45
43
|
"webpack-merge": "5.9.0",
|
|
46
44
|
"webpack-virtual-modules": "0.5.0",
|
|
47
45
|
"webpackbar": "5.0.2",
|
|
48
|
-
"xml2js": "0.6.
|
|
46
|
+
"xml2js": "0.6.2"
|
|
49
47
|
},
|
|
50
48
|
"devDependencies": {
|
|
51
|
-
"@moneko/mock": "^1.0.10",
|
|
52
|
-
"@moneko/postcss": "^1.0.30",
|
|
53
49
|
"@swc/cli": "0.1.62",
|
|
54
|
-
"@types/js-yaml": "
|
|
55
|
-
"@types/mini-css-extract-plugin": "
|
|
56
|
-
"@types/shelljs": "
|
|
57
|
-
"@types/webpack-bundle-analyzer": "
|
|
58
|
-
"@types/webpack-env": "
|
|
59
|
-
"eslint-config-neko": "
|
|
60
|
-
"shelljs": "
|
|
61
|
-
"stylelint-config-moneko": "
|
|
50
|
+
"@types/js-yaml": "4.0.5",
|
|
51
|
+
"@types/mini-css-extract-plugin": "2.5.1",
|
|
52
|
+
"@types/shelljs": "0.8.12",
|
|
53
|
+
"@types/webpack-bundle-analyzer": "4.6.0",
|
|
54
|
+
"@types/webpack-env": "1.18.1",
|
|
55
|
+
"eslint-config-neko": "1.1.1",
|
|
56
|
+
"shelljs": "0.8.5",
|
|
57
|
+
"stylelint-config-moneko": "1.0.17"
|
|
62
58
|
},
|
|
63
59
|
"files": [
|
|
64
60
|
"lib",
|
package/template/index.html
CHANGED
|
@@ -20,10 +20,6 @@
|
|
|
20
20
|
<%= customTag %>
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
23
|
-
<div id="root">
|
|
24
|
-
<div style="width: 100%; height: 100vh; display: flex;justify-content: center;align-items: center;">
|
|
25
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="margin:auto;background:0 0;display:block;shape-rendering:auto" width="289" height="180" preserveAspectRatio="xMidYMid"><g style="transform-origin:144.5px 90px;transform:scale(1)"><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-106.379979px -18.690895px;animation:1s linear -.644286s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M41.85 69.65q.48-1.76.64-4.28.16-2.52 0-5.04t-.76-4.76q-.6-2.24-1.8-3.44-.48-.48-.76-.32-.28.16.12.8.8 1.44.76 4.44-.04 3-.52 6.52-.48 3.52-1.28 7.04t-1.6 6.16q-.4 1.12-.8 2.8-.4 1.68-.84 3.4-.44 1.72-.76 3.36t-.48 2.76q0 .24-.08.92t.16.84q.16 0 .48-.68.32-.68.4-.84 1.92-4.48 3.92-9.56t3.2-10.12" fill="#d2d2cb" stroke-width="none" style="fill:#d2d2cb"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-104.214976px -7.74362px;animation:1s linear -.628571s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M40.01 89.17q.4-1.44 1.12-3.76.72-2.32 1.44-5.08.72-2.76 1.4-5.76.68-3 1.04-5.84t.24-5.24q-.12-2.4-.84-3.92-.08-.24-.32-.48t-.24.4q.16 5.12-1.04 10.24t-2.56 9.28q-1.04 3.28-2.12 6.56t-1.84 6.52q-.76 3.24-.96 6.36-.2 3.12.6 6 .32 1.04.56 1.04.24-.08.24-1.04 0-1.44.28-3.24.28-1.8.76-3.8.48-2 1.04-4.12t1.2-4.12" fill="#d2d2cb" stroke-width="none" style="fill:#4d695d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-111.122235px -9.275339px;animation:1s linear -.612857s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M38.49 111.09q-2.8-.32-5-2.8t-2.92-6.08q-.72-3.44-.36-7t1.24-6.68q1.28-4.8 3.04-9.88 1.76-5.08 3-10.04 1.24-4.96 1.4-9.56.16-4.6-1.6-8.44-.16-.08-.24-.36-.08-.28-.24-.2-.24 0-.08.56.64 3.68.08 7.96-.56 4.28-1.8 8.88-1.24 4.6-2.8 9.48-1.56 4.88-2.92 9.76-1.04 3.6-1.4 7.64-.36 4.04.52 8.12.48 2.08 1.48 3.76 1 1.68 2.36 2.84 1.36 1.16 2.96 1.8 1.6.64 3.28.56h.24q.08 0 .24-.08 0-.24-.48-.24" fill="#d2d2cb" stroke-width="none" style="fill:#83a79d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-108.070783px 14.809107px;animation:1s linear -.597143s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M36.09 107.09q-1.44-1.68-2.32-4.32-.08-.24-.24-.76l-.32-1.04q-.16-.52-.32-.96-.16-.44-.24-.44-.32 0-.32 1.04t.24 2.4q.24 1.36.72 2.76.48 1.4 1.12 2.2 1.28 1.44 2.6 1.76 1.32.32 2.68.32.48 0 .76-.28t-.44-.44q-2.32-.24-3.92-2.24" fill="#d2d2cb" stroke-width="none" style="fill:#dae8e5"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-86.985215px 2.089108px;animation:1s linear -.581429s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M69.29 89.17q.24-2.16.08-4.56-.16-2.4-1-4.44-.84-2.04-2.56-3.4-1.72-1.36-4.52-1.36-3.76 0-6.56 2.04t-4.8 5.04q-2 3-3.12 6.4-1.12 3.4-1.44 6.2-.48 3.84-.12 6.64t1.32 4.6q.96 1.8 2.44 2.68 1.48.88 3.24.88 2.48.08 5.24-1.4 2.76-1.48 5.16-4.16 2.4-2.68 4.2-6.56 1.8-3.88 2.44-8.6zm-25.76 5.52q.32-3.2 1.6-7.04t3.56-7.12q2.28-3.28 5.48-5.48 3.2-2.2 7.44-2.2 3.2 0 5.28 1.52t3.2 3.88q1.12 2.36 1.44 5.12.32 2.76 0 5.24-.72 5.76-2.8 10t-4.88 7.08q-2.8 2.84-5.92 4.24-3.12 1.4-6 1.4-2.16 0-3.88-.96-1.72-.96-2.88-3t-1.6-5.2q-.44-3.16-.04-7.48zm8.96 11.28q-.4 0-.8-.28t-.64-.68q-.24-.4-.32-.8-.08-.4.32-.56.24-.08.64.56t.88.64q.8 0 1.88-1.04 1.08-1.04 2.08-2.44t1.76-2.76q.76-1.36 1.08-2 .32-.64.64-1.64.32-1 .6-2.04.28-1.04.48-2.04.2-1 .28-1.72.4-3.6-.16-5.56-.56-1.96-1.84-1.96-.96 0-2 .6t-1.96 1.56q-.92.96-1.64 2.12-.72 1.16-1.04 2.36-.4 1.36-.56 1.36-.24 0-.24-1.36.24-1.52 1.04-3t2-2.64q1.2-1.16 2.64-1.92 1.44-.76 2.96-.76t2.28 1.08q.76 1.08 1.08 2.64.32 1.56.28 3.2-.04 1.64-.2 2.6-.32 2.16-1 4.2-.68 2.04-1.64 4.12-.48.96-1.44 2.36t-2.2 2.68q-1.24 1.28-2.64 2.2-1.4.92-2.6.92zm2.56 1.52q.08.48-.76.8-.84.32-1.72.32-2.48-.08-3.8-1.6-1.32-1.52-1.84-3.6t-.48-4.32q.04-2.24.2-3.76.32-2.64 1.28-5.92t2.72-6.16q1.76-2.88 4.32-4.84 2.56-1.96 6.08-1.96 2.32 0 3.72 1.2 1.4 1.2 2.08 2.96.68 1.76.8 3.8t-.12 3.72q-.16 1.84-.56 3.36-.4 1.52-1.12 3.36-.24.56-.64 1.28t-.88.64q-.24-.08-.12-.64t.32-1.4q.2-.84.44-1.76t.32-1.72q.16-1.36.2-3.4.04-2.04-.32-3.96t-1.32-3.28q-.96-1.36-2.88-1.36-2.8 0-5.16 1.8-2.36 1.8-4.12 4.4-1.76 2.6-2.84 5.44-1.08 2.84-1.32 5-.16 1.28-.08 3.2.08 1.92.6 3.8t1.72 3.24q1.2 1.36 3.28 1.44.64.08 1.24-.12t.76.04" fill="#d2d2cb" stroke-width="none" style="fill:#30b0e0"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-43.379211px -5.480892px;animation:1s linear -.565714s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M104.01 83.17q-.64 3.2-2.16 6.4t-2.88 6q-.08.16-.36.56-.28.4-.44.4-.24-.08-.24-.52v-.6q.08-.72.28-1.72t.36-2.08.36-2.08q.2-1 .44-1.8.72-2.72 1.2-4.68.48-1.96.72-3.56t.28-3.04q.04-1.44-.2-3.12-.08-.64.08-.8.16-.08.4.16.24.24.4.48 1.36 2.16 1.84 4.76.48 2.6-.08 5.24" fill="#d2d2cb" stroke-width="none" style="fill:#a1cde5"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-41.109985px 2.209107px;animation:1s linear -.55s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M105.61 77.33l.32.48q1.04 1.52 1.04 4t-.48 5.08q-.48 2.6-1.2 5t-1.04 3.84q-.64 2.8-1.76 5.6t-1.92 4.96q-.08.24-.24.52-.16.28-.32.28t-.16-.32v-.56q-.24-4.4.96-8.6 1.2-4.2 2.56-8.52.8-2.64 1.52-5.4.72-2.76.64-6.04 0-.32.08-.32" fill="#d2d2cb" stroke-width="none" style="fill:#bfdeee"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-57.851713px 1.885033px;animation:1s linear -.534286s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M98.41 76.45q-4.88 2-8.28 5.72-3.4 3.72-5.24 8.36-.8 2.08-1.2 3.72-.4 1.64-.64 3.56-.08.4.24.8t.64 0q1.44-1.76 3.68-4.48 2.24-2.72 4.48-5.76 2.24-3.04 4.04-6.16 1.8-3.12 2.28-5.76zm-5.36 27.12q-1.2 1.68-2.32 3.12-1.12 1.44-2.48 2.52-1.36 1.08-3.04 1.72-1.68.64-3.84.72-3.6.16-5.48-1.84-1.88-2-2.6-4.88-.72-2.88-.52-5.96.2-3.08.84-5.08.88-2.8 2.12-5.32 1.24-2.52 2.64-4.56 1.4-2.04 2.88-3.52t2.92-2.28q.08 0 .36-.16.28-.16.28.08.08 0-.08.24t-.32.4q-4.16 4.32-6.6 9.76-2.44 5.44-2.76 11.2-.08 1.44.12 3.12.2 1.68.8 3.16.6 1.48 1.72 2.48t3.04 1q1.52 0 2.8-.52 1.28-.52 2.4-1.36 1.12-.84 2.04-1.84.92-1 1.64-1.88 1.6-2 2.96-4.16 0-1.6.2-3.12t.6-3.04q.24-1.12.44-1.8.2-.68.4-1.28t.4-1.28q.2-.68.6-1.8-1.28 2.24-2.52 4.2t-2.64 3.76q-1.4 1.8-2.88 3.52t-3.24 3.48q-1.36 1.36-2.24.88-.88-.48-1.04-2.24-.16-2.72.28-5.28.44-2.56 1.56-5.36 1.04-2.56 2.6-4.96t3.6-4.36q2.04-1.96 4.52-3.36 2.48-1.4 5.28-1.88.16-.88.28-1.52.12-.64.2-1.28l.16-.88q.16-.08.36.16.2.24.36.64.96 2.64.64 5.28-.32 2.64-1.16 5.36-.84 2.72-1.96 5.56-1.12 2.84-1.84 5.72-.96 4.08-.52 8.44.44 4.36 3.4 7.88l.24.32q-.08.08-.48-.16-2.32-1.44-3.48-3.48-1.16-2.04-1.64-4.28" fill="#d2d2cb" stroke-width="none" style="fill:#bc252d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-58.343315px 1.437679px;animation:1s linear -.518571s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M95.85 75.25q.16.16-.04.24-.2.08-.84.24-1.04.32-2.52 1.2-1.48.88-3.12 2.24-1.64 1.36-3.24 3.16-1.6 1.8-2.8 3.88-1.2 2.16-2.04 4.24-.84 2.08-1.36 3.8-.52 1.72-.76 2.96t-.24 1.72v2.52q0 1.32.32 2.36.32 1.04 1.12 1.6t2.4.32q.08 0 .4-.12l.64-.24q.32-.12.6-.2.28-.08.36-.08.08.16-.12.4-.2.24-.52.52t-.6.52q-.28.24-.36.32-2 1.2-3.36.72-1.36-.48-2.12-1.8t-1.04-3.12q-.28-1.8-.2-3.24.16-2.8.88-5.56t1.84-5.56q.88-2.16 2.64-4.44 1.76-2.28 3.96-4.2 2.2-1.92 4.6-3.16 2.4-1.24 4.64-1.32.8 0 .88.08" fill="#d2d2cb" stroke-width="none" style="fill:#d2d2cb"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-45.756649px 16.809107px;animation:1s linear -.502857s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M100.57 111.17q.16.24.08.32-.24 0-.64-.16-.24-.16-1.28-.96-1.04-.8-1.52-2.56-.16-.64-.28-1.64-.12-1-.12-1.88 0-.88.12-1.52t.36-.64q.24 0 .52.96t.36 1.2q.24 1.12.44 1.96.2.84.44 1.56.32.88.84 2t.68 1.36" fill="#d2d2cb" stroke-width="none" style="fill:#4d695d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-5.481979px -18.174894px;animation:1s linear -.487143s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M142.65 69.65q-1.12 5.04-2.92 10.04-1.8 5-3.56 9.48-.08.4-.4 1.04t-.72.48q-.08 0-.08-.72t.08-.96q.16-1.12.44-2.68t.64-3.16q.36-1.6.76-3.16t.72-2.68q.24-.48.6-2.16.36-1.68.76-3.96.4-2.28.72-4.92.32-2.64.4-5.08.08-2.44-.04-4.44-.12-2-.68-2.96-.4-.8-.16-.88.32 0 .72.4 1.2 1.2 1.88 3.24.68 2.04 1 4.4.32 2.36.24 4.68-.08 2.32-.4 4" fill="#d2d2cb" stroke-width="none" style="fill:#83a79d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-3.125813px -7.088036px;animation:1s linear -.471429s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M144.73 60.77q.8 1.6.96 3.92.16 2.32-.08 5t-.76 5.52q-.52 2.84-1.16 5.44-.64 2.6-1.24 4.84-.6 2.24-1 3.68-1.12 4.16-2.04 8.28-.92 4.12-.92 7 0 1.04-.08 1.04-.16.16-.36-.24-.2-.4-.36-.8-.8-2.88-.68-5.96t.76-6.32q.64-3.24 1.64-6.56 1-3.32 1.96-6.6 1.12-4.16 2.24-8.68t.72-9.56q0-.4-.04-.44-.04-.04.04-.04.16 0 .4.48" fill="#d2d2cb" stroke-width="none" style="fill:#dae8e5"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-20.039978px -8.560894px;animation:1s linear -.455714s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M133.21 77.17q-4.8 2.08-8.2 5.8-3.4 3.72-5.16 8.28-.72 1.92-1.16 3.64-.44 1.72-.6 3.64-.08.96.48.72.56-.24.96-.72.96-1.2 1.76-2.36t1.64-2.4q.84-1.24 1.76-2.64.92-1.4 2.04-3 1.2-1.68 2.28-3.32 1.08-1.64 1.92-3.08.84-1.44 1.44-2.64.6-1.2.84-1.92zm-1.76 6.32q-2.88 5.6-5.92 10.52t-6.96 9q-2.48 2.64-2.96-.8-.16-2.72.4-5.68.56-2.96 1.68-5.6 1.04-2.56 2.56-4.96t3.52-4.4q2-2 4.44-3.36 2.44-1.36 5.24-1.84.96-3.36 1.84-6.6.88-3.24 1.44-6.36.56-3.12.6-6.04.04-2.92-.52-5.56-.16-.48-.08-.48.16-.08.28.16.12.24.12.32 1.92 3.84 1.88 8.24-.04 4.4-1.08 9.12-1.04 4.72-2.6 9.6t-2.68 9.76q-.72 3.12-.84 6.68-.12 3.56.68 7 .8 3.6 2.96 6.12t4.96 2.76q.64.08.64.24 0 .16-.2.2-.2.04-.36.04-1.68 0-3.32-.64t-3.08-1.84q-1.44-1.2-2.52-2.84t-1.56-3.72q-.16-.64-.16-1.04-2.24 4.24-5.4 6.84-3.16 2.6-7.96 3-3.6.24-5.48-1.68-1.88-1.92-2.6-4.64-.72-2.72-.48-5.72.24-3 .88-4.92 1.84-5.52 4.64-9.72 2.8-4.2 5.6-5.88.16-.16.48-.28.32-.12.4-.04.16.08-.08.32l-.32.32q-4.32 4.32-6.68 9.88-2.36 5.56-2.52 11.32-.08 1.44.08 3.12.16 1.68.76 3.16.6 1.48 1.72 2.48t3.04 1q2.72.08 5.16-1.64t4.24-4.24q1.8-2.52 2.92-5.4 1.12-2.88 1.28-5.28-.56.64-.96 1.32-.4.68-1.04 1.48-.08.16-.48.52-.4.36-.64.28-.16-.08.16-.92.32-.84.8-1.84.48-1 .96-1.92.48-.92.64-1.24.88-1.84 1.36-3.68.48-1.84 1.12-4" fill="#d2d2cb" stroke-width="none" style="fill:#30b0e0"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-6.232479px 14.829108px;animation:1s linear -.44s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M142.57 109.49q0 .16-.4.32-.24.08-.4.08-1.52.16-2.84-.16-1.32-.32-2.68-1.68-.72-.72-1.24-2.16-.52-1.44-.8-2.8-.28-1.36-.24-2.4.04-1.04.36-.96.08-.08.28.32t.36.92l.32 1.04q.16.52.24.76.4 1.28.96 2.32.56 1.04 1.36 1.84 1.92 2.24 4.16 2.32.16 0 .36.04.2.04.2.2" fill="#d2d2cb" stroke-width="none" style="fill:#a1cde5"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:-23.213318px 1.764662px;animation:1s linear -.424286s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M130.97 75.73q0 .08-.12.16t-.6.24q-1.04.4-2.56 1.32t-3.2 2.28q-1.68 1.36-3.32 3.16t-2.84 3.88q-1.2 2.16-2.04 4.2-.84 2.04-1.32 3.76-.48 1.72-.68 2.92-.2 1.2-.28 1.6-.08 1.36-.08 2.68t.36 2.4q.36 1.08 1.16 1.64.8.56 2.4.32.16 0 1-.36t1-.28q.08.08-.08.32t-.48.52q-.32.28-.6.48-.28.2-.36.28-.72.4-1.6.6-.88.2-1.72.04t-1.56-.68q-.72-.52-1.04-1.48-.88-2.96-.8-5.76.16-2.8.72-5.56.56-2.76 1.92-5.56.8-2.16 2.52-4.48 1.72-2.32 3.96-4.24 2.24-1.92 4.68-3.2 2.44-1.28 4.6-1.36h.64q.32 0 .32.16" fill="#d2d2cb" stroke-width="none" style="fill:#bfdeee"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:10.532883px -4.070892px;animation:1s linear -.408571s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M157.85 84.93q.24-1.04.28-2.4.04-1.36-.2-2.8-.24-1.44-.84-2.76-.6-1.32-1.56-2.28-.48-.32-.56-.32-.32 0 0 .48.48 1.04.36 3.24t-.52 4.56q-.4 2.36-.84 4.24-.44 1.88-.52 2.28-.56 1.44-1 3.6-.44 2.16-.44 3.52-.08.16-.08.64t.24.56q.08 0 .32-.4t.4-.56q1.44-2.56 2.76-5.6 1.32-3.04 2.2-6" fill="#d2d2cb" stroke-width="none" style="fill:#bc252d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:12.820015px 3.449107px;animation:1s linear -.392857s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M158.17 97.01q.32-1.44 1.04-3.72.72-2.28 1.2-4.72t.48-4.8q0-2.36-.96-3.88-.32-.32-.48-.32-.16 0-.08.32 0 3.04-.68 5.64-.68 2.6-1.48 5.08-1.36 4.08-2.48 7.96-1.12 3.88-.96 7.96 0 .24.04.52t.28.28q.16 0 .24-.16l.24-.48q.8-1.92 1.84-4.52 1.04-2.6 1.76-5.16" fill="#d2d2cb" stroke-width="none" style="fill:#d2d2cb"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:5.805752px 2.231329px;animation:1s linear -.377143s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M152.49 111.33q-1.52-1.6-2.32-3.56-.8-1.96-1.12-4-.32-2.04-.16-4.12t.64-3.92q.72-2.88 1.84-5.76t1.92-5.72q.8-2.84.92-5.6t-1.16-5.4q-.24-.4-.32-.4-.08 0-.08.12t.08.2q.24 2.4-.32 4.96t-1.44 5.24q-.88 2.68-1.96 5.52-1.08 2.84-1.8 5.8-.56 2.16-.76 4.4-.2 2.24.28 4.44.48 2.2 1.76 4.2t3.68 3.68q.16.16.4.2.24.04-.08-.28" fill="#d2d2cb" stroke-width="none" style="fill:#4d695d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:8.416683px 17.169107px;animation:1s linear -.361429s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M153.13 108.29q-.24-.64-.52-1.6-.28-.96-.44-1.84-.16-.32-.4-1.2-.24-.88-.4-.88-.32 0-.44.56t-.12 1.4q0 .84.12 1.76t.36 1.56q.48 1.6 1.16 2.24.68.64 1.8 1.04.48.24.72.24.08 0 .04-.12t-.12-.12q-.56-.64-1-1.36-.44-.72-.76-1.68" fill="#d2d2cb" stroke-width="none" style="fill:#83a79d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:16.390022px -28.590895px;animation:1s linear -.345714s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M159.37 66.93q-.4 0-1.24-.12t-.84-.76q0-.24.72-.6t1.6-1.04q.88-.68 1.6-1.76.72-1.08.72-2.76 0-2.08-.8-3.12-.16-.24-.4-.52-.24-.28-.16-.36.16 0 .36.12.2.12.28.2 1.6.88 2.44 2.28.84 1.4.84 2.68 0 2.56-1.2 4.16t-3.92 1.6" fill="#d2d2cb" stroke-width="none" style="fill:#dae8e5"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:13.350014px -30.419821px;animation:1s linear -.33s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M156.41 63.73q-.96.4-.96-.48 0-.64.48-1.24t.92-1.32q.44-.72.6-1.64.16-.92-.48-2.28-.16-.4-.56-.88t-.24-.56q.16-.08.68.12t.68.28q1.36.64 2.04 1.92.68 1.28.68 2.24 0 1.52-1.24 2.52t-2.6 1.32" fill="#d2d2cb" stroke-width="none" style="fill:#30b0e0"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:10.550026px -30.630892px;animation:1s linear -.314286s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M154.09 59.41q0-.4.24-.92t.8-.52q.4 0 .64.52t.24.92q0 .32-.24.84t-.64.52q-.56 0-.8-.48t-.24-.88" fill="#d2d2cb" stroke-width="none" style="fill:#a1cde5"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:37.019875px 2.357107px;animation:1s linear -.298571s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M189.37 82.61q.16 2.48-.32 4.76t-1.2 4.2q-.16.4-.52.88t-.68.32q-.16 0-.08-.56t.08-.8q.08-.88.12-2.2.04-1.32.04-2.68t-.12-2.6q-.12-1.24-.36-2.12-.72-2.56-2.28-2.84-1.56-.28-3.16.84t-3.04 3.12q-1.44 2-1.92 3.92.48-.72 1.24-1.72t1.72-1.92q.96-.92 2.04-1.52t2.04-.52q1.04.08 1.48 1.12.44 1.04.52 2.56.08 1.52-.16 3.28-.24 1.76-.56 3.28-.56 2.48-.96 5.12-.4 2.64-.28 5.16t.88 4.88q.76 2.36 2.6 4.36.16.24.24.4.08.16-.4-.08-2.08-1.2-3.32-2.8-1.24-1.6-1.88-3.44-.64-1.84-.76-3.84-.12-2 .04-4 .32-2.88.96-5.04.64-2.16.96-4.88.16-1.68-.24-2.2-.4-.52-.96-.6-.8-.08-1.8.84-1 .92-2.08 2.6-1.08 1.68-2.08 3.92t-1.72 4.72q-.64 2.48-1.56 5.16t-1.72 4.6q-.32.72-.48.72-.16 0-.28-.32-.12-.32-.12-.48-.32-4 .72-7.92t2.4-7.92q.8-2.48 1.44-4.4.64-1.92.64-4.88 0-1.28.64-2.68.64-1.4 1.88-2.56 1.24-1.16 3.08-1.88t4.16-.64q3.84.08 5.92 1.8t2.92 4.36q.84 2.64.72 5.72-.12 3.08-.68 5.96-.48 2.16-1.12 3.92-.64 1.76-1.36 3.28-.72 1.52-1.36 2.88-.64 1.36-1.04 2.72-.08.24-.16.52t-.24.28q-.16 0-.24-.32-.08-.32-.08-.72-.16-2.72.56-5.24.72-2.52 1.52-5.2t1.2-5.64q.4-2.96-.32-6.56-.72-3.84-3.52-5.12-2.8-1.28-6.4.16-.48.24-1.28.72t-1.56 1.28q-.76.8-1.4 1.88-.64 1.08-.8 2.36.96-1.44 2.24-2.72 1.28-1.28 2.72-2.04 1.44-.76 2.92-.92 1.48-.16 2.92.56 1.68.88 2.32 2.44.64 1.56.72 2.92" fill="#d2d2cb" stroke-width="none" style="fill:#bfdeee"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:25.772522px -4.064739px;animation:1s linear -.282857s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M173.05 84.77q-.88 3.04-2.36 6t-2.44 5.68q-.08.16-.28.6-.2.44-.52.36-.16-.08-.2-.52-.04-.44-.04-.68 0-1.28.44-3.4t.92-3.48q.16-.48.6-2.44.44-1.96.8-4.28.36-2.32.48-4.48.12-2.16-.44-3.12-.32-.56 0-.56.24 0 .64.4.96.88 1.56 2.16.6 1.28.88 2.68.28 1.4.24 2.76-.04 1.36-.28 2.32" fill="#d2d2cb" stroke-width="none" style="fill:#bc252d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:42.387352px 15.062441px;animation:1s linear -.267143s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M189.37 111.25q-.16.08-.64-.08-.24-.08-.4-.16-1.12-.72-1.92-1.64-.8-.92-1.6-3.16-.24-.8-.36-2.04t-.04-2.44q.08-1.2.28-2.04.2-.84.6-.84.16 0 .36.92.2.92.4 2.12.2 1.2.44 2.4t.4 1.76l.8 2.4q.4 1.2 1.28 2.08.16.16.32.44t.08.28" fill="#d2d2cb" stroke-width="none" style="fill:#d2d2cb"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:21.080132px 2.374821px;animation:1s linear -.251429s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M167.77 111.41q-2.48-1.68-3.8-3.68-1.32-2-1.8-4.16t-.36-4.4q.12-2.24.6-4.4.64-2.88 1.64-5.72 1-2.84 1.92-5.52.92-2.68 1.44-5.24.52-2.56.12-4.88 0-.32.08-.32.16 0 .4.4 1.44 2.56 1.36 5.28-.08 2.72-.88 5.56-.8 2.84-1.96 5.76t-1.8 5.88q-.4 1.84-.52 3.88t.28 4.04q.4 2 1.32 3.92t2.52 3.44q.32.16.16.32t-.36.04q-.2-.12-.36-.2" fill="#d2d2cb" stroke-width="none" style="fill:#4d695d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:24.043343px 17.231964px;animation:1s linear -.235714s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M170.81 111.73q-.24.16-.64-.24-.88-.64-1.72-1.36-.84-.72-1.64-2.32-.32-.56-.48-1.44-.16-.88-.16-1.72t.12-1.4q.12-.56.36-.56.32.08.52.88t.36 1.04q.32.88.56 1.64.24.76.56 1.48.48 1.12.96 1.92.48.8 1.12 1.6.08.08.16.24.08.16-.08.24" fill="#d2d2cb" stroke-width="none" style="fill:#83a79d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:76.190018px 5.601109px;animation:1s linear -.22s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M224.89 75.81v-.24q-.16-.08-.36.24-.2.32-.36.48-1.2 1.52-2.16 3.76-.96 2.24-1.64 4.72-.68 2.48-1.12 4.96-.44 2.48-.76 4.4-.4 2.72-.68 5.16t-.52 4.76q-.24 2.32-.4 4.68-.16 2.36-.4 4.84.08.08.08.44v1.36q0 .28.16.28.08 0 .24-.28.16-.28.32-.6.16-.32.24-.64l.08-.32q.88-1.92 1.52-4.48.64-2.56 1.04-5.12.08-.64.32-2.64t.56-4.64q.32-2.64.76-5.72.44-3.08.88-5.92t.96-5.16q.52-2.32 1-3.52.08-.32.16-.48.08-.16.08-.32" fill="#d2d2cb" stroke-width="none" style="fill:#dae8e5"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:67.812241px -.882688px;animation:1s linear -.204286s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M222.25 75.25q0-.08-.56-.08-.24 0-.48.08-3.04.32-5.6 1.64-2.56 1.32-4.68 3.28-2.12 1.96-3.76 4.44-1.64 2.48-2.68 5.12-1.12 2.72-1.68 5.76-.56 3.04-.4 5.68.24 3.44 3.04.64 2.4-2.4 4.52-5.2 2.12-2.8 4-5.92t3.56-6.36q1.68-3.24 3.36-6.52.32-.64.24-.64-.16-.16-.36 0-.2.16-.2.32-4.32 5.52-8.04 10.56-3.72 5.04-6.84 10-.4.4-.52.24-.12-.16-.04-.56.16-1.84.6-3.8.44-1.96 1.24-3.96 1.92-4.88 5.52-8.64 3.6-3.76 9.04-5.6.72-.32.72-.48" fill="#d2d2cb" stroke-width="none" style="fill:#30b0e0"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:63.618591px .729107px;animation:1s linear -.188571s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M217.93 74.69q-.08-.16-.36-.16h-.52q-2.24 0-4.68 1.28-2.44 1.28-4.68 3.24-2.24 1.96-4 4.32-1.76 2.36-2.64 4.52-1.12 2.88-1.88 5.56-.76 2.68-.84 5.4-.08 1.44.12 2.8.2 1.36.76 2.96.32.96 1.08 1.52t1.6.72q.84.16 1.72 0t1.52-.64q.08-.08.36-.32.28-.24.56-.52t.48-.52q.2-.24.12-.4-.08-.16-.76.2t-1.16.44q-1.68.32-2.52-.24-.84-.56-1.2-1.64-.36-1.08-.32-2.4.04-1.32.2-2.6 0-.48.2-1.68t.68-2.92q.48-1.72 1.32-3.8.84-2.08 2.04-4.16 1.2-2.08 2.84-3.84 1.64-1.76 3.32-3.12t3.24-2.24q1.56-.88 2.68-1.2.56-.16.64-.28.08-.12.08-.28" fill="#d2d2cb" stroke-width="none" style="fill:#a1cde5"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:67.344307px 13.990774px;animation:1s linear -.172857s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M227.61 74.13v-.32q-.24 0-.4.32-.08.16-.16.4-2.4 4.96-3.36 10.2-.96 5.24-1.44 10.68-.48 5.44-.96 10.96-.48 5.52-1.92 11.04-.48 1.76-.96 3.68-.48 1.92-1.28 3.76-.8 1.84-2.12 3.48t-3.56 2.76q-2.56 1.36-4.72 1.16-2.16-.2-4-1.16-1.84-.96-3.36-2.44-1.52-1.48-2.64-2.68-.16-.16-.32-.36-.16-.2-.24-.12-.16.08-.04.36.12.28.2.44 1.84 3.44 5.6 6 .88.64 2.16 1.12 1.28.48 2.76.68 1.48.2 3.04-.08t3-1.24q2.64-1.76 4.2-3.72 1.56-1.96 2.52-4t1.48-4.2q.52-2.16 1-4.24 1.36-5.44 1.88-10.84.52-5.4.84-10.68.32-5.28.8-10.44.48-5.16 1.84-10.04.16-.32.16-.48" fill="#d2d2cb" stroke-width="none" style="fill:#bfdeee"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:63.203522px 12.401834px;animation:1s linear -.157143s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M218.17 89.09q.4-1.68 1.08-3.48t1.08-3.56q0-.16.12-.56t.04-.4q-.16-.08-.48.4-.32.48-.32.56-1.12 1.84-2 3.88-.88 2.04-1.6 3.72-.16.4-.68 1.36-.52.96-1.04 2.04t-.88 2q-.36.92-.12 1.08.16 0 .48-.36.32-.36.48-.52.24-.4.56-.84.32-.44.64-.84-.48 2-.84 3.32-.36 1.32-.76 2.36-.4 1.04-.92 1.96-.52.92-1.4 2.12-.64.88-1.56 1.88-.92 1-2.08 1.84-1.16.84-2.52 1.36-1.36.52-2.88.52-1.92 0-3.04-1t-1.68-2.48q-.56-1.48-.72-3.16-.16-1.68-.08-3.12.32-5.76 2.68-11.24 2.36-5.48 6.6-9.8 0-.08.24-.32t.24-.32q-.16-.16-.4 0l-.32.16q-1.44.88-3 2.4t-2.96 3.56q-1.4 2.04-2.56 4.52-1.16 2.48-1.96 5.12-.4 1.36-.6 3.24-.2 1.88-.08 3.92.12 2.04.56 4.08.44 2.04 1.44 3.6t2.56 2.48q1.56.92 3.88.76 2.32-.16 3.72-.8 1.4-.64 2.28-1.36 1.12-.88 2-1.84.88-.96 1.76-1.84-.48 2.8-.92 4.76-.44 1.96-.84 3.72-.56 2.4-1.04 4.6-.48 2.2-1.04 3.88-.56 1.68-1.28 2.76-.72 1.08-1.68 1.24-1.12 0-1.12.24-.08.24.32.4.4.16.8.24 1.2.24 2.28-.4 1.08-.64 1.92-1.88.84-1.24 1.52-2.92t1.16-3.44q.96-3.68 1.6-7.16.64-3.48 1.2-7.32.56-3.76.92-7.52t1.24-7.6" fill="#d2d2cb" stroke-width="none" style="fill:#bc252d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:58.411324px 36.894824px;animation:1s linear -.141429s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M209.21 128.77q-.16-.16-.44-.12-.28.04-.36.04-1.36.24-2.68-.08t-2.68-.88q-1.52-.64-2.8-1.56-1.28-.92-2.88-1.96-.16-.16-.48-.32-.32-.16-.32 0-.08.08.12.4t.36.48q1.04 1.36 2.2 2.56 1.16 1.2 3 1.92 1.2.48 2.48.64 1.28.16 2.36.04 1.08-.12 1.72-.44.64-.32.4-.72" fill="#d2d2cb" stroke-width="none" style="fill:#d2d2cb"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:91.190025px 17.449108px;animation:1s linear -.125714s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M234.17 112.93q-.4 0-1.24-.12t-.84-.76q0-.24.72-.6t1.6-1q.88-.64 1.6-1.72.72-1.08.72-2.76 0-2.08-.8-3.12-.16-.24-.4-.52-.24-.28-.16-.36.16 0 .36.12.2.12.28.2 1.6.88 2.44 2.28.84 1.4.84 2.68 0 2.56-1.2 4.12t-3.92 1.56" fill="#d2d2cb" stroke-width="none" style="fill:#4d695d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:88.150017px 15.660178px;animation:1s linear -.11s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M231.21 109.81q-.96.4-.96-.48 0-.64.48-1.24t.92-1.32q.44-.72.6-1.64.16-.92-.48-2.28-.16-.4-.56-.88t-.24-.56q.16-.08.68.12t.68.28q1.36.64 2.04 1.92.68 1.28.68 2.24 0 1.52-1.24 2.52t-2.6 1.32" fill="#d2d2cb" stroke-width="none" style="fill:#83a79d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:85.350021px 15.449107px;animation:1s linear -.094286s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M228.89 105.49q0-.4.24-.92t.8-.52q.4 0 .64.52t.24.92q0 .32-.24.84t-.64.52q-.56 0-.8-.48t-.24-.88" fill="#d2d2cb" stroke-width="none" style="fill:#dae8e5"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:111.350014px 17.449108px;animation:1s linear -.078571s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M254.33 112.93q-.4 0-1.24-.12t-.84-.76q0-.24.72-.6t1.6-1q.88-.64 1.6-1.72.72-1.08.72-2.76 0-2.08-.8-3.12-.16-.24-.4-.52-.24-.28-.16-.36.16 0 .36.12.2.12.28.2 1.6.88 2.44 2.28.84 1.4.84 2.68 0 2.56-1.2 4.12t-3.92 1.56" fill="#d2d2cb" stroke-width="none" style="fill:#30b0e0"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:108.31002px 15.660178px;animation:1s linear -.062857s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M251.37 109.81q-.96.4-.96-.48 0-.64.48-1.24t.92-1.32q.44-.72.6-1.64.16-.92-.48-2.28-.16-.4-.56-.88t-.24-.56q.16-.08.68.12t.68.28q1.36.64 2.04 1.92.68 1.28.68 2.24 0 1.52-1.24 2.52t-2.6 1.32" fill="#d2d2cb" stroke-width="none" style="fill:#a1cde5"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:105.510017px 15.449107px;animation:1s linear -.047143s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M249.05 105.49q0-.4.24-.92t.8-.52q.4 0 .64.52t.24.92q0 .32-.24.84t-.64.52q-.56 0-.8-.48t-.24-.88" fill="#d2d2cb" stroke-width="none" style="fill:#bfdeee"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:131.510017px 17.449108px;animation:1s linear -.031429s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M274.49 112.93q-.4 0-1.24-.12t-.84-.76q0-.24.72-.6t1.6-1q.88-.64 1.6-1.72.72-1.08.72-2.76 0-2.08-.8-3.12-.16-.24-.4-.52-.24-.28-.16-.36.16 0 .36.12.2.12.28.2 1.6.88 2.44 2.28.84 1.4.84 2.68 0 2.56-1.2 4.12t-3.92 1.56" fill="#d2d2cb" stroke-width="none" style="fill:#bc252d"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:128.470024px 15.660178px;animation:1s linear -.015714s infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M271.53 109.81q-.96.4-.96-.48 0-.64.48-1.24t.92-1.32q.44-.72.6-1.64.16-.92-.48-2.28-.16-.4-.56-.88t-.24-.56q.16-.08.68.12t.68.28q1.36.64 2.04 1.92.68 1.28.68 2.24 0 1.52-1.24 2.52t-2.6 1.32" fill="#d2d2cb" stroke-width="none" style="fill:#d2d2cb"/></g><g style="transform:matrix(1,0,0,1,0,0);transform-origin:125.670029px 15.449107px;animation:1s linear infinite forwards bounce-3c330417-32e6-452f-bc30-b486e5f258a7"><path d="M269.21 105.49q0-.4.24-.92t.8-.52q.4 0 .64.52t.24.92q0 .32-.24.84t-.64.52q-.56 0-.8-.48t-.24-.88" fill="#d2d2cb" stroke-width="none" style="fill:#4d695d"/></g></g><style id="bounce-3c330417-32e6-452f-bc30-b486e5f258a7">@keyframes bounce-3c330417-32e6-452f-bc30-b486e5f258a7{0%{animation-timing-function:cubic-bezier(.1361,.2514,.2175,.8786);transform:translate(0,0) scaleY(1)}37%{animation-timing-function:cubic-bezier(.7674,.1844,.8382,.7157);transform:translate(0,-39.96px) scaleY(1)}72%{animation-timing-function:cubic-bezier(.1118,.2149,.2172,.941);transform:translate(0,0) scaleY(1)}87%{animation-timing-function:cubic-bezier(.7494,.2259,.8209,.6963);transform:translate(0,19.900000000000002px) scaleY(.602)}}</style></svg>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
23
|
+
<div id="root"></div>
|
|
28
24
|
</body>
|
|
29
25
|
</html>
|
package/typings/global.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { JsMinifyOptions, Config as SwcConfig } from '@swc/core';
|
|
|
6
6
|
import type { CssNanoOptionsExtended } from 'css-minimizer-webpack-plugin';
|
|
7
7
|
import type { MinifyOptions } from 'terser';
|
|
8
8
|
import type { Options } from 'ts-import-plugin';
|
|
9
|
-
import type { Configuration, RuleSetRule, WebpackPluginInstance } from 'webpack';
|
|
9
|
+
import type { Configuration, ExternalsPresets, RuleSetRule, WebpackPluginInstance } from 'webpack';
|
|
10
10
|
import type {
|
|
11
11
|
ProxyArray,
|
|
12
12
|
ProxyConfigArray,
|
|
@@ -16,14 +16,8 @@ import type {
|
|
|
16
16
|
import type { State } from 'webpackbar';
|
|
17
17
|
|
|
18
18
|
export type MinifierType = 'swc' | 'terser';
|
|
19
|
-
export declare type AppType =
|
|
20
|
-
|
|
21
|
-
| 'mobile'
|
|
22
|
-
| 'site'
|
|
23
|
-
| 'back-stage'
|
|
24
|
-
| 'single-spa'
|
|
25
|
-
| 'library';
|
|
26
|
-
export declare type Framework = 'react' | 'solid-js';
|
|
19
|
+
export declare type AppType = 'mobile' | 'site' | 'backstage' | 'micro' | 'library';
|
|
20
|
+
export declare type Framework = 'react' | 'solid';
|
|
27
21
|
export type TerserOptions = MinifyOptions;
|
|
28
22
|
export type SwcOptions = JsMinifyOptions;
|
|
29
23
|
export type HtmlWebpackOption = HtmlWebpackPluginOptions & {
|
|
@@ -94,26 +88,24 @@ export declare type ConfigType<T extends 'tsc' | 'swc' = 'swc'> = {
|
|
|
94
88
|
/** 环境变量, 可通过 process.env 获取 */
|
|
95
89
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
96
90
|
env?: Record<string, any>;
|
|
97
|
-
// /** persistence 持久化数据使用的key, 为 false 时关闭持久化
|
|
98
|
-
// * @default false
|
|
99
|
-
// **/
|
|
100
|
-
// persistence?: string | false;
|
|
101
91
|
devtool?: Configuration['devtool'];
|
|
102
92
|
sourceMap?: SourceMapDevToolPluginOptions | false;
|
|
103
93
|
/** 路径别名映射 */
|
|
104
|
-
alias
|
|
94
|
+
alias: {
|
|
105
95
|
[key: string]: string;
|
|
106
96
|
};
|
|
107
97
|
/** 根路由 */
|
|
108
|
-
|
|
98
|
+
basename: string;
|
|
109
99
|
/** 输出目录前置路径
|
|
110
100
|
* @default /
|
|
111
101
|
* */
|
|
112
102
|
publicPath: string;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
103
|
+
rem?: {
|
|
104
|
+
/** 设计图尺寸, 用于计算rem
|
|
105
|
+
* @default 1680
|
|
106
|
+
* */
|
|
107
|
+
designSize: number;
|
|
108
|
+
} | null;
|
|
117
109
|
/** 自定义降级组件 */
|
|
118
110
|
fallbackCompPath?: string | null;
|
|
119
111
|
/** less 全局变量 */
|
|
@@ -122,28 +114,6 @@ export declare type ConfigType<T extends 'tsc' | 'swc' = 'swc'> = {
|
|
|
122
114
|
* @default n
|
|
123
115
|
*/
|
|
124
116
|
prefixCls?: string;
|
|
125
|
-
/** 左侧菜单栏, 不需要时设置为 false, 仅 type: back-stage 时有效 */
|
|
126
|
-
layoutSider:
|
|
127
|
-
| false
|
|
128
|
-
| {
|
|
129
|
-
theme?: 'light' | 'dark';
|
|
130
|
-
breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
131
|
-
};
|
|
132
|
-
/** iconfont图标设置 */
|
|
133
|
-
iconfont?: {
|
|
134
|
-
/** 图标加载地址
|
|
135
|
-
* @example
|
|
136
|
-
* iconfont: {
|
|
137
|
-
* scriptUrl: [
|
|
138
|
-
* '//at.alicdn.com/t/font_2632005_n3kt9cjpzn.js', // icon one
|
|
139
|
-
* '//at.alicdn.com/t/font_2446726_525dowa25vp.js', // icon two
|
|
140
|
-
* ]
|
|
141
|
-
* }
|
|
142
|
-
*/
|
|
143
|
-
scriptUrl?: string | string[];
|
|
144
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
145
|
-
extraCommonProps?: Record<string, any>;
|
|
146
|
-
};
|
|
147
117
|
/** 主题设置 */
|
|
148
118
|
theme?: Theme;
|
|
149
119
|
/** 自定义 webpack module rules */
|
|
@@ -222,6 +192,9 @@ export declare type ConfigType<T extends 'tsc' | 'swc' = 'swc'> = {
|
|
|
222
192
|
plugins: WebpackPluginInstance[];
|
|
223
193
|
/** 对生产chunk进行拆分 */
|
|
224
194
|
splitChunk?: false | OptimizationSplitChunksOptions;
|
|
195
|
+
/** 拆分 runtime 代码
|
|
196
|
+
* @default 'single'
|
|
197
|
+
*/
|
|
225
198
|
runtimeChunk?:
|
|
226
199
|
| boolean
|
|
227
200
|
| 'single'
|
|
@@ -243,7 +216,17 @@ export declare type ConfigType<T extends 'tsc' | 'swc' = 'swc'> = {
|
|
|
243
216
|
media?: string[];
|
|
244
217
|
fonts?: string[];
|
|
245
218
|
};
|
|
246
|
-
|
|
219
|
+
/** bundle分析
|
|
220
|
+
* @default false
|
|
221
|
+
* @example
|
|
222
|
+
* // 推荐
|
|
223
|
+
* {
|
|
224
|
+
* analyzerMode: 'static',
|
|
225
|
+
* reportFilename: 'report.html',
|
|
226
|
+
* openAnalyzer: false,
|
|
227
|
+
* }
|
|
228
|
+
*/
|
|
229
|
+
bundleAnalyzer: BundleAnalyzerPlugin.Options | false;
|
|
247
230
|
/** seo优化
|
|
248
231
|
* @default false
|
|
249
232
|
*/
|
|
@@ -288,6 +271,11 @@ export declare type ConfigType<T extends 'tsc' | 'swc' = 'swc'> = {
|
|
|
288
271
|
* console.log(b); // { age: 12 }
|
|
289
272
|
*/
|
|
290
273
|
virtualModule?: Record<string, string | object>;
|
|
274
|
+
/** 是否使用 normalize css
|
|
275
|
+
* @default true
|
|
276
|
+
*/
|
|
277
|
+
normalizeCss?: boolean;
|
|
278
|
+
externalsPresets?: ExternalsPresets;
|
|
291
279
|
};
|
|
292
280
|
export declare interface ModuleFederationOption {
|
|
293
281
|
/** 模块名称,唯一性,不能重名 */
|
|
@@ -425,67 +413,6 @@ export declare interface SourceMapDevToolPluginOptions {
|
|
|
425
413
|
sourceRoot?: string;
|
|
426
414
|
test?: string | RegExp | Rule[];
|
|
427
415
|
}
|
|
428
|
-
export type ProgramInfoType = {
|
|
429
|
-
/** 应用名称 */
|
|
430
|
-
name: string;
|
|
431
|
-
/** 应用描述 */
|
|
432
|
-
description: string;
|
|
433
|
-
/** 应用版本 */
|
|
434
|
-
version: string;
|
|
435
|
-
/** 应用类型 */
|
|
436
|
-
type: 'mobile' | 'site' | 'back-stage' | 'single-spa' | 'library';
|
|
437
|
-
/** 开发者 */
|
|
438
|
-
author: {
|
|
439
|
-
name: string;
|
|
440
|
-
url?: string;
|
|
441
|
-
email?: string;
|
|
442
|
-
};
|
|
443
|
-
/** 存储库 */
|
|
444
|
-
repository: {
|
|
445
|
-
type?: string;
|
|
446
|
-
url?: string;
|
|
447
|
-
directory?: string;
|
|
448
|
-
};
|
|
449
|
-
/** 路由模式 */
|
|
450
|
-
routerMode: 'hash' | 'browser' | 'memory';
|
|
451
|
-
/** 根路由 */
|
|
452
|
-
routeBaseName: string;
|
|
453
|
-
/** 设计尺寸 */
|
|
454
|
-
designSize: number;
|
|
455
|
-
/** 渲染模式 */
|
|
456
|
-
renderMode: 'ssr' | 'csr';
|
|
457
|
-
};
|
|
458
|
-
|
|
459
|
-
export type CoverageType = {
|
|
460
|
-
/** 语句(statement coverage) */
|
|
461
|
-
statements: string;
|
|
462
|
-
/** 语句覆盖: 是不是每个语句都执行了 */
|
|
463
|
-
coveredstatements: string;
|
|
464
|
-
/** 条件(branch coverage) */
|
|
465
|
-
conditionals: string;
|
|
466
|
-
/** 条件覆盖: 是不是每个条件代码块都执行了 */
|
|
467
|
-
coveredconditionals: string;
|
|
468
|
-
/** 函数(function coverage) */
|
|
469
|
-
methods: string;
|
|
470
|
-
/** 函数覆盖: 是不是每个函数都调用了 */
|
|
471
|
-
coveredmethods: string;
|
|
472
|
-
};
|
|
473
|
-
|
|
474
|
-
export type ProjectCoverageType = {
|
|
475
|
-
/** 元素 */
|
|
476
|
-
elements: string;
|
|
477
|
-
/** 覆盖元素 */
|
|
478
|
-
coveredelements: string;
|
|
479
|
-
complexity: string;
|
|
480
|
-
loc: string;
|
|
481
|
-
ncloc: string;
|
|
482
|
-
/** 经过测试的组件 */
|
|
483
|
-
packages: string;
|
|
484
|
-
/** 经过测试的文件 */
|
|
485
|
-
files: string;
|
|
486
|
-
/** 经过测试的类 */
|
|
487
|
-
classes: string;
|
|
488
|
-
};
|
|
489
416
|
|
|
490
417
|
export declare interface OptimizationSplitChunksOptions {
|
|
491
418
|
/**
|
package/lib/define.d.ts
DELETED
package/lib/define.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{CONFIG as o}from"./common.js";import{NODE_ENV as e}from"./process-env.js";let r={"process.env":JSON.stringify({NODE_ENV:e,...o.env})};export default r;
|
package/lib/modifyVars.d.ts
DELETED
package/lib/modifyVars.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;
|