@fangzhongya/vue-archive 0.0.2-18 → 0.0.2-20
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/es/packages/config.d.ts +1 -1
- package/dist/es/packages/utils/common.d.ts +1 -0
- package/dist/es/packages/utils/common.js +55 -51
- package/dist/es/packages/utils/glob.js +48 -45
- package/dist/lib/packages/config.d.ts +1 -1
- package/dist/lib/packages/utils/common.d.ts +1 -0
- package/dist/lib/packages/utils/common.js +1 -1
- package/dist/lib/packages/utils/glob.js +2 -2
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ export interface ObjUnk {
|
|
|
6
6
|
[key: string]: unknown;
|
|
7
7
|
}
|
|
8
8
|
export type GetRaw = (v: any) => Promise<unknown>;
|
|
9
|
-
export type Globs = Record<string,
|
|
9
|
+
export type Globs = Record<string, GetRaw> | GetRaw;
|
|
10
10
|
export interface GlobComs {
|
|
11
11
|
[key: string]: AsyncComponentLoader;
|
|
12
12
|
}
|
|
@@ -73,3 +73,4 @@ export interface ComponentsObjs {
|
|
|
73
73
|
components: Array<ComponentsObj>;
|
|
74
74
|
}
|
|
75
75
|
export declare function getComponentsArr(urls: Array<string>, v: Resolver, comRaw: Globs, com: GlobComs, config: Components): ComponentsObjs;
|
|
76
|
+
export declare function getRawValue(comRaw: Globs, key: string): GetRaw;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { setSession as
|
|
2
|
-
import { humpToLine as
|
|
3
|
-
import { lineToLargeHump as
|
|
1
|
+
import { setSession as E, getSession as w } from "./storage.js";
|
|
2
|
+
import { humpToLine as N } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js";
|
|
3
|
+
import { lineToLargeHump as A } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js";
|
|
4
4
|
import { appearNum as h } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.js";
|
|
5
|
-
import { getSuffix as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
let n =
|
|
5
|
+
import { getSuffix as x } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js";
|
|
6
|
+
const R = ["vue", "js"];
|
|
7
|
+
function S(t, e) {
|
|
8
|
+
let n = N(t.name), i = [];
|
|
9
9
|
return t.alias && i.push(t.alias + "-" + n), e && e.length > 0 && e.forEach((r) => {
|
|
10
10
|
t.alias && i.push(t.alias + "-" + r + "-" + n), i.push(r + "-" + n);
|
|
11
11
|
}), i;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function $(t) {
|
|
14
14
|
return t.sort((e, n) => {
|
|
15
15
|
let i = h(e, "/"), r = h(n, "/");
|
|
16
16
|
return i == r ? n.length - e.length : r - i;
|
|
17
17
|
}), t;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function C(t = [], e = [], n = []) {
|
|
20
20
|
let i = e;
|
|
21
|
-
(!i || i.length == 0) && (i =
|
|
21
|
+
(!i || i.length == 0) && (i = R);
|
|
22
22
|
let r = [];
|
|
23
|
-
return t && t.length > 0 && (r = t), n && n.length > 0 && n.forEach((
|
|
24
|
-
i == null || i.forEach((
|
|
25
|
-
r.push(
|
|
23
|
+
return t && t.length > 0 && (r = t), n && n.length > 0 && n.forEach((p) => {
|
|
24
|
+
i == null || i.forEach((u) => {
|
|
25
|
+
r.push(p + "." + u);
|
|
26
26
|
});
|
|
27
|
-
}), r = [...new Set(r)],
|
|
27
|
+
}), r = [...new Set(r)], $(r);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function T(t, e, n = {}, i = "") {
|
|
30
30
|
for (let r = 0; r < e.length; r++) {
|
|
31
|
-
const
|
|
32
|
-
let f = t.match(
|
|
31
|
+
const p = e[r], u = new RegExp("^.*/([^/]+)" + p + "$");
|
|
32
|
+
let f = t.match(u);
|
|
33
33
|
if (f) {
|
|
34
|
-
const
|
|
34
|
+
const a = [], o = {};
|
|
35
35
|
let c = "";
|
|
36
36
|
Object.keys(n).forEach((m) => {
|
|
37
37
|
let g = n[m];
|
|
38
|
-
t.startsWith(g + "/") && (c = g, o[m] = g,
|
|
38
|
+
t.startsWith(g + "/") && (c = g, o[m] = g, a.push(m));
|
|
39
39
|
});
|
|
40
|
-
let
|
|
40
|
+
let l = f[1], s = {
|
|
41
41
|
dir: "",
|
|
42
|
-
suffix:
|
|
43
|
-
name:
|
|
44
|
-
value:
|
|
42
|
+
suffix: x(t),
|
|
43
|
+
name: A(l),
|
|
44
|
+
value: l,
|
|
45
45
|
key: "",
|
|
46
46
|
tdir: "",
|
|
47
47
|
adir: c,
|
|
@@ -53,66 +53,70 @@ function C(t, e, n = {}, i = "") {
|
|
|
53
53
|
mds: [],
|
|
54
54
|
tests: void 0
|
|
55
55
|
};
|
|
56
|
-
return s.aliasNames =
|
|
56
|
+
return s.aliasNames = S(
|
|
57
57
|
s,
|
|
58
|
-
|
|
58
|
+
a
|
|
59
59
|
), s;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
63
|
+
function O(t) {
|
|
64
|
+
E("aside.key", t);
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
66
|
+
function U() {
|
|
67
|
+
return w("aside.key");
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function v(t) {
|
|
70
70
|
let e = t.match(/\/([^\/]+)\/$/);
|
|
71
71
|
return e && e.length > 1 ? e[1] : "";
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function K(t, e) {
|
|
74
74
|
return e ? new RegExp(
|
|
75
75
|
e + ".+(\\.(js|ts))?$"
|
|
76
76
|
).test(t) : !1;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function L(t, e) {
|
|
79
79
|
return e ? new RegExp(
|
|
80
80
|
"/" + e + "(\\.(js|ts))?$"
|
|
81
81
|
).test(t) : !1;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
const
|
|
83
|
+
function V(t, e, n, i, r) {
|
|
84
|
+
const p = [], u = [], f = C(
|
|
85
85
|
e.matchexts,
|
|
86
86
|
e.extensions,
|
|
87
87
|
e.matchs
|
|
88
|
-
),
|
|
88
|
+
), a = v(e.dir);
|
|
89
89
|
return t.forEach((o) => {
|
|
90
90
|
const c = new RegExp("^" + e.dir);
|
|
91
|
-
let
|
|
92
|
-
if (r.comprops &&
|
|
91
|
+
let l = o.replace(c, "");
|
|
92
|
+
if (r.comprops && K(l, r.comprops) || r.curprops && L(l, r.curprops)) {
|
|
93
93
|
let s = {};
|
|
94
|
-
s.comprops = r.comprops || "", s.curprops = r.curprops || "", s.value =
|
|
94
|
+
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), p.push(s);
|
|
95
95
|
} else {
|
|
96
|
-
let s =
|
|
97
|
-
|
|
96
|
+
let s = T(
|
|
97
|
+
l,
|
|
98
98
|
f,
|
|
99
99
|
e.aliass,
|
|
100
100
|
e.alias
|
|
101
101
|
);
|
|
102
|
-
s && (s.comprops = r.comprops, s.curprops = r.curprops, s.dir = e.dir, s.tdir =
|
|
102
|
+
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), u.push(s));
|
|
103
103
|
}
|
|
104
104
|
}), {
|
|
105
|
-
props:
|
|
106
|
-
components:
|
|
105
|
+
props: p,
|
|
106
|
+
components: u
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
+
function d(t, e) {
|
|
110
|
+
return typeof t == "function" ? t : t[e] || t;
|
|
111
|
+
}
|
|
109
112
|
export {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
K as
|
|
117
|
-
|
|
113
|
+
R as defaultExtensions,
|
|
114
|
+
U as getAsideKey,
|
|
115
|
+
V as getComponentsArr,
|
|
116
|
+
C as getMatchs,
|
|
117
|
+
d as getRawValue,
|
|
118
|
+
T as getUrlName,
|
|
119
|
+
K as isComprops,
|
|
120
|
+
L as isCurprops,
|
|
121
|
+
O as setAsideKey
|
|
118
122
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { getConfig as C } from "../config.js";
|
|
2
|
-
import { getComponentsArr as O,
|
|
2
|
+
import { getComponentsArr as O, getRawValue as A, defaultExtensions as I, isComprops as K, isCurprops as b } from "./common.js";
|
|
3
3
|
import { humpToLine as h } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js";
|
|
4
4
|
import { lineToLargeHump as E } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js";
|
|
5
5
|
import { firstLower as T } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js";
|
|
6
|
-
import { duplicateRemoval as
|
|
6
|
+
import { duplicateRemoval as M } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js";
|
|
7
7
|
import { asyncMergeArray as N } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-XQB2HUHZ.js";
|
|
8
8
|
import { getSuffix as w } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js";
|
|
9
|
-
import { getTextImport as
|
|
9
|
+
import { getTextImport as U } from "./index.js";
|
|
10
10
|
const m = {}, d = {}, P = [], L = {}, j = {}, p = {};
|
|
11
|
-
function
|
|
11
|
+
function S() {
|
|
12
12
|
return C("example");
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function V(e, t, s) {
|
|
15
15
|
const n = Object.assign(
|
|
16
16
|
{
|
|
17
17
|
exampless: [],
|
|
@@ -25,7 +25,10 @@ function S(e, t, s) {
|
|
|
25
25
|
}), n.exampless = r, n.examples = void 0;
|
|
26
26
|
const i = [], l = n.examplesRaw;
|
|
27
27
|
l && Object.keys(l).forEach((o) => {
|
|
28
|
-
i.push(o), p[o] =
|
|
28
|
+
i.push(o), p[o] = A(
|
|
29
|
+
l,
|
|
30
|
+
o
|
|
31
|
+
);
|
|
29
32
|
}), n.examplessRaw = i, n.examplesRaw = void 0, L[e] = n;
|
|
30
33
|
}
|
|
31
34
|
function k(e, t = "vue") {
|
|
@@ -38,7 +41,7 @@ function k(e, t = "vue") {
|
|
|
38
41
|
} else
|
|
39
42
|
(t == "js" || t == "ts") && (s = e);
|
|
40
43
|
if (s) {
|
|
41
|
-
const n =
|
|
44
|
+
const n = U(s);
|
|
42
45
|
let r = n == null ? void 0 : n.map((i) => i.n);
|
|
43
46
|
const a = [];
|
|
44
47
|
return r && r.length > 0 && r.forEach((i) => {
|
|
@@ -46,7 +49,7 @@ function k(e, t = "vue") {
|
|
|
46
49
|
}), a;
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
|
-
function
|
|
52
|
+
function re(e) {
|
|
50
53
|
return new Promise((t) => {
|
|
51
54
|
e ? e.raw ? t(e.raw) : e.getRaw ? e.getRaw(e).then((s) => {
|
|
52
55
|
const n = (s || "") + "";
|
|
@@ -102,7 +105,7 @@ function H(e, t, s) {
|
|
|
102
105
|
i.push(c, f, T(f));
|
|
103
106
|
}) : i = [...r], i = [...new Set(i)], i;
|
|
104
107
|
}
|
|
105
|
-
function
|
|
108
|
+
function $(e, t, s, n) {
|
|
106
109
|
const r = [];
|
|
107
110
|
return s.examplessRaw.forEach((a) => {
|
|
108
111
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -134,14 +137,14 @@ function R(e) {
|
|
|
134
137
|
t,
|
|
135
138
|
s.componentName || 0
|
|
136
139
|
);
|
|
137
|
-
t.mds =
|
|
140
|
+
t.mds = $(n, r, s, t);
|
|
138
141
|
const a = {};
|
|
139
142
|
return s.exampless.forEach((i) => {
|
|
140
143
|
for (let l = 0; l < r.length; l++) {
|
|
141
144
|
const o = r[l];
|
|
142
145
|
if (i.startsWith(n + o + "/")) {
|
|
143
146
|
const c = new RegExp(
|
|
144
|
-
"^\\" + n + o + "/(.*)/index\\." +
|
|
147
|
+
"^\\" + n + o + "/(.*)/index\\." + I.join("|") + "$"
|
|
145
148
|
);
|
|
146
149
|
let f = "", u = i.match(c);
|
|
147
150
|
u && u.length > 1 && (f = u[1]), a[i] = {
|
|
@@ -162,14 +165,14 @@ function R(e) {
|
|
|
162
165
|
}), t.tests = a, a;
|
|
163
166
|
}
|
|
164
167
|
}
|
|
165
|
-
function
|
|
168
|
+
function ie(e) {
|
|
166
169
|
if (e) {
|
|
167
170
|
const t = R(e);
|
|
168
171
|
return Object.values(t);
|
|
169
172
|
} else
|
|
170
173
|
return [];
|
|
171
174
|
}
|
|
172
|
-
function
|
|
175
|
+
function le(e, t, s) {
|
|
173
176
|
x();
|
|
174
177
|
const n = R(s), r = [];
|
|
175
178
|
if (t) {
|
|
@@ -181,7 +184,7 @@ function ie(e, t, s) {
|
|
|
181
184
|
a.name + "/" + a.value == e && r.push(a);
|
|
182
185
|
}), r;
|
|
183
186
|
}
|
|
184
|
-
function
|
|
187
|
+
function oe(e) {
|
|
185
188
|
return R(e), m[e].mds;
|
|
186
189
|
}
|
|
187
190
|
function W(e, t, s) {
|
|
@@ -214,7 +217,7 @@ function W(e, t, s) {
|
|
|
214
217
|
}
|
|
215
218
|
});
|
|
216
219
|
}
|
|
217
|
-
function
|
|
220
|
+
function ce(e) {
|
|
218
221
|
return new Promise((t) => {
|
|
219
222
|
if (e && e.length > 0) {
|
|
220
223
|
let s = e.map((n) => ({
|
|
@@ -239,17 +242,17 @@ function oe(e) {
|
|
|
239
242
|
t([]);
|
|
240
243
|
});
|
|
241
244
|
}
|
|
242
|
-
function
|
|
243
|
-
const e =
|
|
245
|
+
function q() {
|
|
246
|
+
const e = S(), t = C("components");
|
|
244
247
|
t == null || t.forEach((s) => {
|
|
245
248
|
var r;
|
|
246
|
-
|
|
249
|
+
G(s);
|
|
247
250
|
let n = s.dir || ((r = s == null ? void 0 : s.resolver) == null ? void 0 : r.dir) || "";
|
|
248
|
-
|
|
251
|
+
V(n, e, s.example);
|
|
249
252
|
}), console.log("componentsObj", m);
|
|
250
253
|
}
|
|
251
254
|
const g = "default";
|
|
252
|
-
function
|
|
255
|
+
function B(e) {
|
|
253
256
|
let t = h(e.name), s = [...e.aliasNames];
|
|
254
257
|
s.push(t), s.forEach((n) => {
|
|
255
258
|
P.push({
|
|
@@ -258,17 +261,17 @@ function q(e) {
|
|
|
258
261
|
});
|
|
259
262
|
});
|
|
260
263
|
}
|
|
261
|
-
function
|
|
264
|
+
function D(e, t) {
|
|
262
265
|
const s = {};
|
|
263
266
|
t == null || t.forEach((n) => {
|
|
264
|
-
m[n.key] = n,
|
|
267
|
+
m[n.key] = n, B(n);
|
|
265
268
|
const r = Object.values(n.aliass || {});
|
|
266
269
|
r && r.length ? r.forEach((a) => {
|
|
267
270
|
s[a] = s[a] || [], s[a].push(n.key);
|
|
268
271
|
}) : (s[g] = s[g] || [], s[g].push(n.key));
|
|
269
272
|
});
|
|
270
273
|
}
|
|
271
|
-
function
|
|
274
|
+
function G(e) {
|
|
272
275
|
var n;
|
|
273
276
|
let t, s;
|
|
274
277
|
e.resolver ? (t = e.alias || ((n = e.resolver) == null ? void 0 : n.alias) || g, s = O(
|
|
@@ -285,15 +288,15 @@ function D(e) {
|
|
|
285
288
|
e
|
|
286
289
|
)), s && (s != null && s.props) && s.props.forEach((r) => {
|
|
287
290
|
d[r.key] = r;
|
|
288
|
-
}),
|
|
291
|
+
}), D(t, s.components);
|
|
289
292
|
}
|
|
290
|
-
function
|
|
293
|
+
function fe(e) {
|
|
291
294
|
return x(), m[e];
|
|
292
295
|
}
|
|
293
296
|
function x() {
|
|
294
|
-
return Object.keys(m).length == 0 &&
|
|
297
|
+
return Object.keys(m).length == 0 && q(), Object.values(m);
|
|
295
298
|
}
|
|
296
|
-
function
|
|
299
|
+
function me(e, t, s) {
|
|
297
300
|
x();
|
|
298
301
|
const n = [];
|
|
299
302
|
if (s) {
|
|
@@ -304,9 +307,9 @@ function fe(e, t, s) {
|
|
|
304
307
|
let r = h(e);
|
|
305
308
|
return P.forEach((a) => {
|
|
306
309
|
t ? a.name.includes(r) && n.push(m[a.value]) : a.name == r && n.push(m[a.value]);
|
|
307
|
-
}),
|
|
310
|
+
}), M(n, "key");
|
|
308
311
|
}
|
|
309
|
-
async function
|
|
312
|
+
async function J(e, t) {
|
|
310
313
|
let s = e;
|
|
311
314
|
if (e) {
|
|
312
315
|
let n = W(
|
|
@@ -318,7 +321,7 @@ async function G(e, t) {
|
|
|
318
321
|
}
|
|
319
322
|
return s;
|
|
320
323
|
}
|
|
321
|
-
function
|
|
324
|
+
function Q(e) {
|
|
322
325
|
return new Promise((t) => {
|
|
323
326
|
if (e && e.length > 0) {
|
|
324
327
|
let s = e.map((n) => d[n.key] || d[n.key + ".js"] || d[n.key + ".ts"]);
|
|
@@ -327,7 +330,7 @@ function J(e) {
|
|
|
327
330
|
(n, r, a, i) => {
|
|
328
331
|
a.raw ? n() : a.getRaw ? a.getRaw(a).then(async (l) => {
|
|
329
332
|
const o = (l || "") + "";
|
|
330
|
-
let c = await
|
|
333
|
+
let c = await J(
|
|
331
334
|
o,
|
|
332
335
|
e[i]
|
|
333
336
|
);
|
|
@@ -342,32 +345,32 @@ function J(e) {
|
|
|
342
345
|
});
|
|
343
346
|
}
|
|
344
347
|
async function y(e) {
|
|
345
|
-
const t = await
|
|
348
|
+
const t = await Q(e);
|
|
346
349
|
return ((t == null ? void 0 : t.map((n) => n.raw)) || []).join(`
|
|
347
350
|
`);
|
|
348
351
|
}
|
|
349
|
-
async function
|
|
352
|
+
async function X(e, t) {
|
|
350
353
|
let s = e;
|
|
351
354
|
if (e && (t.comprops || t.curprops)) {
|
|
352
355
|
let n = W(
|
|
353
356
|
t.key,
|
|
354
357
|
e,
|
|
355
358
|
t.suffix
|
|
356
|
-
).filter((a) =>
|
|
359
|
+
).filter((a) => K(
|
|
357
360
|
a.name,
|
|
358
361
|
t.comprops || ""
|
|
359
|
-
) ||
|
|
362
|
+
) || b(a.name, t.curprops || "")), r = await y(n);
|
|
360
363
|
s += r;
|
|
361
364
|
}
|
|
362
365
|
return s;
|
|
363
366
|
}
|
|
364
|
-
function
|
|
367
|
+
function ue(e) {
|
|
365
368
|
return new Promise((t) => {
|
|
366
369
|
if (e) {
|
|
367
370
|
x();
|
|
368
371
|
const s = m[e];
|
|
369
372
|
s ? s.raw ? t(s.raw) : s.getRaw ? s.getRaw(s).then(async (n) => {
|
|
370
|
-
const r = (n || "") + "", a = await
|
|
373
|
+
const r = (n || "") + "", a = await X(
|
|
371
374
|
r,
|
|
372
375
|
s
|
|
373
376
|
);
|
|
@@ -379,14 +382,14 @@ function me(e) {
|
|
|
379
382
|
}
|
|
380
383
|
export {
|
|
381
384
|
g as defaultName,
|
|
382
|
-
|
|
383
|
-
|
|
385
|
+
me as getCompoName,
|
|
386
|
+
fe as getCompoNameKey,
|
|
384
387
|
x as getCompoNameObj,
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
388
|
+
oe as getKeyMds,
|
|
389
|
+
ce as getLocalTextArr,
|
|
390
|
+
ue as getLocalTextComponents,
|
|
391
|
+
re as getLocalTextTests,
|
|
389
392
|
W as getTestImportUrl,
|
|
390
|
-
|
|
391
|
-
|
|
393
|
+
ie as getTestName,
|
|
394
|
+
le as getTestNameObj
|
|
392
395
|
};
|
|
@@ -6,7 +6,7 @@ export interface ObjUnk {
|
|
|
6
6
|
[key: string]: unknown;
|
|
7
7
|
}
|
|
8
8
|
export type GetRaw = (v: any) => Promise<unknown>;
|
|
9
|
-
export type Globs = Record<string,
|
|
9
|
+
export type Globs = Record<string, GetRaw> | GetRaw;
|
|
10
10
|
export interface GlobComs {
|
|
11
11
|
[key: string]: AsyncComponentLoader;
|
|
12
12
|
}
|
|
@@ -73,3 +73,4 @@ export interface ComponentsObjs {
|
|
|
73
73
|
components: Array<ComponentsObj>;
|
|
74
74
|
}
|
|
75
75
|
export declare function getComponentsArr(urls: Array<string>, v: Resolver, comRaw: Globs, com: GlobComs, config: Components): ComponentsObjs;
|
|
76
|
+
export declare function getRawValue(comRaw: Globs, key: string): GetRaw;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./storage.js"),R=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js"),q=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js"),m=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.js"),E=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js"),A=["vue","js"];function K(t,e){let n=R.humpToLine(t.name),i=[];return t.alias&&i.push(t.alias+"-"+n),e&&e.length>0&&e.forEach(s=>{t.alias&&i.push(t.alias+"-"+s+"-"+n),i.push(s+"-"+n)}),i}function T(t){return t.sort((e,n)=>{let i=m.appearNum(e,"/"),s=m.appearNum(n,"/");return i==s?n.length-e.length:s-i}),t}function C(t=[],e=[],n=[]){let i=e;(!i||i.length==0)&&(i=A);let s=[];return t&&t.length>0&&(s=t),n&&n.length>0&&n.forEach(a=>{i==null||i.forEach(l=>{s.push(a+"."+l)})}),s=[...new Set(s)],T(s)}function N(t,e,n={},i=""){for(let s=0;s<e.length;s++){const a=e[s],l=new RegExp("^.*/([^/]+)"+a+"$");let c=t.match(l);if(c){const p=[],u={};let f="";Object.keys(n).forEach(g=>{let h=n[g];t.startsWith(h+"/")&&(f=h,u[g]=h,p.push(g))});let o=c[1],r={dir:"",suffix:E.getSuffix(t),name:q.lineToLargeHump(o),value:o,key:"",tdir:"",adir:f,alias:i,aliass:u,aliasNames:[],raw:"",getRaw:null,mds:[],tests:void 0};return r.aliasNames=K(r,p),r}}}function y(t){x.setSession("aside.key",t)}function D(){return x.getSession("aside.key")}function H(t){let e=t.match(/\/([^\/]+)\/$/);return e&&e.length>1?e[1]:""}function w(t,e){return e?new RegExp(e+".+(\\.(js|ts))?$").test(t):!1}function S(t,e){return e?new RegExp("/"+e+"(\\.(js|ts))?$").test(t):!1}function M(t,e,n,i,s){const a=[],l=[],c=C(e.matchexts,e.extensions,e.matchs),p=H(e.dir);return t.forEach(u=>{const f=new RegExp("^"+e.dir);let o=u.replace(f,"");if(s.comprops&&w(o,s.comprops)||s.curprops&&S(o,s.curprops)){let r={};r.comprops=s.comprops||"",r.curprops=s.curprops||"",r.value=o,r.dir=e.dir,r.suffix=E.getSuffix(u),r.tdir=p,r.key=u,r.raw="",r.getRaw=d(n,u),a.push(r)}else{let r=N(o,c,e.aliass,e.alias);r&&(r.comprops=s.comprops,r.curprops=s.curprops,r.dir=e.dir,r.tdir=p,r.key=u,r.component=i[u],r.getRaw=d(n,u),l.push(r))}}),{props:a,components:l}}function d(t,e){return typeof t=="function"?t:t[e]||t}exports.defaultExtensions=A;exports.getAsideKey=D;exports.getComponentsArr=M;exports.getMatchs=C;exports.getRawValue=d;exports.getUrlName=N;exports.isComprops=w;exports.isCurprops=S;exports.setAsideKey=y;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../config.js"),
|
|
2
|
-
`)}async function _(e,t){let s=e;if(e&&(t.comprops||t.curprops)){let n=T(t.key,e,t.suffix).filter(a=>
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../config.js"),h=require("./common.js"),x=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js"),C=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js"),E=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js"),j=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js"),N=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-XQB2HUHZ.js"),d=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js"),H=require("./index.js"),u={},R={},y=[],P={},q={},p={};function S(){return L.getConfig("example")}function b(e,t,s){const n=Object.assign({exampless:[],examplessRaw:[]},t,s),r=[],a=n.examples;a&&Object.keys(a).forEach(l=>{r.push(l),q[l]=a[l]}),n.exampless=r,n.examples=void 0;const i=[],o=n.examplesRaw;o&&Object.keys(o).forEach(l=>{i.push(l),p[l]=h.getRawValue(o,l)}),n.examplessRaw=i,n.examplesRaw=void 0,P[e]=n}function k(e,t="vue"){let s="";if(t=="vue"){let r=new RegExp(/(<script([^>]*)>)((.|\n|\r)*)(<\/script>)/g).exec(e);r&&(s=r[3])}else(t=="js"||t=="ts")&&(s=e);if(s){const n=H.getTextImport(s);let r=n==null?void 0:n.map(i=>i.n);const a=[];return r&&r.length>0&&r.forEach(i=>{i&&(i.startsWith("./")||i.startsWith("../"))&&a.push(i)}),a}}function K(e){return new Promise(t=>{e?e.raw?t(e.raw):e.getRaw?e.getRaw(e).then(s=>{const n=(s||"")+"";e.raw=n,e.getRaw=null,t(n)}):t(""):t("")})}function I(e,t){e=(e||"")+"";let s="";switch(e){case"1":s=t.tdir+"/";break;case"2":s=t.adir+"/";break;case"3":s=t.tdir+"/"+t.adir+"/";break}return s}function M(e,t,s){var o,l;e=(e||"")+"",s=(s||"")+"";let n=x.humpToLine(t.name),r=[];const a=Object.values(t.aliass||{});if(e==="1")t.alias&&r.push(t.alias+"-"+n);else if(e==="2")a&&a.length>0&&a.forEach(c=>{r.push(c+"-"+n)});else if(e==="3"){let c="";t.alias&&(c=t.alias+"-"),a==null||a.forEach(f=>{r.push(c+f+"-"+n)})}else e==="4"?(o=t.aliasNames)==null||o.forEach(c=>{r.push(x.humpToLine(c))}):e=="9"&&(r.push(n),(l=t.aliasNames)==null||l.forEach(c=>{r.push(x.humpToLine(c))}));r.length==0&&r.push(n);let i=[];return s==="1"?r.forEach(c=>{let f=C.lineToLargeHump(c);i.push(f,E.firstLower(f))}):s==="2"?r.forEach(c=>{let f=C.lineToLargeHump(c);i.push(c,f,E.firstLower(f))}):i=[...r],i=[...new Set(i)],i}function U(e,t,s,n){const r=[];return s.examplessRaw.forEach(a=>{for(let i=0;i<t.length;i++){const o=t[i];if(a==e+o+"/"+s.md+".md"){r.push({topurl:e,comkey:n.key,suffix:d.getSuffix(a),name:n.name,value:o,key:a,raw:"",getRaw:p[a]||p});break}}}),r}function O(e){w();const t=u[e];if(t.tests)return t.tests;{const s=P[t.dir],n=s.dir+I(s.level||0,t),r=M(s.aliaslevel||0,t,s.componentName||0);t.mds=U(n,r,s,t);const a={};return s.exampless.forEach(i=>{for(let o=0;o<r.length;o++){const l=r[o];if(i.startsWith(n+l+"/")){const c=new RegExp("^\\"+n+l+"/(.*)/index\\."+h.defaultExtensions.join("|")+"$");let f="",m=i.match(c);m&&m.length>1&&(f=m[1]),a[i]={topurl:n,name:l,value:f,suffix:d.getSuffix(i),comname:t.name,comkey:t.key,key:i,component:q[i],raw:"",getRaw:p[i]||p};break}}}),t.tests=a,a}}function W(e){if(e){const t=O(e);return Object.values(t)}else return[]}function B(e,t,s){w();const n=O(s),r=[];if(t){let a=n[t];if(a)return r.push(a),r}return Object.values(n).forEach(a=>{a.name+"/"+a.value==e&&r.push(a)}),r}function D(e){return O(e),u[e].mds}function T(e,t,s){let n=k(t,s)||[],r=e.split("/");return n.map(a=>{if(a.startsWith("./")){let i=r.slice(0,r.length-1).join("/"),o=a.substring(2);return{name:a,value:o,suffix:d.getSuffix(a),head:i,key:i+"/"+o}}else{let i=a.split("/"),o=0;for(let m=0;m<i.length;m++)if(i[m]!=".."){o=m;break}let l=i.slice(o,i.length),c=r.slice(0,r.length-o-1).join("/"),f=l.join("/");return{name:a,value:f,suffix:d.getSuffix(a),head:c,key:c+"/"+f}}})}function J(e){return new Promise(t=>{if(e&&e.length>0){let s=e.map(n=>({raw:"",value:n.value,suffix:d.getSuffix(n.key),key:n.key,getRaw:p[n.key]||p}));N.asyncMergeArray(s,(n,r,a,i)=>{a.raw?n():a.getRaw?a.getRaw(a).then(o=>{const l=(o||"")+"";a.raw=l,a.getRaw=null,n()}):n()}).then(()=>{t(s)})}else t([])})}function V(){const e=S(),t=L.getConfig("components");t==null||t.forEach(s=>{var r;F(s);let n=s.dir||((r=s==null?void 0:s.resolver)==null?void 0:r.dir)||"";b(n,e,s.example)}),console.log("componentsObj",u)}const g="default";function X(e){let t=x.humpToLine(e.name),s=[...e.aliasNames];s.push(t),s.forEach(n=>{y.push({name:n,value:e.key})})}function Z(e,t){const s={};t==null||t.forEach(n=>{u[n.key]=n,X(n);const r=Object.values(n.aliass||{});r&&r.length?r.forEach(a=>{s[a]=s[a]||[],s[a].push(n.key)}):(s[g]=s[g]||[],s[g].push(n.key))})}function F(e){var n;let t,s;e.resolver?(t=e.alias||((n=e.resolver)==null?void 0:n.alias)||g,s=h.getComponentsArr(e.resolver.urls||[],e.resolver,e.componentsRaw,e.components,e)):(t=e.alias||g,s=h.getComponentsArr(Object.keys(e.componentsRaw),e,e.componentsRaw,e.components,e)),s&&(s!=null&&s.props)&&s.props.forEach(r=>{R[r.key]=r}),Z(t,s.components)}function Q(e){return w(),u[e]}function w(){return Object.keys(u).length==0&&V(),Object.values(u)}function $(e,t,s){w();const n=[];if(s){let a=u[s];if(a&&a.key)return[a]}let r=x.humpToLine(e);return y.forEach(a=>{t?a.name.includes(r)&&n.push(u[a.value]):a.name==r&&n.push(u[a.value])}),j.duplicateRemoval(n,"key")}async function G(e,t){let s=e;if(e){let n=T(t.key,e,t.suffix).filter(r=>r.key.startsWith(t.head));s+=await A(n)}return s}function Y(e){return new Promise(t=>{if(e&&e.length>0){let s=e.map(n=>R[n.key]||R[n.key+".js"]||R[n.key+".ts"]);N.asyncMergeArray(s,(n,r,a,i)=>{a.raw?n():a.getRaw?a.getRaw(a).then(async o=>{const l=(o||"")+"";let c=await G(l,e[i]);a.raw=c,a.getRaw=null,n()}):n()}).then(()=>{t(s)})}else t([])})}async function A(e){const t=await Y(e);return((t==null?void 0:t.map(n=>n.raw))||[]).join(`
|
|
2
|
+
`)}async function _(e,t){let s=e;if(e&&(t.comprops||t.curprops)){let n=T(t.key,e,t.suffix).filter(a=>h.isComprops(a.name,t.comprops||"")||h.isCurprops(a.name,t.curprops||"")),r=await A(n);s+=r}return s}function z(e){return new Promise(t=>{if(e){w();const s=u[e];s?s.raw?t(s.raw):s.getRaw?s.getRaw(s).then(async n=>{const r=(n||"")+"",a=await _(r,s);s.raw=a,s.getRaw=null,t(a)}):t(""):t("")}else t("")})}exports.defaultName=g;exports.getCompoName=$;exports.getCompoNameKey=Q;exports.getCompoNameObj=w;exports.getKeyMds=D;exports.getLocalTextArr=J;exports.getLocalTextComponents=z;exports.getLocalTextTests=K;exports.getTestImportUrl=T;exports.getTestName=W;exports.getTestNameObj=B;
|