@fangzhongya/vue-components 0.1.29 → 0.1.30

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.
Files changed (61) hide show
  1. package/dist/archive.cjs +190 -340
  2. package/dist/archive.d.cts +5 -4
  3. package/dist/archive.d.ts +5 -4
  4. package/dist/archive.js +190 -341
  5. package/dist/chunk-J7CICTHH-DzD10422.cjs +25 -0
  6. package/dist/chunk-J7CICTHH-Ikr5rmAQ.js +20 -0
  7. package/dist/component-B-5G8Yjc.js +431 -0
  8. package/dist/component-CVkcT_sw.cjs +459 -0
  9. package/dist/component.cjs +2 -8
  10. package/dist/component.d.cts +14 -14
  11. package/dist/component.d.ts +15 -14
  12. package/dist/component.js +2 -8
  13. package/dist/config.cjs +59 -6
  14. package/dist/config.d.cts +134 -133
  15. package/dist/config.d.ts +134 -133
  16. package/dist/config.js +57 -5
  17. package/dist/import.cjs +18 -25
  18. package/dist/import.d.cts +5 -4
  19. package/dist/import.d.ts +5 -4
  20. package/dist/import.js +18 -26
  21. package/dist/imports-Cl3zPCxJ.cjs +971 -0
  22. package/dist/imports-DLu2DPCK.js +966 -0
  23. package/dist/imports.cjs +2 -8
  24. package/dist/imports.d.cts +14 -14
  25. package/dist/imports.d.ts +15 -14
  26. package/dist/imports.js +2 -8
  27. package/dist/index-5NuL-vgA.d.ts +5609 -0
  28. package/dist/index-DORWvPc3.d.cts +5609 -0
  29. package/dist/index.cjs +8 -17
  30. package/dist/index.d.cts +7 -8
  31. package/dist/index.d.ts +7 -8
  32. package/dist/index.js +6 -17
  33. package/dist/library.cjs +32 -48
  34. package/dist/library.d.cts +7 -6
  35. package/dist/library.d.ts +7 -6
  36. package/dist/library.js +32 -49
  37. package/dist/resolver.cjs +25 -10
  38. package/dist/resolver.d.cts +5 -4
  39. package/dist/resolver.d.ts +5 -4
  40. package/dist/resolver.js +24 -10
  41. package/dist/types-CZdqb5KI-T7Ielv5Y.d.cts +134 -0
  42. package/dist/types-CZdqb5KI-T7Ielv5Y.d.ts +134 -0
  43. package/dist/util-Ddld3oFr.js +93 -0
  44. package/dist/util-DtBzae46.cjs +116 -0
  45. package/dist/util.cjs +8 -16
  46. package/dist/util.d.cts +104 -5
  47. package/dist/util.d.ts +104 -5
  48. package/dist/util.js +3 -16
  49. package/package.json +10 -10
  50. package/dist/chunk-2SBJQUCI.cjs +0 -1238
  51. package/dist/chunk-3XFEJIQP.js +0 -135
  52. package/dist/chunk-6PYVVU7E.cjs +0 -581
  53. package/dist/chunk-7JRVVHVI.cjs +0 -33
  54. package/dist/chunk-AKNB7BKJ.cjs +0 -25
  55. package/dist/chunk-DURXCSNX.js +0 -62
  56. package/dist/chunk-HFFYPZA3.js +0 -1238
  57. package/dist/chunk-IXN2F3IJ.js +0 -581
  58. package/dist/chunk-NLSI7A24.cjs +0 -135
  59. package/dist/chunk-RRQV2YXW.js +0 -33
  60. package/dist/chunk-TVGK2KRP.js +0 -25
  61. package/dist/chunk-UNBQUEQ4.cjs +0 -62
package/dist/archive.js CHANGED
@@ -1,353 +1,202 @@
1
- import {
2
- component_default
3
- } from "./chunk-IXN2F3IJ.js";
4
- import {
5
- config
6
- } from "./chunk-DURXCSNX.js";
7
- import {
8
- unmergeObject
9
- } from "./chunk-3XFEJIQP.js";
10
- import "./chunk-TVGK2KRP.js";
11
-
12
- // packages/archive.ts
13
- import { writeFile } from "fs";
14
- import { resolve } from "path";
15
-
16
- // node_modules/.pnpm/@fangzhongya+utils@0.0.75/node_modules/@fangzhongya/utils/dist/chunk-ZADO6V3Z.js
1
+ import { config } from "./config.js";
2
+ import { r as unmergeObject } from "./util-Ddld3oFr.js";
3
+ import { t as FangComponent } from "./component-B-5G8Yjc.js";
4
+ import { writeFile } from "node:fs";
5
+ import { resolve } from "node:path";
6
+ //#region node_modules/.pnpm/@fangzhongya+utils@0.0.80/node_modules/@fangzhongya/utils/dist/chunk-ZADO6V3Z.js
17
7
  var TYPE_MARKERS = {
18
- // 对象引用
19
- CIRCULAR_REF: "_CR_",
20
- // 新增:循环引用标记
21
- FUNCTION_REF: "_FR_",
22
- CODE_BLOCK: "_CB_",
23
- /**内置对象*/
24
- SYMBOL: "_Sy_",
25
- FUNCTION: "_F_",
26
- UNDEFINED: "_UN_",
27
- DATE: "_D_",
28
- REGEXP: "_R_",
29
- NAN: "_N_",
30
- BIGINT: "_BI_",
31
- MAP: "_M_",
32
- SET: "_S_",
33
- ARRAY_BUFFER: "_AB_",
34
- TYPED_ARRAY: "_TA_",
35
- DATA_VIEW: "_DV_",
36
- ERROR: "_E_",
37
- URL: "_U_",
38
- INFINITY: "_I_",
39
- NEGATIVE_INFINITY: "_NI_",
40
- INT8_ARRAY: "_I8_",
41
- UINT8_ARRAY: "_U8_",
42
- UINT8_CLAMPED_ARRAY: "_U8C_",
43
- INT16_ARRAY: "_I1_",
44
- UINT16_ARRAY: "_U1_",
45
- INT32_ARRAY: "_I3_",
46
- UINT32_ARRAY: "_U3_",
47
- FLOAT32_ARRAY: "_F3_",
48
- FLOAT64_ARRAY: "_F6_",
49
- BIGINT64_ARRAY: "_BI6_",
50
- BIGUINT64_ARRAY: "_BU6_"
8
+ CIRCULAR_REF: "_CR_",
9
+ FUNCTION_REF: "_FR_",
10
+ CODE_BLOCK: "_CB_",
11
+ /**内置对象*/
12
+ SYMBOL: "_Sy_",
13
+ FUNCTION: "_F_",
14
+ UNDEFINED: "_UN_",
15
+ DATE: "_D_",
16
+ REGEXP: "_R_",
17
+ NAN: "_N_",
18
+ BIGINT: "_BI_",
19
+ MAP: "_M_",
20
+ SET: "_S_",
21
+ ARRAY_BUFFER: "_AB_",
22
+ TYPED_ARRAY: "_TA_",
23
+ DATA_VIEW: "_DV_",
24
+ ERROR: "_E_",
25
+ URL: "_U_",
26
+ INFINITY: "_I_",
27
+ NEGATIVE_INFINITY: "_NI_",
28
+ INT8_ARRAY: "_I8_",
29
+ UINT8_ARRAY: "_U8_",
30
+ UINT8_CLAMPED_ARRAY: "_U8C_",
31
+ INT16_ARRAY: "_I1_",
32
+ UINT16_ARRAY: "_U1_",
33
+ INT32_ARRAY: "_I3_",
34
+ UINT32_ARRAY: "_U3_",
35
+ FLOAT32_ARRAY: "_F3_",
36
+ FLOAT64_ARRAY: "_F6_",
37
+ BIGINT64_ARRAY: "_BI6_",
38
+ BIGUINT64_ARRAY: "_BU6_"
51
39
  };
52
40
  var arrayBufferUtils = {
53
- // 将ArrayBuffer编码为Base64字符串
54
- encode: (buffer) => {
55
- if (typeof Buffer !== "undefined") {
56
- const bytes = new Uint8Array(buffer);
57
- let binary = "";
58
- bytes.forEach((byte) => binary += String.fromCharCode(byte));
59
- return btoa(binary);
60
- }
61
- if (typeof btoa === "function") {
62
- const bytes = new Uint8Array(buffer);
63
- let binary = "";
64
- for (let i = 0; i < bytes.byteLength; i++) {
65
- binary += String.fromCharCode(bytes[i]);
66
- }
67
- return btoa(binary);
68
- }
69
- throw new Error(
70
- "ArrayBuffer encoding not supported in this environment"
71
- );
72
- },
73
- // 将Base64字符串解码为ArrayBuffer
74
- decode: (base64Str) => {
75
- if (typeof Buffer !== "undefined") {
76
- const binaryString = atob(base64Str);
77
- const bytes = new Uint8Array(binaryString.length);
78
- for (let i = 0; i < binaryString.length; i++) {
79
- bytes[i] = binaryString.charCodeAt(i);
80
- }
81
- return bytes.buffer;
82
- }
83
- if (typeof atob === "function") {
84
- const binaryString = atob(base64Str);
85
- const bytes = new Uint8Array(binaryString.length);
86
- for (let i = 0; i < binaryString.length; i++) {
87
- bytes[i] = binaryString.charCodeAt(i);
88
- }
89
- return bytes.buffer;
90
- }
91
- throw new Error(
92
- "ArrayBuffer decoding not supported in this environment"
93
- );
94
- },
95
- // 获取ArrayBuffer的字节数组表示
96
- toByteArray: (buffer) => {
97
- return Array.from(new Uint8Array(buffer));
98
- },
99
- // 从字节数组创建ArrayBuffer
100
- fromByteArray: (array) => {
101
- const buffer = new ArrayBuffer(array.length);
102
- const view = new Uint8Array(buffer);
103
- array.forEach((value, index) => view[index] = value);
104
- return buffer;
105
- }
41
+ encode: (buffer) => {
42
+ if (typeof Buffer !== "undefined") {
43
+ const bytes = new Uint8Array(buffer);
44
+ let binary = "";
45
+ bytes.forEach((byte) => binary += String.fromCharCode(byte));
46
+ return btoa(binary);
47
+ }
48
+ if (typeof btoa === "function") {
49
+ const bytes = new Uint8Array(buffer);
50
+ let binary = "";
51
+ for (let i = 0; i < bytes.byteLength; i++) binary += String.fromCharCode(bytes[i]);
52
+ return btoa(binary);
53
+ }
54
+ throw new Error("ArrayBuffer encoding not supported in this environment");
55
+ },
56
+ decode: (base64Str) => {
57
+ if (typeof Buffer !== "undefined") {
58
+ const binaryString = atob(base64Str);
59
+ const bytes = new Uint8Array(binaryString.length);
60
+ for (let i = 0; i < binaryString.length; i++) bytes[i] = binaryString.charCodeAt(i);
61
+ return bytes.buffer;
62
+ }
63
+ if (typeof atob === "function") {
64
+ const binaryString = atob(base64Str);
65
+ const bytes = new Uint8Array(binaryString.length);
66
+ for (let i = 0; i < binaryString.length; i++) bytes[i] = binaryString.charCodeAt(i);
67
+ return bytes.buffer;
68
+ }
69
+ throw new Error("ArrayBuffer decoding not supported in this environment");
70
+ },
71
+ toByteArray: (buffer) => {
72
+ return Array.from(new Uint8Array(buffer));
73
+ },
74
+ fromByteArray: (array) => {
75
+ const buffer = new ArrayBuffer(array.length);
76
+ const view = new Uint8Array(buffer);
77
+ array.forEach((value, index) => view[index] = value);
78
+ return buffer;
79
+ }
106
80
  };
107
81
  function getObjectPath(obj, key, seen) {
108
- if (obj === null || obj === void 0) {
109
- return String(key);
110
- }
111
- if (!Object.prototype.hasOwnProperty.call(obj, key)) {
112
- return String(key);
113
- }
114
- const objPath = seen.get(obj);
115
- if (objPath) {
116
- return Array.isArray(obj) ? `${objPath}[${key}]` : `${objPath}.${key}`;
117
- }
118
- const path = `root${key}`;
119
- if (typeof obj === "object" && obj !== null && !seen.has(obj)) {
120
- seen.set(obj, path);
121
- }
122
- return path;
82
+ if (obj === null || obj === void 0) return String(key);
83
+ if (!Object.prototype.hasOwnProperty.call(obj, key)) return String(key);
84
+ const objPath = seen.get(obj);
85
+ if (objPath) return Array.isArray(obj) ? `${objPath}[${key}]` : `${objPath}.${key}`;
86
+ const path = `root${key}`;
87
+ if (typeof obj === "object" && obj !== null && !seen.has(obj)) seen.set(obj, path);
88
+ return path;
123
89
  }
124
90
  function toJSONSStringify(obj, space, filtrat = "__") {
125
- const seen = /* @__PURE__ */ new WeakMap();
126
- return JSON.stringify(
127
- obj,
128
- function(key, value) {
129
- const fullPath = this === null || this === void 0 ? key : getObjectPath(this, key, seen);
130
- if (filtrat && key.startsWith(filtrat)) {
131
- return void 0;
132
- }
133
- if (value === null) {
134
- return null;
135
- }
136
- if (typeof value === "object" && value !== null) {
137
- const existingPath = seen.get(value);
138
- if (existingPath && existingPath !== fullPath) {
139
- return {
140
- [TYPE_MARKERS.CIRCULAR_REF]: existingPath
141
- };
142
- }
143
- if (!seen.has(value)) {
144
- seen.set(value, fullPath);
145
- }
146
- }
147
- if (this[key] instanceof Date) {
148
- return {
149
- [TYPE_MARKERS.DATE]: this[key].getTime()
150
- };
151
- }
152
- if (this[key] instanceof URL) {
153
- return {
154
- [TYPE_MARKERS.URL]: this[key].href
155
- };
156
- }
157
- if (value === Infinity) {
158
- return { [TYPE_MARKERS.INFINITY]: 1 };
159
- }
160
- if (value === -Infinity) {
161
- return { [TYPE_MARKERS.NEGATIVE_INFINITY]: 1 };
162
- }
163
- if (value === void 0) {
164
- return { [TYPE_MARKERS.UNDEFINED]: 1 };
165
- }
166
- if (Object.is(value, NaN)) {
167
- return { [TYPE_MARKERS.NAN]: 1 };
168
- }
169
- switch (typeof value) {
170
- case "bigint":
171
- return { [TYPE_MARKERS.BIGINT]: value.toString() };
172
- case "symbol":
173
- return {
174
- [TYPE_MARKERS.SYMBOL]: {
175
- k: Symbol.keyFor(value) ?? 0,
176
- d: value.description || ""
177
- }
178
- };
179
- case "function":
180
- return {
181
- [TYPE_MARKERS.FUNCTION]: value.toString()
182
- };
183
- case "object":
184
- if (value instanceof RegExp) {
185
- return {
186
- [TYPE_MARKERS.REGEXP]: {
187
- s: value.source,
188
- f: value.flags
189
- }
190
- };
191
- }
192
- if (value instanceof Map) {
193
- return {
194
- [TYPE_MARKERS.MAP]: Array.from(value.entries())
195
- };
196
- }
197
- if (value instanceof Set) {
198
- return {
199
- [TYPE_MARKERS.SET]: Array.from(value.values())
200
- };
201
- }
202
- if (value instanceof ArrayBuffer) {
203
- return {
204
- [TYPE_MARKERS.ARRAY_BUFFER]: arrayBufferUtils.encode(value)
205
- };
206
- }
207
- if (value instanceof Int8Array) {
208
- return {
209
- [TYPE_MARKERS.INT8_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
210
- };
211
- }
212
- if (value instanceof Uint8Array) {
213
- return {
214
- [TYPE_MARKERS.UINT8_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
215
- };
216
- }
217
- if (value instanceof Uint8ClampedArray) {
218
- return {
219
- [TYPE_MARKERS.UINT8_CLAMPED_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
220
- };
221
- }
222
- if (value instanceof Int16Array) {
223
- return {
224
- [TYPE_MARKERS.INT16_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
225
- };
226
- }
227
- if (value instanceof Uint16Array) {
228
- return {
229
- [TYPE_MARKERS.UINT16_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
230
- };
231
- }
232
- if (value instanceof Int32Array) {
233
- return {
234
- [TYPE_MARKERS.INT32_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
235
- };
236
- }
237
- if (value instanceof Uint32Array) {
238
- return {
239
- [TYPE_MARKERS.UINT32_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
240
- };
241
- }
242
- if (value instanceof Float32Array) {
243
- return {
244
- [TYPE_MARKERS.FLOAT32_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
245
- };
246
- }
247
- if (value instanceof Float64Array) {
248
- return {
249
- [TYPE_MARKERS.FLOAT64_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
250
- };
251
- }
252
- if (value instanceof BigInt64Array) {
253
- return {
254
- [TYPE_MARKERS.BIGINT64_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
255
- };
256
- }
257
- if (value instanceof BigUint64Array) {
258
- return {
259
- [TYPE_MARKERS.BIGUINT64_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
260
- };
261
- }
262
- if (value instanceof DataView) {
263
- return {
264
- [TYPE_MARKERS.DATA_VIEW]: {
265
- b: arrayBufferUtils.encode(
266
- value.buffer
267
- ),
268
- o: value.byteOffset,
269
- l: value.byteLength
270
- }
271
- };
272
- }
273
- if (value instanceof Error) {
274
- return {
275
- [TYPE_MARKERS.ERROR]: {
276
- n: value.name,
277
- m: value.message,
278
- s: value.stack
279
- }
280
- };
281
- }
282
- }
283
- return value;
284
- },
285
- space
286
- );
91
+ const seen = /* @__PURE__ */ new WeakMap();
92
+ return JSON.stringify(obj, function(key, value) {
93
+ const fullPath = this === null || this === void 0 ? key : getObjectPath(this, key, seen);
94
+ if (filtrat && key.startsWith(filtrat)) return;
95
+ if (value === null) return null;
96
+ if (typeof value === "object" && value !== null) {
97
+ const existingPath = seen.get(value);
98
+ if (existingPath && existingPath !== fullPath) return { [TYPE_MARKERS.CIRCULAR_REF]: existingPath };
99
+ if (!seen.has(value)) seen.set(value, fullPath);
100
+ }
101
+ if (this[key] instanceof Date) return { [TYPE_MARKERS.DATE]: this[key].getTime() };
102
+ if (this[key] instanceof URL) return { [TYPE_MARKERS.URL]: this[key].href };
103
+ if (value === Infinity) return { [TYPE_MARKERS.INFINITY]: 1 };
104
+ if (value === -Infinity) return { [TYPE_MARKERS.NEGATIVE_INFINITY]: 1 };
105
+ if (value === void 0) return { [TYPE_MARKERS.UNDEFINED]: 1 };
106
+ if (Object.is(value, NaN)) return { [TYPE_MARKERS.NAN]: 1 };
107
+ switch (typeof value) {
108
+ case "bigint": return { [TYPE_MARKERS.BIGINT]: value.toString() };
109
+ case "symbol": return { [TYPE_MARKERS.SYMBOL]: {
110
+ k: Symbol.keyFor(value) ?? 0,
111
+ d: value.description || ""
112
+ } };
113
+ case "function": return { [TYPE_MARKERS.FUNCTION]: value.toString() };
114
+ case "object":
115
+ if (value instanceof RegExp) return { [TYPE_MARKERS.REGEXP]: {
116
+ s: value.source,
117
+ f: value.flags
118
+ } };
119
+ if (value instanceof Map) return { [TYPE_MARKERS.MAP]: Array.from(value.entries()) };
120
+ if (value instanceof Set) return { [TYPE_MARKERS.SET]: Array.from(value.values()) };
121
+ if (value instanceof ArrayBuffer) return { [TYPE_MARKERS.ARRAY_BUFFER]: arrayBufferUtils.encode(value) };
122
+ if (value instanceof Int8Array) return { [TYPE_MARKERS.INT8_ARRAY]: arrayBufferUtils.toByteArray(value.buffer) };
123
+ if (value instanceof Uint8Array) return { [TYPE_MARKERS.UINT8_ARRAY]: arrayBufferUtils.toByteArray(value.buffer) };
124
+ if (value instanceof Uint8ClampedArray) return { [TYPE_MARKERS.UINT8_CLAMPED_ARRAY]: arrayBufferUtils.toByteArray(value.buffer) };
125
+ if (value instanceof Int16Array) return { [TYPE_MARKERS.INT16_ARRAY]: arrayBufferUtils.toByteArray(value.buffer) };
126
+ if (value instanceof Uint16Array) return { [TYPE_MARKERS.UINT16_ARRAY]: arrayBufferUtils.toByteArray(value.buffer) };
127
+ if (value instanceof Int32Array) return { [TYPE_MARKERS.INT32_ARRAY]: arrayBufferUtils.toByteArray(value.buffer) };
128
+ if (value instanceof Uint32Array) return { [TYPE_MARKERS.UINT32_ARRAY]: arrayBufferUtils.toByteArray(value.buffer) };
129
+ if (value instanceof Float32Array) return { [TYPE_MARKERS.FLOAT32_ARRAY]: arrayBufferUtils.toByteArray(value.buffer) };
130
+ if (value instanceof Float64Array) return { [TYPE_MARKERS.FLOAT64_ARRAY]: arrayBufferUtils.toByteArray(value.buffer) };
131
+ if (value instanceof BigInt64Array) return { [TYPE_MARKERS.BIGINT64_ARRAY]: arrayBufferUtils.toByteArray(value.buffer) };
132
+ if (value instanceof BigUint64Array) return { [TYPE_MARKERS.BIGUINT64_ARRAY]: arrayBufferUtils.toByteArray(value.buffer) };
133
+ if (value instanceof DataView) return { [TYPE_MARKERS.DATA_VIEW]: {
134
+ b: arrayBufferUtils.encode(value.buffer),
135
+ o: value.byteOffset,
136
+ l: value.byteLength
137
+ } };
138
+ if (value instanceof Error) return { [TYPE_MARKERS.ERROR]: {
139
+ n: value.name,
140
+ m: value.message,
141
+ s: value.stack
142
+ } };
143
+ }
144
+ return value;
145
+ }, space);
287
146
  }
288
-
289
- // packages/archive.ts
290
- var archiveConfig = {
291
- /**
292
- * 自动导入的文件目录
293
- */
294
- dir: "./packages/",
295
- /**
296
- * 匹配文件名称和文件类型
297
- */
298
- matchexts: ["/src/index.vue"],
299
- /**
300
- * 是否去掉路径的前缀
301
- */
302
- urlprefix: true,
303
- /**
304
- * 是否生成json 配置文件
305
- */
306
- isJson: true,
307
- /**
308
- * 控制台是否输出日志
309
- */
310
- log: true,
311
- /**
312
- * 生成json 配置文件名称
313
- */
314
- jsonName: "./components.config.json"
147
+ //#endregion
148
+ //#region packages/archive.ts
149
+ const archiveConfig = {
150
+ /**
151
+ * 自动导入的文件目录
152
+ */
153
+ dir: "./packages/",
154
+ /**
155
+ * 匹配文件名称和文件类型
156
+ */
157
+ matchexts: ["/src/index.vue"],
158
+ /**
159
+ * 是否去掉路径的前缀
160
+ */
161
+ urlprefix: true,
162
+ /**
163
+ * 是否生成json 配置文件
164
+ */
165
+ isJson: true,
166
+ /**
167
+ * 控制台是否输出日志
168
+ */
169
+ log: true,
170
+ /**
171
+ * 生成json 配置文件名称
172
+ */
173
+ jsonName: "./components.config.json"
315
174
  };
316
175
  function setJson(obj) {
317
- if (obj.isJson && obj.dir) {
318
- global._ComponentsResolverArchive_ = global._ComponentsResolverArchive_ || {};
319
- global._ComponentsResolverArchive_[obj.dir] = obj;
320
- if (obj.jsonName) {
321
- let url = resolve(process.cwd(), obj.jsonName);
322
- writeFile(
323
- url,
324
- toJSONSStringify(global._ComponentsResolverArchive_, 4),
325
- "utf-8",
326
- () => {
327
- }
328
- );
329
- }
330
- }
176
+ if (obj.isJson && obj.dir) {
177
+ global._ComponentsResolverArchive_ = global._ComponentsResolverArchive_ || {};
178
+ global._ComponentsResolverArchive_[obj.dir] = obj;
179
+ if (obj.jsonName) writeFile(resolve(process.cwd(), obj.jsonName), toJSONSStringify(global._ComponentsResolverArchive_, 4), "utf-8", () => {});
180
+ }
331
181
  }
332
- function ComponentsResolverArchive(config2 = {}) {
333
- const configs = unmergeObject(config, archiveConfig, 2, true);
334
- const fangComp = new component_default(unmergeObject(configs, config2, 1));
335
- setJson(fangComp.config);
336
- return [
337
- {
338
- type: "component",
339
- resolve: (name) => {
340
- return fangComp.resolve(name, "component");
341
- }
342
- },
343
- {
344
- type: "directive",
345
- resolve: (name) => {
346
- return fangComp.resolve(name, "directive");
347
- }
348
- }
349
- ];
182
+ /**
183
+ * 自动按需匹配注册
184
+ * @returns
185
+ */
186
+ function ComponentsResolverArchive(config$1 = {}) {
187
+ const fangComp = new FangComponent(unmergeObject(unmergeObject(config, archiveConfig, 2, true), config$1, 1));
188
+ setJson(fangComp.config);
189
+ return [{
190
+ type: "component",
191
+ resolve: (name) => {
192
+ return fangComp.resolve(name, "component");
193
+ }
194
+ }, {
195
+ type: "directive",
196
+ resolve: (name) => {
197
+ return fangComp.resolve(name, "directive");
198
+ }
199
+ }];
350
200
  }
351
- export {
352
- ComponentsResolverArchive
353
- };
201
+ //#endregion
202
+ export { ComponentsResolverArchive };
@@ -0,0 +1,25 @@
1
+ //#region node_modules/.pnpm/@fangzhongya+utils@0.0.80/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
2
+ function humpToLine(name) {
3
+ const reg = /(([A-Z])([^A-Z]*))/g;
4
+ let result;
5
+ const arr = [];
6
+ let i = 0;
7
+ while ((result = reg.exec(name)) !== null) {
8
+ if (i == 0 && result.index != 0) arr.push(name.substring(0, result.index));
9
+ i++;
10
+ arr.push(result[1].toLowerCase());
11
+ }
12
+ if (arr.length == 0) return name;
13
+ else {
14
+ let a = arr.join("-");
15
+ a = a.replace(/[-]{2,}/g, "-");
16
+ return a;
17
+ }
18
+ }
19
+ //#endregion
20
+ Object.defineProperty(exports, "humpToLine", {
21
+ enumerable: true,
22
+ get: function() {
23
+ return humpToLine;
24
+ }
25
+ });
@@ -0,0 +1,20 @@
1
+ //#region node_modules/.pnpm/@fangzhongya+utils@0.0.80/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
2
+ function humpToLine(name) {
3
+ const reg = /(([A-Z])([^A-Z]*))/g;
4
+ let result;
5
+ const arr = [];
6
+ let i = 0;
7
+ while ((result = reg.exec(name)) !== null) {
8
+ if (i == 0 && result.index != 0) arr.push(name.substring(0, result.index));
9
+ i++;
10
+ arr.push(result[1].toLowerCase());
11
+ }
12
+ if (arr.length == 0) return name;
13
+ else {
14
+ let a = arr.join("-");
15
+ a = a.replace(/[-]{2,}/g, "-");
16
+ return a;
17
+ }
18
+ }
19
+ //#endregion
20
+ export { humpToLine as t };