@fangzhongya/vue-archive 0.0.2-14 → 0.0.2-16

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.
@@ -71,10 +71,14 @@ function T(t) {
71
71
  return e && e.length > 1 ? e[1] : "";
72
72
  }
73
73
  function v(t, e) {
74
- return e ? new RegExp(e + ".+\\.(js|ts)$").test(t) : !1;
74
+ return e ? new RegExp(
75
+ e + ".+(\\.(js|ts))?$"
76
+ ).test(t) : !1;
75
77
  }
76
78
  function K(t, e) {
77
- return e ? new RegExp(e + "\\.(js|ts)$").test(t) : !1;
79
+ return e ? new RegExp(
80
+ "/" + e + "(\\.(js|ts))?$"
81
+ ).test(t) : !1;
78
82
  }
79
83
  function U(t, e, n, i, r) {
80
84
  const p = [], l = [], f = $(
@@ -1,17 +1,17 @@
1
1
  import { getConfig as C } from "../config.js";
2
- import { getComponentsArr as O, defaultExtensions as I, isComprops as K, isCurprops as M } from "./common.js";
2
+ import { getComponentsArr as O, defaultExtensions as y, isComprops as A, isCurprops as I } from "./common.js";
3
3
  import { humpToLine as p } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js";
4
4
  import { lineToLargeHump as E } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js";
5
5
  import { firstLower as T } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js";
6
- import { duplicateRemoval as U } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js";
6
+ import { duplicateRemoval as K } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js";
7
7
  import { asyncMergeArray as N } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-XQB2HUHZ.js";
8
8
  import { getSuffix as g } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js";
9
- import { getTextImport as S } from "./index.js";
10
- const m = {}, P = {}, L = [], j = {}, b = {}, d = {};
11
- function $() {
9
+ import { getTextImport as M } from "./index.js";
10
+ const m = {}, x = {}, P = [], L = {}, j = {}, d = {};
11
+ function U() {
12
12
  return C("example");
13
13
  }
14
- function F(e, t, s) {
14
+ function S(e, t, s) {
15
15
  const n = Object.assign(
16
16
  {
17
17
  exampless: [],
@@ -20,15 +20,15 @@ function F(e, t, s) {
20
20
  t,
21
21
  s
22
22
  ), r = [], a = n.examples;
23
- a && Object.keys(a).forEach((l) => {
24
- r.push(l), b[l] = a[l];
23
+ a && Object.keys(a).forEach((o) => {
24
+ r.push(o), j[o] = a[o];
25
25
  }), n.exampless = r, n.examples = void 0;
26
- const i = [], o = n.examplesRaw;
27
- o && Object.keys(o).forEach((l) => {
28
- i.push(l), d[l] = o[l];
29
- }), n.examplessRaw = i, n.examplesRaw = void 0, j[e] = n;
26
+ const i = [], l = n.examplesRaw;
27
+ l && Object.keys(l).forEach((o) => {
28
+ i.push(o), d[o] = l[o];
29
+ }), n.examplessRaw = i, n.examplesRaw = void 0, L[e] = n;
30
30
  }
31
- function H(e, t = "vue") {
31
+ function k(e, t = "vue") {
32
32
  let s = "";
33
33
  if (t == "vue") {
34
34
  let r = new RegExp(
@@ -38,7 +38,7 @@ function H(e, t = "vue") {
38
38
  } else
39
39
  (t == "js" || t == "ts") && (s = e);
40
40
  if (s) {
41
- const n = S(s);
41
+ const n = M(s);
42
42
  let r = n == null ? void 0 : n.map((i) => i.n);
43
43
  const a = [];
44
44
  return r && r.length > 0 && r.forEach((i) => {
@@ -46,7 +46,7 @@ function H(e, t = "vue") {
46
46
  }), a;
47
47
  }
48
48
  }
49
- function re(e) {
49
+ function ae(e) {
50
50
  return new Promise((t) => {
51
51
  e ? e.raw ? t(e.raw) : e.getRaw ? e.getRaw().then((s) => {
52
52
  const n = (s || "") + "";
@@ -54,7 +54,7 @@ function re(e) {
54
54
  }) : t("") : t("");
55
55
  });
56
56
  }
57
- function V(e, t) {
57
+ function F(e, t) {
58
58
  e = (e || "") + "";
59
59
  let s = "";
60
60
  switch (e) {
@@ -70,8 +70,8 @@ function V(e, t) {
70
70
  }
71
71
  return s;
72
72
  }
73
- function Z(e, t, s) {
74
- var o, l;
73
+ function H(e, t, s) {
74
+ var l, o;
75
75
  e = (e || "") + "", s = (s || "") + "";
76
76
  let n = p(t.name), r = [];
77
77
  const a = Object.values(t.aliass || {});
@@ -87,9 +87,9 @@ function Z(e, t, s) {
87
87
  r.push(c + f + "-" + n);
88
88
  });
89
89
  } else
90
- e === "4" ? (o = t.aliasNames) == null || o.forEach((c) => {
90
+ e === "4" ? (l = t.aliasNames) == null || l.forEach((c) => {
91
91
  r.push(p(c));
92
- }) : e == "9" && (r.push(n), (l = t.aliasNames) == null || l.forEach((c) => {
92
+ }) : e == "9" && (r.push(n), (o = t.aliasNames) == null || o.forEach((c) => {
93
93
  r.push(p(c));
94
94
  }));
95
95
  r.length == 0 && r.push(n);
@@ -102,18 +102,18 @@ function Z(e, t, s) {
102
102
  i.push(c, f, T(f));
103
103
  }) : i = [...r], i = [...new Set(i)], i;
104
104
  }
105
- function q(e, t, s, n) {
105
+ function V(e, t, s, n) {
106
106
  const r = [];
107
107
  return s.examplessRaw.forEach((a) => {
108
108
  for (let i = 0; i < t.length; i++) {
109
- const o = t[i];
110
- if (a == e + o + "/" + s.md + ".md") {
109
+ const l = t[i];
110
+ if (a == e + l + "/" + s.md + ".md") {
111
111
  r.push({
112
112
  topurl: e,
113
113
  comkey: n.key,
114
114
  suffix: g(a),
115
115
  name: n.name,
116
- value: o,
116
+ value: l,
117
117
  key: a,
118
118
  raw: "",
119
119
  getRaw: d[a]
@@ -129,30 +129,30 @@ function R(e) {
129
129
  if (t.tests)
130
130
  return t.tests;
131
131
  {
132
- const s = j[t.dir], n = s.dir + V(s.level || 0, t), r = Z(
132
+ const s = L[t.dir], n = s.dir + F(s.level || 0, t), r = H(
133
133
  s.aliaslevel || 0,
134
134
  t,
135
135
  s.componentName || 0
136
136
  );
137
- t.mds = q(n, r, s, t);
137
+ t.mds = V(n, r, s, t);
138
138
  const a = {};
139
139
  return s.exampless.forEach((i) => {
140
- for (let o = 0; o < r.length; o++) {
141
- const l = r[o];
142
- if (i.startsWith(n + l + "/")) {
140
+ for (let l = 0; l < r.length; l++) {
141
+ const o = r[l];
142
+ if (i.startsWith(n + o + "/")) {
143
143
  const c = new RegExp(
144
- "^\\" + n + l + "/(.*)/index\\." + I.join("|") + "$"
144
+ "^\\" + n + o + "/(.*)/index\\." + y.join("|") + "$"
145
145
  );
146
146
  let f = "", u = i.match(c);
147
147
  u && u.length > 1 && (f = u[1]), a[i] = {
148
148
  topurl: n,
149
- name: l,
149
+ name: o,
150
150
  value: f,
151
151
  suffix: g(i),
152
152
  comname: t.name,
153
153
  comkey: t.key,
154
154
  key: i,
155
- component: b[i],
155
+ component: j[i],
156
156
  raw: "",
157
157
  getRaw: d[i]
158
158
  };
@@ -162,14 +162,14 @@ function R(e) {
162
162
  }), t.tests = a, a;
163
163
  }
164
164
  }
165
- function ie(e) {
165
+ function re(e) {
166
166
  if (e) {
167
167
  const t = R(e);
168
168
  return Object.values(t);
169
169
  } else
170
170
  return [];
171
171
  }
172
- function le(e, t, s) {
172
+ function ie(e, t, s) {
173
173
  w();
174
174
  const n = R(s), r = [];
175
175
  if (t) {
@@ -181,41 +181,40 @@ function le(e, t, s) {
181
181
  a.name + "/" + a.value == e && r.push(a);
182
182
  }), r;
183
183
  }
184
- function oe(e) {
184
+ function le(e) {
185
185
  return R(e), m[e].mds;
186
186
  }
187
- function A(e, t, s) {
188
- let n = H(t, s) || [], r = e.split("/");
187
+ function W(e, t, s) {
188
+ let n = k(t, s) || [], r = e.split("/");
189
189
  return n.map((a) => {
190
- let i = /\.([a-z|A-Z]+)$/g;
191
190
  if (a.startsWith("./")) {
192
- let o = r.slice(0, r.length - 1).join("/"), l = a.substring(2);
193
- return i.test(l) || (a = a + "." + s), {
191
+ let i = r.slice(0, r.length - 1).join("/"), l = a.substring(2);
192
+ return {
194
193
  name: a,
195
194
  value: l,
196
195
  suffix: g(a),
197
- head: o,
198
- key: o + "/" + l
196
+ head: i,
197
+ key: i + "/" + l
199
198
  };
200
199
  } else {
201
- let o = a.split("/"), l = 0;
202
- for (let x = 0; x < o.length; x++)
203
- if (o[x] != "..") {
204
- l = x;
200
+ let i = a.split("/"), l = 0;
201
+ for (let u = 0; u < i.length; u++)
202
+ if (i[u] != "..") {
203
+ l = u;
205
204
  break;
206
205
  }
207
- let c = o.slice(l, o.length), f = r.slice(0, r.length - l - 1).join("/"), u = c.join("/");
208
- return i.test(u) || (a = a + "." + s), {
206
+ let o = i.slice(l, i.length), c = r.slice(0, r.length - l - 1).join("/"), f = o.join("/");
207
+ return {
209
208
  name: a,
210
- value: u,
209
+ value: f,
211
210
  suffix: g(a),
212
- head: f,
213
- key: f + "/" + u
211
+ head: c,
212
+ key: c + "/" + f
214
213
  };
215
214
  }
216
215
  });
217
216
  }
218
- function ce(e) {
217
+ function oe(e) {
219
218
  return new Promise((t) => {
220
219
  if (e && e.length > 0) {
221
220
  let s = e.map((n) => ({
@@ -228,9 +227,9 @@ function ce(e) {
228
227
  N(
229
228
  s,
230
229
  (n, r, a, i) => {
231
- a.raw ? n() : a.getRaw ? a.getRaw().then((o) => {
232
- const l = (o || "") + "";
233
- a.raw = l, a.getRaw = null, n();
230
+ a.raw ? n() : a.getRaw ? a.getRaw().then((l) => {
231
+ const o = (l || "") + "";
232
+ a.raw = o, a.getRaw = null, n();
234
233
  }) : n();
235
234
  }
236
235
  ).then(() => {
@@ -240,36 +239,36 @@ function ce(e) {
240
239
  t([]);
241
240
  });
242
241
  }
243
- function B() {
244
- const e = $(), t = C("components");
242
+ function $() {
243
+ const e = U(), t = C("components");
245
244
  t == null || t.forEach((s) => {
246
245
  var r;
247
- J(s);
246
+ D(s);
248
247
  let n = s.dir || ((r = s == null ? void 0 : s.resolver) == null ? void 0 : r.dir) || "";
249
- F(n, e, s.example);
248
+ S(n, e, s.example);
250
249
  }), console.log("componentsObj", m);
251
250
  }
252
251
  const h = "default";
253
- function D(e) {
252
+ function q(e) {
254
253
  let t = p(e.name), s = [...e.aliasNames];
255
254
  s.push(t), s.forEach((n) => {
256
- L.push({
255
+ P.push({
257
256
  name: n,
258
257
  value: e.key
259
258
  });
260
259
  });
261
260
  }
262
- function G(e, t) {
261
+ function B(e, t) {
263
262
  const s = {};
264
263
  t == null || t.forEach((n) => {
265
- m[n.key] = n, D(n);
264
+ m[n.key] = n, q(n);
266
265
  const r = Object.values(n.aliass || {});
267
266
  r && r.length ? r.forEach((a) => {
268
267
  s[a] = s[a] || [], s[a].push(n.key);
269
268
  }) : (s[h] = s[h] || [], s[h].push(n.key));
270
269
  });
271
270
  }
272
- function J(e) {
271
+ function D(e) {
273
272
  var n;
274
273
  let t, s;
275
274
  e.resolver ? (t = e.alias || ((n = e.resolver) == null ? void 0 : n.alias) || h, s = O(
@@ -285,16 +284,16 @@ function J(e) {
285
284
  e.components,
286
285
  e
287
286
  )), s && (s != null && s.props) && s.props.forEach((r) => {
288
- P[r.key] = r;
289
- }), G(t, s.components);
287
+ x[r.key] = r;
288
+ }), B(t, s.components);
290
289
  }
291
- function fe(e) {
290
+ function ce(e) {
292
291
  return w(), m[e];
293
292
  }
294
293
  function w() {
295
- return Object.keys(m).length == 0 && B(), Object.values(m);
294
+ return Object.keys(m).length == 0 && $(), Object.values(m);
296
295
  }
297
- function me(e, t, s) {
296
+ function fe(e, t, s) {
298
297
  w();
299
298
  const n = [];
300
299
  if (s) {
@@ -303,33 +302,33 @@ function me(e, t, s) {
303
302
  return [a];
304
303
  }
305
304
  let r = p(e);
306
- return L.forEach((a) => {
305
+ return P.forEach((a) => {
307
306
  t ? a.name.includes(r) && n.push(m[a.value]) : a.name == r && n.push(m[a.value]);
308
- }), U(n, "key");
307
+ }), K(n, "key");
309
308
  }
310
- async function Q(e, t) {
309
+ async function G(e, t) {
311
310
  let s = e;
312
311
  if (e) {
313
- let n = A(
312
+ let n = W(
314
313
  t.key,
315
314
  e,
316
315
  t.suffix
317
316
  ).filter((r) => r.key.startsWith(t.head));
318
- s += await W(n);
317
+ s += await b(n);
319
318
  }
320
319
  return s;
321
320
  }
322
- function X(e) {
321
+ function J(e) {
323
322
  return new Promise((t) => {
324
323
  if (e && e.length > 0) {
325
- let s = e.map((n) => P[n.key]);
324
+ let s = e.map((n) => x[n.key] || x[n.key + ".js"] || x[n.key + ".ts"]);
326
325
  N(
327
326
  s,
328
327
  (n, r, a, i) => {
329
- a.raw ? n() : a.getRaw ? a.getRaw().then(async (o) => {
330
- const l = (o || "") + "";
331
- let c = await Q(
332
- l,
328
+ a.raw ? n() : a.getRaw ? a.getRaw().then(async (l) => {
329
+ const o = (l || "") + "";
330
+ let c = await G(
331
+ o,
333
332
  e[i]
334
333
  );
335
334
  a.raw = c, a.getRaw = null, n();
@@ -342,33 +341,33 @@ function X(e) {
342
341
  t([]);
343
342
  });
344
343
  }
345
- async function W(e) {
346
- const t = await X(e);
344
+ async function b(e) {
345
+ const t = await J(e);
347
346
  return ((t == null ? void 0 : t.map((n) => n.raw)) || []).join(`
348
347
  `);
349
348
  }
350
- async function Y(e, t) {
349
+ async function Q(e, t) {
351
350
  let s = e;
352
- if (e && t.comprops) {
353
- let n = A(
351
+ if (e && (t.comprops || t.curprops)) {
352
+ let n = W(
354
353
  t.key,
355
354
  e,
356
355
  t.suffix
357
- ).filter((a) => K(
356
+ ).filter((a) => A(
358
357
  a.name,
359
358
  t.comprops || ""
360
- ) || M(a.name, t.curprops || "")), r = await W(n);
359
+ ) || I(a.name, t.curprops || "")), r = await b(n);
361
360
  s += r;
362
361
  }
363
362
  return s;
364
363
  }
365
- function ue(e) {
364
+ function me(e) {
366
365
  return new Promise((t) => {
367
366
  if (e) {
368
367
  w();
369
368
  const s = m[e];
370
369
  s ? s.raw ? t(s.raw) : s.getRaw ? s.getRaw().then(async (n) => {
371
- const r = (n || "") + "", a = await Y(
370
+ const r = (n || "") + "", a = await Q(
372
371
  r,
373
372
  s
374
373
  );
@@ -380,14 +379,14 @@ function ue(e) {
380
379
  }
381
380
  export {
382
381
  h as defaultName,
383
- me as getCompoName,
384
- fe as getCompoNameKey,
382
+ fe as getCompoName,
383
+ ce as getCompoNameKey,
385
384
  w as getCompoNameObj,
386
- oe as getKeyMds,
387
- ce as getLocalTextArr,
388
- ue as getLocalTextComponents,
389
- re as getLocalTextTests,
390
- A as getTestImportUrl,
391
- ie as getTestName,
392
- le as getTestNameObj
385
+ le as getKeyMds,
386
+ oe as getLocalTextArr,
387
+ me as getLocalTextComponents,
388
+ ae as getLocalTextTests,
389
+ W as getTestImportUrl,
390
+ re as getTestName,
391
+ ie as getTestNameObj
393
392
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./storage.js"),S=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js"),R=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js"),d=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.js"),x=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js"),E=["vue","js"];function q(t,e){let n=S.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 K(t){return t.sort((e,n)=>{let i=d.appearNum(e,"/"),s=d.appearNum(n,"/");return i==s?n.length-e.length:s-i}),t}function w(t=[],e=[],n=[]){let i=e;(!i||i.length==0)&&(i=E);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)],K(s)}function A(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:x.getSuffix(t),name:R.lineToLargeHump(o),value:o,key:"",tdir:"",adir:f,alias:i,aliass:u,aliasNames:[],raw:"",getRaw:null,mds:[],tests:void 0};return r.aliasNames=q(r,p),r}}}function T(t){m.setSession("aside.key",t)}function D(){return m.getSession("aside.key")}function H(t){let e=t.match(/\/([^\/]+)\/$/);return e&&e.length>1?e[1]:""}function C(t,e){return e?new RegExp(e+".+\\.(js|ts)$").test(t):!1}function N(t,e){return e?new RegExp(e+"\\.(js|ts)$").test(t):!1}function M(t,e,n,i,s){const a=[],l=[],c=w(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&&C(o,s.comprops)||s.curprops&&N(o,s.curprops)){let r={};r.comprops=s.comprops||"",r.curprops=s.curprops||"",r.value=o,r.dir=e.dir,r.suffix=x.getSuffix(u),r.tdir=p,r.key=u,r.raw="",r.getRaw=n[u],a.push(r)}else{let r=A(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=n[u],l.push(r))}}),{props:a,components:l}}exports.defaultExtensions=E;exports.getAsideKey=D;exports.getComponentsArr=M;exports.getMatchs=w;exports.getUrlName=A;exports.isComprops=C;exports.isCurprops=N;exports.setAsideKey=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./storage.js"),S=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js"),R=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js"),d=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.js"),x=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js"),E=["vue","js"];function q(t,e){let n=S.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 K(t){return t.sort((e,n)=>{let i=d.appearNum(e,"/"),s=d.appearNum(n,"/");return i==s?n.length-e.length:s-i}),t}function w(t=[],e=[],n=[]){let i=e;(!i||i.length==0)&&(i=E);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)],K(s)}function A(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:x.getSuffix(t),name:R.lineToLargeHump(o),value:o,key:"",tdir:"",adir:f,alias:i,aliass:u,aliasNames:[],raw:"",getRaw:null,mds:[],tests:void 0};return r.aliasNames=q(r,p),r}}}function T(t){m.setSession("aside.key",t)}function D(){return m.getSession("aside.key")}function H(t){let e=t.match(/\/([^\/]+)\/$/);return e&&e.length>1?e[1]:""}function C(t,e){return e?new RegExp(e+".+(\\.(js|ts))?$").test(t):!1}function N(t,e){return e?new RegExp("/"+e+"(\\.(js|ts))?$").test(t):!1}function M(t,e,n,i,s){const a=[],l=[],c=w(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&&C(o,s.comprops)||s.curprops&&N(o,s.curprops)){let r={};r.comprops=s.comprops||"",r.curprops=s.curprops||"",r.value=o,r.dir=e.dir,r.suffix=x.getSuffix(u),r.tdir=p,r.key=u,r.raw="",r.getRaw=n[u],a.push(r)}else{let r=A(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=n[u],l.push(r))}}),{props:a,components:l}}exports.defaultExtensions=E;exports.getAsideKey=D;exports.getComponentsArr=M;exports.getMatchs=w;exports.getUrlName=A;exports.isComprops=C;exports.isCurprops=N;exports.setAsideKey=T;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../config.js"),w=require("./common.js"),h=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js"),C=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js"),E=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js"),H=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js"),N=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-XQB2HUHZ.js"),x=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js"),S=require("./index.js"),u={},A={},P=[],b={},j={},R={};function K(){return L.getConfig("example")}function I(e,t,s){const n=Object.assign({exampless:[],examplessRaw:[]},t,s),r=[],a=n.examples;a&&Object.keys(a).forEach(o=>{r.push(o),j[o]=a[o]}),n.exampless=r,n.examples=void 0;const i=[],l=n.examplesRaw;l&&Object.keys(l).forEach(o=>{i.push(o),R[o]=l[o]}),n.examplessRaw=i,n.examplesRaw=void 0,b[e]=n}function M(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=S.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 U(e){return new Promise(t=>{e?e.raw?t(e.raw):e.getRaw?e.getRaw().then(s=>{const n=(s||"")+"";e.raw=n,e.getRaw=null,t(n)}):t(""):t("")})}function W(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 B(e,t,s){var l,o;e=(e||"")+"",s=(s||"")+"";let n=h.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"?(l=t.aliasNames)==null||l.forEach(c=>{r.push(h.humpToLine(c))}):e=="9"&&(r.push(n),(o=t.aliasNames)==null||o.forEach(c=>{r.push(h.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 D(e,t,s,n){const r=[];return s.examplessRaw.forEach(a=>{for(let i=0;i<t.length;i++){const l=t[i];if(a==e+l+"/"+s.md+".md"){r.push({topurl:e,comkey:n.key,suffix:x.getSuffix(a),name:n.name,value:l,key:a,raw:"",getRaw:R[a]});break}}}),r}function O(e){g();const t=u[e];if(t.tests)return t.tests;{const s=b[t.dir],n=s.dir+W(s.level||0,t),r=B(s.aliaslevel||0,t,s.componentName||0);t.mds=D(n,r,s,t);const a={};return s.exampless.forEach(i=>{for(let l=0;l<r.length;l++){const o=r[l];if(i.startsWith(n+o+"/")){const c=new RegExp("^\\"+n+o+"/(.*)/index\\."+w.defaultExtensions.join("|")+"$");let f="",m=i.match(c);m&&m.length>1&&(f=m[1]),a[i]={topurl:n,name:o,value:f,suffix:x.getSuffix(i),comname:t.name,comkey:t.key,key:i,component:j[i],raw:"",getRaw:R[i]};break}}}),t.tests=a,a}}function Z(e){if(e){const t=O(e);return Object.values(t)}else return[]}function J(e,t,s){g();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 X(e){return O(e),u[e].mds}function T(e,t,s){let n=M(t,s)||[],r=e.split("/");return n.map(a=>{let i=/\.([a-z|A-Z]+)$/g;if(a.startsWith("./")){let l=r.slice(0,r.length-1).join("/"),o=a.substring(2);return i.test(o)||(a=a+"."+s),{name:a,value:o,suffix:x.getSuffix(a),head:l,key:l+"/"+o}}else{let l=a.split("/"),o=0;for(let d=0;d<l.length;d++)if(l[d]!=".."){o=d;break}let c=l.slice(o,l.length),f=r.slice(0,r.length-o-1).join("/"),m=c.join("/");return i.test(m)||(a=a+"."+s),{name:a,value:m,suffix:x.getSuffix(a),head:f,key:f+"/"+m}}})}function y(e){return new Promise(t=>{if(e&&e.length>0){let s=e.map(n=>({raw:"",value:n.value,suffix:x.getSuffix(n.key),key:n.key,getRaw:R[n.key]}));N.asyncMergeArray(s,(n,r,a,i)=>{a.raw?n():a.getRaw?a.getRaw().then(l=>{const o=(l||"")+"";a.raw=o,a.getRaw=null,n()}):n()}).then(()=>{t(s)})}else t([])})}function F(){const e=K(),t=L.getConfig("components");t==null||t.forEach(s=>{var r;k(s);let n=s.dir||((r=s==null?void 0:s.resolver)==null?void 0:r.dir)||"";I(n,e,s.example)}),console.log("componentsObj",u)}const p="default";function V(e){let t=h.humpToLine(e.name),s=[...e.aliasNames];s.push(t),s.forEach(n=>{P.push({name:n,value:e.key})})}function $(e,t){const s={};t==null||t.forEach(n=>{u[n.key]=n,V(n);const r=Object.values(n.aliass||{});r&&r.length?r.forEach(a=>{s[a]=s[a]||[],s[a].push(n.key)}):(s[p]=s[p]||[],s[p].push(n.key))})}function k(e){var n;let t,s;e.resolver?(t=e.alias||((n=e.resolver)==null?void 0:n.alias)||p,s=w.getComponentsArr(e.resolver.urls||[],e.resolver,e.componentsRaw,e.components,e)):(t=e.alias||p,s=w.getComponentsArr(Object.keys(e.componentsRaw),e,e.componentsRaw,e.components,e)),s&&(s!=null&&s.props)&&s.props.forEach(r=>{A[r.key]=r}),$(t,s.components)}function Q(e){return g(),u[e]}function g(){return Object.keys(u).length==0&&F(),Object.values(u)}function G(e,t,s){g();const n=[];if(s){let a=u[s];if(a&&a.key)return[a]}let r=h.humpToLine(e);return P.forEach(a=>{t?a.name.includes(r)&&n.push(u[a.value]):a.name==r&&n.push(u[a.value])}),H.duplicateRemoval(n,"key")}async function Y(e,t){let s=e;if(e){let n=T(t.key,e,t.suffix).filter(r=>r.key.startsWith(t.head));s+=await q(n)}return s}function _(e){return new Promise(t=>{if(e&&e.length>0){let s=e.map(n=>A[n.key]);N.asyncMergeArray(s,(n,r,a,i)=>{a.raw?n():a.getRaw?a.getRaw().then(async l=>{const o=(l||"")+"";let c=await Y(o,e[i]);a.raw=c,a.getRaw=null,n()}):n()}).then(()=>{t(s)})}else t([])})}async function q(e){const t=await _(e);return((t==null?void 0:t.map(n=>n.raw))||[]).join(`
2
- `)}async function z(e,t){let s=e;if(e&&t.comprops){let n=T(t.key,e,t.suffix).filter(a=>w.isComprops(a.name,t.comprops||"")||w.isCurprops(a.name,t.curprops||"")),r=await q(n);s+=r}return s}function v(e){return new Promise(t=>{if(e){g();const s=u[e];s?s.raw?t(s.raw):s.getRaw?s.getRaw().then(async n=>{const r=(n||"")+"",a=await z(r,s);s.raw=a,s.getRaw=null,t(a)}):t(""):t("")}else t("")})}exports.defaultName=p;exports.getCompoName=G;exports.getCompoNameKey=Q;exports.getCompoNameObj=g;exports.getKeyMds=X;exports.getLocalTextArr=y;exports.getLocalTextComponents=v;exports.getLocalTextTests=U;exports.getTestImportUrl=T;exports.getTestName=Z;exports.getTestNameObj=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../config.js"),w=require("./common.js"),h=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js"),C=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js"),E=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js"),A=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js"),N=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-XQB2HUHZ.js"),x=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-14/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js"),b=require("./index.js"),u={},d={},y=[],P={},j={},R={};function H(){return L.getConfig("example")}function S(e,t,s){const n=Object.assign({exampless:[],examplessRaw:[]},t,s),r=[],a=n.examples;a&&Object.keys(a).forEach(l=>{r.push(l),j[l]=a[l]}),n.exampless=r,n.examples=void 0;const i=[],o=n.examplesRaw;o&&Object.keys(o).forEach(l=>{i.push(l),R[l]=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=b.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().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=h.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(h.humpToLine(c))}):e=="9"&&(r.push(n),(l=t.aliasNames)==null||l.forEach(c=>{r.push(h.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:x.getSuffix(a),name:n.name,value:o,key:a,raw:"",getRaw:R[a]});break}}}),r}function O(e){g();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\\."+w.defaultExtensions.join("|")+"$");let f="",m=i.match(c);m&&m.length>1&&(f=m[1]),a[i]={topurl:n,name:l,value:f,suffix:x.getSuffix(i),comname:t.name,comkey:t.key,key:i,component:j[i],raw:"",getRaw:R[i]};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){g();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:x.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:x.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:x.getSuffix(n.key),key:n.key,getRaw:R[n.key]}));N.asyncMergeArray(s,(n,r,a,i)=>{a.raw?n():a.getRaw?a.getRaw().then(o=>{const l=(o||"")+"";a.raw=l,a.getRaw=null,n()}):n()}).then(()=>{t(s)})}else t([])})}function X(){const e=H(),t=L.getConfig("components");t==null||t.forEach(s=>{var r;V(s);let n=s.dir||((r=s==null?void 0:s.resolver)==null?void 0:r.dir)||"";S(n,e,s.example)}),console.log("componentsObj",u)}const p="default";function Z(e){let t=h.humpToLine(e.name),s=[...e.aliasNames];s.push(t),s.forEach(n=>{y.push({name:n,value:e.key})})}function F(e,t){const s={};t==null||t.forEach(n=>{u[n.key]=n,Z(n);const r=Object.values(n.aliass||{});r&&r.length?r.forEach(a=>{s[a]=s[a]||[],s[a].push(n.key)}):(s[p]=s[p]||[],s[p].push(n.key))})}function V(e){var n;let t,s;e.resolver?(t=e.alias||((n=e.resolver)==null?void 0:n.alias)||p,s=w.getComponentsArr(e.resolver.urls||[],e.resolver,e.componentsRaw,e.components,e)):(t=e.alias||p,s=w.getComponentsArr(Object.keys(e.componentsRaw),e,e.componentsRaw,e.components,e)),s&&(s!=null&&s.props)&&s.props.forEach(r=>{d[r.key]=r}),F(t,s.components)}function Q(e){return g(),u[e]}function g(){return Object.keys(u).length==0&&X(),Object.values(u)}function $(e,t,s){g();const n=[];if(s){let a=u[s];if(a&&a.key)return[a]}let r=h.humpToLine(e);return y.forEach(a=>{t?a.name.includes(r)&&n.push(u[a.value]):a.name==r&&n.push(u[a.value])}),A.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 q(n)}return s}function Y(e){return new Promise(t=>{if(e&&e.length>0){let s=e.map(n=>d[n.key]||d[n.key+".js"]||d[n.key+".ts"]);N.asyncMergeArray(s,(n,r,a,i)=>{a.raw?n():a.getRaw?a.getRaw().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 q(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=>w.isComprops(a.name,t.comprops||"")||w.isCurprops(a.name,t.curprops||"")),r=await q(n);s+=r}return s}function z(e){return new Promise(t=>{if(e){g();const s=u[e];s?s.raw?t(s.raw):s.getRaw?s.getRaw().then(async n=>{const r=(n||"")+"",a=await _(r,s);s.raw=a,s.getRaw=null,t(a)}):t(""):t("")}else t("")})}exports.defaultName=p;exports.getCompoName=$;exports.getCompoNameKey=Q;exports.getCompoNameObj=g;exports.getKeyMds=D;exports.getLocalTextArr=J;exports.getLocalTextComponents=z;exports.getLocalTextTests=K;exports.getTestImportUrl=T;exports.getTestName=W;exports.getTestNameObj=B;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/vue-archive",
3
3
  "private": false,
4
- "version": "0.0.2-14",
4
+ "version": "0.0.2-16",
5
5
  "type": "module",
6
6
  "description ": "vue 组件注释生成文档",
7
7
  "author": "fangzhongya ",