@fangzhongya/vue-components 0.1.4-6 → 0.1.6
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/archive.cjs +7 -18
- package/dist/archive.js +9 -20
- package/dist/{chunk-GL2K5DLE.cjs → chunk-2EK53BNC.cjs} +5 -5
- package/dist/{chunk-GFQYWT6C.js → chunk-2KIAPSQV.js} +1 -1
- package/dist/{chunk-2NHLVRTH.js → chunk-3JVAEN3H.js} +88 -7
- package/dist/{chunk-Y4UKND2N.cjs → chunk-7TRA2EJI.cjs} +103 -22
- package/dist/{chunk-KK33EYSC.js → chunk-A5OVCZQE.js} +3 -3
- package/dist/{chunk-COV2LTIA.cjs → chunk-MRYLBEJR.cjs} +10 -10
- package/dist/{chunk-5WAJPDYC.cjs → chunk-ULH7QSGL.cjs} +1 -1
- package/dist/{chunk-X23FY6UK.cjs → chunk-VF7SYL7Q.cjs} +1 -0
- package/dist/{chunk-S6QJIPBZ.js → chunk-ZQPRQ7JM.js} +1 -0
- package/dist/{chunk-GHO4GLS3.js → chunk-ZTRD2TOY.js} +8 -8
- package/dist/component.cjs +4 -4
- package/dist/component.d.cts +1 -1
- package/dist/component.d.ts +1 -1
- package/dist/component.js +3 -3
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +21 -1
- package/dist/config.d.ts +21 -1
- package/dist/config.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +5 -5
- package/dist/library.cjs +2 -2
- package/dist/library.d.cts +1 -1
- package/dist/library.d.ts +1 -1
- package/dist/library.js +1 -1
- package/dist/resolver.cjs +6 -6
- package/dist/resolver.js +5 -5
- package/dist/util.cjs +3 -3
- package/dist/util.js +2 -2
- package/package.json +26 -24
package/dist/archive.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk7TRA2EJIcjs = require('./chunk-7TRA2EJI.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkVF7SYL7Qcjs = require('./chunk-VF7SYL7Q.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('./chunk-
|
|
9
|
+
var _chunkMRYLBEJRcjs = require('./chunk-MRYLBEJR.cjs');
|
|
10
|
+
require('./chunk-ULH7QSGL.cjs');
|
|
11
11
|
|
|
12
12
|
// packages/archive.ts
|
|
13
13
|
var _fs = require('fs');
|
|
@@ -46,11 +46,7 @@ function setJson(obj) {
|
|
|
46
46
|
let url = _path.resolve.call(void 0, process.cwd(), obj.jsonName);
|
|
47
47
|
_fs.writeFile.call(void 0,
|
|
48
48
|
url,
|
|
49
|
-
JSON.stringify(
|
|
50
|
-
global._ComponentsResolverArchive_,
|
|
51
|
-
null,
|
|
52
|
-
4
|
|
53
|
-
),
|
|
49
|
+
JSON.stringify(global._ComponentsResolverArchive_, null, 4),
|
|
54
50
|
"utf-8",
|
|
55
51
|
() => {
|
|
56
52
|
}
|
|
@@ -59,15 +55,8 @@ function setJson(obj) {
|
|
|
59
55
|
}
|
|
60
56
|
}
|
|
61
57
|
function ComponentsResolverArchive(config2 = {}) {
|
|
62
|
-
const configs =
|
|
63
|
-
|
|
64
|
-
archiveConfig,
|
|
65
|
-
2,
|
|
66
|
-
true
|
|
67
|
-
);
|
|
68
|
-
const fangComp = new (0, _chunkY4UKND2Ncjs.component_default)(
|
|
69
|
-
_chunkCOV2LTIAcjs.unmergeObject.call(void 0, configs, config2, 1)
|
|
70
|
-
);
|
|
58
|
+
const configs = _chunkMRYLBEJRcjs.unmergeObject.call(void 0, _chunkVF7SYL7Qcjs.config, archiveConfig, 2, true);
|
|
59
|
+
const fangComp = new (0, _chunk7TRA2EJIcjs.component_default)(_chunkMRYLBEJRcjs.unmergeObject.call(void 0, configs, config2, 1));
|
|
71
60
|
setJson(fangComp.config);
|
|
72
61
|
return [
|
|
73
62
|
{
|
package/dist/archive.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
component_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3JVAEN3H.js";
|
|
4
4
|
import {
|
|
5
5
|
config
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZQPRQ7JM.js";
|
|
7
7
|
import {
|
|
8
8
|
unmergeObject
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-ZTRD2TOY.js";
|
|
10
|
+
import "./chunk-2KIAPSQV.js";
|
|
11
11
|
|
|
12
12
|
// packages/archive.ts
|
|
13
|
-
import { writeFile } from "
|
|
14
|
-
import { resolve } from "
|
|
13
|
+
import { writeFile } from "fs";
|
|
14
|
+
import { resolve } from "path";
|
|
15
15
|
var archiveConfig = {
|
|
16
16
|
/**
|
|
17
17
|
* 自动导入的文件目录
|
|
@@ -46,11 +46,7 @@ function setJson(obj) {
|
|
|
46
46
|
let url = resolve(process.cwd(), obj.jsonName);
|
|
47
47
|
writeFile(
|
|
48
48
|
url,
|
|
49
|
-
JSON.stringify(
|
|
50
|
-
global._ComponentsResolverArchive_,
|
|
51
|
-
null,
|
|
52
|
-
4
|
|
53
|
-
),
|
|
49
|
+
JSON.stringify(global._ComponentsResolverArchive_, null, 4),
|
|
54
50
|
"utf-8",
|
|
55
51
|
() => {
|
|
56
52
|
}
|
|
@@ -59,15 +55,8 @@ function setJson(obj) {
|
|
|
59
55
|
}
|
|
60
56
|
}
|
|
61
57
|
function ComponentsResolverArchive(config2 = {}) {
|
|
62
|
-
const configs = unmergeObject(
|
|
63
|
-
|
|
64
|
-
archiveConfig,
|
|
65
|
-
2,
|
|
66
|
-
true
|
|
67
|
-
);
|
|
68
|
-
const fangComp = new component_default(
|
|
69
|
-
unmergeObject(configs, config2, 1)
|
|
70
|
-
);
|
|
58
|
+
const configs = unmergeObject(config, archiveConfig, 2, true);
|
|
59
|
+
const fangComp = new component_default(unmergeObject(configs, config2, 1));
|
|
71
60
|
setJson(fangComp.config);
|
|
72
61
|
return [
|
|
73
62
|
{
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk7TRA2EJIcjs = require('./chunk-7TRA2EJI.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkVF7SYL7Qcjs = require('./chunk-VF7SYL7Q.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkMRYLBEJRcjs = require('./chunk-MRYLBEJR.cjs');
|
|
10
10
|
|
|
11
11
|
// packages/resolver.ts
|
|
12
12
|
function ComponentsResolver(config2 = {}) {
|
|
13
|
-
const configs =
|
|
14
|
-
const fangComp = new (0,
|
|
13
|
+
const configs = _chunkMRYLBEJRcjs.unmergeObject.call(void 0, _chunkVF7SYL7Qcjs.config, config2, 1);
|
|
14
|
+
const fangComp = new (0, _chunk7TRA2EJIcjs.component_default)(configs);
|
|
15
15
|
return [
|
|
16
16
|
{
|
|
17
17
|
type: "component",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
1
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
|
|
2
2
|
function humpToLine(name) {
|
|
3
3
|
const reg = /(([A-Z])([^A-Z]*))/g;
|
|
4
4
|
let result;
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
firstUpper,
|
|
3
3
|
getComponentNames,
|
|
4
4
|
styleLog
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZTRD2TOY.js";
|
|
6
6
|
import {
|
|
7
7
|
humpToLine
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2KIAPSQV.js";
|
|
9
9
|
|
|
10
10
|
// packages/component.ts
|
|
11
11
|
import fastGlob from "fast-glob";
|
|
@@ -40,6 +40,7 @@ function getForUrl(arr, name) {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
return;
|
|
43
44
|
}
|
|
44
45
|
function getForUrlStart(arr, name) {
|
|
45
46
|
if (arr) {
|
|
@@ -50,11 +51,13 @@ function getForUrlStart(arr, name) {
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
}
|
|
54
|
+
return;
|
|
53
55
|
}
|
|
54
56
|
var FangComponent = class {
|
|
55
57
|
config;
|
|
56
58
|
#comUrls;
|
|
57
59
|
#dirUrls;
|
|
60
|
+
#cssUrls;
|
|
58
61
|
#cacheObj;
|
|
59
62
|
#curDir;
|
|
60
63
|
#aliassArr;
|
|
@@ -76,6 +79,7 @@ var FangComponent = class {
|
|
|
76
79
|
this.#setGetMatch();
|
|
77
80
|
this.#comUrls = [];
|
|
78
81
|
this.#dirUrls = [];
|
|
82
|
+
this.#cssUrls = [];
|
|
79
83
|
this.#cacheObj = {};
|
|
80
84
|
this.#curDir = "";
|
|
81
85
|
if (this.config.dir) {
|
|
@@ -186,19 +190,36 @@ var FangComponent = class {
|
|
|
186
190
|
return isUrl(key);
|
|
187
191
|
});
|
|
188
192
|
}
|
|
193
|
+
if (this.config.csss !== "") {
|
|
194
|
+
const u = this.config.csss ?? this.config.dir;
|
|
195
|
+
const cs = this.config.csssuffixs ?? ["css", "scss"];
|
|
196
|
+
const durl = this.config.dir + "**/" + u + "/**/*.{" + cs.join(",") + "}";
|
|
197
|
+
const globs = fastGlob.sync(durl, {
|
|
198
|
+
onlyFiles: false,
|
|
199
|
+
absolute: true
|
|
200
|
+
}) || [];
|
|
201
|
+
this.#cssUrls = globs.filter((key) => {
|
|
202
|
+
return isUrl(key);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
189
205
|
if (this.config.urlprefix) {
|
|
190
206
|
if (this.config.dir) {
|
|
191
207
|
const dir = this.config.dir;
|
|
192
208
|
const urls = [];
|
|
193
209
|
const dirUrls = [];
|
|
210
|
+
const cssUrls = [];
|
|
194
211
|
this.#comUrls?.forEach((key) => {
|
|
195
212
|
urls.push(key.replace(reg, dir));
|
|
196
213
|
});
|
|
197
214
|
this.#dirUrls?.forEach((key) => {
|
|
198
215
|
dirUrls.push(key.replace(reg, dir));
|
|
199
216
|
});
|
|
217
|
+
this.#cssUrls?.forEach((key) => {
|
|
218
|
+
cssUrls.push(key.replace(reg, dir));
|
|
219
|
+
});
|
|
200
220
|
this.config.urls = urls;
|
|
201
221
|
this.config.dirUrls = dirUrls;
|
|
222
|
+
this.config.cssUrls = cssUrls;
|
|
202
223
|
}
|
|
203
224
|
}
|
|
204
225
|
}
|
|
@@ -216,6 +237,7 @@ var FangComponent = class {
|
|
|
216
237
|
} else {
|
|
217
238
|
return this.config.dir + "**/*.*";
|
|
218
239
|
}
|
|
240
|
+
return;
|
|
219
241
|
}
|
|
220
242
|
/**
|
|
221
243
|
* 获取当前缓存数
|
|
@@ -273,14 +295,15 @@ var FangComponent = class {
|
|
|
273
295
|
* @param {String} type 类型
|
|
274
296
|
* @returns { Object } 注册的对象
|
|
275
297
|
*/
|
|
276
|
-
#getNameFromUrl(from, name, type) {
|
|
298
|
+
#getNameFromUrl(from, name, type, sideEffects) {
|
|
277
299
|
let dname = "";
|
|
278
300
|
if (this.config.getFromName) {
|
|
279
301
|
dname = this.config.getFromName(from, name, type);
|
|
280
302
|
}
|
|
281
303
|
return {
|
|
282
304
|
name: dname || "default",
|
|
283
|
-
from
|
|
305
|
+
from,
|
|
306
|
+
sideEffects
|
|
284
307
|
};
|
|
285
308
|
}
|
|
286
309
|
/**
|
|
@@ -313,6 +336,7 @@ var FangComponent = class {
|
|
|
313
336
|
}
|
|
314
337
|
return this.#getCorrespondUrl(as, m, type, ml);
|
|
315
338
|
}
|
|
339
|
+
return;
|
|
316
340
|
}
|
|
317
341
|
/**
|
|
318
342
|
* 有前缀匹配
|
|
@@ -331,6 +355,7 @@ var FangComponent = class {
|
|
|
331
355
|
} else if (urls.length > 1) {
|
|
332
356
|
return this.#getCorrespondUrl2(type, urls, ml, yname, top);
|
|
333
357
|
}
|
|
358
|
+
return;
|
|
334
359
|
}
|
|
335
360
|
/**
|
|
336
361
|
* 通过名称匹配对应路径
|
|
@@ -374,14 +399,33 @@ var FangComponent = class {
|
|
|
374
399
|
element
|
|
375
400
|
);
|
|
376
401
|
if (from2) {
|
|
377
|
-
|
|
402
|
+
let sideEffects = void 0;
|
|
403
|
+
if (type == "component") {
|
|
404
|
+
sideEffects = this.#getConfigUrl(
|
|
405
|
+
"sideEffects",
|
|
406
|
+
sl,
|
|
407
|
+
aliass[element],
|
|
408
|
+
name,
|
|
409
|
+
element
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
return this.#getNameFromUrl(
|
|
413
|
+
from2,
|
|
414
|
+
name,
|
|
415
|
+
type,
|
|
416
|
+
sideEffects
|
|
417
|
+
);
|
|
378
418
|
}
|
|
379
419
|
}
|
|
380
420
|
}
|
|
381
421
|
}
|
|
382
422
|
const from = this.#getMatchUrl(name, type);
|
|
383
423
|
if (from) {
|
|
384
|
-
|
|
424
|
+
let sideEffects = void 0;
|
|
425
|
+
if (type == "component") {
|
|
426
|
+
sideEffects = this.#getMatchUrl(name, "sideEffects");
|
|
427
|
+
}
|
|
428
|
+
return this.#getNameFromUrl(from, name, type, sideEffects);
|
|
385
429
|
}
|
|
386
430
|
}
|
|
387
431
|
/**
|
|
@@ -405,6 +449,18 @@ var FangComponent = class {
|
|
|
405
449
|
urls.push(...vs);
|
|
406
450
|
});
|
|
407
451
|
}
|
|
452
|
+
} else if (type == "sideEffects") {
|
|
453
|
+
const getMatchCss = this.config.getMatchCss;
|
|
454
|
+
if (getMatchCss) {
|
|
455
|
+
arr.forEach((v) => {
|
|
456
|
+
const vs = getMatchCss(
|
|
457
|
+
v,
|
|
458
|
+
this.config.extensions,
|
|
459
|
+
this.config.matchCsss
|
|
460
|
+
);
|
|
461
|
+
urls.push(...vs);
|
|
462
|
+
});
|
|
463
|
+
}
|
|
408
464
|
} else {
|
|
409
465
|
const getMatch = this.config.getMatch;
|
|
410
466
|
if (getMatch) {
|
|
@@ -440,6 +496,15 @@ var FangComponent = class {
|
|
|
440
496
|
this.config.matchDirexts
|
|
441
497
|
);
|
|
442
498
|
}
|
|
499
|
+
} else if (type == "sideEffects") {
|
|
500
|
+
const getMatchCss = this.config.getMatchCss;
|
|
501
|
+
if (getMatchCss) {
|
|
502
|
+
urls = getMatchCss(
|
|
503
|
+
name,
|
|
504
|
+
this.config.extensions,
|
|
505
|
+
this.config.matchCsss
|
|
506
|
+
);
|
|
507
|
+
}
|
|
443
508
|
} else {
|
|
444
509
|
const getMatch = this.config.getMatch;
|
|
445
510
|
if (getMatch) {
|
|
@@ -467,6 +532,12 @@ var FangComponent = class {
|
|
|
467
532
|
as.push(key);
|
|
468
533
|
}
|
|
469
534
|
});
|
|
535
|
+
} else if (type == "sideEffects") {
|
|
536
|
+
this.#cssUrls?.forEach((key) => {
|
|
537
|
+
if (isUrlsMatchi(key, arr)) {
|
|
538
|
+
as.push(key);
|
|
539
|
+
}
|
|
540
|
+
});
|
|
470
541
|
} else {
|
|
471
542
|
this.#comUrls?.forEach((key) => {
|
|
472
543
|
if (isUrlsMatchi(key, arr)) {
|
|
@@ -516,6 +587,7 @@ var FangComponent = class {
|
|
|
516
587
|
return url;
|
|
517
588
|
}
|
|
518
589
|
}
|
|
590
|
+
return;
|
|
519
591
|
}
|
|
520
592
|
/**
|
|
521
593
|
* 无前缀匹配
|
|
@@ -531,6 +603,7 @@ var FangComponent = class {
|
|
|
531
603
|
} else if (urls.length > 1) {
|
|
532
604
|
return this.#getCorrespondUrl(urls, name, type);
|
|
533
605
|
}
|
|
606
|
+
return;
|
|
534
607
|
}
|
|
535
608
|
/**
|
|
536
609
|
* 输出日志
|
|
@@ -543,7 +616,8 @@ var FangComponent = class {
|
|
|
543
616
|
if (this.config.log) {
|
|
544
617
|
const texts = {
|
|
545
618
|
component: 2,
|
|
546
|
-
directive:
|
|
619
|
+
directive: 4,
|
|
620
|
+
sideEffects: 5
|
|
547
621
|
};
|
|
548
622
|
const arr = [];
|
|
549
623
|
arr.push(
|
|
@@ -572,6 +646,13 @@ var FangComponent = class {
|
|
|
572
646
|
}) + sfrom;
|
|
573
647
|
}
|
|
574
648
|
arr.push(sfrom);
|
|
649
|
+
if (obj.sideEffects) {
|
|
650
|
+
arr.push(
|
|
651
|
+
styleLog(obj.sideEffects.toString(), {
|
|
652
|
+
text: texts["sideEffects"]
|
|
653
|
+
})
|
|
654
|
+
);
|
|
655
|
+
}
|
|
575
656
|
} else {
|
|
576
657
|
arr.push(
|
|
577
658
|
styleLog(type, {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkMRYLBEJRcjs = require('./chunk-MRYLBEJR.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkULH7QSGLcjs = require('./chunk-ULH7QSGL.cjs');
|
|
9
9
|
|
|
10
10
|
// packages/component.ts
|
|
11
11
|
var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
|
|
@@ -40,6 +40,7 @@ function getForUrl(arr, name) {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
return;
|
|
43
44
|
}
|
|
44
45
|
function getForUrlStart(arr, name) {
|
|
45
46
|
if (arr) {
|
|
@@ -50,11 +51,13 @@ function getForUrlStart(arr, name) {
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
}
|
|
54
|
+
return;
|
|
53
55
|
}
|
|
54
56
|
var FangComponent = class {
|
|
55
57
|
|
|
56
58
|
#comUrls;
|
|
57
59
|
#dirUrls;
|
|
60
|
+
#cssUrls;
|
|
58
61
|
#cacheObj;
|
|
59
62
|
#curDir;
|
|
60
63
|
#aliassArr;
|
|
@@ -76,6 +79,7 @@ var FangComponent = class {
|
|
|
76
79
|
this.#setGetMatch();
|
|
77
80
|
this.#comUrls = [];
|
|
78
81
|
this.#dirUrls = [];
|
|
82
|
+
this.#cssUrls = [];
|
|
79
83
|
this.#cacheObj = {};
|
|
80
84
|
this.#curDir = "";
|
|
81
85
|
if (this.config.dir) {
|
|
@@ -186,19 +190,36 @@ var FangComponent = class {
|
|
|
186
190
|
return isUrl(key);
|
|
187
191
|
});
|
|
188
192
|
}
|
|
193
|
+
if (this.config.csss !== "") {
|
|
194
|
+
const u = _nullishCoalesce(this.config.csss, () => ( this.config.dir));
|
|
195
|
+
const cs = _nullishCoalesce(this.config.csssuffixs, () => ( ["css", "scss"]));
|
|
196
|
+
const durl = this.config.dir + "**/" + u + "/**/*.{" + cs.join(",") + "}";
|
|
197
|
+
const globs = _fastglob2.default.sync(durl, {
|
|
198
|
+
onlyFiles: false,
|
|
199
|
+
absolute: true
|
|
200
|
+
}) || [];
|
|
201
|
+
this.#cssUrls = globs.filter((key) => {
|
|
202
|
+
return isUrl(key);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
189
205
|
if (this.config.urlprefix) {
|
|
190
206
|
if (this.config.dir) {
|
|
191
207
|
const dir = this.config.dir;
|
|
192
208
|
const urls = [];
|
|
193
209
|
const dirUrls = [];
|
|
210
|
+
const cssUrls = [];
|
|
194
211
|
_optionalChain([this, 'access', _3 => _3.#comUrls, 'optionalAccess', _4 => _4.forEach, 'call', _5 => _5((key) => {
|
|
195
212
|
urls.push(key.replace(reg, dir));
|
|
196
213
|
})]);
|
|
197
214
|
_optionalChain([this, 'access', _6 => _6.#dirUrls, 'optionalAccess', _7 => _7.forEach, 'call', _8 => _8((key) => {
|
|
198
215
|
dirUrls.push(key.replace(reg, dir));
|
|
199
216
|
})]);
|
|
217
|
+
_optionalChain([this, 'access', _9 => _9.#cssUrls, 'optionalAccess', _10 => _10.forEach, 'call', _11 => _11((key) => {
|
|
218
|
+
cssUrls.push(key.replace(reg, dir));
|
|
219
|
+
})]);
|
|
200
220
|
this.config.urls = urls;
|
|
201
221
|
this.config.dirUrls = dirUrls;
|
|
222
|
+
this.config.cssUrls = cssUrls;
|
|
202
223
|
}
|
|
203
224
|
}
|
|
204
225
|
}
|
|
@@ -216,6 +237,7 @@ var FangComponent = class {
|
|
|
216
237
|
} else {
|
|
217
238
|
return this.config.dir + "**/*.*";
|
|
218
239
|
}
|
|
240
|
+
return;
|
|
219
241
|
}
|
|
220
242
|
/**
|
|
221
243
|
* 获取当前缓存数
|
|
@@ -247,7 +269,7 @@ var FangComponent = class {
|
|
|
247
269
|
* @returns { Boolean } 是否要替换
|
|
248
270
|
*/
|
|
249
271
|
#namefilter(name) {
|
|
250
|
-
name =
|
|
272
|
+
name = _chunkULH7QSGLcjs.humpToLine.call(void 0, name);
|
|
251
273
|
if (this.config.startss) {
|
|
252
274
|
for (let index = 0; index < this.config.startss.length; index++) {
|
|
253
275
|
const element = this.config.startss[index] + "-";
|
|
@@ -273,14 +295,15 @@ var FangComponent = class {
|
|
|
273
295
|
* @param {String} type 类型
|
|
274
296
|
* @returns { Object } 注册的对象
|
|
275
297
|
*/
|
|
276
|
-
#getNameFromUrl(from, name, type) {
|
|
298
|
+
#getNameFromUrl(from, name, type, sideEffects) {
|
|
277
299
|
let dname = "";
|
|
278
300
|
if (this.config.getFromName) {
|
|
279
301
|
dname = this.config.getFromName(from, name, type);
|
|
280
302
|
}
|
|
281
303
|
return {
|
|
282
304
|
name: dname || "default",
|
|
283
|
-
from
|
|
305
|
+
from,
|
|
306
|
+
sideEffects
|
|
284
307
|
};
|
|
285
308
|
}
|
|
286
309
|
/**
|
|
@@ -307,12 +330,13 @@ var FangComponent = class {
|
|
|
307
330
|
} else if (as.length > 1) {
|
|
308
331
|
let m;
|
|
309
332
|
if (/[A-Z]/.test(yname.slice(0, 1))) {
|
|
310
|
-
m = yname.replace(
|
|
333
|
+
m = yname.replace(_chunkMRYLBEJRcjs.firstUpper.call(void 0, top), "");
|
|
311
334
|
} else {
|
|
312
335
|
m = yname.replace(top, "");
|
|
313
336
|
}
|
|
314
337
|
return this.#getCorrespondUrl(as, m, type, ml);
|
|
315
338
|
}
|
|
339
|
+
return;
|
|
316
340
|
}
|
|
317
341
|
/**
|
|
318
342
|
* 有前缀匹配
|
|
@@ -331,6 +355,7 @@ var FangComponent = class {
|
|
|
331
355
|
} else if (urls.length > 1) {
|
|
332
356
|
return this.#getCorrespondUrl2(type, urls, ml, yname, top);
|
|
333
357
|
}
|
|
358
|
+
return;
|
|
334
359
|
}
|
|
335
360
|
/**
|
|
336
361
|
* 通过名称匹配对应路径
|
|
@@ -339,14 +364,14 @@ var FangComponent = class {
|
|
|
339
364
|
* @returns { Object } 注册的对象
|
|
340
365
|
*/
|
|
341
366
|
#setNameFrom(name, type) {
|
|
342
|
-
let mb =
|
|
367
|
+
let mb = _chunkULH7QSGLcjs.humpToLine.call(void 0, name);
|
|
343
368
|
const alias = this.config.alias;
|
|
344
369
|
if (alias) {
|
|
345
370
|
if (mb.startsWith(alias + "-")) {
|
|
346
371
|
const reg = new RegExp("^" + alias + "-");
|
|
347
372
|
mb = mb.replace(reg, "");
|
|
348
373
|
const reg1 = new RegExp("^" + alias);
|
|
349
|
-
const reg2 = new RegExp("^" +
|
|
374
|
+
const reg2 = new RegExp("^" + _chunkMRYLBEJRcjs.firstUpper.call(void 0, alias));
|
|
350
375
|
if (reg1.test(name)) {
|
|
351
376
|
name = name.replace(reg1, "");
|
|
352
377
|
} else if (reg2.test(name)) {
|
|
@@ -374,14 +399,33 @@ var FangComponent = class {
|
|
|
374
399
|
element
|
|
375
400
|
);
|
|
376
401
|
if (from2) {
|
|
377
|
-
|
|
402
|
+
let sideEffects = void 0;
|
|
403
|
+
if (type == "component") {
|
|
404
|
+
sideEffects = this.#getConfigUrl(
|
|
405
|
+
"sideEffects",
|
|
406
|
+
sl,
|
|
407
|
+
aliass[element],
|
|
408
|
+
name,
|
|
409
|
+
element
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
return this.#getNameFromUrl(
|
|
413
|
+
from2,
|
|
414
|
+
name,
|
|
415
|
+
type,
|
|
416
|
+
sideEffects
|
|
417
|
+
);
|
|
378
418
|
}
|
|
379
419
|
}
|
|
380
420
|
}
|
|
381
421
|
}
|
|
382
422
|
const from = this.#getMatchUrl(name, type);
|
|
383
423
|
if (from) {
|
|
384
|
-
|
|
424
|
+
let sideEffects = void 0;
|
|
425
|
+
if (type == "component") {
|
|
426
|
+
sideEffects = this.#getMatchUrl(name, "sideEffects");
|
|
427
|
+
}
|
|
428
|
+
return this.#getNameFromUrl(from, name, type, sideEffects);
|
|
385
429
|
}
|
|
386
430
|
}
|
|
387
431
|
/**
|
|
@@ -391,7 +435,7 @@ var FangComponent = class {
|
|
|
391
435
|
* @returns {Array} 需要匹配的地址名称数组
|
|
392
436
|
*/
|
|
393
437
|
#setMatchUrls(name, type) {
|
|
394
|
-
const arr =
|
|
438
|
+
const arr = _chunkMRYLBEJRcjs.getComponentNames.call(void 0, name);
|
|
395
439
|
const urls = [];
|
|
396
440
|
if (type == "directive") {
|
|
397
441
|
const getMatchDir = this.config.getMatchDir;
|
|
@@ -405,6 +449,18 @@ var FangComponent = class {
|
|
|
405
449
|
urls.push(...vs);
|
|
406
450
|
});
|
|
407
451
|
}
|
|
452
|
+
} else if (type == "sideEffects") {
|
|
453
|
+
const getMatchCss = this.config.getMatchCss;
|
|
454
|
+
if (getMatchCss) {
|
|
455
|
+
arr.forEach((v) => {
|
|
456
|
+
const vs = getMatchCss(
|
|
457
|
+
v,
|
|
458
|
+
this.config.extensions,
|
|
459
|
+
this.config.matchCsss
|
|
460
|
+
);
|
|
461
|
+
urls.push(...vs);
|
|
462
|
+
});
|
|
463
|
+
}
|
|
408
464
|
} else {
|
|
409
465
|
const getMatch = this.config.getMatch;
|
|
410
466
|
if (getMatch) {
|
|
@@ -440,6 +496,15 @@ var FangComponent = class {
|
|
|
440
496
|
this.config.matchDirexts
|
|
441
497
|
);
|
|
442
498
|
}
|
|
499
|
+
} else if (type == "sideEffects") {
|
|
500
|
+
const getMatchCss = this.config.getMatchCss;
|
|
501
|
+
if (getMatchCss) {
|
|
502
|
+
urls = getMatchCss(
|
|
503
|
+
name,
|
|
504
|
+
this.config.extensions,
|
|
505
|
+
this.config.matchCsss
|
|
506
|
+
);
|
|
507
|
+
}
|
|
443
508
|
} else {
|
|
444
509
|
const getMatch = this.config.getMatch;
|
|
445
510
|
if (getMatch) {
|
|
@@ -462,13 +527,19 @@ var FangComponent = class {
|
|
|
462
527
|
#getUrlsMatchi(arr, type) {
|
|
463
528
|
const as = [];
|
|
464
529
|
if (type == "directive") {
|
|
465
|
-
_optionalChain([this, 'access',
|
|
530
|
+
_optionalChain([this, 'access', _12 => _12.#dirUrls, 'optionalAccess', _13 => _13.forEach, 'call', _14 => _14((key) => {
|
|
531
|
+
if (isUrlsMatchi(key, arr)) {
|
|
532
|
+
as.push(key);
|
|
533
|
+
}
|
|
534
|
+
})]);
|
|
535
|
+
} else if (type == "sideEffects") {
|
|
536
|
+
_optionalChain([this, 'access', _15 => _15.#cssUrls, 'optionalAccess', _16 => _16.forEach, 'call', _17 => _17((key) => {
|
|
466
537
|
if (isUrlsMatchi(key, arr)) {
|
|
467
538
|
as.push(key);
|
|
468
539
|
}
|
|
469
540
|
})]);
|
|
470
541
|
} else {
|
|
471
|
-
_optionalChain([this, 'access',
|
|
542
|
+
_optionalChain([this, 'access', _18 => _18.#comUrls, 'optionalAccess', _19 => _19.forEach, 'call', _20 => _20((key) => {
|
|
472
543
|
if (isUrlsMatchi(key, arr)) {
|
|
473
544
|
as.push(key);
|
|
474
545
|
}
|
|
@@ -516,6 +587,7 @@ var FangComponent = class {
|
|
|
516
587
|
return url;
|
|
517
588
|
}
|
|
518
589
|
}
|
|
590
|
+
return;
|
|
519
591
|
}
|
|
520
592
|
/**
|
|
521
593
|
* 无前缀匹配
|
|
@@ -531,6 +603,7 @@ var FangComponent = class {
|
|
|
531
603
|
} else if (urls.length > 1) {
|
|
532
604
|
return this.#getCorrespondUrl(urls, name, type);
|
|
533
605
|
}
|
|
606
|
+
return;
|
|
534
607
|
}
|
|
535
608
|
/**
|
|
536
609
|
* 输出日志
|
|
@@ -543,43 +616,51 @@ var FangComponent = class {
|
|
|
543
616
|
if (this.config.log) {
|
|
544
617
|
const texts = {
|
|
545
618
|
component: 2,
|
|
546
|
-
directive:
|
|
619
|
+
directive: 4,
|
|
620
|
+
sideEffects: 5
|
|
547
621
|
};
|
|
548
622
|
const arr = [];
|
|
549
623
|
arr.push(
|
|
550
|
-
|
|
624
|
+
_chunkMRYLBEJRcjs.styleLog.call(void 0, "[@fangzhongya/vue-components]", {
|
|
551
625
|
text: 3
|
|
552
626
|
})
|
|
553
627
|
);
|
|
554
628
|
if (obj && obj.from) {
|
|
555
|
-
let sfrom =
|
|
629
|
+
let sfrom = _chunkMRYLBEJRcjs.styleLog.call(void 0, _optionalChain([obj, 'optionalAccess', _21 => _21.from]), {
|
|
556
630
|
text: 4,
|
|
557
631
|
revert: true
|
|
558
632
|
});
|
|
559
633
|
arr.push(
|
|
560
|
-
|
|
634
|
+
_chunkMRYLBEJRcjs.styleLog.call(void 0, type, {
|
|
561
635
|
text: texts[type]
|
|
562
636
|
})
|
|
563
637
|
);
|
|
564
638
|
arr.push(
|
|
565
|
-
|
|
639
|
+
_chunkMRYLBEJRcjs.styleLog.call(void 0, name, {
|
|
566
640
|
bold: true
|
|
567
641
|
})
|
|
568
642
|
);
|
|
569
643
|
if (!is) {
|
|
570
|
-
sfrom =
|
|
644
|
+
sfrom = _chunkMRYLBEJRcjs.styleLog.call(void 0, "+", {
|
|
571
645
|
text: 2
|
|
572
646
|
}) + sfrom;
|
|
573
647
|
}
|
|
574
648
|
arr.push(sfrom);
|
|
649
|
+
if (obj.sideEffects) {
|
|
650
|
+
arr.push(
|
|
651
|
+
_chunkMRYLBEJRcjs.styleLog.call(void 0, obj.sideEffects.toString(), {
|
|
652
|
+
text: texts["sideEffects"]
|
|
653
|
+
})
|
|
654
|
+
);
|
|
655
|
+
}
|
|
575
656
|
} else {
|
|
576
657
|
arr.push(
|
|
577
|
-
|
|
658
|
+
_chunkMRYLBEJRcjs.styleLog.call(void 0, type, {
|
|
578
659
|
text: texts[type]
|
|
579
660
|
})
|
|
580
661
|
);
|
|
581
662
|
arr.push(
|
|
582
|
-
|
|
663
|
+
_chunkMRYLBEJRcjs.styleLog.call(void 0, name, {
|
|
583
664
|
bold: true,
|
|
584
665
|
text: 1
|
|
585
666
|
})
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
component_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3JVAEN3H.js";
|
|
4
4
|
import {
|
|
5
5
|
config
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZQPRQ7JM.js";
|
|
7
7
|
import {
|
|
8
8
|
unmergeObject
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZTRD2TOY.js";
|
|
10
10
|
|
|
11
11
|
// packages/resolver.ts
|
|
12
12
|
function ComponentsResolver(config2 = {}) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkULH7QSGLcjs = require('./chunk-ULH7QSGL.cjs');
|
|
4
4
|
|
|
5
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
5
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-HVQG2IGJ.js
|
|
6
6
|
function styleLog(msg = "", obj) {
|
|
7
7
|
const arr = ["\x1B[0m"];
|
|
8
8
|
if (_optionalChain([obj, 'optionalAccess', _ => _.revert])) {
|
|
@@ -32,7 +32,7 @@ function styleLog(msg = "", obj) {
|
|
|
32
32
|
return arr.join("");
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
35
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-A6J46LQK.js
|
|
36
36
|
function unmergeObject(a, b, j = 0, i) {
|
|
37
37
|
let c;
|
|
38
38
|
if (a instanceof Array) {
|
|
@@ -78,12 +78,12 @@ function unmergeObject(a, b, j = 0, i) {
|
|
|
78
78
|
return c;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
81
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js
|
|
82
82
|
function firstUpper(str) {
|
|
83
83
|
return str.slice(0, 1).toUpperCase() + str.slice(1);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
86
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js
|
|
87
87
|
function lineToLargeHump(name) {
|
|
88
88
|
let arr = name.split("-");
|
|
89
89
|
arr = arr.map((vs) => {
|
|
@@ -92,25 +92,25 @@ function lineToLargeHump(name) {
|
|
|
92
92
|
return arr.join("");
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
95
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js
|
|
96
96
|
function firstLower(str) {
|
|
97
97
|
return str.slice(0, 1).toLowerCase() + str.slice(1);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
100
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-AM67P3W7.js
|
|
101
101
|
function lineToSmallHump(name) {
|
|
102
102
|
return firstLower(lineToLargeHump(name));
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
105
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-VRRDYCUH.js
|
|
106
106
|
function getComponentNames(name) {
|
|
107
107
|
if (name.includes("-")) {
|
|
108
|
-
const line =
|
|
108
|
+
const line = _chunkULH7QSGLcjs.humpToLine.call(void 0, name);
|
|
109
109
|
const upper = lineToLargeHump(line);
|
|
110
110
|
const lower = lineToSmallHump(upper);
|
|
111
111
|
return [line, upper, lower];
|
|
112
112
|
} else if (/[A-Z]/.test(name)) {
|
|
113
|
-
const line =
|
|
113
|
+
const line = _chunkULH7QSGLcjs.humpToLine.call(void 0, name);
|
|
114
114
|
if (/^[A-Z]/.test(name)) {
|
|
115
115
|
const upper = lineToLargeHump(line);
|
|
116
116
|
const lower = lineToSmallHump(upper);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
|
|
2
2
|
function humpToLine(name) {
|
|
3
3
|
const reg = /(([A-Z])([^A-Z]*))/g;
|
|
4
4
|
let result;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
humpToLine
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2KIAPSQV.js";
|
|
4
4
|
|
|
5
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
5
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-HVQG2IGJ.js
|
|
6
6
|
function styleLog(msg = "", obj) {
|
|
7
7
|
const arr = ["\x1B[0m"];
|
|
8
8
|
if (obj?.revert) {
|
|
@@ -32,7 +32,7 @@ function styleLog(msg = "", obj) {
|
|
|
32
32
|
return arr.join("");
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
35
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-A6J46LQK.js
|
|
36
36
|
function unmergeObject(a, b, j = 0, i) {
|
|
37
37
|
let c;
|
|
38
38
|
if (a instanceof Array) {
|
|
@@ -78,12 +78,12 @@ function unmergeObject(a, b, j = 0, i) {
|
|
|
78
78
|
return c;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
81
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js
|
|
82
82
|
function firstUpper(str) {
|
|
83
83
|
return str.slice(0, 1).toUpperCase() + str.slice(1);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
86
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js
|
|
87
87
|
function lineToLargeHump(name) {
|
|
88
88
|
let arr = name.split("-");
|
|
89
89
|
arr = arr.map((vs) => {
|
|
@@ -92,17 +92,17 @@ function lineToLargeHump(name) {
|
|
|
92
92
|
return arr.join("");
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
95
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js
|
|
96
96
|
function firstLower(str) {
|
|
97
97
|
return str.slice(0, 1).toLowerCase() + str.slice(1);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
100
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-AM67P3W7.js
|
|
101
101
|
function lineToSmallHump(name) {
|
|
102
102
|
return firstLower(lineToLargeHump(name));
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
105
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.25/node_modules/@fangzhongya/utils/dist/chunk-VRRDYCUH.js
|
|
106
106
|
function getComponentNames(name) {
|
|
107
107
|
if (name.includes("-")) {
|
|
108
108
|
const line = humpToLine(name);
|
package/dist/component.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunk7TRA2EJIcjs = require('./chunk-7TRA2EJI.cjs');
|
|
4
|
+
require('./chunk-MRYLBEJR.cjs');
|
|
5
|
+
require('./chunk-ULH7QSGL.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = _chunk7TRA2EJIcjs.component_default;
|
package/dist/component.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { FangConfig, Config } from './config.cjs';
|
|
|
2
2
|
import { ComponentInfo } from 'unplugin-vue-components';
|
|
3
3
|
|
|
4
4
|
type FangComponentInfo = ComponentInfo | undefined | void;
|
|
5
|
-
type ResolveType = 'component' | 'directive';
|
|
5
|
+
type ResolveType = 'component' | 'directive' | 'sideEffects';
|
|
6
6
|
/**
|
|
7
7
|
* 自动注册组件和指令的方法
|
|
8
8
|
*/
|
package/dist/component.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { FangConfig, Config } from './config.js';
|
|
|
2
2
|
import { ComponentInfo } from 'unplugin-vue-components';
|
|
3
3
|
|
|
4
4
|
type FangComponentInfo = ComponentInfo | undefined | void;
|
|
5
|
-
type ResolveType = 'component' | 'directive';
|
|
5
|
+
type ResolveType = 'component' | 'directive' | 'sideEffects';
|
|
6
6
|
/**
|
|
7
7
|
* 自动注册组件和指令的方法
|
|
8
8
|
*/
|
package/dist/component.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
component_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-3JVAEN3H.js";
|
|
4
|
+
import "./chunk-ZTRD2TOY.js";
|
|
5
|
+
import "./chunk-2KIAPSQV.js";
|
|
6
6
|
export {
|
|
7
7
|
component_default as default
|
|
8
8
|
};
|
package/dist/config.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkVF7SYL7Qcjs = require('./chunk-VF7SYL7Q.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
exports.config =
|
|
6
|
+
exports.config = _chunkVF7SYL7Qcjs.config;
|
package/dist/config.d.cts
CHANGED
|
@@ -37,11 +37,23 @@ interface Config {
|
|
|
37
37
|
* 匹配文件名称和文件类型
|
|
38
38
|
*/
|
|
39
39
|
matchexts?: Array<string | RegExp>;
|
|
40
|
+
/**
|
|
41
|
+
* 指令
|
|
42
|
+
*/
|
|
40
43
|
matchDirexts?: Array<string | RegExp>;
|
|
44
|
+
/**
|
|
45
|
+
* 样式
|
|
46
|
+
*/
|
|
47
|
+
matchCsss?: Array<string | RegExp>;
|
|
41
48
|
/**
|
|
42
49
|
* 指令文件夹名称
|
|
43
50
|
*/
|
|
44
51
|
directives?: string;
|
|
52
|
+
/**
|
|
53
|
+
* 样式文件夹名称
|
|
54
|
+
*/
|
|
55
|
+
csss?: string;
|
|
56
|
+
csssuffixs?: Array<string>;
|
|
45
57
|
/**
|
|
46
58
|
* 是否缓存
|
|
47
59
|
*/
|
|
@@ -69,9 +81,13 @@ interface Config {
|
|
|
69
81
|
*/
|
|
70
82
|
getMatch?(name: string, extensions?: Array<string>, matchs?: Array<string | RegExp>, matchexts?: Array<string | RegExp>): Array<string | RegExp>;
|
|
71
83
|
/**
|
|
72
|
-
*
|
|
84
|
+
* 获取指令匹配数组
|
|
73
85
|
*/
|
|
74
86
|
getMatchDir?(name: string, extensions?: Array<string>, matchDirexts?: Array<string | RegExp>): Array<string | RegExp>;
|
|
87
|
+
/**
|
|
88
|
+
* 获取样式匹配数组
|
|
89
|
+
*/
|
|
90
|
+
getMatchCss?(name: string, extensions?: Array<string>, matchCsss?: Array<string | RegExp>): Array<string | RegExp>;
|
|
75
91
|
}
|
|
76
92
|
interface FangConfig extends Config {
|
|
77
93
|
/**
|
|
@@ -94,6 +110,10 @@ interface FangConfig extends Config {
|
|
|
94
110
|
* 格式化的指令的地址
|
|
95
111
|
*/
|
|
96
112
|
dirUrls?: Array<string>;
|
|
113
|
+
/**
|
|
114
|
+
* 格式化的样式的地址
|
|
115
|
+
*/
|
|
116
|
+
cssUrls?: Array<string>;
|
|
97
117
|
}
|
|
98
118
|
declare const config: Config;
|
|
99
119
|
|
package/dist/config.d.ts
CHANGED
|
@@ -37,11 +37,23 @@ interface Config {
|
|
|
37
37
|
* 匹配文件名称和文件类型
|
|
38
38
|
*/
|
|
39
39
|
matchexts?: Array<string | RegExp>;
|
|
40
|
+
/**
|
|
41
|
+
* 指令
|
|
42
|
+
*/
|
|
40
43
|
matchDirexts?: Array<string | RegExp>;
|
|
44
|
+
/**
|
|
45
|
+
* 样式
|
|
46
|
+
*/
|
|
47
|
+
matchCsss?: Array<string | RegExp>;
|
|
41
48
|
/**
|
|
42
49
|
* 指令文件夹名称
|
|
43
50
|
*/
|
|
44
51
|
directives?: string;
|
|
52
|
+
/**
|
|
53
|
+
* 样式文件夹名称
|
|
54
|
+
*/
|
|
55
|
+
csss?: string;
|
|
56
|
+
csssuffixs?: Array<string>;
|
|
45
57
|
/**
|
|
46
58
|
* 是否缓存
|
|
47
59
|
*/
|
|
@@ -69,9 +81,13 @@ interface Config {
|
|
|
69
81
|
*/
|
|
70
82
|
getMatch?(name: string, extensions?: Array<string>, matchs?: Array<string | RegExp>, matchexts?: Array<string | RegExp>): Array<string | RegExp>;
|
|
71
83
|
/**
|
|
72
|
-
*
|
|
84
|
+
* 获取指令匹配数组
|
|
73
85
|
*/
|
|
74
86
|
getMatchDir?(name: string, extensions?: Array<string>, matchDirexts?: Array<string | RegExp>): Array<string | RegExp>;
|
|
87
|
+
/**
|
|
88
|
+
* 获取样式匹配数组
|
|
89
|
+
*/
|
|
90
|
+
getMatchCss?(name: string, extensions?: Array<string>, matchCsss?: Array<string | RegExp>): Array<string | RegExp>;
|
|
75
91
|
}
|
|
76
92
|
interface FangConfig extends Config {
|
|
77
93
|
/**
|
|
@@ -94,6 +110,10 @@ interface FangConfig extends Config {
|
|
|
94
110
|
* 格式化的指令的地址
|
|
95
111
|
*/
|
|
96
112
|
dirUrls?: Array<string>;
|
|
113
|
+
/**
|
|
114
|
+
* 格式化的样式的地址
|
|
115
|
+
*/
|
|
116
|
+
cssUrls?: Array<string>;
|
|
97
117
|
}
|
|
98
118
|
declare const config: Config;
|
|
99
119
|
|
package/dist/config.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk2EK53BNCcjs = require('./chunk-2EK53BNC.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
6
|
+
var _chunk7TRA2EJIcjs = require('./chunk-7TRA2EJI.cjs');
|
|
7
|
+
require('./chunk-VF7SYL7Q.cjs');
|
|
8
|
+
require('./chunk-MRYLBEJR.cjs');
|
|
9
|
+
require('./chunk-ULH7QSGL.cjs');
|
|
10
10
|
|
|
11
11
|
// packages/index.ts
|
|
12
|
-
var FangComponent = class extends
|
|
12
|
+
var FangComponent = class extends _chunk7TRA2EJIcjs.component_default {
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.ComponentsResolver =
|
|
17
|
+
exports.ComponentsResolver = _chunk2EK53BNCcjs.ComponentsResolver; exports.FangComponent = FangComponent;
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComponentsResolver
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A5OVCZQE.js";
|
|
4
4
|
import {
|
|
5
5
|
component_default
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-3JVAEN3H.js";
|
|
7
|
+
import "./chunk-ZQPRQ7JM.js";
|
|
8
|
+
import "./chunk-ZTRD2TOY.js";
|
|
9
|
+
import "./chunk-2KIAPSQV.js";
|
|
10
10
|
|
|
11
11
|
// packages/index.ts
|
|
12
12
|
var FangComponent = class extends component_default {
|
package/dist/library.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkULH7QSGLcjs = require('./chunk-ULH7QSGL.cjs');
|
|
4
4
|
|
|
5
5
|
// packages/library.ts
|
|
6
6
|
function namefilter(config, name) {
|
|
7
|
-
let vm =
|
|
7
|
+
let vm = _chunkULH7QSGLcjs.humpToLine.call(void 0, name);
|
|
8
8
|
if (config.alias) {
|
|
9
9
|
const reg1 = new RegExp("^" + config.alias + "-" + config.prefix + "-");
|
|
10
10
|
if (reg1.test(vm)) {
|
package/dist/library.d.cts
CHANGED
package/dist/library.d.ts
CHANGED
package/dist/library.js
CHANGED
package/dist/resolver.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
3
|
+
var _chunk2EK53BNCcjs = require('./chunk-2EK53BNC.cjs');
|
|
4
|
+
require('./chunk-7TRA2EJI.cjs');
|
|
5
|
+
require('./chunk-VF7SYL7Q.cjs');
|
|
6
|
+
require('./chunk-MRYLBEJR.cjs');
|
|
7
|
+
require('./chunk-ULH7QSGL.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.ComponentsResolver =
|
|
10
|
+
exports.ComponentsResolver = _chunk2EK53BNCcjs.ComponentsResolver;
|
package/dist/resolver.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComponentsResolver
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-A5OVCZQE.js";
|
|
4
|
+
import "./chunk-3JVAEN3H.js";
|
|
5
|
+
import "./chunk-ZQPRQ7JM.js";
|
|
6
|
+
import "./chunk-ZTRD2TOY.js";
|
|
7
|
+
import "./chunk-2KIAPSQV.js";
|
|
8
8
|
export {
|
|
9
9
|
ComponentsResolver
|
|
10
10
|
};
|
package/dist/util.cjs
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkMRYLBEJRcjs = require('./chunk-MRYLBEJR.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkULH7QSGLcjs = require('./chunk-ULH7QSGL.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.firstUpper =
|
|
16
|
+
exports.firstUpper = _chunkMRYLBEJRcjs.firstUpper; exports.getComponentNames = _chunkMRYLBEJRcjs.getComponentNames; exports.humpToLine = _chunkULH7QSGLcjs.humpToLine; exports.styleLog = _chunkMRYLBEJRcjs.styleLog; exports.unmergeObject = _chunkMRYLBEJRcjs.unmergeObject;
|
package/dist/util.js
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
getComponentNames,
|
|
4
4
|
styleLog,
|
|
5
5
|
unmergeObject
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZTRD2TOY.js";
|
|
7
7
|
import {
|
|
8
8
|
humpToLine
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2KIAPSQV.js";
|
|
10
10
|
export {
|
|
11
11
|
firstUpper,
|
|
12
12
|
getComponentNames,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fangzhongya/vue-components",
|
|
3
3
|
"private": false,
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.6",
|
|
6
6
|
"description ": "unplugin-vue-components插件",
|
|
7
7
|
"author": "fangzhongya ",
|
|
8
8
|
"license": "MIT",
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
"registry": "https://registry.npmjs.org/"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@fangzhongya/create": "0.2.
|
|
22
|
-
"@fangzhongya/utils": "0.0.
|
|
23
|
-
"@types/node": "^
|
|
21
|
+
"@fangzhongya/create": "0.2.30",
|
|
22
|
+
"@fangzhongya/utils": "0.0.25",
|
|
23
|
+
"@types/node": "^24.1.0",
|
|
24
24
|
"ts-node": "^10.9.2",
|
|
25
|
-
"tsup": "^8.0
|
|
26
|
-
"typescript": "^5.
|
|
27
|
-
"unplugin-vue-components": "^
|
|
28
|
-
"vitest": "^
|
|
29
|
-
"vue": "^3.
|
|
25
|
+
"tsup": "^8.5.0",
|
|
26
|
+
"typescript": "^5.8.3",
|
|
27
|
+
"unplugin-vue-components": "^28.8.0",
|
|
28
|
+
"vitest": "^3.2.4",
|
|
29
|
+
"vue": "^3.5.18"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"fast-glob": "^3.3.
|
|
32
|
+
"fast-glob": "^3.3.3"
|
|
33
33
|
},
|
|
34
34
|
"main": "./dist/index.cjs",
|
|
35
35
|
"module": "./dist/index.js",
|
|
@@ -39,41 +39,43 @@
|
|
|
39
39
|
],
|
|
40
40
|
"exports": {
|
|
41
41
|
"./archive": {
|
|
42
|
+
"types": "./dist/archive.d.ts",
|
|
42
43
|
"require": "./dist/archive.cjs",
|
|
43
|
-
"import": "./dist/archive.js"
|
|
44
|
-
"types": "./dist/archive.d.ts"
|
|
44
|
+
"import": "./dist/archive.js"
|
|
45
45
|
},
|
|
46
46
|
"./resolver": {
|
|
47
|
+
"types": "./dist/resolver.d.ts",
|
|
47
48
|
"require": "./dist/resolver.cjs",
|
|
48
|
-
"import": "./dist/resolver.js"
|
|
49
|
-
"types": "./dist/resolver.d.ts"
|
|
49
|
+
"import": "./dist/resolver.js"
|
|
50
50
|
},
|
|
51
51
|
"./component": {
|
|
52
|
+
"types": "./dist/component.d.ts",
|
|
52
53
|
"require": "./dist/component.cjs",
|
|
53
|
-
"import": "./dist/component.js"
|
|
54
|
-
"types": "./dist/component.d.ts"
|
|
54
|
+
"import": "./dist/component.js"
|
|
55
55
|
},
|
|
56
56
|
".": {
|
|
57
|
+
"types": "./dist/index.d.ts",
|
|
57
58
|
"require": "./dist/index.cjs",
|
|
58
|
-
"import": "./dist/index.js"
|
|
59
|
-
"types": "./dist/index.d.ts"
|
|
59
|
+
"import": "./dist/index.js"
|
|
60
60
|
},
|
|
61
61
|
"./library": {
|
|
62
|
+
"types": "./dist/library.d.ts",
|
|
62
63
|
"require": "./dist/library.cjs",
|
|
63
|
-
"import": "./dist/library.js"
|
|
64
|
-
"types": "./dist/library.d.ts"
|
|
64
|
+
"import": "./dist/library.js"
|
|
65
65
|
},
|
|
66
66
|
"./index": {
|
|
67
|
+
"types": "./dist/index.d.ts",
|
|
67
68
|
"require": "./dist/index.cjs",
|
|
68
|
-
"import": "./dist/index.js"
|
|
69
|
-
"types": "./dist/index.d.ts"
|
|
69
|
+
"import": "./dist/index.js"
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
|
-
"dev": "ts-node node/index.ts",
|
|
73
|
+
"dev": "node --loader ts-node/esm node/index.ts",
|
|
74
|
+
"devx": "ts-node node/index.ts",
|
|
74
75
|
"pub": "pnpm publish --access public --no-git-checks",
|
|
75
76
|
"all": "pnpm dev & pnpm build & pnpm pub",
|
|
76
|
-
"dev:tests": "ts-node node/tests.ts",
|
|
77
|
+
"dev:tests": "node --loader ts-node/esm node/tests.ts",
|
|
78
|
+
"devx:tests": "ts-node node/tests.ts",
|
|
77
79
|
"build": "tsup",
|
|
78
80
|
"test": "vitest test"
|
|
79
81
|
}
|