@fangzhongya/vue-archive 0.0.5 → 0.0.7
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/dist/node/index.cjs +19 -38
- package/dist/node/index.d.cts +1 -3
- package/dist/node/index.d.ts +1 -3
- package/dist/node/index.js +19 -38
- package/dist/packages/config.d.ts +1 -3
- package/dist/packages/utils/common.d.ts +2 -2
- package/dist/packages/utils/common.js +5 -21
- package/dist/packages/utils/glob.cjs +3 -3
- package/dist/packages/utils/glob.js +167 -177
- package/package.json +3 -3
package/dist/node/index.cjs
CHANGED
|
@@ -86,7 +86,7 @@ function lineToLargeHump(name) {
|
|
|
86
86
|
return arr.join("");
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
// node_modules/.pnpm/@fangzhongya+create@0.2.
|
|
89
|
+
// node_modules/.pnpm/@fangzhongya+create@0.2.10/node_modules/@fangzhongya/create/dist/chunk-GZYHZMXR.js
|
|
90
90
|
var import_node_fs = require("fs");
|
|
91
91
|
var import_node_path = require("path");
|
|
92
92
|
function getUrlCatalogueObj(str) {
|
|
@@ -345,7 +345,7 @@ function writeFileUrl(url, files, callback, isDirs, isFile, issynch) {
|
|
|
345
345
|
});
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
// node_modules/.pnpm/@fangzhongya+create@0.2.
|
|
348
|
+
// node_modules/.pnpm/@fangzhongya+create@0.2.10/node_modules/@fangzhongya/create/dist/chunk-UAWU4UVR.js
|
|
349
349
|
var import_node_path2 = require("path");
|
|
350
350
|
function styleLog(msg = "", obj) {
|
|
351
351
|
const arr = ["\x1B[0m"];
|
|
@@ -767,7 +767,7 @@ var FangCom = class {
|
|
|
767
767
|
}
|
|
768
768
|
};
|
|
769
769
|
|
|
770
|
-
// node_modules/.pnpm/@fangzhongya+create@0.2.
|
|
770
|
+
// node_modules/.pnpm/@fangzhongya+create@0.2.10/node_modules/@fangzhongya/create/dist/bins/md.js
|
|
771
771
|
var defaultConfig2 = Object.assign({}, defaultConfig, {
|
|
772
772
|
name: "md"
|
|
773
773
|
});
|
|
@@ -1016,10 +1016,7 @@ function getUrlName(url, pps, raliass = {}, alias = "") {
|
|
|
1016
1016
|
mds: [],
|
|
1017
1017
|
tests: void 0
|
|
1018
1018
|
};
|
|
1019
|
-
rsobj.aliasNames = getAliassNames(
|
|
1020
|
-
rsobj,
|
|
1021
|
-
aliass
|
|
1022
|
-
);
|
|
1019
|
+
rsobj.aliasNames = getAliassNames(rsobj, aliass);
|
|
1023
1020
|
return rsobj;
|
|
1024
1021
|
}
|
|
1025
1022
|
}
|
|
@@ -1035,9 +1032,7 @@ function getTDir(key) {
|
|
|
1035
1032
|
}
|
|
1036
1033
|
function isComprops(url, comprops) {
|
|
1037
1034
|
if (comprops) {
|
|
1038
|
-
const reg = new RegExp(
|
|
1039
|
-
comprops + ".+(\\.(js|ts))?$"
|
|
1040
|
-
);
|
|
1035
|
+
const reg = new RegExp(comprops + ".+(\\.(js|ts))?$");
|
|
1041
1036
|
return reg.test(url);
|
|
1042
1037
|
} else {
|
|
1043
1038
|
return false;
|
|
@@ -1045,9 +1040,7 @@ function isComprops(url, comprops) {
|
|
|
1045
1040
|
}
|
|
1046
1041
|
function isCurprops(url, comprops) {
|
|
1047
1042
|
if (comprops) {
|
|
1048
|
-
const reg = new RegExp(
|
|
1049
|
-
"/" + comprops + "(\\.(js|ts))?$"
|
|
1050
|
-
);
|
|
1043
|
+
const reg = new RegExp("/" + comprops + "(\\.(js|ts))?$");
|
|
1051
1044
|
return reg.test(url);
|
|
1052
1045
|
} else {
|
|
1053
1046
|
return false;
|
|
@@ -1056,11 +1049,7 @@ function isCurprops(url, comprops) {
|
|
|
1056
1049
|
function getComponentsArr(urls, v, comRaw, com, config2) {
|
|
1057
1050
|
const props2 = [];
|
|
1058
1051
|
const arr = [];
|
|
1059
|
-
const ppz = getMatchs(
|
|
1060
|
-
v.matchexts,
|
|
1061
|
-
v.extensions,
|
|
1062
|
-
v.matchs
|
|
1063
|
-
);
|
|
1052
|
+
const ppz = getMatchs(v.matchexts, v.extensions, v.matchs);
|
|
1064
1053
|
const tdir = getTDir(v.dir);
|
|
1065
1054
|
urls.forEach((key) => {
|
|
1066
1055
|
const reg = new RegExp("^" + v.dir);
|
|
@@ -1078,12 +1067,7 @@ function getComponentsArr(urls, v, comRaw, com, config2) {
|
|
|
1078
1067
|
value.getRaw = getRawValue(comRaw, key);
|
|
1079
1068
|
props2.push(value);
|
|
1080
1069
|
} else {
|
|
1081
|
-
let value = getUrlName(
|
|
1082
|
-
k,
|
|
1083
|
-
ppz,
|
|
1084
|
-
v.aliass,
|
|
1085
|
-
v.alias
|
|
1086
|
-
);
|
|
1070
|
+
let value = getUrlName(k, ppz, v.aliass, v.alias);
|
|
1087
1071
|
if (value) {
|
|
1088
1072
|
value.comprops = config2.comprops;
|
|
1089
1073
|
value.curprops = config2.curprops;
|
|
@@ -1863,7 +1847,7 @@ function getComponents() {
|
|
|
1863
1847
|
const arr = getConfig("components");
|
|
1864
1848
|
arr?.forEach((v) => {
|
|
1865
1849
|
setForComponentsValue(v);
|
|
1866
|
-
let dir = v.dir ||
|
|
1850
|
+
let dir = v.dir || "";
|
|
1867
1851
|
setExampleObj(dir, example, v.example);
|
|
1868
1852
|
});
|
|
1869
1853
|
}
|
|
@@ -1900,20 +1884,17 @@ function setComponentsObj(alias, arr) {
|
|
|
1900
1884
|
function setForComponentsValue(v) {
|
|
1901
1885
|
let alias;
|
|
1902
1886
|
let obj;
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
v
|
|
1911
|
-
);
|
|
1912
|
-
} else {
|
|
1913
|
-
alias = v.alias || defaultName;
|
|
1914
|
-
let urls = v?.urls || Object.keys(v.componentsRaw);
|
|
1915
|
-
obj = getComponentsArr(urls, v, v.componentsRaw, v.components, v);
|
|
1887
|
+
const resolver = v.resolver;
|
|
1888
|
+
if (resolver) {
|
|
1889
|
+
Object.keys(resolver).forEach((key) => {
|
|
1890
|
+
if (typeof v[key] === "undefined") {
|
|
1891
|
+
v[key] = resolver[key];
|
|
1892
|
+
}
|
|
1893
|
+
});
|
|
1916
1894
|
}
|
|
1895
|
+
alias = v.alias || defaultName;
|
|
1896
|
+
let urls = v?.urls || Object.keys(v.componentsRaw);
|
|
1897
|
+
obj = getComponentsArr(urls, v, v.componentsRaw, v.components, v);
|
|
1917
1898
|
if (obj && obj?.props) {
|
|
1918
1899
|
obj.props.forEach((z) => {
|
|
1919
1900
|
componentPropsObj[z.key] = z;
|
package/dist/node/index.d.cts
CHANGED
|
@@ -16,13 +16,11 @@ interface Component {
|
|
|
16
16
|
matchs?: Array<string>;
|
|
17
17
|
matchexts?: Array<string>;
|
|
18
18
|
directives?: string;
|
|
19
|
-
}
|
|
20
|
-
interface Resolver extends Component {
|
|
21
19
|
urls?: Array<string>;
|
|
22
20
|
dirUrls?: Array<string>;
|
|
23
21
|
}
|
|
24
22
|
interface Components extends Component {
|
|
25
|
-
resolver?:
|
|
23
|
+
resolver?: Component;
|
|
26
24
|
urls?: string[];
|
|
27
25
|
comprops?: string;
|
|
28
26
|
curprops?: string;
|
package/dist/node/index.d.ts
CHANGED
|
@@ -16,13 +16,11 @@ interface Component {
|
|
|
16
16
|
matchs?: Array<string>;
|
|
17
17
|
matchexts?: Array<string>;
|
|
18
18
|
directives?: string;
|
|
19
|
-
}
|
|
20
|
-
interface Resolver extends Component {
|
|
21
19
|
urls?: Array<string>;
|
|
22
20
|
dirUrls?: Array<string>;
|
|
23
21
|
}
|
|
24
22
|
interface Components extends Component {
|
|
25
|
-
resolver?:
|
|
23
|
+
resolver?: Component;
|
|
26
24
|
urls?: string[];
|
|
27
25
|
comprops?: string;
|
|
28
26
|
curprops?: string;
|
package/dist/node/index.js
CHANGED
|
@@ -60,7 +60,7 @@ function lineToLargeHump(name) {
|
|
|
60
60
|
return arr.join("");
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
// node_modules/.pnpm/@fangzhongya+create@0.2.
|
|
63
|
+
// node_modules/.pnpm/@fangzhongya+create@0.2.10/node_modules/@fangzhongya/create/dist/chunk-GZYHZMXR.js
|
|
64
64
|
import {
|
|
65
65
|
open,
|
|
66
66
|
readdir,
|
|
@@ -330,7 +330,7 @@ function writeFileUrl(url, files, callback, isDirs, isFile, issynch) {
|
|
|
330
330
|
});
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
// node_modules/.pnpm/@fangzhongya+create@0.2.
|
|
333
|
+
// node_modules/.pnpm/@fangzhongya+create@0.2.10/node_modules/@fangzhongya/create/dist/chunk-UAWU4UVR.js
|
|
334
334
|
import { resolve, join as join2 } from "node:path";
|
|
335
335
|
function styleLog(msg = "", obj) {
|
|
336
336
|
const arr = ["\x1B[0m"];
|
|
@@ -752,7 +752,7 @@ var FangCom = class {
|
|
|
752
752
|
}
|
|
753
753
|
};
|
|
754
754
|
|
|
755
|
-
// node_modules/.pnpm/@fangzhongya+create@0.2.
|
|
755
|
+
// node_modules/.pnpm/@fangzhongya+create@0.2.10/node_modules/@fangzhongya/create/dist/bins/md.js
|
|
756
756
|
var defaultConfig2 = Object.assign({}, defaultConfig, {
|
|
757
757
|
name: "md"
|
|
758
758
|
});
|
|
@@ -1001,10 +1001,7 @@ function getUrlName(url, pps, raliass = {}, alias = "") {
|
|
|
1001
1001
|
mds: [],
|
|
1002
1002
|
tests: void 0
|
|
1003
1003
|
};
|
|
1004
|
-
rsobj.aliasNames = getAliassNames(
|
|
1005
|
-
rsobj,
|
|
1006
|
-
aliass
|
|
1007
|
-
);
|
|
1004
|
+
rsobj.aliasNames = getAliassNames(rsobj, aliass);
|
|
1008
1005
|
return rsobj;
|
|
1009
1006
|
}
|
|
1010
1007
|
}
|
|
@@ -1020,9 +1017,7 @@ function getTDir(key) {
|
|
|
1020
1017
|
}
|
|
1021
1018
|
function isComprops(url, comprops) {
|
|
1022
1019
|
if (comprops) {
|
|
1023
|
-
const reg = new RegExp(
|
|
1024
|
-
comprops + ".+(\\.(js|ts))?$"
|
|
1025
|
-
);
|
|
1020
|
+
const reg = new RegExp(comprops + ".+(\\.(js|ts))?$");
|
|
1026
1021
|
return reg.test(url);
|
|
1027
1022
|
} else {
|
|
1028
1023
|
return false;
|
|
@@ -1030,9 +1025,7 @@ function isComprops(url, comprops) {
|
|
|
1030
1025
|
}
|
|
1031
1026
|
function isCurprops(url, comprops) {
|
|
1032
1027
|
if (comprops) {
|
|
1033
|
-
const reg = new RegExp(
|
|
1034
|
-
"/" + comprops + "(\\.(js|ts))?$"
|
|
1035
|
-
);
|
|
1028
|
+
const reg = new RegExp("/" + comprops + "(\\.(js|ts))?$");
|
|
1036
1029
|
return reg.test(url);
|
|
1037
1030
|
} else {
|
|
1038
1031
|
return false;
|
|
@@ -1041,11 +1034,7 @@ function isCurprops(url, comprops) {
|
|
|
1041
1034
|
function getComponentsArr(urls, v, comRaw, com, config2) {
|
|
1042
1035
|
const props2 = [];
|
|
1043
1036
|
const arr = [];
|
|
1044
|
-
const ppz = getMatchs(
|
|
1045
|
-
v.matchexts,
|
|
1046
|
-
v.extensions,
|
|
1047
|
-
v.matchs
|
|
1048
|
-
);
|
|
1037
|
+
const ppz = getMatchs(v.matchexts, v.extensions, v.matchs);
|
|
1049
1038
|
const tdir = getTDir(v.dir);
|
|
1050
1039
|
urls.forEach((key) => {
|
|
1051
1040
|
const reg = new RegExp("^" + v.dir);
|
|
@@ -1063,12 +1052,7 @@ function getComponentsArr(urls, v, comRaw, com, config2) {
|
|
|
1063
1052
|
value.getRaw = getRawValue(comRaw, key);
|
|
1064
1053
|
props2.push(value);
|
|
1065
1054
|
} else {
|
|
1066
|
-
let value = getUrlName(
|
|
1067
|
-
k,
|
|
1068
|
-
ppz,
|
|
1069
|
-
v.aliass,
|
|
1070
|
-
v.alias
|
|
1071
|
-
);
|
|
1055
|
+
let value = getUrlName(k, ppz, v.aliass, v.alias);
|
|
1072
1056
|
if (value) {
|
|
1073
1057
|
value.comprops = config2.comprops;
|
|
1074
1058
|
value.curprops = config2.curprops;
|
|
@@ -1848,7 +1832,7 @@ function getComponents() {
|
|
|
1848
1832
|
const arr = getConfig("components");
|
|
1849
1833
|
arr?.forEach((v) => {
|
|
1850
1834
|
setForComponentsValue(v);
|
|
1851
|
-
let dir = v.dir ||
|
|
1835
|
+
let dir = v.dir || "";
|
|
1852
1836
|
setExampleObj(dir, example, v.example);
|
|
1853
1837
|
});
|
|
1854
1838
|
}
|
|
@@ -1885,20 +1869,17 @@ function setComponentsObj(alias, arr) {
|
|
|
1885
1869
|
function setForComponentsValue(v) {
|
|
1886
1870
|
let alias;
|
|
1887
1871
|
let obj;
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
v
|
|
1896
|
-
);
|
|
1897
|
-
} else {
|
|
1898
|
-
alias = v.alias || defaultName;
|
|
1899
|
-
let urls = v?.urls || Object.keys(v.componentsRaw);
|
|
1900
|
-
obj = getComponentsArr(urls, v, v.componentsRaw, v.components, v);
|
|
1872
|
+
const resolver = v.resolver;
|
|
1873
|
+
if (resolver) {
|
|
1874
|
+
Object.keys(resolver).forEach((key) => {
|
|
1875
|
+
if (typeof v[key] === "undefined") {
|
|
1876
|
+
v[key] = resolver[key];
|
|
1877
|
+
}
|
|
1878
|
+
});
|
|
1901
1879
|
}
|
|
1880
|
+
alias = v.alias || defaultName;
|
|
1881
|
+
let urls = v?.urls || Object.keys(v.componentsRaw);
|
|
1882
|
+
obj = getComponentsArr(urls, v, v.componentsRaw, v.components, v);
|
|
1902
1883
|
if (obj && obj?.props) {
|
|
1903
1884
|
obj.props.forEach((z) => {
|
|
1904
1885
|
componentPropsObj[z.key] = z;
|
|
@@ -18,13 +18,11 @@ export interface Component {
|
|
|
18
18
|
matchs?: Array<string>;
|
|
19
19
|
matchexts?: Array<string>;
|
|
20
20
|
directives?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface Resolver extends Component {
|
|
23
21
|
urls?: Array<string>;
|
|
24
22
|
dirUrls?: Array<string>;
|
|
25
23
|
}
|
|
26
24
|
export interface Components extends Component {
|
|
27
|
-
resolver?:
|
|
25
|
+
resolver?: Component;
|
|
28
26
|
urls?: string[];
|
|
29
27
|
comprops?: string;
|
|
30
28
|
curprops?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsyncComponentLoader } from '../../vue/dist/vue.esm-bundler.js';
|
|
2
|
-
import { ObjStr, Component,
|
|
2
|
+
import { ObjStr, Component, Components, Globs, GlobComs, GetRaw } from '../config';
|
|
3
3
|
export declare const defaultExtensions: string[];
|
|
4
4
|
/**
|
|
5
5
|
* 判断是否匹配
|
|
@@ -74,5 +74,5 @@ export interface ComponentsObjs {
|
|
|
74
74
|
props: Array<PropsObj>;
|
|
75
75
|
components: Array<ComponentsObj>;
|
|
76
76
|
}
|
|
77
|
-
export declare function getComponentsArr(urls: Array<string>, v:
|
|
77
|
+
export declare function getComponentsArr(urls: Array<string>, v: Components, comRaw: Globs, com: GlobComs, config: Components): ComponentsObjs;
|
|
78
78
|
export declare function getRawValue(comRaw: Globs, key: string): GetRaw | null;
|
|
@@ -53,10 +53,7 @@ function T(t, e, n = {}, i = "") {
|
|
|
53
53
|
mds: [],
|
|
54
54
|
tests: void 0
|
|
55
55
|
};
|
|
56
|
-
return s.aliasNames = S(
|
|
57
|
-
s,
|
|
58
|
-
a
|
|
59
|
-
), s;
|
|
56
|
+
return s.aliasNames = S(s, a), s;
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
59
|
}
|
|
@@ -71,21 +68,13 @@ function v(t) {
|
|
|
71
68
|
return e && e.length > 1 ? e[1] : "";
|
|
72
69
|
}
|
|
73
70
|
function K(t, e) {
|
|
74
|
-
return e ? new RegExp(
|
|
75
|
-
e + ".+(\\.(js|ts))?$"
|
|
76
|
-
).test(t) : !1;
|
|
71
|
+
return e ? new RegExp(e + ".+(\\.(js|ts))?$").test(t) : !1;
|
|
77
72
|
}
|
|
78
73
|
function L(t, e) {
|
|
79
|
-
return e ? new RegExp(
|
|
80
|
-
"/" + e + "(\\.(js|ts))?$"
|
|
81
|
-
).test(t) : !1;
|
|
74
|
+
return e ? new RegExp("/" + e + "(\\.(js|ts))?$").test(t) : !1;
|
|
82
75
|
}
|
|
83
76
|
function V(t, e, n, i, r) {
|
|
84
|
-
const u = [], p = [], f = C(
|
|
85
|
-
e.matchexts,
|
|
86
|
-
e.extensions,
|
|
87
|
-
e.matchs
|
|
88
|
-
), a = v(e.dir);
|
|
77
|
+
const u = [], p = [], f = C(e.matchexts, e.extensions, e.matchs), a = v(e.dir);
|
|
89
78
|
return t.forEach((o) => {
|
|
90
79
|
const c = new RegExp("^" + e.dir);
|
|
91
80
|
let l = o.replace(c, "");
|
|
@@ -93,12 +82,7 @@ function V(t, e, n, i, r) {
|
|
|
93
82
|
let s = {};
|
|
94
83
|
s.comprops = r.comprops || "", s.curprops = r.curprops || "", s.value = l, s.dir = e.dir, s.suffix = x(o), s.tdir = a, s.key = o, s.raw = "", s.getRaw = d(n, o), u.push(s);
|
|
95
84
|
} else {
|
|
96
|
-
let s = T(
|
|
97
|
-
l,
|
|
98
|
-
f,
|
|
99
|
-
e.aliass,
|
|
100
|
-
e.alias
|
|
101
|
-
);
|
|
85
|
+
let s = T(l, f, e.aliass, e.alias);
|
|
102
86
|
s && (s.comprops = r.comprops, s.curprops = r.curprops, s.dir = e.dir, s.tdir = a, s.key = o, s.component = i[o], s.getRaw = d(n, o), p.push(s));
|
|
103
87
|
}
|
|
104
88
|
}), {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../config.cjs"),m=require("./common.cjs"),
|
|
2
|
-
`+i[3]),
|
|
3
|
-
`)}async function te(e,t){let
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../config.cjs"),m=require("./common.cjs"),h=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.cjs"),L=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.cjs"),N=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.cjs"),V=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.cjs"),j=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.cjs"),d=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.cjs"),H=require("./index.cjs"),u={},w={},q=[],S={},b={},O={};function I(){return y.getConfig("example")}function U(e,t,n){const s=Object.assign({exampless:[],examplessRaw:[]},t,n),r=[],a=s.examples;a&&Object.keys(a).forEach(l=>{r.push(l),b[l]=a[l]});const i=s.examplesRaw,o=[];s.urls&&s.urls.length>0?(s.exampless=s.urls,s.urls.forEach(l=>{o.push(l),i&&(O[l]=P(i,l))})):(s.exampless=r,i&&Object.keys(i).forEach(l=>{o.push(l),i&&(O[l]=P(i,l))})),s.examples=void 0,s.examplessRaw=o,s.examplesRaw=void 0,S[e]=s}function P(e,t){return typeof e=="function"?e:e&&(e[t]||e)}async function B(e,t){let n="";if(t=="vue"){let r=new RegExp(/(<script([^>]*)>)((.|\n|\r)*)(<\/script>)/g).exec(e);if(r){n=r[3];const a=/((.|\n|\r)*)<\/script>/g.exec(n),i=/(<script([^>]*)>)((.|\n|\r)*)/g.exec(n);let o=n;a&&(o=a[1]),i&&(o=o+`
|
|
2
|
+
`+i[3]),n=o}}else(t=="js"||t=="ts"||t=="")&&(n=e);if(n){const s=await H.getTextImport(n);let r=s==null?void 0:s.map(i=>i.n);const a=[];return r&&r.length>0&&r.forEach(i=>{i&&(i.startsWith("./")||i.startsWith("../"))&&a.push(i)}),a}}function W(e){return new Promise(t=>{e?e.raw?t(e.raw):e.getRaw?e.getRaw(e).then(n=>{const s=R(n);e.raw=s,e.getRaw=null,t(s)}):t(""):t("")})}function A(e,t){e=(e||"")+"";let n="";switch(e){case"1":n=t.tdir+"/";break;case"2":n=t.adir+"/";break;case"3":n=t.tdir+"/"+t.adir+"/";break}return n}function k(e,t,n){var o,l;e=(e||"")+"",n=(n||"")+"";let s=h.humpToLine(t.name),r=[];const a=Object.values(t.aliass||{});if(e==="1")t.alias&&r.push(t.alias+"-"+s);else if(e==="2")a&&a.length>0&&a.forEach(c=>{r.push(c+"-"+s)});else if(e==="3"){let c="";t.alias&&(c=t.alias+"-"),a==null||a.forEach(f=>{r.push(c+f+"-"+s)})}else e==="4"?(o=t.aliasNames)==null||o.forEach(c=>{r.push(h.humpToLine(c))}):e=="9"&&(r.push(s),(l=t.aliasNames)==null||l.forEach(c=>{r.push(h.humpToLine(c))}));r.length==0&&r.push(s);let i=[];return n==="1"?r.forEach(c=>{let f=L.lineToLargeHump(c);i.push(f,N.firstLower(f))}):n==="2"?r.forEach(c=>{let f=L.lineToLargeHump(c);i.push(c,f,N.firstLower(f))}):i=[...r],i=[...new Set(i)],i}function D(e,t,n,s){const r=[];return n.examplessRaw.forEach(a=>{for(let i=0;i<t.length;i++){const o=t[i];if(a==e+o+"/"+n.md+".md"){r.push({topurl:e,comkey:s.key,suffix:d.getSuffix(a),name:s.name,value:o,key:a,raw:"",getRaw:m.getRawValue(O,a)});break}}}),r}function C(e){p();const t=u[e];if(t.tests)return t.tests;{const n=S[t.dir],s=n.dir+A(n.level||0,t),r=k(n.aliaslevel||0,t,n.componentName||0);t.mds=D(s,r,n,t);const a={};return n.exampless.forEach(i=>{for(let o=0;o<r.length;o++){const l=r[o];if(i.startsWith(s+l+"/")){const c=new RegExp("^\\"+s+l+"/(.*)/index\\."+m.defaultExtensions.join("|")+"$");let f="",g=i.match(c);g&&g.length>1&&(f=g[1]),a[i]={topurl:s,name:l,value:f,suffix:d.getSuffix(i),comname:t.name,comkey:t.key,key:i,component:b[i],raw:"",getRaw:m.getRawValue(O,i)};break}}}),t.tests=a,a}}function F(e){if(e){const t=C(e);return Object.values(t)}else return[]}function J(e,t,n){p();const s=C(n),r=[];if(t){let a=s[t];if(a)return r.push(a),r}return Object.values(s).forEach(a=>{a.name+"/"+a.value==e&&r.push(a)}),r}function G(e){return C(e),u[e].mds}async function E(e,t,n,s){let r=await B(t,n)||[],a=e.split("/");return r.map(i=>{if(i.startsWith("./")){let o=a.slice(0,a.length-1).join("/"),l=i.substring(2);return{name:i,comprops:s||"",value:l,suffix:d.getSuffix(i),head:o,key:o+"/"+l}}else{let o=i.split("/"),l=0;for(let T=0;T<o.length;T++)if(o[T]!=".."){l=T;break}let c=o.slice(l,o.length),f=a.slice(0,a.length-l-1).join("/"),g=c.join("/");return{name:i,comprops:s||"",value:g,suffix:d.getSuffix(i),head:f,key:f+"/"+g}}})}function X(e){return new Promise(t=>{if(e&&e.length>0){let n=e.map(s=>({raw:"",name:s.name,value:s.value,suffix:d.getSuffix(s.key),key:s.key,getRaw:m.getRawValue(O,s.key)}));j.asyncMergeArray(n,(s,r,a,i)=>{a.raw?s():a.getRaw?a.getRaw(a).then(o=>{const l=R(o);a.raw=l,a.getRaw=null,s()}):s()}).then(()=>{t(n)})}else t([])})}function Z(){const e=I(),t=y.getConfig("components");t==null||t.forEach(n=>{Y(n);let s=n.dir||"";U(s,e,n.example)})}const x="default";function Q(e){let t=h.humpToLine(e.name),n=[...e.aliasNames];n.push(t),n.forEach(s=>{q.push({name:s,value:e.key})})}function $(e,t){const n={};t==null||t.forEach(s=>{u[s.key]=s,Q(s);const r=Object.values(s.aliass||{});r&&r.length?r.forEach(a=>{n[a]=n[a]||[],n[a].push(s.key)}):(n[x]=n[x]||[],n[x].push(s.key))})}function Y(e){let t,n;const s=e.resolver;s&&Object.keys(s).forEach(a=>{typeof e[a]>"u"&&(e[a]=s[a])}),t=e.alias||x;let r=(e==null?void 0:e.urls)||Object.keys(e.componentsRaw);n=m.getComponentsArr(r,e,e.componentsRaw,e.components,e),n&&(n!=null&&n.props)&&n.props.forEach(a=>{w[a.key]=a}),$(t,n.components)}function _(e){return p(),u[e]}function p(){return Object.keys(u).length==0&&Z(),Object.values(u)}function z(){return p(),w}function v(e,t,n){p();const s=[];if(n){let a=u[n];if(a&&a.key)return[a]}let r=h.humpToLine(e);return q.forEach(a=>{t?a.name.includes(r)&&s.push(u[a.value]):a.name==r&&s.push(u[a.value])}),V.duplicateRemoval(s,"key")}async function ee(e,t){let n=e;if(e){let s=(await E(t.key,e,t.suffix,t.comprops)).filter(r=>r.key.startsWith(t.head)||m.isComprops(r.name,t.comprops||""));n=await M(s)+n}return n}function K(e){return new Promise(t=>{if(e&&e.length>0){let n=e.map(s=>w[s.key]||w[s.key+".js"]||w[s.key+".ts"]).filter(s=>!!s);j.asyncMergeArray(n,(s,r,a,i)=>{a.raw?s():a.getRaw?a.getRaw(a).then(async o=>{const l=R(o);let c=await ee(l,e[i]);a.raw=c,a.getRaw=null,s()}):s()}).then(()=>{t(n)})}else t([])})}async function M(e){const t=await K(e);return((t==null?void 0:t.map(s=>s.raw))||[]).join(`
|
|
3
|
+
`)}async function te(e,t){let n=e;if(e&&(t.comprops||t.curprops)){let s=(await E(t.key,e,t.suffix,t.comprops||"")).filter(a=>m.isComprops(a.name,t.comprops||"")||m.isCurprops(a.name,t.curprops||""));n=await M(s)+n}return n}function R(e){return e&&typeof e=="object"?e.default||"":(e||"")+""}function se(e){return new Promise(t=>{if(e){p();const n=u[e];n?n.raw?t(n.raw):n.getRaw?n.getRaw(n).then(s=>{const r=R(s);te(r,n).then(a=>{n.raw=a,n.getRaw=null,t(a)})}):t(""):t("")}else t("")})}exports.defaultName=x;exports.getCompoName=v;exports.getCompoNameKey=_;exports.getCompoNameObj=p;exports.getComponentPropsObjs=z;exports.getGetRawValue=R;exports.getKeyMds=G;exports.getLevelUrl=A;exports.getLocalTextArr=X;exports.getLocalTextComponents=se;exports.getLocalTextTests=W;exports.getPropsRaws=K;exports.getTestImportUrl=E;exports.getTestName=F;exports.getTestNameObj=J;
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { getConfig as
|
|
2
|
-
import { getRawValue as E, isComprops as j, isCurprops as
|
|
1
|
+
import { getConfig as L } from "../config.js";
|
|
2
|
+
import { getRawValue as E, isComprops as j, isCurprops as M, defaultExtensions as U, getComponentsArr as V } from "./common.js";
|
|
3
3
|
import { humpToLine as h } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js";
|
|
4
|
-
import { lineToLargeHump as
|
|
5
|
-
import { firstLower as
|
|
4
|
+
import { lineToLargeHump as T } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js";
|
|
5
|
+
import { firstLower as N } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js";
|
|
6
6
|
import { duplicateRemoval as S } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js";
|
|
7
|
-
import { asyncMergeArray as
|
|
8
|
-
import { getSuffix as
|
|
7
|
+
import { asyncMergeArray as W } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.js";
|
|
8
|
+
import { getSuffix as w } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js";
|
|
9
9
|
import { getTextImport as B } from "./index.js";
|
|
10
|
-
const
|
|
10
|
+
const u = {}, g = {}, y = [], A = {}, I = {}, x = {};
|
|
11
11
|
function F() {
|
|
12
|
-
return
|
|
12
|
+
return L("example");
|
|
13
13
|
}
|
|
14
|
-
function G(e, t,
|
|
15
|
-
const
|
|
14
|
+
function G(e, t, n) {
|
|
15
|
+
const s = Object.assign(
|
|
16
16
|
{
|
|
17
17
|
exampless: [],
|
|
18
18
|
examplessRaw: []
|
|
19
19
|
},
|
|
20
20
|
t,
|
|
21
|
-
|
|
22
|
-
), a = [], r =
|
|
21
|
+
n
|
|
22
|
+
), a = [], r = s.examples;
|
|
23
23
|
r && Object.keys(r).forEach((o) => {
|
|
24
|
-
a.push(o),
|
|
24
|
+
a.push(o), I[o] = r[o];
|
|
25
25
|
});
|
|
26
|
-
const i =
|
|
27
|
-
|
|
28
|
-
l.push(o), i && (
|
|
29
|
-
})) : (
|
|
30
|
-
l.push(o), i && (
|
|
31
|
-
})),
|
|
26
|
+
const i = s.examplesRaw, l = [];
|
|
27
|
+
s.urls && s.urls.length > 0 ? (s.exampless = s.urls, s.urls.forEach((o) => {
|
|
28
|
+
l.push(o), i && (x[o] = P(i, o));
|
|
29
|
+
})) : (s.exampless = a, i && Object.keys(i).forEach((o) => {
|
|
30
|
+
l.push(o), i && (x[o] = P(i, o));
|
|
31
|
+
})), s.examples = void 0, s.examplessRaw = l, s.examplesRaw = void 0, A[e] = s;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function P(e, t) {
|
|
34
34
|
return typeof e == "function" ? e : e && (e[t] || e);
|
|
35
35
|
}
|
|
36
36
|
async function H(e, t) {
|
|
37
|
-
let
|
|
37
|
+
let n = "";
|
|
38
38
|
if (t == "vue") {
|
|
39
39
|
let a = new RegExp(/(<script([^>]*)>)((.|\n|\r)*)(<\/script>)/g).exec(e);
|
|
40
40
|
if (a) {
|
|
41
|
-
|
|
42
|
-
const r = /((.|\n|\r)*)<\/script>/g.exec(
|
|
43
|
-
let l =
|
|
41
|
+
n = a[3];
|
|
42
|
+
const r = /((.|\n|\r)*)<\/script>/g.exec(n), i = /(<script([^>]*)>)((.|\n|\r)*)/g.exec(n);
|
|
43
|
+
let l = n;
|
|
44
44
|
r && (l = r[1]), i && (l = l + `
|
|
45
|
-
` + i[3]),
|
|
45
|
+
` + i[3]), n = l;
|
|
46
46
|
}
|
|
47
|
-
} else (t == "js" || t == "ts" || t == "") && (
|
|
48
|
-
if (
|
|
49
|
-
const
|
|
50
|
-
let a =
|
|
47
|
+
} else (t == "js" || t == "ts" || t == "") && (n = e);
|
|
48
|
+
if (n) {
|
|
49
|
+
const s = await B(n);
|
|
50
|
+
let a = s == null ? void 0 : s.map((i) => i.n);
|
|
51
51
|
const r = [];
|
|
52
52
|
return a && a.length > 0 && a.forEach((i) => {
|
|
53
53
|
i && (i.startsWith("./") || i.startsWith("../")) && r.push(i);
|
|
@@ -56,74 +56,74 @@ async function H(e, t) {
|
|
|
56
56
|
}
|
|
57
57
|
function oe(e) {
|
|
58
58
|
return new Promise((t) => {
|
|
59
|
-
e ? e.raw ? t(e.raw) : e.getRaw ? e.getRaw(e).then((
|
|
60
|
-
const
|
|
61
|
-
e.raw =
|
|
59
|
+
e ? e.raw ? t(e.raw) : e.getRaw ? e.getRaw(e).then((n) => {
|
|
60
|
+
const s = R(n);
|
|
61
|
+
e.raw = s, e.getRaw = null, t(s);
|
|
62
62
|
}) : t("") : t("");
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
function $(e, t) {
|
|
66
66
|
e = (e || "") + "";
|
|
67
|
-
let
|
|
67
|
+
let n = "";
|
|
68
68
|
switch (e) {
|
|
69
69
|
case "1":
|
|
70
|
-
|
|
70
|
+
n = t.tdir + "/";
|
|
71
71
|
break;
|
|
72
72
|
case "2":
|
|
73
|
-
|
|
73
|
+
n = t.adir + "/";
|
|
74
74
|
break;
|
|
75
75
|
case "3":
|
|
76
|
-
|
|
76
|
+
n = t.tdir + "/" + t.adir + "/";
|
|
77
77
|
break;
|
|
78
78
|
}
|
|
79
|
-
return
|
|
79
|
+
return n;
|
|
80
80
|
}
|
|
81
|
-
function q(e, t,
|
|
81
|
+
function q(e, t, n) {
|
|
82
82
|
var l, o;
|
|
83
|
-
e = (e || "") + "",
|
|
84
|
-
let
|
|
83
|
+
e = (e || "") + "", n = (n || "") + "";
|
|
84
|
+
let s = h(t.name), a = [];
|
|
85
85
|
const r = Object.values(t.aliass || {});
|
|
86
86
|
if (e === "1")
|
|
87
|
-
t.alias && a.push(t.alias + "-" +
|
|
87
|
+
t.alias && a.push(t.alias + "-" + s);
|
|
88
88
|
else if (e === "2")
|
|
89
89
|
r && r.length > 0 && r.forEach((f) => {
|
|
90
|
-
a.push(f + "-" +
|
|
90
|
+
a.push(f + "-" + s);
|
|
91
91
|
});
|
|
92
92
|
else if (e === "3") {
|
|
93
93
|
let f = "";
|
|
94
94
|
t.alias && (f = t.alias + "-"), r == null || r.forEach((c) => {
|
|
95
|
-
a.push(f + c + "-" +
|
|
95
|
+
a.push(f + c + "-" + s);
|
|
96
96
|
});
|
|
97
97
|
} else e === "4" ? (l = t.aliasNames) == null || l.forEach((f) => {
|
|
98
98
|
a.push(h(f));
|
|
99
|
-
}) : e == "9" && (a.push(
|
|
99
|
+
}) : e == "9" && (a.push(s), (o = t.aliasNames) == null || o.forEach((f) => {
|
|
100
100
|
a.push(h(f));
|
|
101
101
|
}));
|
|
102
|
-
a.length == 0 && a.push(
|
|
102
|
+
a.length == 0 && a.push(s);
|
|
103
103
|
let i = [];
|
|
104
|
-
return
|
|
105
|
-
let c =
|
|
106
|
-
i.push(c,
|
|
107
|
-
}) :
|
|
108
|
-
let c =
|
|
109
|
-
i.push(f, c,
|
|
104
|
+
return n === "1" ? a.forEach((f) => {
|
|
105
|
+
let c = T(f);
|
|
106
|
+
i.push(c, N(c));
|
|
107
|
+
}) : n === "2" ? a.forEach((f) => {
|
|
108
|
+
let c = T(f);
|
|
109
|
+
i.push(f, c, N(c));
|
|
110
110
|
}) : i = [...a], i = [...new Set(i)], i;
|
|
111
111
|
}
|
|
112
|
-
function D(e, t,
|
|
112
|
+
function D(e, t, n, s) {
|
|
113
113
|
const a = [];
|
|
114
|
-
return
|
|
114
|
+
return n.examplessRaw.forEach((r) => {
|
|
115
115
|
for (let i = 0; i < t.length; i++) {
|
|
116
116
|
const l = t[i];
|
|
117
|
-
if (r == e + l + "/" +
|
|
117
|
+
if (r == e + l + "/" + n.md + ".md") {
|
|
118
118
|
a.push({
|
|
119
119
|
topurl: e,
|
|
120
|
-
comkey:
|
|
121
|
-
suffix:
|
|
122
|
-
name:
|
|
120
|
+
comkey: s.key,
|
|
121
|
+
suffix: w(r),
|
|
122
|
+
name: s.name,
|
|
123
123
|
value: l,
|
|
124
124
|
key: r,
|
|
125
125
|
raw: "",
|
|
126
|
-
getRaw: E(
|
|
126
|
+
getRaw: E(x, r)
|
|
127
127
|
});
|
|
128
128
|
break;
|
|
129
129
|
}
|
|
@@ -132,36 +132,36 @@ function D(e, t, s, n) {
|
|
|
132
132
|
}
|
|
133
133
|
function C(e) {
|
|
134
134
|
p();
|
|
135
|
-
const t =
|
|
135
|
+
const t = u[e];
|
|
136
136
|
if (t.tests)
|
|
137
137
|
return t.tests;
|
|
138
138
|
{
|
|
139
|
-
const
|
|
140
|
-
|
|
139
|
+
const n = A[t.dir], s = n.dir + $(n.level || 0, t), a = q(
|
|
140
|
+
n.aliaslevel || 0,
|
|
141
141
|
t,
|
|
142
|
-
|
|
142
|
+
n.componentName || 0
|
|
143
143
|
);
|
|
144
|
-
t.mds = D(
|
|
144
|
+
t.mds = D(s, a, n, t);
|
|
145
145
|
const r = {};
|
|
146
|
-
return
|
|
146
|
+
return n.exampless.forEach((i) => {
|
|
147
147
|
for (let l = 0; l < a.length; l++) {
|
|
148
148
|
const o = a[l];
|
|
149
|
-
if (i.startsWith(
|
|
149
|
+
if (i.startsWith(s + o + "/")) {
|
|
150
150
|
const f = new RegExp(
|
|
151
|
-
"^\\" +
|
|
151
|
+
"^\\" + s + o + "/(.*)/index\\." + U.join("|") + "$"
|
|
152
152
|
);
|
|
153
|
-
let c = "",
|
|
154
|
-
|
|
155
|
-
topurl:
|
|
153
|
+
let c = "", m = i.match(f);
|
|
154
|
+
m && m.length > 1 && (c = m[1]), r[i] = {
|
|
155
|
+
topurl: s,
|
|
156
156
|
name: o,
|
|
157
157
|
value: c,
|
|
158
|
-
suffix:
|
|
158
|
+
suffix: w(i),
|
|
159
159
|
comname: t.name,
|
|
160
160
|
comkey: t.key,
|
|
161
161
|
key: i,
|
|
162
|
-
component:
|
|
162
|
+
component: I[i],
|
|
163
163
|
raw: "",
|
|
164
|
-
getRaw: E(
|
|
164
|
+
getRaw: E(x, i)
|
|
165
165
|
};
|
|
166
166
|
break;
|
|
167
167
|
}
|
|
@@ -176,202 +176,192 @@ function fe(e) {
|
|
|
176
176
|
} else
|
|
177
177
|
return [];
|
|
178
178
|
}
|
|
179
|
-
function ce(e, t,
|
|
179
|
+
function ce(e, t, n) {
|
|
180
180
|
p();
|
|
181
|
-
const
|
|
181
|
+
const s = C(n), a = [];
|
|
182
182
|
if (t) {
|
|
183
|
-
let r =
|
|
183
|
+
let r = s[t];
|
|
184
184
|
if (r)
|
|
185
185
|
return a.push(r), a;
|
|
186
186
|
}
|
|
187
|
-
return Object.values(
|
|
187
|
+
return Object.values(s).forEach((r) => {
|
|
188
188
|
r.name + "/" + r.value == e && a.push(r);
|
|
189
189
|
}), a;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
return C(e),
|
|
191
|
+
function ue(e) {
|
|
192
|
+
return C(e), u[e].mds;
|
|
193
193
|
}
|
|
194
|
-
async function
|
|
195
|
-
let a = await H(t,
|
|
194
|
+
async function K(e, t, n, s) {
|
|
195
|
+
let a = await H(t, n) || [], r = e.split("/");
|
|
196
196
|
return a.map((i) => {
|
|
197
197
|
if (i.startsWith("./")) {
|
|
198
198
|
let l = r.slice(0, r.length - 1).join("/"), o = i.substring(2);
|
|
199
199
|
return {
|
|
200
200
|
name: i,
|
|
201
|
-
comprops:
|
|
201
|
+
comprops: s || "",
|
|
202
202
|
value: o,
|
|
203
|
-
suffix:
|
|
203
|
+
suffix: w(i),
|
|
204
204
|
head: l,
|
|
205
205
|
key: l + "/" + o
|
|
206
206
|
};
|
|
207
207
|
} else {
|
|
208
208
|
let l = i.split("/"), o = 0;
|
|
209
|
-
for (let
|
|
210
|
-
if (l[
|
|
211
|
-
o =
|
|
209
|
+
for (let d = 0; d < l.length; d++)
|
|
210
|
+
if (l[d] != "..") {
|
|
211
|
+
o = d;
|
|
212
212
|
break;
|
|
213
213
|
}
|
|
214
|
-
let f = l.slice(o, l.length), c = r.slice(0, r.length - o - 1).join("/"),
|
|
214
|
+
let f = l.slice(o, l.length), c = r.slice(0, r.length - o - 1).join("/"), m = f.join("/");
|
|
215
215
|
return {
|
|
216
216
|
name: i,
|
|
217
|
-
comprops:
|
|
218
|
-
value:
|
|
219
|
-
suffix:
|
|
217
|
+
comprops: s || "",
|
|
218
|
+
value: m,
|
|
219
|
+
suffix: w(i),
|
|
220
220
|
head: c,
|
|
221
|
-
key: c + "/" +
|
|
221
|
+
key: c + "/" + m
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function me(e) {
|
|
227
227
|
return new Promise((t) => {
|
|
228
228
|
if (e && e.length > 0) {
|
|
229
|
-
let
|
|
229
|
+
let n = e.map((s) => ({
|
|
230
230
|
raw: "",
|
|
231
|
-
name:
|
|
232
|
-
value:
|
|
233
|
-
suffix:
|
|
234
|
-
key:
|
|
235
|
-
getRaw: E(
|
|
231
|
+
name: s.name,
|
|
232
|
+
value: s.value,
|
|
233
|
+
suffix: w(s.key),
|
|
234
|
+
key: s.key,
|
|
235
|
+
getRaw: E(x, s.key)
|
|
236
236
|
}));
|
|
237
|
-
|
|
238
|
-
r.raw ?
|
|
239
|
-
const o =
|
|
240
|
-
r.raw = o, r.getRaw = null,
|
|
241
|
-
}) :
|
|
237
|
+
W(n, (s, a, r, i) => {
|
|
238
|
+
r.raw ? s() : r.getRaw ? r.getRaw(r).then((l) => {
|
|
239
|
+
const o = R(l);
|
|
240
|
+
r.raw = o, r.getRaw = null, s();
|
|
241
|
+
}) : s();
|
|
242
242
|
}).then(() => {
|
|
243
|
-
t(
|
|
243
|
+
t(n);
|
|
244
244
|
});
|
|
245
245
|
} else
|
|
246
246
|
t([]);
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
249
|
function J() {
|
|
250
|
-
const e = F(), t =
|
|
251
|
-
t == null || t.forEach((
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
G(n, e, s.example);
|
|
250
|
+
const e = F(), t = L("components");
|
|
251
|
+
t == null || t.forEach((n) => {
|
|
252
|
+
Y(n);
|
|
253
|
+
let s = n.dir || "";
|
|
254
|
+
G(s, e, n.example);
|
|
256
255
|
});
|
|
257
256
|
}
|
|
258
|
-
const
|
|
257
|
+
const O = "default";
|
|
259
258
|
function Q(e) {
|
|
260
|
-
let t = h(e.name),
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
name:
|
|
259
|
+
let t = h(e.name), n = [...e.aliasNames];
|
|
260
|
+
n.push(t), n.forEach((s) => {
|
|
261
|
+
y.push({
|
|
262
|
+
name: s,
|
|
264
263
|
value: e.key
|
|
265
264
|
});
|
|
266
265
|
});
|
|
267
266
|
}
|
|
268
267
|
function X(e, t) {
|
|
269
|
-
const
|
|
270
|
-
t == null || t.forEach((
|
|
271
|
-
|
|
272
|
-
const a = Object.values(
|
|
268
|
+
const n = {};
|
|
269
|
+
t == null || t.forEach((s) => {
|
|
270
|
+
u[s.key] = s, Q(s);
|
|
271
|
+
const a = Object.values(s.aliass || {});
|
|
273
272
|
a && a.length ? a.forEach((r) => {
|
|
274
|
-
|
|
275
|
-
}) : (
|
|
273
|
+
n[r] = n[r] || [], n[r].push(s.key);
|
|
274
|
+
}) : (n[O] = n[O] || [], n[O].push(s.key));
|
|
276
275
|
});
|
|
277
276
|
}
|
|
278
277
|
function Y(e) {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
);
|
|
289
|
-
else {
|
|
290
|
-
t = e.alias || w;
|
|
291
|
-
let a = (e == null ? void 0 : e.urls) || Object.keys(e.componentsRaw);
|
|
292
|
-
s = T(a, e, e.componentsRaw, e.components, e);
|
|
293
|
-
}
|
|
294
|
-
s && (s != null && s.props) && s.props.forEach((a) => {
|
|
295
|
-
g[a.key] = a;
|
|
296
|
-
}), X(t, s.components);
|
|
278
|
+
let t, n;
|
|
279
|
+
const s = e.resolver;
|
|
280
|
+
s && Object.keys(s).forEach((r) => {
|
|
281
|
+
typeof e[r] > "u" && (e[r] = s[r]);
|
|
282
|
+
}), t = e.alias || O;
|
|
283
|
+
let a = (e == null ? void 0 : e.urls) || Object.keys(e.componentsRaw);
|
|
284
|
+
n = V(a, e, e.componentsRaw, e.components, e), n && (n != null && n.props) && n.props.forEach((r) => {
|
|
285
|
+
g[r.key] = r;
|
|
286
|
+
}), X(t, n.components);
|
|
297
287
|
}
|
|
298
288
|
function pe(e) {
|
|
299
|
-
return p(),
|
|
289
|
+
return p(), u[e];
|
|
300
290
|
}
|
|
301
291
|
function p() {
|
|
302
|
-
return Object.keys(
|
|
292
|
+
return Object.keys(u).length == 0 && J(), Object.values(u);
|
|
303
293
|
}
|
|
304
294
|
function he() {
|
|
305
295
|
return p(), g;
|
|
306
296
|
}
|
|
307
|
-
function ge(e, t,
|
|
297
|
+
function ge(e, t, n) {
|
|
308
298
|
p();
|
|
309
|
-
const
|
|
310
|
-
if (
|
|
311
|
-
let r =
|
|
299
|
+
const s = [];
|
|
300
|
+
if (n) {
|
|
301
|
+
let r = u[n];
|
|
312
302
|
if (r && r.key)
|
|
313
303
|
return [r];
|
|
314
304
|
}
|
|
315
305
|
let a = h(e);
|
|
316
|
-
return
|
|
317
|
-
t ? r.name.includes(a) &&
|
|
318
|
-
}), S(
|
|
306
|
+
return y.forEach((r) => {
|
|
307
|
+
t ? r.name.includes(a) && s.push(u[r.value]) : r.name == a && s.push(u[r.value]);
|
|
308
|
+
}), S(s, "key");
|
|
319
309
|
}
|
|
320
310
|
async function Z(e, t) {
|
|
321
|
-
let
|
|
311
|
+
let n = e;
|
|
322
312
|
if (e) {
|
|
323
|
-
let
|
|
324
|
-
|
|
313
|
+
let s = (await K(t.key, e, t.suffix, t.comprops)).filter((a) => a.key.startsWith(t.head) || j(a.name, t.comprops || ""));
|
|
314
|
+
n = await b(s) + n;
|
|
325
315
|
}
|
|
326
|
-
return
|
|
316
|
+
return n;
|
|
327
317
|
}
|
|
328
318
|
function _(e) {
|
|
329
319
|
return new Promise((t) => {
|
|
330
320
|
if (e && e.length > 0) {
|
|
331
|
-
let
|
|
332
|
-
|
|
333
|
-
r.raw ?
|
|
334
|
-
const o =
|
|
321
|
+
let n = e.map((s) => g[s.key] || g[s.key + ".js"] || g[s.key + ".ts"]).filter((s) => !!s);
|
|
322
|
+
W(n, (s, a, r, i) => {
|
|
323
|
+
r.raw ? s() : r.getRaw ? r.getRaw(r).then(async (l) => {
|
|
324
|
+
const o = R(l);
|
|
335
325
|
let f = await Z(o, e[i]);
|
|
336
|
-
r.raw = f, r.getRaw = null,
|
|
337
|
-
}) :
|
|
326
|
+
r.raw = f, r.getRaw = null, s();
|
|
327
|
+
}) : s();
|
|
338
328
|
}).then(() => {
|
|
339
|
-
t(
|
|
329
|
+
t(n);
|
|
340
330
|
});
|
|
341
331
|
} else
|
|
342
332
|
t([]);
|
|
343
333
|
});
|
|
344
334
|
}
|
|
345
|
-
async function
|
|
335
|
+
async function b(e) {
|
|
346
336
|
const t = await _(e);
|
|
347
|
-
return ((t == null ? void 0 : t.map((
|
|
337
|
+
return ((t == null ? void 0 : t.map((s) => s.raw)) || []).join(`
|
|
348
338
|
`);
|
|
349
339
|
}
|
|
350
|
-
async function
|
|
351
|
-
let
|
|
340
|
+
async function z(e, t) {
|
|
341
|
+
let n = e;
|
|
352
342
|
if (e && (t.comprops || t.curprops)) {
|
|
353
|
-
let
|
|
343
|
+
let s = (await K(
|
|
354
344
|
t.key,
|
|
355
345
|
e,
|
|
356
346
|
t.suffix,
|
|
357
347
|
t.comprops || ""
|
|
358
|
-
)).filter((r) => j(r.name, t.comprops || "") ||
|
|
359
|
-
|
|
348
|
+
)).filter((r) => j(r.name, t.comprops || "") || M(r.name, t.curprops || ""));
|
|
349
|
+
n = await b(s) + n;
|
|
360
350
|
}
|
|
361
|
-
return
|
|
351
|
+
return n;
|
|
362
352
|
}
|
|
363
|
-
function
|
|
353
|
+
function R(e) {
|
|
364
354
|
return e && typeof e == "object" ? e.default || "" : (e || "") + "";
|
|
365
355
|
}
|
|
366
356
|
function we(e) {
|
|
367
357
|
return new Promise((t) => {
|
|
368
358
|
if (e) {
|
|
369
359
|
p();
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
const a =
|
|
373
|
-
|
|
374
|
-
|
|
360
|
+
const n = u[e];
|
|
361
|
+
n ? n.raw ? t(n.raw) : n.getRaw ? n.getRaw(n).then((s) => {
|
|
362
|
+
const a = R(s);
|
|
363
|
+
z(a, n).then((r) => {
|
|
364
|
+
n.raw = r, n.getRaw = null, t(r);
|
|
375
365
|
});
|
|
376
366
|
}) : t("") : t("");
|
|
377
367
|
} else
|
|
@@ -379,19 +369,19 @@ function we(e) {
|
|
|
379
369
|
});
|
|
380
370
|
}
|
|
381
371
|
export {
|
|
382
|
-
|
|
372
|
+
O as defaultName,
|
|
383
373
|
ge as getCompoName,
|
|
384
374
|
pe as getCompoNameKey,
|
|
385
375
|
p as getCompoNameObj,
|
|
386
376
|
he as getComponentPropsObjs,
|
|
387
|
-
|
|
388
|
-
|
|
377
|
+
R as getGetRawValue,
|
|
378
|
+
ue as getKeyMds,
|
|
389
379
|
$ as getLevelUrl,
|
|
390
|
-
|
|
380
|
+
me as getLocalTextArr,
|
|
391
381
|
we as getLocalTextComponents,
|
|
392
382
|
oe as getLocalTextTests,
|
|
393
383
|
_ as getPropsRaws,
|
|
394
|
-
|
|
384
|
+
K as getTestImportUrl,
|
|
395
385
|
fe as getTestName,
|
|
396
386
|
ce as getTestNameObj
|
|
397
387
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fangzhongya/vue-archive",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description ": "vue 组件注释生成文档",
|
|
7
7
|
"author": "fangzhongya ",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"registry": "https://registry.npmjs.org/"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@fangzhongya/create": "0.2.
|
|
21
|
+
"@fangzhongya/create": "0.2.10",
|
|
22
22
|
"@fangzhongya/utils": "0.0.8-77",
|
|
23
23
|
"@fangzhongya/vue-components": "0.1.4-6",
|
|
24
24
|
"@highlightjs/vue-plugin": "^2.1.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"dist"
|
|
59
59
|
],
|
|
60
60
|
"exports": {
|
|
61
|
-
"./css": "./dist/
|
|
61
|
+
"./css": "./dist/vue-archive.css",
|
|
62
62
|
"./node": {
|
|
63
63
|
"types": "./dist/node/index.d.ts",
|
|
64
64
|
"require": "./dist/node/index.cjs",
|