@fangzhongya/vue-archive 0.0.96 → 0.0.98

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.
@@ -1,50 +1,50 @@
1
- import { getConfig as A } from "../config.js";
2
- import { getVueTexts as H } from "@fangzhongya/utils/html/getVueText";
3
- import { getRawValue as R, isComprops as K, isCurprops as S, getComponentsArr as q, defaultExtensions as E } from "./common.js";
4
- import { mergeObject as D } from "@fangzhongya/utils/basic/object/mergeObject";
1
+ import { getConfig as v } from "../config.js";
2
+ import { getVueTexts as B } from "@fangzhongya/utils/html/getVueText";
3
+ import { getRawValue as R, isComprops as z, isCurprops as F, getComponentsArr as G, defaultExtensions as E } from "./common.js";
4
+ import { mergeObject as H } from "@fangzhongya/utils/basic/object/mergeObject";
5
5
  import "@fangzhongya/utils/basic/array/toggleArray";
6
- import { humpToLine as C } from "@fangzhongya/utils/name/humpToLine";
7
- import { lineToLargeHump as I } from "@fangzhongya/utils/name/lineToLargeHump";
6
+ import { humpToLine as N } from "@fangzhongya/utils/name/humpToLine";
7
+ import { lineToLargeHump as S } from "@fangzhongya/utils/name/lineToLargeHump";
8
8
  import "@fangzhongya/utils/basic/string/appearNum";
9
9
  import { firstLower as V } from "@fangzhongya/utils/basic/string/firstLower";
10
- import { duplicateRemoval as J } from "@fangzhongya/utils/basic/array/duplicateRemoval";
11
- import { asyncMergeArray as U } from "@fangzhongya/utils/basic/array/asyncMergeArray";
10
+ import { duplicateRemoval as D } from "@fangzhongya/utils/basic/array/duplicateRemoval";
11
+ import { asyncMergeArray as I } from "@fangzhongya/utils/basic/array/asyncMergeArray";
12
12
  import "@fangzhongya/utils/basic/string/firstUpper";
13
13
  import { getSuffix as g } from "@fangzhongya/utils/urls/getSuffix";
14
14
  import "@fangzhongya/utils/basic/array/replaceAfter";
15
- import { getTextImport as Q } from "./index.js";
16
- const h = {}, x = {}, M = [], v = {}, P = {}, m = {};
17
- function X() {
18
- return A("example");
15
+ import { getTextImport as J } from "./index.js";
16
+ const h = {}, x = {}, K = [], U = {}, b = {}, m = {};
17
+ function Q() {
18
+ return v("example");
19
19
  }
20
- function Y(t, e, n, r) {
21
- const a = D(e, n || {}, 3, !0);
20
+ function X(t, e, n, r) {
21
+ const a = H(e, n || {}, 3, !0);
22
22
  a.exampless = a.exampless || [], a.examplessRaw = a.examplessRaw || [];
23
23
  const s = [], i = a.examples;
24
24
  i && Object.keys(i).forEach((o) => {
25
- s.push(o), P[o] = i[o];
25
+ s.push(o), b[o] = i[o];
26
26
  });
27
27
  const l = a.examplesRaw, f = [];
28
28
  if (a.urls && a.urls.length > 0 ? (a.exampless = a.urls, a.urls.forEach((o) => {
29
- f.push(o), l && (m[o] = j(l, o));
29
+ f.push(o), l && (m[o] = C(l, o));
30
30
  })) : (a.exampless = s, l && Object.keys(l).forEach((o) => {
31
- f.push(o), m[o] = j(l, o);
31
+ f.push(o), m[o] = C(l, o);
32
32
  })), a.examples = void 0, e.tests && r) {
33
33
  const o = e.testsNanme || "/tests/";
34
34
  typeof o == "string" ? Object.keys(r).forEach((c) => {
35
- c.includes(o) && (a.exampless.push(c), f.push(c), m[c] = j(r, c));
35
+ c.includes(o) && (a.exampless.push(c), f.push(c), m[c] = C(r, c));
36
36
  }) : Object.keys(r).forEach((c) => {
37
- o.test(c) && (a.exampless.push(c), f.push(c), m[c] = j(r, c));
37
+ o.test(c) && (a.exampless.push(c), f.push(c), m[c] = C(r, c));
38
38
  });
39
39
  }
40
- a.exampless = [...new Set(a.exampless)], a.examplessRaw = [...new Set(f)], a.examplesRaw = void 0, v[t] = a;
40
+ a.exampless = [...new Set(a.exampless)], a.examplessRaw = [...new Set(f)], a.examplesRaw = void 0, U[t] = a;
41
41
  }
42
- function j(t, e) {
42
+ function C(t, e) {
43
43
  return typeof t == "function" ? t : t && (t[e] || t);
44
44
  }
45
45
  const L = {};
46
- function Z(t) {
47
- const e = A("resolve");
46
+ function Y(t) {
47
+ const e = v("resolve");
48
48
  if (L[t])
49
49
  return L[t];
50
50
  for (let n of e)
@@ -53,30 +53,30 @@ function Z(t) {
53
53
  return L[t] = a, a;
54
54
  }
55
55
  }
56
- async function _(t, e) {
56
+ async function Z(t, e) {
57
57
  let n = "";
58
- if (e == "vue" ? n = H(t).script : (e == "js" || e == "ts" || e == "") && (n = t), n) {
59
- const r = await Q(n), a = [];
58
+ if (e == "vue" ? n = B(t).script : (e == "js" || e == "ts" || e == "") && (n = t), n) {
59
+ const r = await J(n), a = [];
60
60
  return r && r.length > 0 && r.forEach((s) => {
61
61
  if (s)
62
62
  if (s.startsWith("./") || s.startsWith("../"))
63
63
  a.push(s);
64
64
  else {
65
- const i = Z(s);
65
+ const i = Y(s);
66
66
  i && a.push(i);
67
67
  }
68
68
  }), a;
69
69
  }
70
70
  }
71
- function We(t) {
71
+ function Le(t) {
72
72
  return new Promise((e) => {
73
73
  t ? t.raw ? e(t.raw) : t.getRaw ? t.getRaw(t).then((n) => {
74
- const r = b(n);
74
+ const r = P(n);
75
75
  t.raw = r, t.getRaw = null, e(r);
76
76
  }) : e("") : e("");
77
77
  });
78
78
  }
79
- function z(t, e) {
79
+ function _(t, e) {
80
80
  t = (t || "") + "";
81
81
  let n = "";
82
82
  switch (t) {
@@ -94,18 +94,18 @@ function z(t, e) {
94
94
  }
95
95
  function y(t, e, n) {
96
96
  t = (t || "") + "", n = (n || "") + "";
97
- let r = C(e.name), a = [];
97
+ let r = N(e.name), a = [];
98
98
  t === "1" ? e.alias && a.push(e.alias + "-" + r) : t === "3" ? e.alias && e.alias + "" : t === "4" ? e.aliasNames?.forEach((i) => {
99
- a.push(C(i));
99
+ a.push(N(i));
100
100
  }) : t == "9" && (a.push(r), e.aliasNames?.forEach((i) => {
101
- a.push(C(i));
101
+ a.push(N(i));
102
102
  })), a.length == 0 && a.push(r);
103
103
  let s = [];
104
104
  return n === "1" ? a.forEach((i) => {
105
- let l = I(i);
105
+ let l = S(i);
106
106
  s.push(l, V(l));
107
107
  }) : n === "2" ? a.forEach((i) => {
108
- let l = I(i);
108
+ let l = S(i);
109
109
  s.push(i, l, V(l));
110
110
  }) : s = [...a], s = [...new Set(s)], s;
111
111
  }
@@ -137,7 +137,7 @@ function $(t) {
137
137
  if (e.tests && Object.keys(e.tests).length > 0)
138
138
  return e.tests;
139
139
  {
140
- const n = v[e.dir], r = n.dir + z(n.level || 0, e), a = y(
140
+ const n = U[e.dir], r = n.dir + _(n.level || 0, e), a = y(
141
141
  n.aliaslevel || 0,
142
142
  e,
143
143
  n.componentName || 0
@@ -167,7 +167,7 @@ function $(t) {
167
167
  key: i,
168
168
  dir: e.dir,
169
169
  url: i,
170
- component: P[i],
170
+ component: b[i],
171
171
  raw: "",
172
172
  getRaw: R(m, i)
173
173
  };
@@ -214,7 +214,7 @@ function ee(t, e, n) {
214
214
  key: s,
215
215
  dir: e.dir,
216
216
  url: s,
217
- component: P[s],
217
+ component: b[s],
218
218
  raw: "",
219
219
  getRaw: R(m, s)
220
220
  };
@@ -255,7 +255,7 @@ function ee(t, e, n) {
255
255
  key: s,
256
256
  dir: e.dir,
257
257
  url: s,
258
- component: P[s],
258
+ component: b[s],
259
259
  raw: "",
260
260
  getRaw: R(m, s)
261
261
  };
@@ -264,14 +264,14 @@ function ee(t, e, n) {
264
264
  }
265
265
  });
266
266
  }
267
- function Le(t) {
267
+ function ve(t) {
268
268
  if (t) {
269
269
  const e = $(t);
270
270
  return Object.values(e);
271
271
  } else
272
272
  return [];
273
273
  }
274
- function Ae(t, e, n) {
274
+ function $e(t, e, n) {
275
275
  T();
276
276
  const r = $(n), a = [];
277
277
  if (e) {
@@ -283,11 +283,11 @@ function Ae(t, e, n) {
283
283
  s.name + "/" + s.value == t && a.push(s);
284
284
  }), a;
285
285
  }
286
- function $e(t) {
286
+ function Ae(t) {
287
287
  return $(t), h[t].mds;
288
288
  }
289
- async function B(t, e, n) {
290
- let r = t.key, a = t.dir, s = t.url, i = t.comprops, l = t.curprops, f = await _(e, n || t.suffix) || [], o = s.split("/");
289
+ async function te(t, e, n) {
290
+ let r = t.key, a = t.dir, s = t.url, i = t.comprops, l = t.curprops, f = await Z(e, n || t.suffix) || [], o = s.split("/");
291
291
  return f.map((c) => {
292
292
  if (c.startsWith("./")) {
293
293
  let u = o.slice(0, o.length - 1).join("/"), p = c.substring(2);
@@ -307,16 +307,16 @@ async function B(t, e, n) {
307
307
  };
308
308
  } else if (c.startsWith("../")) {
309
309
  let u = c.split("/"), p = 0;
310
- for (let N = 0; N < u.length; N++)
311
- if (u[N] != "..") {
312
- p = N;
310
+ for (let j = 0; j < u.length; j++)
311
+ if (u[j] != "..") {
312
+ p = j;
313
313
  break;
314
314
  }
315
315
  let w = u.slice(p, u.length), d = o.slice(0, o.length - p - 1).join("/"), O = w.join("/");
316
316
  const W = d.replace(/^\.\/|((\.\.\/)+)/, "/");
317
- let G = r.indexOf(W) + W.length;
317
+ let q = r.indexOf(W) + W.length;
318
318
  return {
319
- key: r.substring(0, G) + "/" + O,
319
+ key: r.substring(0, q) + "/" + O,
320
320
  name: O,
321
321
  cwd: t.cwd,
322
322
  comprops: i,
@@ -345,7 +345,7 @@ async function B(t, e, n) {
345
345
  }
346
346
  });
347
347
  }
348
- function Ie(t) {
348
+ function Se(t) {
349
349
  return new Promise((e) => {
350
350
  if (t && t.length > 0) {
351
351
  let n = t.map((r) => ({
@@ -354,9 +354,9 @@ function Ie(t) {
354
354
  suffix: g(r.key),
355
355
  getRaw: R(m, r.key)
356
356
  }));
357
- U(n, (r, a, s, i) => {
357
+ I(n, (r, a, s, i) => {
358
358
  s.raw ? r() : s.getRaw ? s.getRaw(s).then((l) => {
359
- const f = b(l);
359
+ const f = P(l);
360
360
  s.raw = f, s.getRaw = null, r();
361
361
  }) : r();
362
362
  }).then(() => {
@@ -366,50 +366,50 @@ function Ie(t) {
366
366
  e([]);
367
367
  });
368
368
  }
369
- function te() {
370
- const t = X();
371
- A("components")?.forEach((n) => {
372
- const r = ae(n);
369
+ function se() {
370
+ const t = Q();
371
+ v("components")?.forEach((n) => {
372
+ const r = ie(n);
373
373
  let a = n.dir || "";
374
- Y(a, t, n.example, r);
374
+ X(a, t, n.example, r);
375
375
  });
376
376
  }
377
- const se = "default";
378
- function ne(t) {
379
- let e = C(t.name), n = [...t.aliasNames];
377
+ const ne = "default";
378
+ function re(t) {
379
+ let e = N(t.name), n = [...t.aliasNames];
380
380
  n.push(e), n.forEach((r) => {
381
- M.push({
381
+ K.push({
382
382
  name: r,
383
383
  value: t.key
384
384
  });
385
385
  });
386
386
  }
387
- function re(t, e) {
387
+ function ae(t, e) {
388
388
  e?.forEach((n) => {
389
- h[n.key] = n, ne(n);
389
+ h[n.key] = n, re(n);
390
390
  });
391
391
  }
392
- function ae(t) {
392
+ function ie(t) {
393
393
  let e, n;
394
394
  const r = t.resolver;
395
395
  r && Object.keys(r).forEach((s) => {
396
396
  typeof t[s] > "u" && (t[s] = r[s]);
397
- }), e = t.alias || se;
397
+ }), e = t.alias || ne;
398
398
  let a = t?.urls || Object.keys(t.componentsRaw);
399
- return n = q(a, t, t.componentsRaw, t.components), n && n?.props && n.props.forEach((s) => {
399
+ return n = G(a, t, t.componentsRaw, t.components), n && n?.props && n.props.forEach((s) => {
400
400
  x[s.url] = s;
401
- }), re(e, n.components), t.componentsRaw;
401
+ }), ae(e, n.components), t.componentsRaw;
402
402
  }
403
403
  function Ve(t) {
404
404
  return T(), h[t];
405
405
  }
406
406
  function T() {
407
- return Object.keys(h).length == 0 && te(), Object.values(h);
407
+ return Object.keys(h).length == 0 && se(), Object.values(h);
408
408
  }
409
- function Ke() {
409
+ function Ie() {
410
410
  return T(), x;
411
411
  }
412
- function Se(t, e, n) {
412
+ function Ke(t, e, n) {
413
413
  T();
414
414
  const r = [];
415
415
  if (n) {
@@ -417,18 +417,10 @@ function Se(t, e, n) {
417
417
  if (s && s.key)
418
418
  return [s];
419
419
  }
420
- let a = C(t);
421
- return M.forEach((s) => {
420
+ let a = N(t);
421
+ return K.forEach((s) => {
422
422
  e ? s.name.includes(a) && r.push(h[s.value]) : s.name == a && r.push(h[s.value]);
423
- }), J(r, "key");
424
- }
425
- async function ie(t, e) {
426
- let n = t;
427
- if (t) {
428
- let r = (await B(e, t)).filter((a) => K(a.key, e.comprops) || S(a.key, e.curprops));
429
- n = await F(r) + n;
430
- }
431
- return n;
423
+ }), D(r, "key");
432
424
  }
433
425
  function le(t) {
434
426
  const e = t.url, n = t.key;
@@ -438,11 +430,10 @@ function oe(t) {
438
430
  return new Promise((e) => {
439
431
  if (t && t.length > 0) {
440
432
  let n = t.map((r) => le(r)).filter((r) => !!r);
441
- U(n, (r, a, s, i) => {
433
+ I(n, (r, a, s, i) => {
442
434
  s.raw ? r() : s.getRaw ? s.getRaw(s).then(async (l) => {
443
- const f = b(l);
444
- let o = await ie(f, t[i]);
445
- s.raw = o, s.getRaw = null, r();
435
+ const f = P(l);
436
+ s.raw = await M(f, t[i]), s.getRaw = null, r();
446
437
  }) : r();
447
438
  }).then(() => {
448
439
  e(n);
@@ -451,19 +442,29 @@ function oe(t) {
451
442
  e([]);
452
443
  });
453
444
  }
454
- async function F(t) {
455
- return ((await oe(t))?.map((r) => r.raw) || []).join(`
445
+ const A = `
446
+ fangzhongya@vue-archive@glob@vue-archive@fangzhongya
447
+ `;
448
+ function fe(t) {
449
+ const e = t.split(A);
450
+ return [...new Set(e)].join(`
456
451
  `);
457
452
  }
458
- async function fe(t, e) {
459
- let n = t;
460
- if (t && (e.comprops || e.curprops)) {
461
- let r = (await B(e, t)).filter((s) => K(s.key, e.comprops) || S(s.key, e.curprops));
462
- n = await F(r) + n;
453
+ async function ce(t) {
454
+ return ((await oe(t))?.map((r) => r.raw) || []).filter((r) => !!r).join(A);
455
+ }
456
+ async function M(t, e) {
457
+ if (t) {
458
+ if (t = `/**${e.url}**/
459
+ ` + t, e.comprops || e.curprops) {
460
+ let n = (await te(e, t)).filter((r) => z(r.key, e.comprops) || F(r.key, e.curprops));
461
+ return t + A + await ce(n);
462
+ }
463
+ return t;
463
464
  }
464
- return n;
465
+ return "";
465
466
  }
466
- function b(t) {
467
+ function P(t) {
467
468
  return t && typeof t == "object" ? t.default || "" : (t || "") + "";
468
469
  }
469
470
  function Ue(t) {
@@ -472,9 +473,10 @@ function Ue(t) {
472
473
  T();
473
474
  const n = h[t];
474
475
  n ? n.raw ? e(n.raw) : n.getRaw ? n.getRaw(n).then((r) => {
475
- const a = b(r);
476
- fe(a, n).then((s) => {
477
- n.raw = s, n.getRaw = null, e(s);
476
+ const a = P(r);
477
+ M(a, n).then((s) => {
478
+ const i = fe(s);
479
+ n.raw = i, n.getRaw = null, e(i);
478
480
  });
479
481
  }) : e("") : e("");
480
482
  } else
@@ -482,19 +484,19 @@ function Ue(t) {
482
484
  });
483
485
  }
484
486
  export {
485
- se as defaultName,
486
- Se as getCompoName,
487
+ ne as defaultName,
488
+ Ke as getCompoName,
487
489
  Ve as getCompoNameKey,
488
490
  T as getCompoNameObj,
489
- Ke as getComponentPropsObjs,
490
- b as getGetRawValue,
491
- $e as getKeyMds,
492
- z as getLevelUrl,
493
- Ie as getLocalTextArr,
491
+ Ie as getComponentPropsObjs,
492
+ P as getGetRawValue,
493
+ Ae as getKeyMds,
494
+ _ as getLevelUrl,
495
+ Se as getLocalTextArr,
494
496
  Ue as getLocalTextComponents,
495
- We as getLocalTextTests,
497
+ Le as getLocalTextTests,
496
498
  oe as getPropsRaws,
497
- B as getTestImportUrl,
498
- Le as getTestName,
499
- Ae as getTestNameObj
499
+ te as getTestImportUrl,
500
+ ve as getTestName,
501
+ $e as getTestNameObj
500
502
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/vue-archive",
3
3
  "private": false,
4
- "version": "0.0.96",
4
+ "version": "0.0.98",
5
5
  "type": "module",
6
6
  "description ": "vue 组件注释生成文档",
7
7
  "author": "fangzhongya ",
@@ -18,35 +18,35 @@
18
18
  "registry": "https://registry.npmjs.org/"
19
19
  },
20
20
  "devDependencies": {
21
- "@codemirror/autocomplete": "6.19.0",
21
+ "@codemirror/autocomplete": "6.19.1",
22
22
  "@codemirror/lang-css": "^6.3.1",
23
23
  "@codemirror/lang-html": "^6.4.11",
24
24
  "@codemirror/lang-javascript": "^6.2.4",
25
25
  "@codemirror/lang-json": "^6.0.2",
26
26
  "@codemirror/state": "^6.5.2",
27
27
  "@codemirror/view": "^6.38.6",
28
- "@fangzhongya/create": "0.2.34",
29
- "@fangzhongya/utils": "0.0.35",
30
- "@fangzhongya/vue-components": "0.1.18",
28
+ "@fangzhongya/create": "0.2.41",
29
+ "@fangzhongya/utils": "0.0.46",
30
+ "@fangzhongya/vue-components": "0.1.20",
31
31
  "@highlightjs/vue-plugin": "^2.1.0",
32
- "@types/node": "^24.8.0",
32
+ "@types/node": "^24.10.1",
33
33
  "@vitejs/plugin-vue": "^6.0.1",
34
- "@vue/compiler-dom": "3.5.22",
35
- "@vue/compiler-sfc": "3.5.22",
36
- "@vue/runtime-dom": "3.5.22",
37
- "@vue/server-renderer": "3.5.22",
38
- "@vue/shared": "3.5.22",
34
+ "@vue/compiler-dom": "3.5.24",
35
+ "@vue/compiler-sfc": "3.5.24",
36
+ "@vue/runtime-dom": "3.5.24",
37
+ "@vue/server-renderer": "3.5.24",
38
+ "@vue/shared": "3.5.24",
39
39
  "codemirror": "^6.0.2",
40
40
  "fast-glob": "^3.3.3",
41
- "sass": "^1.93.2",
41
+ "sass": "^1.94.0",
42
42
  "ts-node": "^10.9.2",
43
- "tsup": "^8.5.0",
43
+ "tsup": "^8.5.1",
44
44
  "typescript": "^5.9.3",
45
- "unplugin-vue-components": "^29.1.0",
46
- "vite": "^7.1.10",
45
+ "unplugin-vue-components": "^30.0.0",
46
+ "vite": "^7.2.2",
47
47
  "vite-plugin-dts": "4.5.4",
48
- "vitest": "^3.2.4",
49
- "vue-tsc": "^3.1.1"
48
+ "vitest": "^4.0.8",
49
+ "vue-tsc": "^3.1.3"
50
50
  },
51
51
  "dependencies": {
52
52
  "comment-parser": "^1.4.1",
@@ -54,7 +54,7 @@
54
54
  "markdown-it": "^14.1.0",
55
55
  "monaco-editor": "^0.54.0",
56
56
  "prettier": "^3.6.2",
57
- "vue": "^3.5.22",
57
+ "vue": "^3.5.24",
58
58
  "vue-router": "^4.6.3"
59
59
  },
60
60
  "types": "./dist/packages/index.d.ts",