@moneko/core 3.0.0-beta.21 → 3.0.0-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{build → lib}/common.d.ts +1 -1
- package/lib/common.js +12 -0
- package/{build → lib}/coverage.d.ts +1 -1
- package/{build → lib}/html-plugin-option.d.ts +1 -1
- package/lib/index.d.ts +2 -35
- package/lib/index.js +1 -1
- package/{build → lib}/process-env.d.ts +3 -2
- package/lib/process-env.js +1 -0
- package/lib/swcrc.js +1 -0
- package/lib/webpack.common.js +1 -0
- package/lib/webpack.dev.js +4 -0
- package/package.json +3 -11
- package/typings/global.d.ts +1 -0
- package/build/common.js +0 -12
- package/build/index.d.ts +0 -2
- package/build/index.js +0 -1
- package/build/process-env.js +0 -1
- package/build/swcrc.js +0 -1
- package/build/webpack.common.js +0 -1
- package/build/webpack.dev.js +0 -4
- package/lib/normalize.css +0 -254
- package/lib/packages/library/bootstrap.d.ts +0 -1
- package/lib/packages/library/bootstrap.js +0 -1
- package/lib/packages/library/index.d.ts +0 -4
- package/lib/packages/library/index.js +0 -1
- package/lib/refresh-rem.d.ts +0 -0
- package/lib/refresh-rem.js +0 -1
- package/lib/router/index.d.ts +0 -52
- package/lib/router/index.js +0 -1
- /package/{build → lib}/coverage.js +0 -0
- /package/{build → lib}/done.d.ts +0 -0
- /package/{build → lib}/done.js +0 -0
- /package/{build → lib}/envFlags.d.ts +0 -0
- /package/{build → lib}/envFlags.js +0 -0
- /package/{build → lib}/esm.d.ts +0 -0
- /package/{build → lib}/esm.js +0 -0
- /package/{build → lib}/has-pkg.d.ts +0 -0
- /package/{build → lib}/has-pkg.js +0 -0
- /package/{build → lib}/html-add-entry-attr.d.ts +0 -0
- /package/{build → lib}/html-add-entry-attr.js +0 -0
- /package/{build → lib}/html-plugin-option.js +0 -0
- /package/{build → lib}/minify.d.ts +0 -0
- /package/{build → lib}/minify.js +0 -0
- /package/{build → lib}/modifyVars.d.ts +0 -0
- /package/{build → lib}/modifyVars.js +0 -0
- /package/{build → lib}/module-federation.d.ts +0 -0
- /package/{build → lib}/module-federation.js +0 -0
- /package/{build → lib}/module.config.d.ts +0 -0
- /package/{build → lib}/module.config.js +0 -0
- /package/{build → lib}/resolver-sync.d.ts +0 -0
- /package/{build → lib}/resolver-sync.js +0 -0
- /package/{build → lib}/seo.d.ts +0 -0
- /package/{build → lib}/seo.js +0 -0
- /package/{build → lib}/swcrc.d.ts +0 -0
- /package/{build → lib}/tsloader.config.d.ts +0 -0
- /package/{build → lib}/tsloader.config.js +0 -0
- /package/{build → lib}/utils.d.ts +0 -0
- /package/{build → lib}/utils.js +0 -0
- /package/{build → lib}/webpack.common.d.ts +0 -0
- /package/{build → lib}/webpack.dev.d.ts +0 -0
- /package/{build → lib}/webpack.prod.d.ts +0 -0
- /package/{build → lib}/webpack.prod.js +0 -0
- /package/{build → lib}/yarn-argv.d.ts +0 -0
- /package/{build → lib}/yarn-argv.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AppType, ConfigType } from '../typings/global.
|
|
1
|
+
import type { AppType, ConfigType } from '../typings/global.js';
|
|
2
2
|
export declare const ENTRYPATH: Record<AppType, string>;
|
|
3
3
|
export declare const log: (msg: string) => void;
|
|
4
4
|
export declare const CONFIG: ConfigType<"swc">;
|
package/lib/common.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import e from"fs";import t from"path";import o from"readline";import s from"chalk";import{merge as l}from"webpack-merge";import{APPTYPE as n,CUSTOMCONFIG as i,jsxImportSource as r,pkgName as a,PROGRAMPATH as c}from"./process-env.js";import{isFunction as p,readConf as m}from"./utils.js";export const ENTRYPATH={mobile:"mobile",site:"site","back-stage":"back-stage","single-spa":"single-spa",library:"library","single-component":"single-component"};let u=[a,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design"],d={chunks:"all",minSize:1024,minChunks:1};"single-component"===n&&(d=!1);let h={seo:!1,mode:"csr",compiler:"swc",bundleAnalyzer:{analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1},entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:""},env:{},routeBaseName:"/",publicPath:"/",designSize:"mobile"===n?375:1680,fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{},layoutSider:{},moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:c+"/node_modules/.temp_cache",devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:`./node_modules/${a}/template/index.html`,favicon:`./node_modules/${a}/template/favicon.ico`,tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],splitChunk:d,runtimeChunk:"single-component"!==n&&"single",moduleFederation:[],rulesInclude:{less:u,css:u,js:u,media:u,fonts:u},mdx:{jsxImportSource:r,remarkPlugins:[],rehypePlugins:[]}};export const log=e=>{o.cursorTo(process.stdout,0),process.stdout.write(e)};let f=h,g=null,y={},w={};try{g=t.join(c,"./config/index.ts"),e.accessSync(g,e.constants.R_OK)}catch(e){g=null}if(g)try{let e=(await m(g,"index")).default;y=p(e)?e(process):e}catch(e){process.stdout.write(s.red(e))}if(i){let o=null;try{o=t.join(c,`./config/${i}.ts`),e.accessSync(o,e.constants.R_OK)}catch(e){o=null}if(null!==o)try{let e=(await m(o,i)).default;w=p(e)?e(process):e}catch(e){process.stdout.write(s.red(e))}}!1===(f=l(f,y,w)).devtool&&(f.sourceMap=!1),!1===f.sourceMap&&(f.devtool=!1),f.fixBrowserRouter&&(f.htmlPluginOption.tags||(f.htmlPluginOption.tags=[]),f.htmlPluginOption.tags.push({textContent:`
|
|
2
|
+
(function(l) {
|
|
3
|
+
if (l.search[1] === '/' ) {
|
|
4
|
+
var decoded = l.search.slice(1).split('&').map(function(s) {
|
|
5
|
+
return s.replace(/~and~/g, '&')
|
|
6
|
+
}).join('?');
|
|
7
|
+
window.history.replaceState(null, null,
|
|
8
|
+
l.pathname.slice(0, -1) + decoded + l.hash
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
}(window.location))
|
|
12
|
+
`}));export const CONFIG=f;export const PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG,log};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CoverageType, ProjectCoverageType } from '../typings/global.
|
|
1
|
+
import type { CoverageType, ProjectCoverageType } from '../typings/global.js';
|
|
2
2
|
export declare const coverage: Record<string, CoverageType & Partial<ProjectCoverageType>>;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,35 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export type PartialConfigType<T = 'swc'> = Partial<ConfigType<T>>;
|
|
4
|
-
export type PartialCommomType<T = 'swc'> = Partial<CommomType<T>>;
|
|
5
|
-
/** 一些项目基本信息 */
|
|
6
|
-
export declare const projectBasicInfo: {
|
|
7
|
-
projectName: string;
|
|
8
|
-
providerConfig: {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
prefixCls: string;
|
|
11
|
-
iconPrefixCls: string;
|
|
12
|
-
input: React.InputHTMLAttributes<HTMLInputElement>;
|
|
13
|
-
};
|
|
14
|
-
programInfo: {
|
|
15
|
-
name: string;
|
|
16
|
-
description: string;
|
|
17
|
-
version: string;
|
|
18
|
-
type: "mobile" | "site" | "back-stage" | "single-spa" | "library";
|
|
19
|
-
author: {
|
|
20
|
-
name: string;
|
|
21
|
-
url?: string | undefined;
|
|
22
|
-
email?: string | undefined;
|
|
23
|
-
};
|
|
24
|
-
repository: {
|
|
25
|
-
type?: string | undefined;
|
|
26
|
-
url?: string | undefined;
|
|
27
|
-
directory?: string | undefined;
|
|
28
|
-
};
|
|
29
|
-
routerMode: "hash" | "browser" | "memory";
|
|
30
|
-
routeBaseName: string;
|
|
31
|
-
designSize: number;
|
|
32
|
-
renderMode: "ssr" | "csr";
|
|
33
|
-
};
|
|
34
|
-
coverage: Record<string, CoverageType & Partial<ProjectCoverageType>>;
|
|
35
|
-
};
|
|
1
|
+
export * from './process-env.js';
|
|
2
|
+
export * from './utils.js';
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export*from"./process-env.js";export*from"./utils.js";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { AppType } from '../typings/global.
|
|
1
|
+
import type { AppType, Framework } from '../typings/global.js';
|
|
2
2
|
export declare const __dirname: string;
|
|
3
3
|
export declare const APPTYPE: AppType;
|
|
4
|
+
export declare const FRAMEWORK: Framework;
|
|
5
|
+
export declare const jsxImportSource: string;
|
|
4
6
|
export declare const PROGRAMPATH: string;
|
|
5
7
|
export declare const PACKAGENAME: string;
|
|
6
8
|
export declare const PACKAGEVERSION: string;
|
|
@@ -11,7 +13,6 @@ export declare const CUSTOMCONFIG: string | undefined;
|
|
|
11
13
|
export declare const DEV: boolean;
|
|
12
14
|
export declare let hasEslintConfig: boolean;
|
|
13
15
|
export declare let hasStylelintConfig: boolean;
|
|
14
|
-
export declare const hasReact: boolean;
|
|
15
16
|
export declare const hasAntd: boolean;
|
|
16
17
|
export declare const programInfo: {
|
|
17
18
|
name: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{readFileSync as e,existsSync as o,mkdirSync as r}from"fs";import{join as s}from"path";import t from"url";import{hasPkg as n}from"./has-pkg.js";import{resolveProgramPath as p}from"./utils.js";import c from"./yarn-argv.js";export const __dirname=t.fileURLToPath(new URL(".",import.meta.url));export const APPTYPE=process.env.APPTYPE;export const FRAMEWORK=process.env.FRAMEWORK;export const jsxImportSource={react:"react","solid-js":"solid-js/h"}[FRAMEWORK];export const PROGRAMPATH=process.cwd();export const PACKAGENAME=process.env.npm_package_name;export const PACKAGEVERSION=process.env.npm_package_version;let a=e(s(__dirname,"../package.json"),{encoding:"utf-8"});export const cacheDir=s(PROGRAMPATH,"./node_modules/.cache/@moneko/cli/");o(cacheDir)||r(cacheDir,{recursive:!0});export const pkgName=JSON.parse(a).name;export const NODE_ENV=process.env.NODE_ENV;export const CUSTOMCONFIG=process.env.npm_config_config||c.config;export const DEV="development"===process.env.NODE_ENV;export let hasEslintConfig=!!Object.keys(process.env).filter(e=>e.startsWith("npm_package_eslintConfig_")).length;export let hasStylelintConfig=!!Object.keys(process.env).filter(e=>e.startsWith("npm_package_stylelint_")).length;export const hasAntd=n("antd");export const programInfo={name:PACKAGENAME,version:PACKAGEVERSION,type:APPTYPE,description:process.env.npm_package_description,author:{name:process.env.npm_package_author_name,email:process.env.npm_package_author_email,url:process.env.npm_package_author_url},repository:{type:process.env.npm_package_repository_type,url:process.env.npm_package_repository_url,directory:process.env.npm_package_repository_directory}};if(parseInt(process.versions.node)>14){let o=e(p("package.json"),{encoding:"utf-8"}),{description:r,author:s,repository:t,eslintConfig:n,stylelint:c}=JSON.parse(o);programInfo.author="string"==typeof s?{name:s}:s,programInfo.repository="string"==typeof s?{url:t}:t,programInfo.description=r,hasEslintConfig=!!n,hasStylelintConfig=!!c}
|
package/lib/swcrc.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{merge as e}from"webpack-merge";import{CONFIG as o}from"./common.js";import r from"./envFlags.js";import{FRAMEWORK as t,jsxImportSource as s}from"./process-env.js";let n={env:{targets:["last 2 version","> 0.5%","ie 11","not dead"],mode:"entry",coreJs:"3"}};export const swcMinifyOption={compress:{top_retain:[],keep_infinity:!0,global_defs:{"@alert":"console.log"},pure_funcs:["console.log","console.warn","console.error","console.info"],toplevel:!1,drop_console:!0,drop_debugger:!0,module:!1,ecma:2015,ie8:!1,keep_classnames:void 0,keep_fnames:!1},mangle:!0};export default((a=!1)=>{let c={module:{type:"es6",ignoreDynamic:!0,strict:!0,strictMode:!0,lazy:!0,noInterop:!0},jsc:{parser:{syntax:"typescript",decorators:!0,dynamicImport:!0,tsx:!0},loose:!0,target:"es2022",externalHelpers:!0,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,useBuiltins:!0,refresh:"react"===t&&a,development:a,importSource:s},constModules:{globals:{"env-flags":r}},optimizer:{simplify:!1}},experimental:{plugins:[["swc-plugin-another-transform-imports",function(e){for(let o=0,r=Object.keys(e),t=r.length;o<t;o++)e[r[o]].transform=`${r[o]}/${e[r[o]].transform}`,e[r[o]].style&&(e[r[o]].style=`${r[o]}/${e[r[o]].style}`);return e}(o.importOnDemand||{})]]}},sourceMaps:!0,parseMap:!0},l=Object.assign(c,!a&&n);return o.swcrc&&(l=e(l,"function"==typeof o.swcrc?o.swcrc(a):o.swcrc)),l});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"fs";import t from"add-asset-html-webpack-plugin";import s from"html-webpack-plugin";import n from"webpack";import o from"webpackbar";import{CONFIG as l,ENTRYPATH as i,PUBLICPATH as a}from"./common.js";import r from"./done.js";import p from"./envFlags.js";import m from"./html-add-entry-attr.js";import c from"./html-plugin-option.js";import{moduleFederation as u}from"./module-federation.js";import f from"./module.config.js";import{APPTYPE as d,DEV as g,hasEslintConfig as j,hasStylelintConfig as h,PACKAGENAME as b,PROGRAMPATH as y,FRAMEWORK as w}from"./process-env.js";import{seo as x}from"./seo.js";import{resolveNodeModulesPath as k,resolveProgramPath as v}from"./utils.js";let C=[".eslintrc.js",".eslintrc.json",".eslintrc.yaml",".eslintrc.json"],O=[".stylelintrc",".stylelintrc.json",".stylelintrc.yaml",".stylelintrc.yml",".stylelintrc.js","stylelint.config.js","stylelint.config.cjs"],P=e.readdirSync(y),$=!1,T=!1;for(let e=0,t=P.length;e<t;e++)O.includes(P[e])&&(T=!0),C.includes(P[e])&&($=!0);$||($=j),T||(T=h);let A=T?(await import("stylelint-webpack-plugin")).default:null,B=$?(await import("eslint-webpack-plugin")).default:null,S={"@":v("src")};Object.assign(S,l.alias),"library"===d&&Object.assign(S,{"@":v("site"),"@pkg":v("components"),[b]:v("components")});let M=l.assetHtml.map(e=>({publicPath:"",...e}));export const outputConfig={path:v("library"===d?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:"js/[name].chunk.js",assetModuleFilename:"assets/[name].[hash][ext]",library:b,libraryTarget:"window",globalObject:"window",chunkLoadingGlobal:`webpackJsonp_${b}`,pathinfo:!1,clean:!0,publicPath:a};let F=k(`@moneko/${w}/lib/packages/${i[d]}/index.js`);"single-component"===d&&(Object.assign(S,{[b]:v("umd")}),F=v(g?"example/index.ts":"src/index.ts"),outputConfig.path=v(g?"dist":"umd"),outputConfig.filename="index.js",outputConfig.library=b,outputConfig.libraryTarget="umd",outputConfig.libraryExport="default");let K={main:F};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.routeBaseName.split("/").filter(Boolean).length,W=Array(L).fill("..").join("/")+(L?"/":"")+"404.html",{pathSegmentsToKeep:D=L,path:R=W}=l.fixBrowserRouter||{},_={entry:K,stats:"errors-only",infrastructureLogging:{level:"none"},target:"web",plugins:[new n.AutomaticPrefetchPlugin,...u,B&&new B({fix:!0,threads:!0,extensions:["js","md","mdx","cjs","ejs","mjs","jsx","ts","tsx","json","html","coffee","vue"]}),A&&new A({fix:!0,threads:!0,extensions:["css","scss","sass","less","ts","tsx","js","jsx"],exclude:["node_modules/","es/","lib/","docs/","coverage/","dist/"]}),new s(c),l.fixBrowserRouter&&new s({filename:R,inject:!1,templateContent:()=>`<html html><head><title>${c.title}</title><script>var pathSegmentsToKeep = ${D||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(M),"single-spa"===d&&new m(e=>!!(e.match(/main\.(.*)\.bundle.js$/)||e.match("main.bundle.js"))),new n.DefinePlugin(p),new n.WatchIgnorePlugin({paths:[/\.d\.ts$/]}),l.sourceMap&&new n.SourceMapDevToolPlugin(l.sourceMap),new o({name:"编译中",color:"#6f42c1"}),new r({done:()=>{!g&&l.seo&&x(),l.done?.()}}),...l.plugins].filter(Boolean),experiments:{topLevelAwait:!0,syncWebAssembly:!0,asyncWebAssembly:!0},resolve:{extensions:[".tsx",".ts",".js",".jsx"],alias:S,fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},module:f,externals:l.externals,output:outputConfig};export default _;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import e from"@soda/friendly-errors-webpack-plugin";import o from"chalk";import{getPort as r}from"portfinder";import t from"webpack";import{merge as s}from"webpack-merge";import{CONFIG as p}from"./common.js";import{hasPkg as i}from"./has-pkg.js";import{FRAMEWORK as a}from"./process-env.js";import{getIPAdress as l,isFunction as m,resolveProgramPath as c}from"./utils.js";import n from"./webpack.common.js";let d=i("@moneko/mock"),v=d&&await import("@moneko/mock"),h="react"===a&&(await import("@pmmmwh/react-refresh-webpack-plugin")).default,w=!1;p.cacheDirectory&&(w={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:p.cacheDirectory});let f=!1===p.devtool||p.devtool?p.devtool:"eval-cheap-module-source-map",u=new Promise(i=>{r({port:p.devServer.port,stopPort:9999},(r,a)=>{let d=[];p.devServer.port!==a&&d.push(`Port ${o.yellow(p.devServer.port)} is in use, trying ${o.green(a)} instead`),p.devServer.port=a;let u="/"===p.routeBaseName,g=p.devServer.https?"https:":"http:",k=u?"":p.routeBaseName,y=s(n,{devtool:f,mode:"development",cache:w,devServer:{headers:{"Access-Control-Allow-Origin":"*"},compress:p.devServer.compress,host:"0.0.0.0",port:a,historyApiFallback:u||{index:k,disableDotRule:!0},https:p.devServer.https,proxy:p.proxy,allowedHosts:p.devServer.allowedHosts,client:{progress:!1,logging:"info",overlay:!1},static:{watch:{ignored:e=>e.endsWith(".d.ts")}},setupMiddlewares:(e,o)=>{if(!o)throw Error("webpack-dev-server is not defined");return o.app&&m(v)&&v(o.app,c("mock/")),e},open:!1,hot:!0},plugins:[new t.HotModuleReplacementPlugin,h&&new h,new e({compilationSuccessInfo:{messages:[`You application is running here:
|
|
2
|
+
|
|
3
|
+
local: ${o.cyan(`${g}//${p.devServer.host}:${a}${k}`)}
|
|
4
|
+
network: ${o.cyan(`${g}//${l()}:${a}${k}`)}`],notes:d},clearConsole:!0})].filter(Boolean)});i(y)})});export default u;
|
package/package.json
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.24",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "
|
|
9
|
-
"
|
|
10
|
-
"build-src": "swc src -d lib -C module.type=es6 -C jsc.loose=true -C jsc.minify.mangle=true -C jsc.minify.compress=true -C minify=true -D",
|
|
11
|
-
"build:types": "tsc && tsc --project cli.json",
|
|
12
|
-
"postbuild": "node ./copy.js ./prefix ./lib",
|
|
13
|
-
"prebuild": "rm -rf ./build && rm -rf ./lib"
|
|
8
|
+
"build": "swc src -d lib -C module.type=nodenext -C jsc.target=esnext -C jsc.loose=true -C jsc.minify.mangle=true -C jsc.minify.compress=true -C minify=true -D",
|
|
9
|
+
"prebuild": "rm -rf ./lib && tsc"
|
|
14
10
|
},
|
|
15
11
|
"keywords": [],
|
|
16
12
|
"author": "moneko",
|
|
@@ -18,7 +14,6 @@
|
|
|
18
14
|
"dependencies": {
|
|
19
15
|
"@emotion/css": "11.11.0",
|
|
20
16
|
"@mdx-js/loader": "2.3.0",
|
|
21
|
-
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
|
|
22
17
|
"@soda/friendly-errors-webpack-plugin": "1.8.1",
|
|
23
18
|
"@swc/core": "1.3.56",
|
|
24
19
|
"@swc/css": "0.0.20",
|
|
@@ -55,7 +50,6 @@
|
|
|
55
50
|
"devDependencies": {
|
|
56
51
|
"@moneko/mock": "^1.0.9",
|
|
57
52
|
"@moneko/postcss": "^1.0.30",
|
|
58
|
-
"@solidjs/router": "^0.8.2",
|
|
59
53
|
"@swc/cli": "0.1.62",
|
|
60
54
|
"@types/mini-css-extract-plugin": "^2.5.1",
|
|
61
55
|
"@types/shelljs": "^0.8.12",
|
|
@@ -63,12 +57,10 @@
|
|
|
63
57
|
"@types/webpack-env": "^1.18.0",
|
|
64
58
|
"eslint-config-neko": "^1.0.23",
|
|
65
59
|
"shelljs": "^0.8.5",
|
|
66
|
-
"solid-js": "^1.7.5",
|
|
67
60
|
"stylelint-config-moneko": "^1.0.15"
|
|
68
61
|
},
|
|
69
62
|
"files": [
|
|
70
63
|
"lib",
|
|
71
|
-
"build",
|
|
72
64
|
"template",
|
|
73
65
|
"typings/global.d.ts"
|
|
74
66
|
]
|
package/typings/global.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare type AppType =
|
|
|
23
23
|
| 'back-stage'
|
|
24
24
|
| 'single-spa'
|
|
25
25
|
| 'library';
|
|
26
|
+
export declare type Framework = 'react' | 'solid-js';
|
|
26
27
|
export type TerserOptions = MinifyOptions;
|
|
27
28
|
export type SwcOptions = JsMinifyOptions;
|
|
28
29
|
export type HtmlWebpackOption = HtmlWebpackPluginOptions & {
|
package/build/common.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import e from"fs";import t from"path";import o from"readline";import s from"chalk";import{merge as l}from"webpack-merge";import{APPTYPE as n,CUSTOMCONFIG as i,hasReact as r,pkgName as a,PROGRAMPATH as c}from"./process-env.js";import{isFunction as p,readConf as m}from"./utils.js";export const ENTRYPATH={mobile:"mobile",site:"site","back-stage":"back-stage","single-spa":"single-spa",library:"library","single-component":"single-component"};let u=[a,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design"],d={chunks:"all",minSize:1024,minChunks:1};"single-component"===n&&(d=!1);let h={seo:!1,mode:"csr",compiler:"swc",bundleAnalyzer:{analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1},entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:""},env:{},routeBaseName:"/",publicPath:"/",designSize:"mobile"===n?375:1680,fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{},layoutSider:{},moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:c+"/node_modules/.temp_cache",devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:`./node_modules/${a}/template/index.html`,favicon:`./node_modules/${a}/template/favicon.ico`,tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],splitChunk:d,runtimeChunk:"single-component"!==n&&"single",moduleFederation:[],rulesInclude:{less:u,css:u,js:u,media:u,fonts:u},mdx:{jsxImportSource:r?"react":"solid-js/h",remarkPlugins:[],rehypePlugins:[]}};export const log=e=>{o.cursorTo(process.stdout,0),process.stdout.write(e)};let f=h,g=null,y={},w={};try{g=t.join(c,"./config/index.ts"),e.accessSync(g,e.constants.R_OK)}catch(e){g=null}if(g)try{let e=(await m(g,"index")).default;y=p(e)?e(process):e}catch(e){process.stdout.write(s.red(e))}if(i){let o=null;try{o=t.join(c,`./config/${i}.ts`),e.accessSync(o,e.constants.R_OK)}catch(e){o=null}if(null!==o)try{let e=(await m(o,i)).default;w=p(e)?e(process):e}catch(e){process.stdout.write(s.red(e))}}!1===(f=l(f,y,w)).devtool&&(f.sourceMap=!1),!1===f.sourceMap&&(f.devtool=!1),f.fixBrowserRouter&&(f.htmlPluginOption.tags||(f.htmlPluginOption.tags=[]),f.htmlPluginOption.tags.push({textContent:`
|
|
2
|
-
(function(l) {
|
|
3
|
-
if (l.search[1] === '/' ) {
|
|
4
|
-
var decoded = l.search.slice(1).split('&').map(function(s) {
|
|
5
|
-
return s.replace(/~and~/g, '&')
|
|
6
|
-
}).join('?');
|
|
7
|
-
window.history.replaceState(null, null,
|
|
8
|
-
l.pathname.slice(0, -1) + decoded + l.hash
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
}(window.location))
|
|
12
|
-
`}));export const CONFIG=f;export const PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG,log};
|
package/build/index.d.ts
DELETED
package/build/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./process-env.js";export*from"./utils.js";
|
package/build/process-env.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{readFileSync as e,existsSync as o,mkdirSync as r}from"fs";import{join as t}from"path";import n from"url";import{hasPkg as s}from"./has-pkg.js";import{resolveProgramPath as p}from"./utils.js";import a from"./yarn-argv.js";export const __dirname=n.fileURLToPath(new URL(".",import.meta.url));export const APPTYPE=process.env.APPTYPE;export const PROGRAMPATH=process.cwd();export const PACKAGENAME=process.env.npm_package_name;export const PACKAGEVERSION=process.env.npm_package_version;let c=e(t(__dirname,"../package.json"),{encoding:"utf-8"});export const cacheDir=t(PROGRAMPATH,"./node_modules/.cache/@moneko/cli/");o(cacheDir)||r(cacheDir,{recursive:!0});export const pkgName=JSON.parse(c).name;export const NODE_ENV=process.env.NODE_ENV;export const CUSTOMCONFIG=process.env.npm_config_config||a.config;export const DEV="development"===process.env.NODE_ENV;export let hasEslintConfig=!!Object.keys(process.env).filter(e=>e.startsWith("npm_package_eslintConfig_")).length;export let hasStylelintConfig=!!Object.keys(process.env).filter(e=>e.startsWith("npm_package_stylelint_")).length;export const hasReact=s("react");export const hasAntd=s("antd");export const programInfo={name:PACKAGENAME,version:PACKAGEVERSION,type:APPTYPE,description:process.env.npm_package_description,author:{name:process.env.npm_package_author_name,email:process.env.npm_package_author_email,url:process.env.npm_package_author_url},repository:{type:process.env.npm_package_repository_type,url:process.env.npm_package_repository_url,directory:process.env.npm_package_repository_directory}};if(parseInt(process.versions.node)>14){let o=e(p("package.json"),{encoding:"utf-8"}),{description:r,author:t,repository:n,eslintConfig:s,stylelint:a}=JSON.parse(o);programInfo.author="string"==typeof t?{name:t}:t,programInfo.repository="string"==typeof t?{url:n}:n,programInfo.description=r,hasEslintConfig=!!s,hasStylelintConfig=!!a}
|
package/build/swcrc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{merge as e}from"webpack-merge";import{CONFIG as o}from"./common.js";import r from"./envFlags.js";import{hasReact as t}from"./process-env.js";let s={env:{targets:["last 2 version","> 0.5%","ie 11","not dead"],mode:"entry",coreJs:"3"}};export const swcMinifyOption={compress:{top_retain:[],keep_infinity:!0,global_defs:{"@alert":"console.log"},pure_funcs:["console.log","console.warn","console.error","console.info"],toplevel:!1,drop_console:!0,drop_debugger:!0,module:!1,ecma:2015,ie8:!1,keep_classnames:void 0,keep_fnames:!1},mangle:!0};export default((n=!1)=>{let a={module:{type:"es6",ignoreDynamic:!0,strict:!0,strictMode:!0,lazy:!0,noInterop:!0},jsc:{parser:{syntax:"typescript",decorators:!0,dynamicImport:!0,tsx:!0},loose:!0,target:"es2022",externalHelpers:!0,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,useBuiltins:!0,refresh:t&&n,development:n,importSource:t?"react":"solid-js/h"},constModules:{globals:{"env-flags":r}},optimizer:{simplify:!1}},experimental:{plugins:[["swc-plugin-another-transform-imports",function(e){for(let o=0,r=Object.keys(e),t=r.length;o<t;o++)e[r[o]].transform=`${r[o]}/${e[r[o]].transform}`,e[r[o]].style&&(e[r[o]].style=`${r[o]}/${e[r[o]].style}`);return e}(o.importOnDemand||{})]]}},sourceMaps:!0,parseMap:!0},c=Object.assign(a,!n&&s);return o.swcrc&&(c=e(c,"function"==typeof o.swcrc?o.swcrc(n):o.swcrc)),c});
|
package/build/webpack.common.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"fs";import{join as t}from"path";import s from"add-asset-html-webpack-plugin";import n from"html-webpack-plugin";import o from"webpack";import l from"webpackbar";import{CONFIG as i,ENTRYPATH as a,PUBLICPATH as r}from"./common.js";import p from"./done.js";import m from"./envFlags.js";import c from"./html-add-entry-attr.js";import u from"./html-plugin-option.js";import{moduleFederation as f}from"./module-federation.js";import d from"./module.config.js";import{APPTYPE as g,DEV as j,hasEslintConfig as h,hasStylelintConfig as b,PACKAGENAME as y,PROGRAMPATH as w,__dirname as x}from"./process-env.js";import{seo as k}from"./seo.js";import{resolveProgramPath as v}from"./utils.js";let C=[".eslintrc.js",".eslintrc.json",".eslintrc.yaml",".eslintrc.json"],O=[".stylelintrc",".stylelintrc.json",".stylelintrc.yaml",".stylelintrc.yml",".stylelintrc.js","stylelint.config.js","stylelint.config.cjs"],P=e.readdirSync(w),T=!1,$=!1;for(let e=0,t=P.length;e<t;e++)O.includes(P[e])&&($=!0),C.includes(P[e])&&(T=!0);T||(T=h),$||($=b);let A=$?(await import("stylelint-webpack-plugin")).default:null,B=T?(await import("eslint-webpack-plugin")).default:null,S={"@":v("src")};Object.assign(S,i.alias),"library"===g&&Object.assign(S,{"@":v("site"),"@pkg":v("components"),[y]:v("components")});let M=i.assetHtml.map(e=>({publicPath:"",...e}));export const outputConfig={path:v("library"===g?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:"js/[name].chunk.js",assetModuleFilename:"assets/[name].[hash][ext]",library:y,libraryTarget:"window",globalObject:"window",chunkLoadingGlobal:`webpackJsonp_${y}`,pathinfo:!1,clean:!0,publicPath:r};let F=t(x,`../lib/packages/${a[g]}/index.js`);"single-component"===g&&(Object.assign(S,{[y]:v("umd")}),F=v(j?"example/index.ts":"src/index.ts"),outputConfig.path=v(j?"dist":"umd"),outputConfig.filename="index.js",outputConfig.library=y,outputConfig.libraryTarget="umd",outputConfig.libraryExport="default");let K={main:F};i.entry&&("string"==typeof i.entry?K=i.entry:Object.keys(i.entry)&&Object.assign(K,i.entry)),i.output&&("string"==typeof i.output?outputConfig.path=i.output:Object.keys(i.output)&&Object.assign(outputConfig,i.output));let L=i.routeBaseName.split("/").filter(Boolean).length,W=Array(L).fill("..").join("/")+(L?"/":"")+"404.html",{pathSegmentsToKeep:D=L,path:R=W}=i.fixBrowserRouter||{},_={entry:K,stats:"errors-only",infrastructureLogging:{level:"none"},target:"web",plugins:[new o.AutomaticPrefetchPlugin,...f,B&&new B({fix:!0,threads:!0,extensions:["js","md","mdx","cjs","ejs","mjs","jsx","ts","tsx","json","html","coffee","vue"]}),A&&new A({fix:!0,threads:!0,extensions:["css","scss","sass","less","ts","tsx","js","jsx"],exclude:["node_modules/","es/","lib/","docs/","coverage/","dist/"]}),new n(u),i.fixBrowserRouter&&new n({filename:R,inject:!1,templateContent:()=>`<html html><head><title>${u.title}</title><script>var pathSegmentsToKeep = ${D||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 s(M),"single-spa"===g&&new c(e=>!!(e.match(/main\.(.*)\.bundle.js$/)||e.match("main.bundle.js"))),new o.DefinePlugin(m),new o.WatchIgnorePlugin({paths:[/\.d\.ts$/]}),i.sourceMap&&new o.SourceMapDevToolPlugin(i.sourceMap),new l({name:"编译中",color:"#6f42c1"}),new p({done:()=>{!j&&i.seo&&k(),i.done?.()}}),...i.plugins].filter(Boolean),experiments:{topLevelAwait:!0,syncWebAssembly:!0,asyncWebAssembly:!0},resolve:{extensions:[".tsx",".ts",".js",".jsx"],alias:S,fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},module:d,externals:i.externals,output:outputConfig};export default _;
|
package/build/webpack.dev.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import e from"@soda/friendly-errors-webpack-plugin";import o from"chalk";import{getPort as r}from"portfinder";import t from"webpack";import{merge as s}from"webpack-merge";import{CONFIG as p}from"./common.js";import{hasPkg as i}from"./has-pkg.js";import{hasReact as l}from"./process-env.js";import{getIPAdress as a,isFunction as m,resolveProgramPath as n}from"./utils.js";import c from"./webpack.common.js";let d=i("@moneko/mock"),v=d&&await import("@moneko/mock"),h=l&&(await import("@pmmmwh/react-refresh-webpack-plugin")).default,w=!1;p.cacheDirectory&&(w={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:p.cacheDirectory});let f=!1===p.devtool||p.devtool?p.devtool:"eval-cheap-module-source-map",u=new Promise(i=>{r({port:p.devServer.port,stopPort:9999},(r,d)=>{let u=[];p.devServer.port!==d&&u.push(`Port ${o.yellow(p.devServer.port)} is in use, trying ${o.green(d)} instead`),p.devServer.port=d;let g="/"===p.routeBaseName,k=p.devServer.https?"https:":"http:",y=g?"":p.routeBaseName,$=s(c,{devtool:f,mode:"development",cache:w,devServer:{headers:{"Access-Control-Allow-Origin":"*"},compress:p.devServer.compress,host:"0.0.0.0",port:d,historyApiFallback:g||{index:y,disableDotRule:!0},https:p.devServer.https,proxy:p.proxy,allowedHosts:p.devServer.allowedHosts,client:{progress:!1,logging:"info",overlay:!1},static:{watch:{ignored:e=>e.endsWith(".d.ts")}},setupMiddlewares:(e,o)=>{if(!o)throw Error("webpack-dev-server is not defined");return o.app&&m(v)&&v(o.app,n("mock/")),e},open:!1,hot:!0},plugins:[new t.HotModuleReplacementPlugin,l&&h&&new h,new e({compilationSuccessInfo:{messages:[`You application is running here:
|
|
2
|
-
|
|
3
|
-
local: ${o.cyan(`${k}//${p.devServer.host}:${d}${y}`)}
|
|
4
|
-
network: ${o.cyan(`${k}//${a()}:${d}${y}`)}`],notes:u},clearConsole:!0})].filter(Boolean)});i($)})});export default u;
|
package/lib/normalize.css
DELETED
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
/* @import url('tailwindcss/utilities'); */
|
|
2
|
-
|
|
3
|
-
html,
|
|
4
|
-
body {
|
|
5
|
-
margin: 0;
|
|
6
|
-
padding: 0;
|
|
7
|
-
inline-size: 100vi;
|
|
8
|
-
font-size: 14px;
|
|
9
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
10
|
-
Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
|
11
|
-
'Noto Color Emoji', Helvetica, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans';
|
|
12
|
-
color: var(--text-color, rgb(0 0 0 / 65%));
|
|
13
|
-
line-height: 1.8;
|
|
14
|
-
transition-duration: 0.3s;
|
|
15
|
-
transition-property: background-color, color;
|
|
16
|
-
transition-timing-function: cubic-bezier(0.94, -0.1, 0.1, 1.2);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
#root {
|
|
20
|
-
display: flex;
|
|
21
|
-
-webkit-overflow-scrolling: touch;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
#root > main {
|
|
25
|
-
animation: route-in var(--transition-duration, 0.3s);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
input,
|
|
29
|
-
textarea {
|
|
30
|
-
caret-color: inherit;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
h1 {
|
|
34
|
-
margin: 0.67em 0;
|
|
35
|
-
font-size: 2em;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
hr {
|
|
39
|
-
overflow: visible;
|
|
40
|
-
block-size: 0;
|
|
41
|
-
box-sizing: content-box;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
pre {
|
|
45
|
-
font-size: 1em;
|
|
46
|
-
font-family: monospace;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
a {
|
|
50
|
-
text-decoration: none;
|
|
51
|
-
background-color: transparent;
|
|
52
|
-
cursor: pointer;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
abbr[title] {
|
|
56
|
-
border-block-end: none;
|
|
57
|
-
text-decoration: underline;
|
|
58
|
-
text-decoration: underline dotted;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
b,
|
|
62
|
-
strong {
|
|
63
|
-
font-weight: bolder;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
code,
|
|
67
|
-
kbd,
|
|
68
|
-
samp {
|
|
69
|
-
font-size: 1em;
|
|
70
|
-
font-family: monospace;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
small {
|
|
74
|
-
font-size: 80%;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
sub,
|
|
78
|
-
sup {
|
|
79
|
-
position: relative;
|
|
80
|
-
font-size: 75%;
|
|
81
|
-
line-height: 0;
|
|
82
|
-
vertical-align: baseline;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
sub {
|
|
86
|
-
inset-block-end: -0.25em;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
sup {
|
|
90
|
-
inset-block-start: -0.5em;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
img {
|
|
94
|
-
border-style: none;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
img,
|
|
98
|
-
button {
|
|
99
|
-
outline: 1px solid transparent;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
button,
|
|
103
|
-
input,
|
|
104
|
-
optgroup,
|
|
105
|
-
select,
|
|
106
|
-
textarea {
|
|
107
|
-
margin: 0;
|
|
108
|
-
font-size: 100%;
|
|
109
|
-
font-family: inherit;
|
|
110
|
-
line-height: 1.15;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
button,
|
|
114
|
-
input {
|
|
115
|
-
overflow: visible;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
button,
|
|
119
|
-
select {
|
|
120
|
-
text-transform: none;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
button,
|
|
124
|
-
[type='button'],
|
|
125
|
-
[type='reset'],
|
|
126
|
-
[type='submit'] {
|
|
127
|
-
appearance: button;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
button::-moz-focus-inner,
|
|
131
|
-
[type='button']::-moz-focus-inner,
|
|
132
|
-
[type='reset']::-moz-focus-inner,
|
|
133
|
-
[type='submit']::-moz-focus-inner {
|
|
134
|
-
border-style: none;
|
|
135
|
-
padding: 0;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
button:-moz-focusring,
|
|
139
|
-
[type='button']:-moz-focusring,
|
|
140
|
-
[type='reset']:-moz-focusring,
|
|
141
|
-
[type='submit']:-moz-focusring {
|
|
142
|
-
outline: 1px dotted var(--primary-outline);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
fieldset {
|
|
146
|
-
padding: 0.35em 0.75em 0.625em;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
legend {
|
|
150
|
-
display: table;
|
|
151
|
-
padding: 0;
|
|
152
|
-
max-inline-size: 100%;
|
|
153
|
-
white-space: normal;
|
|
154
|
-
color: inherit;
|
|
155
|
-
box-sizing: border-box;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
progress {
|
|
159
|
-
vertical-align: baseline;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
textarea {
|
|
163
|
-
overflow: auto;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
details {
|
|
167
|
-
display: block;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
summary {
|
|
171
|
-
display: list-item;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
template,
|
|
175
|
-
[hidden] {
|
|
176
|
-
display: none;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
[type='checkbox'],
|
|
180
|
-
[type='radio'] {
|
|
181
|
-
box-sizing: border-box;
|
|
182
|
-
padding: 0;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
[type='number']::-webkit-inner-spin-button,
|
|
186
|
-
[type='number']::-webkit-outer-spin-button {
|
|
187
|
-
block-size: auto;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
[type='search'] {
|
|
191
|
-
appearance: textfield;
|
|
192
|
-
outline-offset: -2px;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
[type='search']::-webkit-search-decoration {
|
|
196
|
-
appearance: none;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
::-webkit-file-upload-button {
|
|
200
|
-
appearance: button;
|
|
201
|
-
font: inherit;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
::-webkit-scrollbar {
|
|
205
|
-
inline-size: 4px;
|
|
206
|
-
block-size: 4px;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
::-webkit-scrollbar-track,
|
|
210
|
-
::-webkit-scrollbar-thumb {
|
|
211
|
-
border-radius: 5px;
|
|
212
|
-
background-color: transparent;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
:hover::-webkit-scrollbar-thumb {
|
|
216
|
-
background-color: var(--primary-selection);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
::-webkit-scrollbar-thumb:hover {
|
|
220
|
-
background-color: var(--primary-hover);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
::-webkit-scrollbar-thumb:active {
|
|
224
|
-
background-color: var(--primary-active);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
::-webkit-scrollbar-button {
|
|
228
|
-
display: none;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
@keyframes route-in {
|
|
232
|
-
from {
|
|
233
|
-
transform: translate3d(0, 16px, 0);
|
|
234
|
-
opacity: 0;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
to {
|
|
238
|
-
transform: translate3d(0, 0, 0);
|
|
239
|
-
opacity: 1;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
@keyframes route-out {
|
|
244
|
-
from {
|
|
245
|
-
transform: translate3d(0, 0, 0);
|
|
246
|
-
opacity: 1;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
to {
|
|
250
|
-
z-index: -1;
|
|
251
|
-
transform: translate3d(0, 1rem, 0);
|
|
252
|
-
opacity: 0;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Router as o}from"@solidjs/router";import{render as n,createComponent as t}from"solid-js/web";import r from"@/index";function e(o){return["[object Function]","[object AsyncFunction]","[object GeneratorFunction]","[object Proxy]"].includes(Object.prototype.toString.call(o))}var i=APPENTRY?await import(APPENTRY):null,u=document.getElementById("root");i&&e(i.bootstrap)&&i.bootstrap(),window.rootInstance={unmount:function(){return null},render:function(){window.rootInstance.unmount=n(function(){return t(o,{children:r})},u)}},window.rootInstance.render(),i&&e(i.mount)&&i.mount();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../../refresh-rem.js";import"../../normalize.css";var r=await import("./bootstrap.js");export default r;
|
package/lib/refresh-rem.d.ts
DELETED
|
File without changes
|
package/lib/refresh-rem.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(o,n){var t=function(){var n=o.documentElement,t=n.clientWidth||o.body.clientWidth,e=t<=375?375:programInfo.designSize,i=t;i=t<=375?t:t<=programInfo.designSize?e:t;var l=16/e*i+"px";l!==n.style.fontSize&&(n.style.fontSize=l)};t(),"addEventListener"in o&&n.addEventListener("orientationchange"in n?"orientationchange":"resize",t,!1),window.scrollTo||(window.scrollTo=function(o){window.scrollLeft=o.left,window.scrollTop=o.top}),document.body.scrollTo||(Element.prototype.scrollTo=function(o){this.scrollLeft=o.left,this.scrollTop=o.top})}(document,window);
|
package/lib/router/index.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
type Any = any;
|
|
2
|
-
type MDXComponents = Record<string, Any>;
|
|
3
|
-
export interface RouterProps {
|
|
4
|
-
/** 菜单id */
|
|
5
|
-
key: string;
|
|
6
|
-
alive?: boolean;
|
|
7
|
-
/** 菜单图标 */
|
|
8
|
-
icon?: string;
|
|
9
|
-
dynamicTitle?: string;
|
|
10
|
-
/** 菜单名 */
|
|
11
|
-
i18n?: string | null;
|
|
12
|
-
hideMenu?: boolean;
|
|
13
|
-
hideTabs?: boolean;
|
|
14
|
-
onlyLogin?: boolean;
|
|
15
|
-
/** 菜单父id */
|
|
16
|
-
parentId?: string;
|
|
17
|
-
root?: boolean;
|
|
18
|
-
path?: string;
|
|
19
|
-
element?: Any;
|
|
20
|
-
fallback?: Any;
|
|
21
|
-
/** 可否关闭标签 */
|
|
22
|
-
closable?: boolean;
|
|
23
|
-
/** 子菜单 */
|
|
24
|
-
children?: RouterProps[];
|
|
25
|
-
props?: {
|
|
26
|
-
path: string;
|
|
27
|
-
components?: MDXComponents;
|
|
28
|
-
[key: string]: Any;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export declare function lazyImport(filePath: string): Promise<unknown>;
|
|
32
|
-
export interface ExampleModule {
|
|
33
|
-
code: string;
|
|
34
|
-
title?: string;
|
|
35
|
-
description?: string | null;
|
|
36
|
-
noInline: boolean;
|
|
37
|
-
language: never;
|
|
38
|
-
}
|
|
39
|
-
export type MyPkg = RouterProps & {
|
|
40
|
-
type: string;
|
|
41
|
-
title: string;
|
|
42
|
-
path: string;
|
|
43
|
-
subtitle?: string;
|
|
44
|
-
icon?: string;
|
|
45
|
-
};
|
|
46
|
-
export declare const myPkgs: MyPkg[];
|
|
47
|
-
export declare const myDemoKv: Record<string, ExampleModule[]>;
|
|
48
|
-
export declare const mdxComponents: MDXComponents;
|
|
49
|
-
export declare const onlyLoginRouter: RouterProps[];
|
|
50
|
-
export declare const router: RouterProps[];
|
|
51
|
-
export declare function matchUtil(pathname: string): RouterProps;
|
|
52
|
-
export {};
|
package/lib/router/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function r(){return(r=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}import{pathToRegexp as t}from"path-to-regexp";export function lazyImport(e){return new Promise(function(r){return import("@/pages/"+e.replace(/:/g,"$").replace(/^\//,"")).then(r).catch(function(){return Promise.resolve({default:null})})})}export var myPkgs=[];export var myDemoKv={};export var mdxComponents={};if("library"===APPTYPE&&import.meta.webpackContext){var n,o=import.meta.webpackContext("@pkg/",{recursive:!0,regExp:/README\.mdx?$/,mode:"sync"}),i={};try{i=(await import("@/components/components")).default}catch(e){}Object.assign(mdxComponents,r({},i)),null==(n=null==o?void 0:o.keys())||n.forEach(function(e){var t=e.substring(2).split("/").slice(0,-1).join("/"),n=o(e),i=n.frontmatte,a=n.default;myPkgs.push(r({key:t,path:t,element:a},i,{props:{components:mdxComponents,path:t}}))});var a=import.meta.webpackContext("@pkg/",{recursive:!0,regExp:/\/examples\/(.+)\.mdx$/,mode:"sync"});a.keys().forEach(function(r){var t=r.substring(2).split("/"),n=t[0];Array.isArray(myDemoKv[n])||(myDemoKv[n]=[]);for(var o,i,l=a(r),c=l.matchAll(/```([^\r\n]+)?\r?\n([\s\S]*?)\r?\n```/g),p="",u="",s=null,m=function(r,t){var n="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(n)return(n=n.call(r)).next.bind(n);if(Array.isArray(r)||(n=function(r,t){if(r){if("string"==typeof r)return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if("Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}}(r))){n&&(r=n);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(c);!(i=m()).done;){var d=i.value;u=d[1]||"tsx",p=d[2],s=l.replace(d[0],"")}myDemoKv[n].push({language:u,code:p,description:s,title:null==(o=t.pop())?void 0:o.replace(/\.mdx$/,""),noInline:/render\([^\\)]*\);?(?=\s*$)/.test(p)})})}var l=[];try{l=(await import("@/router")).default}catch(e){console.info("自定义路由请在 router 目录下新建 index.ts, 类型: RouterProps[]",e)}function c(e,r){return["*"===r&&"*"!==e?void 0:r,e].filter(Boolean).join("/")}var p=[];import.meta.webpackContext&&(p=import.meta.webpackContext("@/pages/",{recursive:!0,regExp:/\.(t|j)sx$/,mode:"lazy"}));var u=function(e){for(var r=[],t=0;t<e.length;t++)for(var n=e[t].split("/").slice(0,-1),o=r,i=0;i<n.length;i++){var a=n[i];if(""!==a){"."===a&&(a="*");var l=o;if(Array.isArray(o)){for(var c=0;c<o.length;c++)if(o[c].path===a){o=o[c].children;break}}if(l===o){var p=i===n.length-1?e[t]:n.slice(0,i+1).join("/")+"/",u={key:p=p.substring(2,p.lastIndexOf("/")),path:a,i18n:"route-"+p,children:[],alive:!1,element:lazyImport(p),hideMenu:p.includes(":"),props:{path:p}};Array.isArray(o)&&o.push(u),o=u.children}}}return r}(p.keys().map(function(e){return e.replace(/\$/g,":")}));function s(e,t,n){return void 0===e&&(e=[]),e.map(function(e){var o=r({},e);return void 0===o.key&&(o.key=c(e.path,n)),void 0===o.i18n&&(o.i18n="route-"+o.key),void 0===o.alive&&(o.alive=!1),"*"===o.path&&void 0===o.hideMenu&&(o.hideMenu=!0),Array.isArray(o.children)&&(o.children=o.children.length?s(o.children,t,o.key):void 0),o.element||(o.element=lazyImport(o.key),o.props={path:o.key}),!!o.onlyLogin!==t||o.root?o:null}).filter(Boolean)}for(var m=[].concat(l),d=0,h=u.length;d<h;d++)!function e(t,n,o){var i,a=t.find(function(e){return e.path===n.path});a?(a.key=c(a.path,o),void 0===a.i18n&&(a.i18n="route-"+a.key),void 0===a.alive&&(a.alive=!1),void 0===a.element&&n.element&&(a.element=n.element,a.props=n.props),void 0===a.hideMenu&&(a.hideMenu="*"===a.path||a.key.includes(":")),Object.assign(a,r({},n,a)),n.children&&(!a.children&&Array.isArray(n.children)&&(a.children=n.children),null==(i=n.children)||i.forEach(function(r){e(null==a?void 0:a.children,r,null==a?void 0:a.key)}))):t.push(n)}(m,u[d]);export var onlyLoginRouter=s(m,!1);export var router=s(m,!0);export function matchUtil(e){var r={key:""};return!function n(o){for(var i=0,a=o.length;i<a;i++){if(o[i].path&&"*"!==o[i].path&&o[i].key)try{if(t(o[i].key).exec(e.substring(1))){r=o[i];return}}catch(e){}Array.isArray(o[i].children)&&n(o[i].children)}}(router),r}
|
|
File without changes
|
/package/{build → lib}/done.d.ts
RENAMED
|
File without changes
|
/package/{build → lib}/done.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{build → lib}/esm.d.ts
RENAMED
|
File without changes
|
/package/{build → lib}/esm.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{build → lib}/minify.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{build → lib}/seo.d.ts
RENAMED
|
File without changes
|
/package/{build → lib}/seo.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{build → lib}/utils.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|