@moneko/core 4.1.4 → 4.2.0-beta.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/bin/build-app.mjs.d.ts +17 -0
- package/lib/bin/{commit-lint.d.mts → commit-lint.mjs.d.ts} +5 -8
- package/lib/bin/help.mjs +1 -1
- package/lib/bin/{index.d.mts → index.mjs.d.ts} +1 -1
- package/lib/bin/{pin.d.mts → pin.mjs.d.ts} +1 -2
- package/lib/bin/{pure-lint.d.mts → pure-lint.mjs.d.ts} +1 -1
- package/lib/bin/server.mjs +1 -1
- package/lib/bin/server.mjs.d.ts +2 -0
- package/lib/bin/setup.mjs +1 -1
- package/lib/bin/tsc.mjs.d.ts +2 -0
- package/lib/bin/utils/{bundle-app.d.mts → bundle-app.mjs.d.ts} +2 -0
- package/lib/bin/utils/config.mjs +1 -1
- package/lib/bin/utils/convert-react.mjs.d.ts +174 -0
- package/lib/bin/utils/get-commit-files.mjs +1 -1
- package/lib/bin/utils/get-commit-files.mjs.d.ts +2 -0
- package/lib/build-dev.mjs.d.ts +1 -0
- package/lib/build.mjs.d.ts +1 -0
- package/lib/commom/{ca.d.mts → ca.mjs.d.ts} +3 -5
- package/lib/commom/check-npm.mjs +1 -1
- package/lib/commom/{check-npm.d.mts → check-npm.mjs.d.ts} +1 -2
- package/lib/commom/{corepack.d.mts → corepack.mjs.d.ts} +1 -2
- package/lib/commom/css-in-js-minify.mjs.d.ts +12 -0
- package/lib/commom/esm.mjs +1 -1
- package/lib/commom/has-pkg.mjs +1 -1
- package/lib/commom/is-ci-environment.mjs +1 -1
- package/lib/commom/{is-ci-environment.d.mts → is-ci-environment.mjs.d.ts} +1 -2
- package/lib/commom/match-path.mjs +1 -1
- package/lib/commom/{match-path.d.mts → match-path.mjs.d.ts} +1 -2
- package/lib/commom/module-resolve.mjs +1 -1
- package/lib/commom/open.mjs +1 -1
- package/lib/commom/{package-manager.d.mts → package-manager.mjs.d.ts} +2 -3
- package/lib/commom/parse-args.mjs +1 -1
- package/lib/commom/paths.mjs.d.ts +33 -0
- package/lib/commom/print-log.mjs +1 -1
- package/lib/commom/{reactive-object.d.mts → reactive-object.mjs.d.ts} +1 -0
- package/lib/commom/rule.mjs.d.ts +2 -0
- package/lib/commom/{setup-env.d.mts → setup-env.mjs.d.ts} +4 -2
- package/lib/commom/sigint-exit.mjs +1 -1
- package/lib/commom/{timer.d.mts → timer.mjs.d.ts} +1 -2
- package/lib/commom/transfer-import-on-demand.mjs.d.ts +54 -0
- package/lib/create-development-configuration.mjs.d.ts +2 -0
- package/lib/dev/config.mjs.d.ts +9 -0
- package/lib/dev/generate-progress-html.mjs +1 -1
- package/lib/dev/get-cert.mjs.d.ts +10 -0
- package/lib/dev/{json-schema.d.mts → json-schema.mjs.d.ts} +3 -1
- package/lib/dev/mock.mjs +1 -1
- package/lib/dev/{mock.d.mts → mock.mjs.d.ts} +17 -21
- package/lib/dev/{proxy.d.mts → proxy.mjs.d.ts} +1 -1
- package/lib/dev.mjs.d.ts +1 -0
- package/lib/{index.d.mts → index.mjs.d.ts} +5 -5
- package/lib/lint/stylelint/{index.d.mts → index.mjs.d.ts} +1 -1
- package/lib/loader/{css-in-js-minify.d.cts → css-in-js-minify.cjs.d.ts} +3 -1
- package/lib/loader/{lightning-css.d.cts → lightning-css.cjs.d.ts} +2 -0
- package/lib/loader/mdx.cjs.d.ts +5 -0
- package/lib/loader/react-compiler.cjs.d.ts +27 -0
- package/lib/loader/{solid.d.cts → solid.cjs.d.ts} +1 -1
- package/lib/module.config.mjs.d.ts +3 -0
- package/lib/options/md-to-html.mjs +1 -1
- package/lib/options/reslove.mjs.d.ts +10 -0
- package/lib/options/{swcrc.d.mts → swcrc.mjs.d.ts} +2 -2
- package/lib/plugin/{compression.d.mts → compression.mjs.d.ts} +1 -1
- package/lib/plugin/{copy.d.mts → copy.mjs.d.ts} +3 -6
- package/lib/plugin/{exposes-declararion.d.mts → exposes-declararion.mjs.d.ts} +1 -1
- package/lib/plugin/{html-plugin.d.mts → html-plugin.mjs.d.ts} +20 -29
- package/lib/plugin/{lightningcss-plugin.d.mts → lightningcss-plugin.mjs.d.ts} +1 -1
- package/lib/plugin/manifest/index.mjs +1 -1
- package/lib/plugin/manifest/{index.d.mts → index.mjs.d.ts} +1 -1
- package/lib/plugin/manifest/types.mjs.d.ts +508 -0
- package/lib/plugin/override-resolve.mjs.d.ts +23 -0
- package/lib/plugin/{virtual-module.d.mts → virtual-module.mjs.d.ts} +1 -1
- package/lib/polyfills/inject-react-refresh.mjs.d.ts +1 -0
- package/lib/polyfills/polyfills.mjs +1 -1
- package/lib/polyfills/replace-children.mjs.d.ts +1 -0
- package/lib/{process-env.d.mts → process-env.mjs.d.ts} +14 -14
- package/lib/utils/{compile-dts.d.mts → compile-dts.mjs.d.ts} +2 -3
- package/lib/utils/create-types.mjs +1 -1
- package/lib/utils/{dts.d.mts → dts.mjs.d.ts} +2 -4
- package/lib/utils/{index.d.mts → index.mjs.d.ts} +9 -15
- package/lib/utils/run.mjs +1 -1
- package/lib/utils/run.mjs.d.ts +2 -0
- package/lib/utils/seo.mjs +2 -2
- package/lib/utils/seo.mjs.d.ts +2 -0
- package/lib/utils/svg-to-data-uri.mjs +1 -1
- package/lib/utils/{vts.d.mts → vts.mjs.d.ts} +3 -3
- package/lib/vm/coverage.mjs +1 -1
- package/lib/vm/{docs.d.mts → docs.mjs.d.ts} +1 -0
- package/lib/vm/generate-doc.mjs +1 -1
- package/lib/vm/{locales.d.mts → locales.mjs.d.ts} +1 -0
- package/lib/worker/compression.mjs.d.ts +1 -0
- package/lib/worker/css-in-js-minify.mjs.d.ts +1 -0
- package/lib/worker/dts.mjs.d.ts +1 -0
- package/lib/worker/react-compiler.mjs.d.ts +1 -0
- package/lib/worker/solid.mjs.d.ts +1 -0
- package/lib/worker/swc-minify.mjs.d.ts +1 -0
- package/package.json +13 -16
- package/lib/bin/build-app.d.mts +0 -16
- package/lib/bin/server.d.mts +0 -2
- package/lib/bin/tsc.d.mts +0 -2
- package/lib/bin/utils/convert-react.d.mts +0 -1
- package/lib/bin/utils/get-commit-files.d.mts +0 -2
- package/lib/build-dev.d.mts +0 -1
- package/lib/build.d.mts +0 -1
- package/lib/commom/css-in-js-minify.d.mts +0 -13
- package/lib/commom/paths.d.mts +0 -52
- package/lib/commom/rule.d.mts +0 -27
- package/lib/commom/transfer-import-on-demand.d.mts +0 -78
- package/lib/create-development-configuration.d.mts +0 -2
- package/lib/dev/config.d.mts +0 -4
- package/lib/dev/get-cert.d.mts +0 -8
- package/lib/dev.d.mts +0 -1
- package/lib/loader/mdx.d.cts +0 -3
- package/lib/loader/react-compiler.d.cts +0 -29
- package/lib/module.config.d.mts +0 -3
- package/lib/options/reslove.d.mts +0 -9
- package/lib/plugin/manifest/types.d.mts +0 -576
- package/lib/plugin/override-resolve.d.mts +0 -25
- package/lib/polyfills/inject-react-refresh.d.mts +0 -1
- package/lib/polyfills/replace-children.d.mts +0 -1
- package/lib/utils/run.d.mts +0 -2
- package/lib/utils/seo.d.mts +0 -2
- package/lib/worker/compression.d.mts +0 -1
- package/lib/worker/css-in-js-minify.d.mts +0 -1
- package/lib/worker/dts.d.mts +0 -1
- package/lib/worker/react-compiler.d.mts +0 -1
- package/lib/worker/solid.d.mts +0 -1
- package/lib/worker/swc-minify.d.mts +0 -1
- /package/lib/bin/{build-dev.d.mts → build-dev.mjs.d.ts} +0 -0
- /package/lib/bin/{build.d.mts → build.mjs.d.ts} +0 -0
- /package/lib/bin/{changelog.d.mts → changelog.mjs.d.ts} +0 -0
- /package/lib/bin/{eslint.d.mts → eslint.mjs.d.ts} +0 -0
- /package/lib/bin/{file.d.mts → file.mjs.d.ts} +0 -0
- /package/lib/bin/{git-hooks.d.mts → git-hooks.mjs.d.ts} +0 -0
- /package/lib/bin/{help.d.mts → help.mjs.d.ts} +0 -0
- /package/lib/bin/{lessc.d.mts → lessc.mjs.d.ts} +0 -0
- /package/lib/bin/{setup.d.mts → setup.mjs.d.ts} +0 -0
- /package/lib/bin/{start.d.mts → start.mjs.d.ts} +0 -0
- /package/lib/bin/{stylelint.d.mts → stylelint.mjs.d.ts} +0 -0
- /package/lib/bin/utils/{config.d.mts → config.mjs.d.ts} +0 -0
- /package/lib/bin/utils/{setup-swcrc.d.mts → setup-swcrc.mjs.d.ts} +0 -0
- /package/lib/build/{common.d.mts → common.mjs.d.ts} +0 -0
- /package/lib/build/{server.d.mts → server.mjs.d.ts} +0 -0
- /package/lib/commom/{diff-object.d.mts → diff-object.mjs.d.ts} +0 -0
- /package/lib/commom/{esm.d.mts → esm.mjs.d.ts} +0 -0
- /package/lib/commom/{has-pkg.d.mts → has-pkg.mjs.d.ts} +0 -0
- /package/lib/commom/{host.d.mts → host.mjs.d.ts} +0 -0
- /package/lib/commom/{log.d.mts → log.mjs.d.ts} +0 -0
- /package/lib/commom/{mime.d.mts → mime.mjs.d.ts} +0 -0
- /package/lib/commom/{module-resolve.d.mts → module-resolve.mjs.d.ts} +0 -0
- /package/lib/commom/{net.d.mts → net.mjs.d.ts} +0 -0
- /package/lib/commom/{open.d.mts → open.mjs.d.ts} +0 -0
- /package/lib/commom/{parse-args.d.mts → parse-args.mjs.d.ts} +0 -0
- /package/lib/commom/{print-log.d.mts → print-log.mjs.d.ts} +0 -0
- /package/lib/commom/{read-json.d.mts → read-json.mjs.d.ts} +0 -0
- /package/lib/commom/{require.d.mts → require.mjs.d.ts} +0 -0
- /package/lib/commom/{sigint-exit.d.mts → sigint-exit.mjs.d.ts} +0 -0
- /package/lib/commom/{transform-solid-js.d.mts → transform-solid-js.mjs.d.ts} +0 -0
- /package/lib/{common.d.mts → common.mjs.d.ts} +0 -0
- /package/lib/{config.d.mts → config.mjs.d.ts} +0 -0
- /package/lib/dev/{generate-progress-html.d.mts → generate-progress-html.mjs.d.ts} +0 -0
- /package/lib/dev/{server.d.mts → server.mjs.d.ts} +0 -0
- /package/lib/{file-system.d.mts → file-system.mjs.d.ts} +0 -0
- /package/lib/lint/eslint/{base.d.mts → base.mjs.d.ts} +0 -0
- /package/lib/lint/eslint/{index.d.mts → index.mjs.d.ts} +0 -0
- /package/lib/lint/eslint/{react-jsx.d.mts → react-jsx.mjs.d.ts} +0 -0
- /package/lib/lint/eslint/{react-legacy.d.mts → react-legacy.mjs.d.ts} +0 -0
- /package/lib/lint/eslint/{react.d.mts → react.mjs.d.ts} +0 -0
- /package/lib/lint/eslint/{solid.d.mts → solid.mjs.d.ts} +0 -0
- /package/lib/lint/eslint/{vue.d.mts → vue.mjs.d.ts} +0 -0
- /package/lib/lint/stylelint/{config.d.mts → config.mjs.d.ts} +0 -0
- /package/lib/options/{jsx-dom-expressions.d.mts → jsx-dom-expressions.mjs.d.ts} +0 -0
- /package/lib/options/{md-to-html.d.mts → md-to-html.mjs.d.ts} +0 -0
- /package/lib/options/{modify-vars.d.mts → modify-vars.mjs.d.ts} +0 -0
- /package/lib/options/{split-chunk.d.mts → split-chunk.mjs.d.ts} +0 -0
- /package/lib/plugin/{css-module-dts.d.mts → css-module-dts.mjs.d.ts} +0 -0
- /package/lib/plugin/{done.d.mts → done.mjs.d.ts} +0 -0
- /package/lib/plugin/{eslint.d.mts → eslint.mjs.d.ts} +0 -0
- /package/lib/plugin/{external-remotes.d.mts → external-remotes.mjs.d.ts} +0 -0
- /package/lib/plugin/{module-federation.d.mts → module-federation.mjs.d.ts} +0 -0
- /package/lib/plugin/{stylelint.d.mts → stylelint.mjs.d.ts} +0 -0
- /package/lib/plugin/{swc-minify-plugin.d.mts → swc-minify-plugin.mjs.d.ts} +0 -0
- /package/lib/{plugins.config.d.mts → plugins.config.mjs.d.ts} +0 -0
- /package/lib/polyfills/{polyfills.d.mts → polyfills.mjs.d.ts} +0 -0
- /package/lib/polyfills/{public-path.d.mts → public-path.mjs.d.ts} +0 -0
- /package/lib/polyfills/{targets.d.mts → targets.mjs.d.ts} +0 -0
- /package/lib/utils/{create-types.d.mts → create-types.mjs.d.ts} +0 -0
- /package/lib/utils/{fetch-module-federation-dts.d.mts → fetch-module-federation-dts.mjs.d.ts} +0 -0
- /package/lib/utils/{svg-to-data-uri.d.mts → svg-to-data-uri.mjs.d.ts} +0 -0
- /package/lib/vm/{app.d.mts → app.mjs.d.ts} +0 -0
- /package/lib/vm/{coverage.d.mts → coverage.mjs.d.ts} +0 -0
- /package/lib/vm/{dts.d.mts → dts.mjs.d.ts} +0 -0
- /package/lib/vm/{example.d.mts → example.mjs.d.ts} +0 -0
- /package/lib/vm/{generate-doc.d.mts → generate-doc.mjs.d.ts} +0 -0
- /package/lib/vm/{render-app.d.mts → render-app.mjs.d.ts} +0 -0
- /package/lib/vm/{routes.d.mts → routes.mjs.d.ts} +0 -0
- /package/lib/vm/{scope.d.mts → scope.mjs.d.ts} +0 -0
- /package/lib/vm/{virtual.d.mts → virtual.mjs.d.ts} +0 -0
- /package/lib/worker/{eslint.d.mts → eslint.mjs.d.ts} +0 -0
- /package/lib/worker/{stylelint.d.mts → stylelint.mjs.d.ts} +0 -0
|
@@ -6,8 +6,7 @@ import { type BinaryLike, type BinaryToTextEncoding } from 'node:crypto';
|
|
|
6
6
|
* @example
|
|
7
7
|
* toCamelCase('hello-world') // 'helloWorld'
|
|
8
8
|
* toCamelCase('foo-bar') // 'fooBar'
|
|
9
|
-
*/
|
|
10
|
-
export declare function toCamelCase(str: string): string;
|
|
9
|
+
*/ export declare function toCamelCase(str: string): string;
|
|
11
10
|
/**
|
|
12
11
|
* 将字符串转换为驼峰命名
|
|
13
12
|
* @param {string} name 需要转换的字符串
|
|
@@ -15,20 +14,18 @@ export declare function toCamelCase(str: string): string;
|
|
|
15
14
|
* @example
|
|
16
15
|
* convertToCamelCase('hello-world') // 'HelloWorld'
|
|
17
16
|
* convertToCamelCase('foo-bar-ui') // 'FooBarUI'
|
|
18
|
-
*/
|
|
19
|
-
export declare function convertToCamelCase(name: string): string;
|
|
17
|
+
*/ export declare function convertToCamelCase(name: string): string;
|
|
20
18
|
type ProgramPath<T extends string> = `${T extends string ? T : string}`;
|
|
21
19
|
/** 位于项目根目录下的位置
|
|
22
20
|
* @param {string} src 路径
|
|
23
21
|
* @returns {string} 位于项目根目录下的位置
|
|
24
|
-
*/
|
|
25
|
-
export declare function resolveProgram<T extends string>(src: T): ProgramPath<T>;
|
|
22
|
+
*/ export declare function resolveProgram<T extends string>(src: T): ProgramPath<T>;
|
|
26
23
|
/** 位于项目根目录node_modules下的位置
|
|
27
24
|
* @param {string} name 路径
|
|
28
25
|
* @returns {string} 位于项目根目录node_modules下的位置
|
|
29
|
-
*/
|
|
30
|
-
export declare function node_modules<T extends string>(name: T): `node_modules/${T}`;
|
|
26
|
+
*/ export declare function node_modules<T extends string>(name: T): `node_modules/${T}`;
|
|
31
27
|
export declare function isObject(target: unknown): target is object;
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
29
|
type AnyFunction = (...a: any[]) => any;
|
|
33
30
|
export declare function isFunction<T>(target: T): target is T & AnyFunction;
|
|
34
31
|
export declare function transformModule(obj: object | string): string;
|
|
@@ -44,21 +41,18 @@ interface DigestOption {
|
|
|
44
41
|
* @param {String | Uint8Array} data 内容
|
|
45
42
|
* @param {DigestOption} option 密钥
|
|
46
43
|
* @returns {Promise<String>} 摘要字符串
|
|
47
|
-
*/
|
|
48
|
-
export declare function digest(data: BinaryLike, option?: DigestOption): string;
|
|
44
|
+
*/ export declare function digest(data: BinaryLike, option?: DigestOption): string;
|
|
49
45
|
/**
|
|
50
46
|
* MD5 加密
|
|
51
47
|
* @param {BinaryLike} data - 要加密的字符串
|
|
52
48
|
* @param {BinaryToTextEncoding} encoding - 编码格式,默认 hex
|
|
53
49
|
* @returns {string} 加密后的字符串
|
|
54
|
-
*/
|
|
55
|
-
export declare function md5(data: BinaryLike, encoding?: BinaryToTextEncoding): string;
|
|
50
|
+
*/ export declare function md5(data: BinaryLike, encoding?: BinaryToTextEncoding): string;
|
|
56
51
|
/**
|
|
57
52
|
* 获取配置文件内容(Typescript)
|
|
58
53
|
* @template T 配置文件类型
|
|
59
54
|
* @param {string} path 配置文件路径
|
|
60
55
|
* @param {T} [normal] 默认配置
|
|
61
56
|
* @returns {Promise<T>} 配置文件内容
|
|
62
|
-
*/
|
|
63
|
-
export
|
|
64
|
-
export {};
|
|
57
|
+
*/ export declare function getConfigWithTypescript<T>(path: string, normal?: T): T;
|
|
58
|
+
export { };
|
package/lib/utils/run.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"node:vm";export default function(n,r){return e.runInThisContext(n||"",{filename:r,lineOffset:0,columnOffset:0,displayErrors:!0})}
|
|
1
|
+
import e from"node:vm";export default function(n,r){return e.runInThisContext(n||"",{filename:r,lineOffset:0,columnOffset:0,displayErrors:!0})};
|
package/lib/utils/seo.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{join as o}from"node:path";import{scanRouter as m,sitemap as t}from"@moneko/mdx";import{saveFileSync as r}from"@moneko/utils";import{routeDir as e}from"../commom/paths.mjs";import{outputConfig as
|
|
1
|
+
import{join as o}from"node:path";import{scanRouter as m,sitemap as t}from"@moneko/mdx";import{saveFileSync as r}from"@moneko/utils";import{routeDir as e}from"../commom/paths.mjs";import{outputConfig as i}from"../common.mjs";import{CONFIG as p}from"../config.mjs";import{isLibrary as s}from"../process-env.mjs";import{resolveProgram as n}from"./index.mjs";export default function(){let{domain:f,jekyll:a,path:l}=p.seo||{},j=l&&n(l)||i?.path;if(!f||!j)return;let x=`https://${f}${p.basename}`;r(o(j,"CNAME"),f),r(o(j,"robots.txt"),`User-agent: *
|
|
2
2
|
Allow: /
|
|
3
3
|
|
|
4
|
-
Sitemap: ${x}/sitemap.txt`),r(o(j,"sitemap.txt"),[x,...t(e,x,m(e,s))].join("\n")),a||r(o(j,".nojekyll"),"")}
|
|
4
|
+
Sitemap: ${x}/sitemap.txt`),r(o(j,"sitemap.txt"),[x,...t(e,x,m(e,s))].join("\n")),a||r(o(j,".nojekyll"),"")};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let f={aqua:/#00ffff(ff)?(?!\w)|#0ff(f)?(?!\w)/gi,azure:/#f0ffff(ff)?(?!\w)/gi,beige:/#f5f5dc(ff)?(?!\w)/gi,bisque:/#ffe4c4(ff)?(?!\w)/gi,black:/#000000(ff)?(?!\w)|#000(f)?(?!\w)/gi,blue:/#0000ff(ff)?(?!\w)|#00f(f)?(?!\w)/gi,brown:/#a52a2a(ff)?(?!\w)/gi,coral:/#ff7f50(ff)?(?!\w)/gi,cornsilk:/#fff8dc(ff)?(?!\w)/gi,crimson:/#dc143c(ff)?(?!\w)/gi,cyan:/#00ffff(ff)?(?!\w)|#0ff(f)?(?!\w)/gi,darkblue:/#00008b(ff)?(?!\w)/gi,darkcyan:/#008b8b(ff)?(?!\w)/gi,darkgrey:/#a9a9a9(ff)?(?!\w)/gi,darkred:/#8b0000(ff)?(?!\w)/gi,deeppink:/#ff1493(ff)?(?!\w)/gi,dimgrey:/#696969(ff)?(?!\w)/gi,gold:/#ffd700(ff)?(?!\w)/gi,green:/#008000(ff)?(?!\w)/gi,grey:/#808080(ff)?(?!\w)/gi,honeydew:/#f0fff0(ff)?(?!\w)/gi,hotpink:/#ff69b4(ff)?(?!\w)/gi,indigo:/#4b0082(ff)?(?!\w)/gi,ivory:/#fffff0(ff)?(?!\w)/gi,khaki:/#f0e68c(ff)?(?!\w)/gi,lavender:/#e6e6fa(ff)?(?!\w)/gi,lime:/#00ff00(ff)?(?!\w)|#0f0(f)?(?!\w)/gi,linen:/#faf0e6(ff)?(?!\w)/gi,maroon:/#800000(ff)?(?!\w)/gi,moccasin:/#ffe4b5(ff)?(?!\w)/gi,navy:/#000080(ff)?(?!\w)/gi,oldlace:/#fdf5e6(ff)?(?!\w)/gi,olive:/#808000(ff)?(?!\w)/gi,orange:/#ffa500(ff)?(?!\w)/gi,orchid:/#da70d6(ff)?(?!\w)/gi,peru:/#cd853f(ff)?(?!\w)/gi,pink:/#ffc0cb(ff)?(?!\w)/gi,plum:/#dda0dd(ff)?(?!\w)/gi,purple:/#800080(ff)?(?!\w)/gi,red:/#ff0000(ff)?(?!\w)|#f00(f)?(?!\w)/gi,salmon:/#fa8072(ff)?(?!\w)/gi,seagreen:/#2e8b57(ff)?(?!\w)/gi,seashell:/#fff5ee(ff)?(?!\w)/gi,sienna:/#a0522d(ff)?(?!\w)/gi,silver:/#c0c0c0(ff)?(?!\w)/gi,skyblue:/#87ceeb(ff)?(?!\w)/gi,snow:/#fffafa(ff)?(?!\w)/gi,tan:/#d2b48c(ff)?(?!\w)/gi,teal:/#008080(ff)?(?!\w)/gi,thistle:/#d8bfd8(ff)?(?!\w)/gi,tomato:/#ff6347(ff)?(?!\w)/gi,violet:/#ee82ee(ff)?(?!\w)/gi,wheat:/#f5deb3(ff)?(?!\w)/gi,white:/#ffffff(ff)?(?!\w)|#fff(f)?(?!\w)/gi};export default function(e){if("string"!=typeof e)throw TypeError(`Expected a string, but received ${typeof e}`);let i=(function(e){let i=e,g=Object.keys(f);for(let e=0,w=g.length;e<w;e++){let w=g[e];f[w].test(i)&&(i=i.replace(f[w],w))}return i})((65279===e.charCodeAt(0)?e.slice(1):e).trim().replaceAll(/\s+/g," ")).replaceAll('"',"'");return`data:image/svg+xml,${encodeURIComponent(i).replaceAll(/%[\dA-F]{2}/g,function(f){switch(f){case"%20":return" ";case"%3D":return"=";case"%3A":return":";case"%2F":return"/";default:return f.toLowerCase()}})}`}
|
|
1
|
+
let f={aqua:/#00ffff(ff)?(?!\w)|#0ff(f)?(?!\w)/gi,azure:/#f0ffff(ff)?(?!\w)/gi,beige:/#f5f5dc(ff)?(?!\w)/gi,bisque:/#ffe4c4(ff)?(?!\w)/gi,black:/#000000(ff)?(?!\w)|#000(f)?(?!\w)/gi,blue:/#0000ff(ff)?(?!\w)|#00f(f)?(?!\w)/gi,brown:/#a52a2a(ff)?(?!\w)/gi,coral:/#ff7f50(ff)?(?!\w)/gi,cornsilk:/#fff8dc(ff)?(?!\w)/gi,crimson:/#dc143c(ff)?(?!\w)/gi,cyan:/#00ffff(ff)?(?!\w)|#0ff(f)?(?!\w)/gi,darkblue:/#00008b(ff)?(?!\w)/gi,darkcyan:/#008b8b(ff)?(?!\w)/gi,darkgrey:/#a9a9a9(ff)?(?!\w)/gi,darkred:/#8b0000(ff)?(?!\w)/gi,deeppink:/#ff1493(ff)?(?!\w)/gi,dimgrey:/#696969(ff)?(?!\w)/gi,gold:/#ffd700(ff)?(?!\w)/gi,green:/#008000(ff)?(?!\w)/gi,grey:/#808080(ff)?(?!\w)/gi,honeydew:/#f0fff0(ff)?(?!\w)/gi,hotpink:/#ff69b4(ff)?(?!\w)/gi,indigo:/#4b0082(ff)?(?!\w)/gi,ivory:/#fffff0(ff)?(?!\w)/gi,khaki:/#f0e68c(ff)?(?!\w)/gi,lavender:/#e6e6fa(ff)?(?!\w)/gi,lime:/#00ff00(ff)?(?!\w)|#0f0(f)?(?!\w)/gi,linen:/#faf0e6(ff)?(?!\w)/gi,maroon:/#800000(ff)?(?!\w)/gi,moccasin:/#ffe4b5(ff)?(?!\w)/gi,navy:/#000080(ff)?(?!\w)/gi,oldlace:/#fdf5e6(ff)?(?!\w)/gi,olive:/#808000(ff)?(?!\w)/gi,orange:/#ffa500(ff)?(?!\w)/gi,orchid:/#da70d6(ff)?(?!\w)/gi,peru:/#cd853f(ff)?(?!\w)/gi,pink:/#ffc0cb(ff)?(?!\w)/gi,plum:/#dda0dd(ff)?(?!\w)/gi,purple:/#800080(ff)?(?!\w)/gi,red:/#ff0000(ff)?(?!\w)|#f00(f)?(?!\w)/gi,salmon:/#fa8072(ff)?(?!\w)/gi,seagreen:/#2e8b57(ff)?(?!\w)/gi,seashell:/#fff5ee(ff)?(?!\w)/gi,sienna:/#a0522d(ff)?(?!\w)/gi,silver:/#c0c0c0(ff)?(?!\w)/gi,skyblue:/#87ceeb(ff)?(?!\w)/gi,snow:/#fffafa(ff)?(?!\w)/gi,tan:/#d2b48c(ff)?(?!\w)/gi,teal:/#008080(ff)?(?!\w)/gi,thistle:/#d8bfd8(ff)?(?!\w)/gi,tomato:/#ff6347(ff)?(?!\w)/gi,violet:/#ee82ee(ff)?(?!\w)/gi,wheat:/#f5deb3(ff)?(?!\w)/gi,white:/#ffffff(ff)?(?!\w)|#fff(f)?(?!\w)/gi};export default function(e){if("string"!=typeof e)throw TypeError(`Expected a string, but received ${typeof e}`);let i=(function(e){let i=e,g=Object.keys(f);for(let e=0,w=g.length;e<w;e++){let w=g[e];f[w].test(i)&&(i=i.replace(f[w],w))}return i})((65279===e.charCodeAt(0)?e.slice(1):e).trim().replaceAll(/\s+/g," ")).replaceAll('"',"'");return`data:image/svg+xml,${encodeURIComponent(i).replaceAll(/%[\dA-F]{2}/g,function(f){switch(f){case"%20":return" ";case"%3D":return"=";case"%3A":return":";case"%2F":return"/";default:return f.toLowerCase()}})}`};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
interface VfsOptions {
|
|
2
2
|
namedExport?: boolean;
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
4
|
modules: Record<string, any>;
|
|
4
5
|
}
|
|
5
6
|
/**
|
|
@@ -13,6 +14,5 @@ interface VfsOptions {
|
|
|
13
14
|
* const a = vts('fullpath/a.ts');
|
|
14
15
|
*
|
|
15
16
|
* console.log(a); // { user: 'admin' }
|
|
16
|
-
*/
|
|
17
|
-
export
|
|
18
|
-
export {};
|
|
17
|
+
*/ export declare function vts<T>(filepath: string, options?: VfsOptions): T;
|
|
18
|
+
export { };
|
package/lib/vm/coverage.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileExists as e,parseXml as t}from"@moneko/utils";import{PACKAGENAME as r}from"../process-env.mjs";export default function(o){let i="export default {}";if(e(o)){let e={},s=t(o);if(s){let{metrics:t,package:o}=JSON.parse(s).coverage.project;Object.assign(e,{[r]:t.$});for(let t=0,r=o.length;t<r;t++){let r=o[t];Object.assign(e,{[r.$.name]:r.metrics.$})}}i=`export default ${JSON.stringify(e)}`}return i}
|
|
1
|
+
import{fileExists as e,parseXml as t}from"@moneko/utils";import{PACKAGENAME as r}from"../process-env.mjs";export default function(o){let i="export default {}";if(e(o)){let e={},s=t(o);if(s){let{metrics:t,package:o}=JSON.parse(s).coverage.project;Object.assign(e,{[r]:t.$});for(let t=0,r=o.length;t<r;t++){let r=o[t];Object.assign(e,{[r.$.name]:r.metrics.$})}}i=`export default ${JSON.stringify(e)}`}return i};
|
|
@@ -2,4 +2,5 @@ import ReactiveObject from '../commom/reactive-object.mjs';
|
|
|
2
2
|
import type { VirtualModules } from '../plugin/virtual-module.mjs';
|
|
3
3
|
export declare const docs_vm: ReactiveObject<VirtualModules>;
|
|
4
4
|
export declare const getCommentPath: (file: string) => string;
|
|
5
|
+
// 要执行的函数
|
|
5
6
|
export declare const getDocs: (comments: string[]) => string;
|
package/lib/vm/generate-doc.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dirname as e}from"node:path";import t from"typescript";import{CONFIG as n}from"../config.mjs";import r from"../options/md-to-html.mjs";import{digest as l}from"../utils/index.mjs";let o=t.ScriptKind,i=t.ScriptTarget,a=t.SyntaxKind,c=t.createSourceFile,s=t.forEachChild,u=t.getLeadingCommentRanges,f=t.isInterfaceDeclaration,m=t.isQuestionToken,p=t.isPropertySignature,g=t.isFunctionTypeNode,$=t.isUnionTypeNode,d=t.isMethodSignature,h={};function b(e){let t=u(e.getSourceFile().text,e.pos);if(t){let n=e.getSourceFile().text.slice(t[0].pos,t[0].end).match(/\/\*\*([\s\S]*?)\*\//);if(n)return n[1].replaceAll(/^\s*\* ?/gm,"").replace(/\s+$/,"").trim()}}function y(e){if(!e)return;let t=e.match(/@since\s+([^\n]+)/);return t?t[1].trim():void 0}function x(e){if(!e)return;let t=e.match(/@author (\w+)\s*(?:<([^>]+)>)?/);if(t&&t.length>0){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})`}}function j(e){if(!e)return;let t=e.match(/@ignore\s+([^\n]+)/);return t?t[1].trim():void 0}let A=/(?<!['"])(unknown|any|void|bigint|object|undefined|null|boolean|number|string|symbol)(?!['"])/g;function S(e,t){if(!e)return;let r=e.replaceAll(/\b([A-Z][a-zA-Z0-9]*)\b/g,e=>{if(h[e]){let r=`/${[n.basename,h[e]].join("/").split("/").filter(Boolean).join("/")}`;return t?`[\\color{#009688}{${e}}](${r})`:`[${e}](${r})`}return t?`\\color{#009688}{${e}}`:e});return t&&(r=r.replaceAll(A,e=>`\\color{#009688}{${e}}`)),r}function T(e){if(e)return(function(e){let t;if(!e)return;let n=[];for(;t=/\\color{([^|}]*)\|?([^|}]*)\|?([^|}]*)\|?([^}]*)}{([^}]*)}/g.exec(e);)n.push(t[0]);return e.replaceAll(/[{}[\]()=>]|keyof|typeof|true|false/g,e=>n.some(t=>t.includes(e))?e:`\\color{#569cd6}{${e}}`)})(e)?.replaceAll(/^\s*\|\s*|\s*\|\s*$/gm,"").replaceAll(/\n/g,"<br/>").replaceAll(/\*/g,"\\*").replaceAll(/\|/g,"\\|").replaceAll(/(['"])((?:(?!\1).)*)\1/g,"\\color{#ce9178}{$1$2$1}")}function k(e){if(e)return e.replaceAll(/@example\s*([\s\S]*?)(?=@[a-zA-Z]|\n*$)/g,"").replaceAll(/^@[a-z].+/gm,"").replaceAll(/(\n\s+)+/g,"<br />").replaceAll(/\n/g,"<br />").replaceAll(/(<br \/>)$/g,"")}let v=new
|
|
1
|
+
import{dirname as e}from"node:path";import t from"typescript";import{CONFIG as n}from"../config.mjs";import r from"../options/md-to-html.mjs";import{digest as l}from"../utils/index.mjs";let o=t.ScriptKind,i=t.ScriptTarget,a=t.SyntaxKind,c=t.createSourceFile,s=t.forEachChild,u=t.getLeadingCommentRanges,f=t.isInterfaceDeclaration,m=t.isQuestionToken,p=t.isPropertySignature,g=t.isFunctionTypeNode,$=t.isUnionTypeNode,d=t.isMethodSignature,h={};function b(e){let t=u(e.getSourceFile().text,e.pos);if(t){let n=e.getSourceFile().text.slice(t[0].pos,t[0].end).match(/\/\*\*([\s\S]*?)\*\//);if(n)return n[1].replaceAll(/^\s*\* ?/gm,"").replace(/\s+$/,"").trim()}}function y(e){if(!e)return;let t=e.match(/@since\s+([^\n]+)/);return t?t[1].trim():void 0}function x(e){if(!e)return;let t=e.match(/@author (\w+)\s*(?:<([^>]+)>)?/);if(t&&t.length>0){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})`}}function j(e){if(!e)return;let t=e.match(/@ignore\s+([^\n]+)/);return t?t[1].trim():void 0}let A=/(?<!['"])(unknown|any|void|bigint|object|undefined|null|boolean|number|string|symbol)(?!['"])/g;function S(e,t){if(!e)return;let r=e.replaceAll(/\b([A-Z][a-zA-Z0-9]*)\b/g,e=>{if(h[e]){let r=`/${[n.basename,h[e]].join("/").split("/").filter(Boolean).join("/")}`;return t?`[\\color{#009688}{${e}}](${r})`:`[${e}](${r})`}return t?`\\color{#009688}{${e}}`:e});return t&&(r=r.replaceAll(A,e=>`\\color{#009688}{${e}}`)),r}function T(e){if(e)return(function(e){let t;if(!e)return;let n=[];for(;t=/\\color{([^|}]*)\|?([^|}]*)\|?([^|}]*)\|?([^}]*)}{([^}]*)}/g.exec(e);)n.push(t[0]);return e.replaceAll(/[{}[\]()=>]|keyof|typeof|true|false/g,e=>n.some(t=>t.includes(e))?e:`\\color{#569cd6}{${e}}`)})(e)?.replaceAll(/^\s*\|\s*|\s*\|\s*$/gm,"").replaceAll(/\n/g,"<br/>").replaceAll(/\*/g,"\\*").replaceAll(/\|/g,"\\|").replaceAll(/(['"])((?:(?!\1).)*)\1/g,"\\color{#ce9178}{$1$2$1}")}function k(e){if(e)return e.replaceAll(/@example\s*([\s\S]*?)(?=@[a-zA-Z]|\n*$)/g,"").replaceAll(/^@[a-z].+/gm,"").replaceAll(/(\n\s+)+/g,"<br />").replaceAll(/\n/g,"<br />").replaceAll(/(<br \/>)$/g,"")}let v=new Map;export default function w(u,A){let w=l(u),B=v.get(w);if(B)return B;let z=c(A,u,i.Latest,!0,o.TS),F="";s(z,r=>{f(r)?F+=function(r){let l=r.name.text;Object.assign(h,{[r.name.text]:e(r.getSourceFile().fileName).replace(n.alias["@pkg"],"")});let o=b(r),i=y(o),c=k(o),s=j(o)?.split("|")||[],u=s.includes("comment"),f=s.includes("initial"),A=s.includes("optional"),v=s.includes("version"),w=s.includes("author"),B=c?`\\color{|4||0.45}{${l}}`:l,z=(function(e){let n=[];if(e.heritageClauses){for(let r of e.heritageClauses)if(r.token===t.SyntaxKind.ExtendsKeyword)for(let e of r.types)n.push(e.getText())}return n})(r)?.map(e=>`<n-tag color="#4c81db" css=".tag{gap:0px;}">${S(T(e))}</n-tag>`),F=[c,B,i&&`\\color{#52c11b|1||0.9}{${i}}`,z.length>0&&`<sub>\`extends\`</sub> ${z.join(" ")}`].filter(Boolean).join(" "),N=`## ${F}`,K=r.members.filter(e=>p(e)&&e.type?.kind!==a.NeverKeyword||d(e)),C=[];if(K.length>0){for(let e=0,t=K.length;e<t;e++){let t=K[e],n=S(T(d(t)?`(${t.parameters.map(e=>`${e.name.getText()}: ${e.type?.getText()||"any"}`).join(", ")}): ${t.type?.getText()||"any"}`:t.type?.getText()||"any"),!0),r=b(t),l=T(t.name.getText());l&&!l.startsWith("\\color")&&(d(t)||function(e){if(e.type){if(!$(e.type))return g(e.type);else for(let t of e.type.types)if(g(t))return!0}return!1}(t)||n?.includes("=>")?l=`\\color{#f9a913}{${l}}`:/^["'](.+)["']$/.test(l)||(l=`\\color{#4c81db}{${l}}`));let i=t.questionToken&&m(t.questionToken);C.push([l,!A&&`\\color{${i?"#f9a913":"#52c11b"}\\|\\|\\|0.9}{${i?"✘":"✔"}}`,!u&&T(k(r)),n,!f&&T(function(e){if(!e)return;let t=e.match(/@default\s+([^\n]+)/);return t?t[1].trim():void 0}(r)),!v&&T(y(r)),!w&&(x(r)||x(o)),function(e){if(!e)return;let t=e.match(/@example\s*([\s\S]*?)(?=@[a-zA-Z]|\n*$)/);return t?t[1].trim():void 0}(r)])}let e=!1,t=!1,n=!1,r=!1;for(let l=0,o=C.length;l<o;l++){let o=C[l];!u&&o[2]&&(r=!0),!f&&o[4]&&(n=!0),!v&&o[5]&&(t=!0),!w&&o[6]&&(e=!0)}N+="\n";let l=["属性",!A&&"必要",r&&"说明","类型",n&&"默认值",t&&"版本",e&&"作者"].filter(Boolean).join("|");N+=`|${l}|`;let i=[":-",!A&&":-",r&&":-",":-",n&&":-",t&&":-",e&&":-"].filter(Boolean);N+="\n";let a=i.join("|");N+=`|${a}|`;for(let l=0,o=C.length;l<o;l++){let o=C[l];N+="\n";let i=[(o[7]?`<n-popover arrow="true" trigger="click" content=${JSON.stringify(`<n-md css=.n-md-body{margin-bottom:0;padding:0.5rem;background-color:transparent;backdrop-filter:none;box-shadow:none;}>${o[7]}</n-md>`)}><n-button size="small" type="primary" circle="true" style="margin-right:8px;">?</n-button></n-popover>`:"")+(o[0]||"-"),!A&&(o[1]||"-"),r&&(o[2]||"-"),o[3]||"-",n&&(o[4]||"-"),t&&(o[5]||"-"),e&&(o[6]||"-")].filter(Boolean).join("|");N+=`|${i}|`}N+="\n"}return N+"\n"}(r):t.isEnumDeclaration(r)&&(F+=function(r){let l=r.name.text,o=b(r),i=k(o),a=y(o);Object.assign(h,{[r.name.text]:e(r.getSourceFile().fileName).replace(n.alias["@pkg"],"")});let c=i?`\\color{|4||0.45}{${l}}`:l,s=[i,c,a&&`\\color{#52c11b|1||0.9}{${a}}`].filter(Boolean).join(" "),u=j(o)?.split("|")||[],f=u.includes("comment"),m=u.includes("version"),p=u.includes("author"),g=`## ${s}`;if(r.members.length>0){let e=[];for(let n=0,l=r.members.length;n<l;n++){let l=r.members[n],i=T(l.name.getText()),a=b(l),c=T(function(e){let n=e.initializer;if(n&&t.isStringLiteral(n))return` '${n.text}'`}(l)),s=T(y(a)),u=T(k(a));!i||i.startsWith("\\color")||/^["'](.+)["']$/.test(i)||(i=`\\color{#4c81db}{${i}}`),e.push([i,!f&&u,c,!m&&s,!p&&(x(a)||x(o))])}let n=!1,l=!1,i=!1;for(let t=0,r=e.length;t<r;t++){let r=e[t];!f&&r[1]&&(i=!0),!m&&r[3]&&(l=!0),!p&&r[4]&&(n=!0)}g+="\n";let a=["属性",i&&"说明","值",l&&"版本",n&&"作者"].filter(Boolean).join("|");g+=`|${a}|`;let c=[":-",i&&":-",":-",l&&":-",n&&":-"].filter(Boolean);g+="\n";let s=c.join("|");g+=`|${s}|`;for(let t=0,r=e.length;t<r;t++){let r=e[t];g+="\n";let o=[r[0]||"-",i&&(r[1]||"-"),r[2]||"-",l&&(r[3]||"-"),n&&(r[4]||"-")].filter(Boolean).join("|");g+=`|${o}|`}}return g+"\n\n"}(r))});let N=r(F);return v.set(w,N),N}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "4.1
|
|
3
|
+
"version": "4.2.0-beta.1",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "rm -rf ./lib && node build.mjs
|
|
8
|
+
"build": "rm -rf ./lib && node build.mjs",
|
|
9
9
|
"prepublishOnly": "npm run build",
|
|
10
10
|
"pin": "node lib/bin/index.mjs pin"
|
|
11
11
|
},
|
|
@@ -128,41 +128,38 @@
|
|
|
128
128
|
"homepage": "https://monako97.github.io/neko-ui/@moneko/config",
|
|
129
129
|
"license": "MIT",
|
|
130
130
|
"dependencies": {
|
|
131
|
-
"@moneko/convert": "1.1.
|
|
132
|
-
"@moneko/eslint": "1.
|
|
131
|
+
"@moneko/convert": "1.1.7",
|
|
132
|
+
"@moneko/eslint": "1.11.0",
|
|
133
133
|
"@moneko/mdx": "1.0.3",
|
|
134
|
-
"@moneko/raw-import": "1.
|
|
134
|
+
"@moneko/raw-import": "1.3.0",
|
|
135
135
|
"@moneko/request": "1.6.2",
|
|
136
|
-
"@moneko/stylelint": "1.
|
|
137
|
-
"@moneko/transform-imports": "1.
|
|
136
|
+
"@moneko/stylelint": "1.8.0",
|
|
137
|
+
"@moneko/transform-imports": "1.4.0",
|
|
138
138
|
"@moneko/utils": "0.3.3",
|
|
139
|
-
"@swc/core": "1.15.
|
|
139
|
+
"@swc/core": "1.15.7",
|
|
140
140
|
"browserslist": "4.28.1",
|
|
141
141
|
"core-js": "3.47.0",
|
|
142
142
|
"core-js-compat": "3.47.0",
|
|
143
143
|
"husky": "9.1.7",
|
|
144
|
-
"less": "4.
|
|
144
|
+
"less": "4.5.1",
|
|
145
145
|
"less-loader": "12.3.0",
|
|
146
146
|
"lightningcss": "1.30.2",
|
|
147
147
|
"marked-completed": "1.2.14",
|
|
148
148
|
"memfs": "4.51.1",
|
|
149
149
|
"swc-loader": "0.2.6",
|
|
150
150
|
"typescript": "5.9.3",
|
|
151
|
-
"webpack": "5.
|
|
151
|
+
"webpack": "5.104.1",
|
|
152
152
|
"webpack-hot-middleware": "2.26.1",
|
|
153
153
|
"webpack-merge": "6.0.1"
|
|
154
154
|
},
|
|
155
155
|
"devDependencies": {
|
|
156
|
-
"@moneko/css": "1.2.0",
|
|
157
156
|
"@types/react-refresh": "0.14.7",
|
|
158
157
|
"@types/stylis": "4.2.7",
|
|
159
158
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
160
159
|
"@types/webpack-hot-middleware": "2.25.12",
|
|
161
|
-
"sass": "1.
|
|
160
|
+
"sass": "1.97.1",
|
|
162
161
|
"sass-loader": "16.0.6",
|
|
163
|
-
"solid-refresh": "0.7.5"
|
|
164
|
-
"stylis": "4.3.6",
|
|
165
|
-
"webpack-bundle-analyzer": "5.1.0"
|
|
162
|
+
"solid-refresh": "0.7.5"
|
|
166
163
|
},
|
|
167
164
|
"publishConfig": {
|
|
168
165
|
"access": "public",
|
|
@@ -172,5 +169,5 @@
|
|
|
172
169
|
"lib",
|
|
173
170
|
"typings"
|
|
174
171
|
],
|
|
175
|
-
"packageManager": "pnpm@10.
|
|
172
|
+
"packageManager": "pnpm@10.26.1"
|
|
176
173
|
}
|
package/lib/bin/build-app.d.mts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 拷贝文件
|
|
3
|
-
* @param {String} source 源文件
|
|
4
|
-
* @param {String} target 目标文件
|
|
5
|
-
* @constructor
|
|
6
|
-
* */
|
|
7
|
-
export declare function copyFileSync(source: string, target: string): void;
|
|
8
|
-
/**
|
|
9
|
-
* 拷贝文件夹
|
|
10
|
-
* @param {String} source 源文件夹
|
|
11
|
-
* @param {String} target 目标文件夹
|
|
12
|
-
* @param {String} sun 是否子文件夹
|
|
13
|
-
* @constructor
|
|
14
|
-
* */
|
|
15
|
-
export declare function copyFolderRecursiveSync(source: string, target: string, sun?: boolean): void;
|
|
16
|
-
export default function createApp(): Promise<void>;
|
package/lib/bin/server.d.mts
DELETED
package/lib/bin/tsc.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/build-dev.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/build.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface CssInJsMinifyOption {
|
|
2
|
-
/**
|
|
3
|
-
* css in js 使用的模块
|
|
4
|
-
* @default '@moneko/css'
|
|
5
|
-
*/
|
|
6
|
-
moduleName: string;
|
|
7
|
-
/**
|
|
8
|
-
* css in js 字符串模版函数
|
|
9
|
-
* @default ['css', 'injectGlobal']
|
|
10
|
-
*/
|
|
11
|
-
allowFuncs: string[];
|
|
12
|
-
}
|
|
13
|
-
export declare function cssInJsMinify(sourceCode: string, options: CssInJsMinifyOption): Promise<import("@swc/core").Output>;
|
package/lib/commom/paths.d.mts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/** 当前文件所在目录的绝对路径 */
|
|
2
|
-
export declare const __dirname: string;
|
|
3
|
-
/** yarn 命令行参数对象,包含配置选项 */
|
|
4
|
-
export declare const yarnArgv: Record<string, string> & {
|
|
5
|
-
config?: string;
|
|
6
|
-
};
|
|
7
|
-
/** 附加启动配置名称
|
|
8
|
-
* @example
|
|
9
|
-
* 当通过以下命令启动时, 此时 CUSTOMCONFIG 为 test
|
|
10
|
-
* ```sh
|
|
11
|
-
* npm run start --config=test
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export declare const CUSTOMCONFIG: string | undefined;
|
|
15
|
-
export declare const TMP_DIR: string;
|
|
16
|
-
declare const paths: {
|
|
17
|
-
/** node_modules 目录路径 */
|
|
18
|
-
nodeModules: string;
|
|
19
|
-
/** pnpm node_modules 目录路径 */
|
|
20
|
-
pnpmNodeModules: string;
|
|
21
|
-
/** deno node_modules 目录路径 */
|
|
22
|
-
denoNodeModules: string;
|
|
23
|
-
/** 核心代码路径 */
|
|
24
|
-
corePath: string;
|
|
25
|
-
/** 项目根目录路径 */
|
|
26
|
-
programPath: string;
|
|
27
|
-
/** CA 目录路径 */
|
|
28
|
-
CA_DIR: string;
|
|
29
|
-
/** webpack 缓存目录路径 */
|
|
30
|
-
webpackCachePath: string;
|
|
31
|
-
/** 代码检查工具(ESLint、Stylelint等)的缓存目录路径 */
|
|
32
|
-
lintCachePath: string;
|
|
33
|
-
/** HTTP 远程模块缓存路径 */
|
|
34
|
-
httpCachePath: string;
|
|
35
|
-
/** SWC 缓存目录路径 */
|
|
36
|
-
swcCachePath: string;
|
|
37
|
-
/** 默认配置文件路径 */
|
|
38
|
-
configPath: string;
|
|
39
|
-
/** 自定义配置文件路径 */
|
|
40
|
-
customConfigPath: string;
|
|
41
|
-
/** 测试覆盖率报告路径 */
|
|
42
|
-
coveragePath: string;
|
|
43
|
-
/** 页面目录路径 */
|
|
44
|
-
pagesPath: string;
|
|
45
|
-
/** 组件目录路径 */
|
|
46
|
-
componentsPath: string;
|
|
47
|
-
/** Mock 数据目录路径 */
|
|
48
|
-
mockPath: string;
|
|
49
|
-
};
|
|
50
|
-
export declare const config_files: string[];
|
|
51
|
-
export declare const routeDir: string;
|
|
52
|
-
export default paths;
|
package/lib/commom/rule.d.mts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
declare const Rule: {
|
|
2
|
-
js: RegExp;
|
|
3
|
-
css: RegExp;
|
|
4
|
-
less: RegExp;
|
|
5
|
-
scss: RegExp;
|
|
6
|
-
wasm: RegExp;
|
|
7
|
-
txt: RegExp;
|
|
8
|
-
image: RegExp;
|
|
9
|
-
video: RegExp;
|
|
10
|
-
font: RegExp;
|
|
11
|
-
markdown: RegExp;
|
|
12
|
-
tsdoc: RegExp;
|
|
13
|
-
css_module: RegExp;
|
|
14
|
-
less_global: RegExp;
|
|
15
|
-
sass_global: RegExp;
|
|
16
|
-
node_modules_css_module: RegExp;
|
|
17
|
-
node_modules: RegExp;
|
|
18
|
-
__tests__: RegExp;
|
|
19
|
-
/**
|
|
20
|
-
* 提取函数字符串
|
|
21
|
-
* @example
|
|
22
|
-
* // () => import('pkg')
|
|
23
|
-
* "rr(() => import('pkg'))rr".replace(Rule.extract_func, '$1')
|
|
24
|
-
* */
|
|
25
|
-
extract_func: RegExp;
|
|
26
|
-
};
|
|
27
|
-
export default Rule;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
export type MemberTransformer =
|
|
2
|
-
/** 帕斯卡拼写法(大驼峰): 所有单词的首字母大写,然后直接连接起来,单词之间没有连接符 */
|
|
3
|
-
'pascal_case'
|
|
4
|
-
/** 骆驼拼写法(小驼峰): 第一个单词的首字母小写, 后续所有单词的首字母大写,然后直接连接起来,单词之间没有连接符 */
|
|
5
|
-
| 'camel_case'
|
|
6
|
-
/** 连字符拼写法: 各个单词或缩写之间以`-`做间隔 */
|
|
7
|
-
| 'kebab_case'
|
|
8
|
-
/** 破折号式: 每个单词全小写或全大写,多单词使用`-`隔开 */
|
|
9
|
-
| 'dashed_case'
|
|
10
|
-
/** 蛇形命名: 每个单词全小写或全大写,多单词使用`_`隔开 */
|
|
11
|
-
| 'snake_case'
|
|
12
|
-
/** 大写 */
|
|
13
|
-
| 'upper_case'
|
|
14
|
-
/** 最后大写 */
|
|
15
|
-
| 'upper_first'
|
|
16
|
-
/** 小写 */
|
|
17
|
-
| 'lower_case'
|
|
18
|
-
/** 最后小写 */
|
|
19
|
-
| 'lower_first';
|
|
20
|
-
export interface TransformerOption {
|
|
21
|
-
/**
|
|
22
|
-
* 要使用的库名称,而不是导入语句中指定的库名称。`${member}` 是替换的成员
|
|
23
|
-
*/
|
|
24
|
-
transform: string;
|
|
25
|
-
/**
|
|
26
|
-
* 设置转换时需要单独导入的样式,`${member}` 是替换的成员
|
|
27
|
-
* @default false
|
|
28
|
-
*/
|
|
29
|
-
style?: string | boolean;
|
|
30
|
-
/**
|
|
31
|
-
* 当设置为true时,将保留 `import { Button }` 语法,而不是转换为 `import Button`
|
|
32
|
-
* @default false
|
|
33
|
-
*/
|
|
34
|
-
skipDefaultConversion?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* 当遇到会导致导入整个模块时,是否抛出
|
|
37
|
-
* @default true
|
|
38
|
-
*/
|
|
39
|
-
preventFullImport?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* `${member}` 成员转换规则
|
|
42
|
-
* @default []
|
|
43
|
-
*/
|
|
44
|
-
memberTransformers?: MemberTransformer[];
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* 引入语法转换
|
|
48
|
-
* @example
|
|
49
|
-
* ```javascript
|
|
50
|
-
* // 案例
|
|
51
|
-
* const conf = {
|
|
52
|
-
* importOnDemand: {
|
|
53
|
-
* antd: {
|
|
54
|
-
* transform: 'lib/${member}',
|
|
55
|
-
* skipDefaultConversion: false,
|
|
56
|
-
* preventFullImport: true,
|
|
57
|
-
* style: 'lib/${member}/style',
|
|
58
|
-
* memberTransformers: ['dashed_case'],
|
|
59
|
-
* },
|
|
60
|
-
* lodash: {
|
|
61
|
-
* transform: '${member}',
|
|
62
|
-
* preventFullImport: true,
|
|
63
|
-
* },
|
|
64
|
-
* },
|
|
65
|
-
* };
|
|
66
|
-
* // 以下代码将会按照预期进行转换
|
|
67
|
-
* import { Button as MyButton, BackTop } from "antd";
|
|
68
|
-
* import { merge } from "lodash";
|
|
69
|
-
* // to
|
|
70
|
-
* import MyButton from "antd/lib/button";
|
|
71
|
-
* import BackTop from "antd/lib/back-top";
|
|
72
|
-
* import "antd/lib/back-top/style";
|
|
73
|
-
* import "antd/lib/button/style";
|
|
74
|
-
* import merge from "lodash/merge";
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
export type SwcImportOnDemandTransform = Record<string, TransformerOption | false>;
|
|
78
|
-
export declare function swcImportOnDemandConfig(config: SwcImportOnDemandTransform): SwcImportOnDemandTransform;
|
package/lib/dev/config.d.mts
DELETED
package/lib/dev/get-cert.d.mts
DELETED
package/lib/dev.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/loader/mdx.d.cts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { TransformOptions } from '@moneko/eslint/babel-core';
|
|
2
|
-
import type { PluginOptions } from '@moneko/eslint/react-compiler';
|
|
3
|
-
import type { LoaderContext } from 'webpack';
|
|
4
|
-
export interface ReactCompilerOption extends Partial<PluginOptions> {
|
|
5
|
-
/**
|
|
6
|
-
* 指定 React 的主要版本
|
|
7
|
-
* @description
|
|
8
|
-
* ReactCompiler 与 React 19+ 配合使用效果最佳;
|
|
9
|
-
*
|
|
10
|
-
* 将 ReactCompiler 与 React 17、18 一起使用需要安装额外的 `react-compiler-runtime` 依赖项;
|
|
11
|
-
*/
|
|
12
|
-
target: '17' | '18' | '19';
|
|
13
|
-
/** 编译模式
|
|
14
|
-
* @description annotation 注释模式: 通过 "use memo"、"use no memo" 手动指定启用优化
|
|
15
|
-
* @example
|
|
16
|
-
* export default function Home() {
|
|
17
|
-
* 'use memo';
|
|
18
|
-
* // ...
|
|
19
|
-
* }
|
|
20
|
-
* export default function About() {
|
|
21
|
-
* 'use no memo';
|
|
22
|
-
* // ...
|
|
23
|
-
* }
|
|
24
|
-
*/
|
|
25
|
-
compilationMode: 'annotation' | 'infer' | 'syntax' | 'all';
|
|
26
|
-
}
|
|
27
|
-
declare function reactCompilerLoader(this: LoaderContext<ReactCompilerOption>, sourceCode: string, inputSourceMap?: TransformOptions['inputSourceMap']): string | undefined;
|
|
28
|
-
export declare function custom(this: LoaderContext<ReactCompilerOption>, sourceCode: string, inputSourceMap?: TransformOptions['inputSourceMap']): () => string | undefined;
|
|
29
|
-
export default reactCompilerLoader;
|
package/lib/module.config.d.mts
DELETED