@fangzhongya/vue-components 0.1.4-0 → 0.1.4-2
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 +6 -6
- package/dist/archive.d.ts +10 -0
- package/dist/archive.js +3 -3
- package/dist/{chunk-LLJF634R.js → chunk-BBUKS5YN.js} +8 -8
- package/dist/{chunk-JW4JUGLW.cjs → chunk-GZCYXJUE.cjs} +10 -10
- package/dist/{chunk-XCAUNC3M.js → chunk-HTNQ5IXZ.js} +1 -1
- package/dist/{chunk-OQD7XNUW.cjs → chunk-JO3FU3FJ.cjs} +1 -1
- package/dist/{chunk-FMTKN6RQ.cjs → chunk-L2I63KQA.cjs} +14 -14
- package/dist/{chunk-XZDWPKIV.js → chunk-UDMQRR2S.js} +2 -2
- package/dist/{chunk-KHNM2K2H.cjs → chunk-VT2OACF3.cjs} +4 -4
- package/dist/{chunk-V65GV3PG.js → chunk-X7CLYK62.js} +2 -2
- package/dist/component.cjs +4 -4
- package/dist/component.d.ts +22 -0
- package/dist/component.js +3 -3
- package/dist/config.d.ts +100 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.ts +9 -0
- package/dist/index.js +4 -4
- package/dist/library.cjs +2 -2
- package/dist/library.d.ts +14 -0
- package/dist/library.js +1 -1
- package/dist/resolver.cjs +5 -5
- package/dist/resolver.d.ts +10 -0
- package/dist/resolver.js +4 -4
- package/dist/util.cjs +3 -3
- package/dist/util.d.ts +5 -0
- package/dist/util.js +2 -2
- package/package.json +17 -11
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 _chunkL2I63KQAcjs = require('./chunk-L2I63KQA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkX23FY6UKcjs = require('./chunk-X23FY6UK.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('./chunk-
|
|
9
|
+
var _chunkGZCYXJUEcjs = require('./chunk-GZCYXJUE.cjs');
|
|
10
|
+
require('./chunk-JO3FU3FJ.cjs');
|
|
11
11
|
|
|
12
12
|
// packages/archive.ts
|
|
13
13
|
var _fs = require('fs');
|
|
@@ -59,14 +59,14 @@ function setJson(obj) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
function ComponentsResolverArchive(config2 = {}) {
|
|
62
|
-
const configs =
|
|
62
|
+
const configs = _chunkGZCYXJUEcjs.unmergeObject.call(void 0,
|
|
63
63
|
_chunkX23FY6UKcjs.config,
|
|
64
64
|
archiveConfig,
|
|
65
65
|
2,
|
|
66
66
|
true
|
|
67
67
|
);
|
|
68
|
-
const fangComp = new (0,
|
|
69
|
-
|
|
68
|
+
const fangComp = new (0, _chunkL2I63KQAcjs.component_default)(
|
|
69
|
+
_chunkGZCYXJUEcjs.unmergeObject.call(void 0, configs, config2, 1)
|
|
70
70
|
);
|
|
71
71
|
setJson(fangComp.config);
|
|
72
72
|
return [
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FangConfig } from './config.js';
|
|
2
|
+
import { ComponentResolver } from 'unplugin-vue-components';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 自动按需匹配注册
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
declare function ComponentsResolverArchive(config?: FangConfig): ComponentResolver[];
|
|
9
|
+
|
|
10
|
+
export { ComponentsResolverArchive };
|
package/dist/archive.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
component_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UDMQRR2S.js";
|
|
4
4
|
import {
|
|
5
5
|
config
|
|
6
6
|
} from "./chunk-S6QJIPBZ.js";
|
|
7
7
|
import {
|
|
8
8
|
unmergeObject
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-BBUKS5YN.js";
|
|
10
|
+
import "./chunk-HTNQ5IXZ.js";
|
|
11
11
|
|
|
12
12
|
// packages/archive.ts
|
|
13
13
|
import { writeFile } from "node:fs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
humpToLine
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HTNQ5IXZ.js";
|
|
4
4
|
|
|
5
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
5
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.8-27/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.8-27/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.8-27/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.8-27/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.8-27/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.8-27/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.8-27/node_modules/@fangzhongya/utils/dist/chunk-VRRDYCUH.js
|
|
106
106
|
function getComponentNames(name) {
|
|
107
107
|
if (name.includes("-")) {
|
|
108
108
|
const line = humpToLine(name);
|
|
@@ -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 _chunkJO3FU3FJcjs = require('./chunk-JO3FU3FJ.cjs');
|
|
4
4
|
|
|
5
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
5
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.8-27/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.8-27/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.8-27/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.8-27/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.8-27/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.8-27/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.8-27/node_modules/@fangzhongya/utils/dist/chunk-VRRDYCUH.js
|
|
106
106
|
function getComponentNames(name) {
|
|
107
107
|
if (name.includes("-")) {
|
|
108
|
-
const line =
|
|
108
|
+
const line = _chunkJO3FU3FJcjs.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 = _chunkJO3FU3FJcjs.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
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
1
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.8-27/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,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.8-27/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 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkGZCYXJUEcjs = require('./chunk-GZCYXJUE.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkJO3FU3FJcjs = require('./chunk-JO3FU3FJ.cjs');
|
|
9
9
|
|
|
10
10
|
// packages/component.ts
|
|
11
11
|
var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
|
|
@@ -247,7 +247,7 @@ var FangComponent = class {
|
|
|
247
247
|
* @returns { Boolean } 是否要替换
|
|
248
248
|
*/
|
|
249
249
|
#namefilter(name) {
|
|
250
|
-
name =
|
|
250
|
+
name = _chunkJO3FU3FJcjs.humpToLine.call(void 0, name);
|
|
251
251
|
if (this.config.startss) {
|
|
252
252
|
for (let index = 0; index < this.config.startss.length; index++) {
|
|
253
253
|
const element = this.config.startss[index] + "-";
|
|
@@ -307,7 +307,7 @@ var FangComponent = class {
|
|
|
307
307
|
} else if (as.length > 1) {
|
|
308
308
|
let m;
|
|
309
309
|
if (/[A-Z]/.test(yname.slice(0, 1))) {
|
|
310
|
-
m = yname.replace(
|
|
310
|
+
m = yname.replace(_chunkGZCYXJUEcjs.firstUpper.call(void 0, top), "");
|
|
311
311
|
} else {
|
|
312
312
|
m = yname.replace(top, "");
|
|
313
313
|
}
|
|
@@ -339,14 +339,14 @@ var FangComponent = class {
|
|
|
339
339
|
* @returns { Object } 注册的对象
|
|
340
340
|
*/
|
|
341
341
|
#setNameFrom(name, type) {
|
|
342
|
-
let mb =
|
|
342
|
+
let mb = _chunkJO3FU3FJcjs.humpToLine.call(void 0, name);
|
|
343
343
|
const alias = this.config.alias;
|
|
344
344
|
if (alias) {
|
|
345
345
|
if (mb.startsWith(alias + "-")) {
|
|
346
346
|
const reg = new RegExp("^" + alias + "-");
|
|
347
347
|
mb = mb.replace(reg, "");
|
|
348
348
|
const reg1 = new RegExp("^" + alias);
|
|
349
|
-
const reg2 = new RegExp("^" +
|
|
349
|
+
const reg2 = new RegExp("^" + _chunkGZCYXJUEcjs.firstUpper.call(void 0, alias));
|
|
350
350
|
if (reg1.test(name)) {
|
|
351
351
|
name = name.replace(reg1, "");
|
|
352
352
|
} else if (reg2.test(name)) {
|
|
@@ -391,7 +391,7 @@ var FangComponent = class {
|
|
|
391
391
|
* @returns {Array} 需要匹配的地址名称数组
|
|
392
392
|
*/
|
|
393
393
|
#setMatchUrls(name, type) {
|
|
394
|
-
const arr =
|
|
394
|
+
const arr = _chunkGZCYXJUEcjs.getComponentNames.call(void 0, name);
|
|
395
395
|
const urls = [];
|
|
396
396
|
if (type == "directive") {
|
|
397
397
|
const getMatchDir = this.config.getMatchDir;
|
|
@@ -547,39 +547,39 @@ var FangComponent = class {
|
|
|
547
547
|
};
|
|
548
548
|
const arr = [];
|
|
549
549
|
arr.push(
|
|
550
|
-
|
|
550
|
+
_chunkGZCYXJUEcjs.styleLog.call(void 0, "[@fangzhongya/vue-components]", {
|
|
551
551
|
text: 3
|
|
552
552
|
})
|
|
553
553
|
);
|
|
554
554
|
if (obj && obj.from) {
|
|
555
|
-
let sfrom =
|
|
555
|
+
let sfrom = _chunkGZCYXJUEcjs.styleLog.call(void 0, _optionalChain([obj, 'optionalAccess', _15 => _15.from]), {
|
|
556
556
|
text: 4,
|
|
557
557
|
revert: true
|
|
558
558
|
});
|
|
559
559
|
arr.push(
|
|
560
|
-
|
|
560
|
+
_chunkGZCYXJUEcjs.styleLog.call(void 0, type, {
|
|
561
561
|
text: texts[type]
|
|
562
562
|
})
|
|
563
563
|
);
|
|
564
564
|
arr.push(
|
|
565
|
-
|
|
565
|
+
_chunkGZCYXJUEcjs.styleLog.call(void 0, name, {
|
|
566
566
|
bold: true
|
|
567
567
|
})
|
|
568
568
|
);
|
|
569
569
|
if (!is) {
|
|
570
|
-
sfrom =
|
|
570
|
+
sfrom = _chunkGZCYXJUEcjs.styleLog.call(void 0, "+", {
|
|
571
571
|
text: 2
|
|
572
572
|
}) + sfrom;
|
|
573
573
|
}
|
|
574
574
|
arr.push(sfrom);
|
|
575
575
|
} else {
|
|
576
576
|
arr.push(
|
|
577
|
-
|
|
577
|
+
_chunkGZCYXJUEcjs.styleLog.call(void 0, type, {
|
|
578
578
|
text: texts[type]
|
|
579
579
|
})
|
|
580
580
|
);
|
|
581
581
|
arr.push(
|
|
582
|
-
|
|
582
|
+
_chunkGZCYXJUEcjs.styleLog.call(void 0, name, {
|
|
583
583
|
bold: true,
|
|
584
584
|
text: 1
|
|
585
585
|
})
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
firstUpper,
|
|
3
3
|
getComponentNames,
|
|
4
4
|
styleLog
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BBUKS5YN.js";
|
|
6
6
|
import {
|
|
7
7
|
humpToLine
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HTNQ5IXZ.js";
|
|
9
9
|
|
|
10
10
|
// packages/component.ts
|
|
11
11
|
import fastGlob from "fast-glob";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkL2I63KQAcjs = require('./chunk-L2I63KQA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkX23FY6UKcjs = require('./chunk-X23FY6UK.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkGZCYXJUEcjs = require('./chunk-GZCYXJUE.cjs');
|
|
10
10
|
|
|
11
11
|
// packages/resolver.ts
|
|
12
12
|
function ComponentsResolver(config2 = {}) {
|
|
13
|
-
const configs =
|
|
14
|
-
const fangComp = new (0,
|
|
13
|
+
const configs = _chunkGZCYXJUEcjs.unmergeObject.call(void 0, _chunkX23FY6UKcjs.config, config2, 1);
|
|
14
|
+
const fangComp = new (0, _chunkL2I63KQAcjs.component_default)(configs);
|
|
15
15
|
return [
|
|
16
16
|
{
|
|
17
17
|
type: "component",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
component_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UDMQRR2S.js";
|
|
4
4
|
import {
|
|
5
5
|
config
|
|
6
6
|
} from "./chunk-S6QJIPBZ.js";
|
|
7
7
|
import {
|
|
8
8
|
unmergeObject
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BBUKS5YN.js";
|
|
10
10
|
|
|
11
11
|
// packages/resolver.ts
|
|
12
12
|
function ComponentsResolver(config2 = {}) {
|
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 _chunkL2I63KQAcjs = require('./chunk-L2I63KQA.cjs');
|
|
4
|
+
require('./chunk-GZCYXJUE.cjs');
|
|
5
|
+
require('./chunk-JO3FU3FJ.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = _chunkL2I63KQAcjs.component_default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FangConfig, Config } from './config.js';
|
|
2
|
+
import { ComponentInfo } from 'unplugin-vue-components';
|
|
3
|
+
|
|
4
|
+
type FangComponentInfo = ComponentInfo | undefined | void;
|
|
5
|
+
type ResolveType = 'component' | 'directive';
|
|
6
|
+
/**
|
|
7
|
+
* 自动注册组件和指令的方法
|
|
8
|
+
*/
|
|
9
|
+
declare class FangComponent {
|
|
10
|
+
#private;
|
|
11
|
+
config: FangConfig;
|
|
12
|
+
constructor(config?: Config);
|
|
13
|
+
/**
|
|
14
|
+
* 自动按需匹配注册
|
|
15
|
+
* @param {String} name 名称
|
|
16
|
+
* @param {String} type 类型
|
|
17
|
+
* @returns { Object } 注册的对象
|
|
18
|
+
*/
|
|
19
|
+
resolve(name: string, type: ResolveType): FangComponentInfo;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { FangComponent as default };
|
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-UDMQRR2S.js";
|
|
4
|
+
import "./chunk-BBUKS5YN.js";
|
|
5
|
+
import "./chunk-HTNQ5IXZ.js";
|
|
6
6
|
export {
|
|
7
7
|
component_default as default
|
|
8
8
|
};
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
interface Config {
|
|
2
|
+
/**
|
|
3
|
+
* 自动导入的文件目录
|
|
4
|
+
*/
|
|
5
|
+
dir?: string;
|
|
6
|
+
/**
|
|
7
|
+
* 文件后缀
|
|
8
|
+
* 如果为空数组,
|
|
9
|
+
*/
|
|
10
|
+
extensions?: Array<string>;
|
|
11
|
+
/**
|
|
12
|
+
* 自己的别名
|
|
13
|
+
*/
|
|
14
|
+
alias?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 只支持自己的别名组件,与子别名无关
|
|
17
|
+
*/
|
|
18
|
+
onlyAlias?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* 通过头匹配,默认转换成 - 模式匹配的
|
|
21
|
+
* dir下面子目录来配置别名
|
|
22
|
+
* 不区分首字母大小写
|
|
23
|
+
*/
|
|
24
|
+
aliass?: {
|
|
25
|
+
[key: string]: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* 目录过滤
|
|
29
|
+
*/
|
|
30
|
+
catalogue?: Array<string | RegExp>;
|
|
31
|
+
/**
|
|
32
|
+
* 匹配数组
|
|
33
|
+
* '' 表示匹配当前文件名
|
|
34
|
+
*/
|
|
35
|
+
matchs?: Array<string | RegExp>;
|
|
36
|
+
/**
|
|
37
|
+
* 匹配文件名称和文件类型
|
|
38
|
+
*/
|
|
39
|
+
matchexts?: Array<string | RegExp>;
|
|
40
|
+
matchDirexts?: Array<string | RegExp>;
|
|
41
|
+
/**
|
|
42
|
+
* 指令文件夹名称
|
|
43
|
+
*/
|
|
44
|
+
directives?: string;
|
|
45
|
+
/**
|
|
46
|
+
* 是否缓存
|
|
47
|
+
*/
|
|
48
|
+
isCache?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 过滤 不匹配 通过头匹配,默认转换成 - 模式匹配的
|
|
51
|
+
* 不区分首字母大小写
|
|
52
|
+
*/
|
|
53
|
+
startss?: Array<string>;
|
|
54
|
+
/**
|
|
55
|
+
* 过滤 不匹配 全匹配 - 模式匹配的
|
|
56
|
+
* 不区分首字母大小写
|
|
57
|
+
*/
|
|
58
|
+
filtes?: Array<string>;
|
|
59
|
+
/**
|
|
60
|
+
* 匹配到的文件路径
|
|
61
|
+
*/
|
|
62
|
+
getFromName?(url: string, name: string, type: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* 控制台是否输出日志
|
|
65
|
+
*/
|
|
66
|
+
log?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* 获取匹配数组
|
|
69
|
+
*/
|
|
70
|
+
getMatch?(name: string, extensions?: Array<string>, matchs?: Array<string | RegExp>, matchexts?: Array<string | RegExp>): Array<string | RegExp>;
|
|
71
|
+
/**
|
|
72
|
+
* 获取匹配数组
|
|
73
|
+
*/
|
|
74
|
+
getMatchDir?(name: string, extensions?: Array<string>, matchDirexts?: Array<string | RegExp>): Array<string | RegExp>;
|
|
75
|
+
}
|
|
76
|
+
interface FangConfig extends Config {
|
|
77
|
+
/**
|
|
78
|
+
* 是否去掉路径的前缀
|
|
79
|
+
*/
|
|
80
|
+
urlprefix?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* 是否生成json 配置文件
|
|
83
|
+
*/
|
|
84
|
+
isJson?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* 生成json 配置文件名称
|
|
87
|
+
*/
|
|
88
|
+
jsonName?: string;
|
|
89
|
+
/**
|
|
90
|
+
* 格式化的组件的地址
|
|
91
|
+
*/
|
|
92
|
+
urls?: Array<string>;
|
|
93
|
+
/**
|
|
94
|
+
* 格式化的指令的地址
|
|
95
|
+
*/
|
|
96
|
+
dirUrls?: Array<string>;
|
|
97
|
+
}
|
|
98
|
+
declare const config: Config;
|
|
99
|
+
|
|
100
|
+
export { Config, FangConfig, config };
|
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 _chunkVT2OACF3cjs = require('./chunk-VT2OACF3.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkL2I63KQAcjs = require('./chunk-L2I63KQA.cjs');
|
|
7
7
|
require('./chunk-X23FY6UK.cjs');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-GZCYXJUE.cjs');
|
|
9
|
+
require('./chunk-JO3FU3FJ.cjs');
|
|
10
10
|
|
|
11
11
|
// packages/index.ts
|
|
12
|
-
var FangComponent = class extends
|
|
12
|
+
var FangComponent = class extends _chunkL2I63KQAcjs.component_default {
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.ComponentsResolver =
|
|
17
|
+
exports.ComponentsResolver = _chunkVT2OACF3cjs.ComponentsResolver; exports.FangComponent = FangComponent;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import FangComponent$1 from './component.js';
|
|
2
|
+
export { Config } from './config.js';
|
|
3
|
+
export { ComponentsResolver } from './resolver.js';
|
|
4
|
+
import 'unplugin-vue-components';
|
|
5
|
+
|
|
6
|
+
declare class FangComponent extends FangComponent$1 {
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { FangComponent };
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComponentsResolver
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X7CLYK62.js";
|
|
4
4
|
import {
|
|
5
5
|
component_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UDMQRR2S.js";
|
|
7
7
|
import "./chunk-S6QJIPBZ.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-BBUKS5YN.js";
|
|
9
|
+
import "./chunk-HTNQ5IXZ.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 _chunkJO3FU3FJcjs = require('./chunk-JO3FU3FJ.cjs');
|
|
4
4
|
|
|
5
5
|
// packages/library.ts
|
|
6
6
|
function namefilter(config, name) {
|
|
7
|
-
let vm =
|
|
7
|
+
let vm = _chunkJO3FU3FJcjs.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)) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentResolver, ComponentResolveResult } from 'unplugin-vue-components';
|
|
2
|
+
|
|
3
|
+
type Config = {
|
|
4
|
+
prefix: string;
|
|
5
|
+
alias?: string;
|
|
6
|
+
getFrom?(mc: string, type: string | number): ComponentResolveResult;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* 自动按需匹配注册
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
declare function FangLibResolver(config: Config): ComponentResolver[];
|
|
13
|
+
|
|
14
|
+
export { FangLibResolver };
|
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-
|
|
3
|
+
var _chunkVT2OACF3cjs = require('./chunk-VT2OACF3.cjs');
|
|
4
|
+
require('./chunk-L2I63KQA.cjs');
|
|
5
5
|
require('./chunk-X23FY6UK.cjs');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-GZCYXJUE.cjs');
|
|
7
|
+
require('./chunk-JO3FU3FJ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.ComponentsResolver =
|
|
10
|
+
exports.ComponentsResolver = _chunkVT2OACF3cjs.ComponentsResolver;
|
package/dist/resolver.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComponentsResolver
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-X7CLYK62.js";
|
|
4
|
+
import "./chunk-UDMQRR2S.js";
|
|
5
5
|
import "./chunk-S6QJIPBZ.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-BBUKS5YN.js";
|
|
7
|
+
import "./chunk-HTNQ5IXZ.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 _chunkGZCYXJUEcjs = require('./chunk-GZCYXJUE.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkJO3FU3FJcjs = require('./chunk-JO3FU3FJ.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.firstUpper =
|
|
16
|
+
exports.firstUpper = _chunkGZCYXJUEcjs.firstUpper; exports.getComponentNames = _chunkGZCYXJUEcjs.getComponentNames; exports.humpToLine = _chunkJO3FU3FJcjs.humpToLine; exports.styleLog = _chunkGZCYXJUEcjs.styleLog; exports.unmergeObject = _chunkGZCYXJUEcjs.unmergeObject;
|
package/dist/util.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { styleLog } from '@fangzhongya/utils/log/styleLog';
|
|
2
|
+
export { unmergeObject } from '@fangzhongya/utils/basic/object/unmergeObject';
|
|
3
|
+
export { getComponentNames } from '@fangzhongya/utils/name/getComponentNames';
|
|
4
|
+
export { humpToLine } from '@fangzhongya/utils/name/humpToLine';
|
|
5
|
+
export { firstUpper } from '@fangzhongya/utils/basic/string/firstUpper';
|
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-BBUKS5YN.js";
|
|
7
7
|
import {
|
|
8
8
|
humpToLine
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HTNQ5IXZ.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.4-
|
|
5
|
+
"version": "0.1.4-2",
|
|
6
6
|
"description ": "unplugin-vue-components插件",
|
|
7
7
|
"author": "fangzhongya ",
|
|
8
8
|
"license": "MIT",
|
|
@@ -18,13 +18,14 @@
|
|
|
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": "^18.
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
21
|
+
"@fangzhongya/create": "0.2.4-3",
|
|
22
|
+
"@fangzhongya/utils": "0.0.8-27",
|
|
23
|
+
"@types/node": "^18.15.5",
|
|
24
|
+
"ts-node": "^10.9.1",
|
|
25
|
+
"tsup": "^6.7.0",
|
|
26
|
+
"typescript": "^5.0.2",
|
|
27
|
+
"unplugin-vue-components": "^0.24.1",
|
|
28
|
+
"vitest": "^0.29.7",
|
|
28
29
|
"vue": "^3.2.47"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
@@ -62,7 +63,12 @@
|
|
|
62
63
|
"import": "./dist/index.js",
|
|
63
64
|
"types": "./dist/index.d.ts"
|
|
64
65
|
},
|
|
65
|
-
"./*": "./*"
|
|
66
|
+
"./*": "./*",
|
|
67
|
+
"./library": {
|
|
68
|
+
"require": "./dist/library.cjs",
|
|
69
|
+
"import": "./dist/library.js",
|
|
70
|
+
"types": "./dist/library.d.ts"
|
|
71
|
+
}
|
|
66
72
|
},
|
|
67
73
|
"typesVersions": {
|
|
68
74
|
"*": {
|
|
@@ -72,10 +78,10 @@
|
|
|
72
78
|
}
|
|
73
79
|
},
|
|
74
80
|
"scripts": {
|
|
75
|
-
"dev": "ts-node node
|
|
81
|
+
"dev": "ts-node node/index.ts",
|
|
76
82
|
"pub": "pnpm publish --access public --no-git-checks",
|
|
77
83
|
"all": "pnpm dev & pnpm build & pnpm pub",
|
|
78
|
-
"dev:tests": "ts-node node
|
|
84
|
+
"dev:tests": "ts-node node/tests.ts",
|
|
79
85
|
"build": "tsup",
|
|
80
86
|
"test": "vitest test"
|
|
81
87
|
}
|