@fangzhongya/vue-components 0.1.19 → 0.1.21
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 +42 -11
- package/dist/archive.d.cts +10 -0
- package/dist/archive.d.ts +10 -0
- package/dist/archive.js +40 -9
- package/dist/{chunk-E2BEMH6U.js → chunk-25JYZGRF.js} +24 -15
- package/dist/{chunk-6BRXYTET.cjs → chunk-4A5AX2PJ.cjs} +4 -4
- package/dist/{chunk-ZWVHHITI.js → chunk-E3I6537N.js} +1 -1
- package/dist/{chunk-OQ2ECPIY.js → chunk-IV2Z7LZ7.js} +8 -8
- package/dist/{chunk-HVHTH5JD.cjs → chunk-LIKH5T7R.cjs} +35 -26
- package/dist/{chunk-EGU4WHHR.cjs → chunk-OQIBNUVK.cjs} +10 -10
- package/dist/{chunk-DQBKCBHA.js → chunk-RHYZ76ZY.js} +2 -2
- package/dist/{chunk-FOPZ7EBX.cjs → chunk-YW7CKAOG.cjs} +1 -1
- package/dist/component.cjs +4 -4
- package/dist/component.d.cts +22 -0
- package/dist/component.d.ts +22 -0
- package/dist/component.js +3 -3
- package/dist/config.d.cts +138 -0
- package/dist/config.d.ts +138 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +4 -4
- package/dist/library.cjs +2 -2
- package/dist/library.d.cts +14 -0
- package/dist/library.d.ts +14 -0
- package/dist/library.js +1 -1
- package/dist/resolver.cjs +5 -5
- package/dist/resolver.d.cts +10 -0
- package/dist/resolver.d.ts +10 -0
- package/dist/resolver.js +4 -4
- package/dist/util.cjs +3 -3
- package/dist/util.d.cts +5 -0
- package/dist/util.d.ts +5 -0
- package/dist/util.js +2 -2
- package/package.json +7 -7
package/dist/archive.cjs
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkLIKH5T7Rcjs = require('./chunk-LIKH5T7R.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkUNBQUEQ4cjs = require('./chunk-UNBQUEQ4.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('./chunk-
|
|
9
|
+
var _chunkOQIBNUVKcjs = require('./chunk-OQIBNUVK.cjs');
|
|
10
|
+
require('./chunk-YW7CKAOG.cjs');
|
|
11
11
|
|
|
12
12
|
// packages/archive.ts
|
|
13
13
|
var _fs = require('fs');
|
|
14
14
|
var _path = require('path');
|
|
15
15
|
|
|
16
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
16
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.73/node_modules/@fangzhongya/utils/dist/chunk-ZADO6V3Z.js
|
|
17
17
|
var TYPE_MARKERS = {
|
|
18
|
+
// 对象引用
|
|
19
|
+
CIRCULAR_REF: "_CR_",
|
|
20
|
+
// 新增:循环引用标记
|
|
18
21
|
FUNCTION_REF: "_FR_",
|
|
19
22
|
CODE_BLOCK: "_CB_",
|
|
20
23
|
/**内置对象*/
|
|
@@ -101,17 +104,45 @@ var arrayBufferUtils = {
|
|
|
101
104
|
return buffer;
|
|
102
105
|
}
|
|
103
106
|
};
|
|
104
|
-
function
|
|
105
|
-
|
|
107
|
+
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;
|
|
123
|
+
}
|
|
124
|
+
function toJSONSStringify(obj, space, filtrat = "__") {
|
|
125
|
+
const seen = /* @__PURE__ */ new WeakMap();
|
|
106
126
|
return JSON.stringify(
|
|
107
127
|
obj,
|
|
108
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
|
+
}
|
|
109
133
|
if (value === null) {
|
|
110
134
|
return null;
|
|
111
135
|
}
|
|
112
|
-
if (typeof value === "object") {
|
|
113
|
-
|
|
114
|
-
|
|
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
|
+
}
|
|
115
146
|
}
|
|
116
147
|
if (this[key] instanceof Date) {
|
|
117
148
|
return {
|
|
@@ -299,8 +330,8 @@ function setJson(obj) {
|
|
|
299
330
|
}
|
|
300
331
|
}
|
|
301
332
|
function ComponentsResolverArchive(config2 = {}) {
|
|
302
|
-
const configs =
|
|
303
|
-
const fangComp = new (0,
|
|
333
|
+
const configs = _chunkOQIBNUVKcjs.unmergeObject.call(void 0, _chunkUNBQUEQ4cjs.config, archiveConfig, 2, true);
|
|
334
|
+
const fangComp = new (0, _chunkLIKH5T7Rcjs.component_default)(_chunkOQIBNUVKcjs.unmergeObject.call(void 0, configs, config2, 1));
|
|
304
335
|
setJson(fangComp.config);
|
|
305
336
|
return [
|
|
306
337
|
{
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FangConfig } from './config.cjs';
|
|
2
|
+
import { ComponentResolver } from 'unplugin-vue-components';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 自动按需匹配注册
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
declare function ComponentsResolverArchive(config?: FangConfig): ComponentResolver[];
|
|
9
|
+
|
|
10
|
+
export { ComponentsResolverArchive };
|
|
@@ -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,20 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
component_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-25JYZGRF.js";
|
|
4
4
|
import {
|
|
5
5
|
config
|
|
6
6
|
} from "./chunk-DURXCSNX.js";
|
|
7
7
|
import {
|
|
8
8
|
unmergeObject
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-IV2Z7LZ7.js";
|
|
10
|
+
import "./chunk-E3I6537N.js";
|
|
11
11
|
|
|
12
12
|
// packages/archive.ts
|
|
13
13
|
import { writeFile } from "fs";
|
|
14
14
|
import { resolve } from "path";
|
|
15
15
|
|
|
16
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
16
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.73/node_modules/@fangzhongya/utils/dist/chunk-ZADO6V3Z.js
|
|
17
17
|
var TYPE_MARKERS = {
|
|
18
|
+
// 对象引用
|
|
19
|
+
CIRCULAR_REF: "_CR_",
|
|
20
|
+
// 新增:循环引用标记
|
|
18
21
|
FUNCTION_REF: "_FR_",
|
|
19
22
|
CODE_BLOCK: "_CB_",
|
|
20
23
|
/**内置对象*/
|
|
@@ -101,17 +104,45 @@ var arrayBufferUtils = {
|
|
|
101
104
|
return buffer;
|
|
102
105
|
}
|
|
103
106
|
};
|
|
104
|
-
function
|
|
105
|
-
|
|
107
|
+
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;
|
|
123
|
+
}
|
|
124
|
+
function toJSONSStringify(obj, space, filtrat = "__") {
|
|
125
|
+
const seen = /* @__PURE__ */ new WeakMap();
|
|
106
126
|
return JSON.stringify(
|
|
107
127
|
obj,
|
|
108
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
|
+
}
|
|
109
133
|
if (value === null) {
|
|
110
134
|
return null;
|
|
111
135
|
}
|
|
112
|
-
if (typeof value === "object") {
|
|
113
|
-
|
|
114
|
-
|
|
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
|
+
}
|
|
115
146
|
}
|
|
116
147
|
if (this[key] instanceof Date) {
|
|
117
148
|
return {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getComponentNames,
|
|
3
3
|
styleLog
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IV2Z7LZ7.js";
|
|
5
5
|
import {
|
|
6
6
|
humpToLine
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-E3I6537N.js";
|
|
8
8
|
|
|
9
9
|
// packages/component.ts
|
|
10
10
|
import fastGlob from "fast-glob";
|
|
11
11
|
import { resolve } from "path";
|
|
12
12
|
|
|
13
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
13
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.73/node_modules/@fangzhongya/utils/dist/chunk-YNOFNHEK.js
|
|
14
14
|
function matchsEnd(key, matchs) {
|
|
15
15
|
if (matchs && matchs.length > 0) {
|
|
16
16
|
for (const value of matchs) {
|
|
@@ -30,7 +30,7 @@ function matchsEnd(key, matchs) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
33
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.73/node_modules/@fangzhongya/utils/dist/chunk-S6JRKYPY.js
|
|
34
34
|
function matchsStart(key, matchs) {
|
|
35
35
|
if (matchs && matchs.length > 0) {
|
|
36
36
|
for (const value of matchs) {
|
|
@@ -133,17 +133,26 @@ var FangComponent = class {
|
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
136
|
+
// 可以添加 @ts-ignore 注释暂时忽略这个警告
|
|
137
|
+
// @ts-ignore
|
|
138
|
+
// #getMatchsUrl(
|
|
139
|
+
// urls: Array<string>,
|
|
140
|
+
// name: string,
|
|
141
|
+
// type: string,
|
|
142
|
+
// config: Config,
|
|
143
|
+
// ) {
|
|
144
|
+
// const arr = this.#getNames()(name, type, config);
|
|
145
|
+
// const ms: FangMatchs = [];
|
|
146
|
+
// const m = config.matchextss;
|
|
147
|
+
// if (m) {
|
|
148
|
+
// ms.push(m);
|
|
149
|
+
// }
|
|
150
|
+
// return (
|
|
151
|
+
// urls.filter((v) => {
|
|
152
|
+
// return isUrlsMatchi(v, arr, ms);
|
|
153
|
+
// })[0] || ''
|
|
154
|
+
// );
|
|
155
|
+
// }
|
|
147
156
|
#isMatchFile(url, arr, matchexts, nomatchexts) {
|
|
148
157
|
const is = isUrlsMatchi(url, arr, matchexts);
|
|
149
158
|
if (is && nomatchexts && nomatchexts.length > 0) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkLIKH5T7Rcjs = require('./chunk-LIKH5T7R.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkUNBQUEQ4cjs = require('./chunk-UNBQUEQ4.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkOQIBNUVKcjs = require('./chunk-OQIBNUVK.cjs');
|
|
10
10
|
|
|
11
11
|
// packages/resolver.ts
|
|
12
12
|
function ComponentsResolver(config2 = {}) {
|
|
13
|
-
const configs =
|
|
14
|
-
const fangComp = new (0,
|
|
13
|
+
const configs = _chunkOQIBNUVKcjs.unmergeObject.call(void 0, _chunkUNBQUEQ4cjs.config, config2, 1);
|
|
14
|
+
const fangComp = new (0, _chunkLIKH5T7Rcjs.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.73/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-E3I6537N.js";
|
|
4
4
|
|
|
5
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
5
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.73/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.73/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.73/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.73/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.73/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.73/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.73/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,16 +1,16 @@
|
|
|
1
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
|
-
var
|
|
4
|
+
var _chunkOQIBNUVKcjs = require('./chunk-OQIBNUVK.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkYW7CKAOGcjs = require('./chunk-YW7CKAOG.cjs');
|
|
8
8
|
|
|
9
9
|
// packages/component.ts
|
|
10
10
|
var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
|
|
11
11
|
var _path = require('path');
|
|
12
12
|
|
|
13
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
13
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.73/node_modules/@fangzhongya/utils/dist/chunk-YNOFNHEK.js
|
|
14
14
|
function matchsEnd(key, matchs) {
|
|
15
15
|
if (matchs && matchs.length > 0) {
|
|
16
16
|
for (const value of matchs) {
|
|
@@ -30,7 +30,7 @@ function matchsEnd(key, matchs) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
33
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.73/node_modules/@fangzhongya/utils/dist/chunk-S6JRKYPY.js
|
|
34
34
|
function matchsStart(key, matchs) {
|
|
35
35
|
if (matchs && matchs.length > 0) {
|
|
36
36
|
for (const value of matchs) {
|
|
@@ -124,26 +124,35 @@ var FangComponent = class {
|
|
|
124
124
|
return this.config.getAliass;
|
|
125
125
|
} else {
|
|
126
126
|
return function(name, _type, c) {
|
|
127
|
-
const arr =
|
|
127
|
+
const arr = _chunkOQIBNUVKcjs.getComponentNames.call(void 0, name);
|
|
128
128
|
if (c.alias) {
|
|
129
|
-
return [...
|
|
129
|
+
return [..._chunkOQIBNUVKcjs.getComponentNames.call(void 0, c.alias + "-" + name), ...arr];
|
|
130
130
|
} else {
|
|
131
131
|
return arr;
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
136
|
+
// 可以添加 @ts-ignore 注释暂时忽略这个警告
|
|
137
|
+
// @ts-ignore
|
|
138
|
+
// #getMatchsUrl(
|
|
139
|
+
// urls: Array<string>,
|
|
140
|
+
// name: string,
|
|
141
|
+
// type: string,
|
|
142
|
+
// config: Config,
|
|
143
|
+
// ) {
|
|
144
|
+
// const arr = this.#getNames()(name, type, config);
|
|
145
|
+
// const ms: FangMatchs = [];
|
|
146
|
+
// const m = config.matchextss;
|
|
147
|
+
// if (m) {
|
|
148
|
+
// ms.push(m);
|
|
149
|
+
// }
|
|
150
|
+
// return (
|
|
151
|
+
// urls.filter((v) => {
|
|
152
|
+
// return isUrlsMatchi(v, arr, ms);
|
|
153
|
+
// })[0] || ''
|
|
154
|
+
// );
|
|
155
|
+
// }
|
|
147
156
|
#isMatchFile(url, arr, matchexts, nomatchexts) {
|
|
148
157
|
const is = isUrlsMatchi(url, arr, matchexts);
|
|
149
158
|
if (is && nomatchexts && nomatchexts.length > 0) {
|
|
@@ -283,7 +292,7 @@ var FangComponent = class {
|
|
|
283
292
|
* @returns { Boolean } 是否要替换
|
|
284
293
|
*/
|
|
285
294
|
#namefilter(name) {
|
|
286
|
-
name =
|
|
295
|
+
name = _chunkYW7CKAOGcjs.humpToLine.call(void 0, name);
|
|
287
296
|
if (this.config.startss) {
|
|
288
297
|
for (let index = 0; index < this.config.startss.length; index++) {
|
|
289
298
|
const element = this.config.startss[index] + "-";
|
|
@@ -496,46 +505,46 @@ var FangComponent = class {
|
|
|
496
505
|
};
|
|
497
506
|
const arr = [];
|
|
498
507
|
arr.push(
|
|
499
|
-
|
|
508
|
+
_chunkOQIBNUVKcjs.styleLog.call(void 0, "[@fangzhongya/vue-components]", {
|
|
500
509
|
text: 3
|
|
501
510
|
})
|
|
502
511
|
);
|
|
503
512
|
if (obj && obj.from) {
|
|
504
|
-
let sfrom =
|
|
513
|
+
let sfrom = _chunkOQIBNUVKcjs.styleLog.call(void 0, _optionalChain([obj, 'optionalAccess', _28 => _28.from]), {
|
|
505
514
|
text: 4,
|
|
506
515
|
revert: true
|
|
507
516
|
});
|
|
508
517
|
arr.push(
|
|
509
|
-
|
|
518
|
+
_chunkOQIBNUVKcjs.styleLog.call(void 0, type, {
|
|
510
519
|
text: texts[type]
|
|
511
520
|
})
|
|
512
521
|
);
|
|
513
522
|
arr.push(
|
|
514
|
-
|
|
523
|
+
_chunkOQIBNUVKcjs.styleLog.call(void 0, name, {
|
|
515
524
|
bold: true
|
|
516
525
|
})
|
|
517
526
|
);
|
|
518
527
|
if (!is) {
|
|
519
|
-
sfrom =
|
|
528
|
+
sfrom = _chunkOQIBNUVKcjs.styleLog.call(void 0, "+", {
|
|
520
529
|
text: 2
|
|
521
530
|
}) + sfrom;
|
|
522
531
|
}
|
|
523
532
|
arr.push(sfrom);
|
|
524
533
|
if (obj.sideEffects) {
|
|
525
534
|
arr.push(
|
|
526
|
-
|
|
535
|
+
_chunkOQIBNUVKcjs.styleLog.call(void 0, obj.sideEffects.toString(), {
|
|
527
536
|
text: texts["sideEffects"]
|
|
528
537
|
})
|
|
529
538
|
);
|
|
530
539
|
}
|
|
531
540
|
} else {
|
|
532
541
|
arr.push(
|
|
533
|
-
|
|
542
|
+
_chunkOQIBNUVKcjs.styleLog.call(void 0, type, {
|
|
534
543
|
text: texts[type]
|
|
535
544
|
})
|
|
536
545
|
);
|
|
537
546
|
arr.push(
|
|
538
|
-
|
|
547
|
+
_chunkOQIBNUVKcjs.styleLog.call(void 0, name, {
|
|
539
548
|
bold: true,
|
|
540
549
|
text: 1
|
|
541
550
|
})
|
|
@@ -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 _chunkYW7CKAOGcjs = require('./chunk-YW7CKAOG.cjs');
|
|
4
4
|
|
|
5
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
5
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.73/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.73/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.73/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.73/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.73/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.73/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.73/node_modules/@fangzhongya/utils/dist/chunk-VRRDYCUH.js
|
|
106
106
|
function getComponentNames(name) {
|
|
107
107
|
if (name.includes("-")) {
|
|
108
|
-
const line =
|
|
108
|
+
const line = _chunkYW7CKAOGcjs.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 = _chunkYW7CKAOGcjs.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,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
component_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-25JYZGRF.js";
|
|
4
4
|
import {
|
|
5
5
|
config
|
|
6
6
|
} from "./chunk-DURXCSNX.js";
|
|
7
7
|
import {
|
|
8
8
|
unmergeObject
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-IV2Z7LZ7.js";
|
|
10
10
|
|
|
11
11
|
// packages/resolver.ts
|
|
12
12
|
function ComponentsResolver(config2 = {}) {
|
|
@@ -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.73/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;
|
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 _chunkLIKH5T7Rcjs = require('./chunk-LIKH5T7R.cjs');
|
|
4
|
+
require('./chunk-OQIBNUVK.cjs');
|
|
5
|
+
require('./chunk-YW7CKAOG.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = _chunkLIKH5T7Rcjs.component_default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FangConfig, Config } from './config.cjs';
|
|
2
|
+
import { ComponentInfo } from 'unplugin-vue-components';
|
|
3
|
+
|
|
4
|
+
type FangComponentInfo = ComponentInfo | undefined | void;
|
|
5
|
+
type ResolveType = 'component' | 'directive' | 'sideEffects';
|
|
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 };
|
|
@@ -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' | 'sideEffects';
|
|
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-25JYZGRF.js";
|
|
4
|
+
import "./chunk-IV2Z7LZ7.js";
|
|
5
|
+
import "./chunk-E3I6537N.js";
|
|
6
6
|
export {
|
|
7
7
|
component_default as default
|
|
8
8
|
};
|
|
@@ -0,0 +1,138 @@
|
|
|
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
|
+
* dir下面子目录来配置别名
|
|
18
|
+
* 不区分首字母大小写
|
|
19
|
+
*/
|
|
20
|
+
getAliass?: (naem: string, type: string, config: Config) => string[];
|
|
21
|
+
/**
|
|
22
|
+
* 匹配目录数组
|
|
23
|
+
* 从头开始匹配
|
|
24
|
+
*/
|
|
25
|
+
matchs?: Array<string | RegExp>;
|
|
26
|
+
/**
|
|
27
|
+
* 匹配文件路径
|
|
28
|
+
* 从尾部开始匹配
|
|
29
|
+
*/
|
|
30
|
+
matchexts?: Array<string | RegExp>;
|
|
31
|
+
/**
|
|
32
|
+
* 不匹配目录数组
|
|
33
|
+
* 从头开始匹配
|
|
34
|
+
*/
|
|
35
|
+
nomatchs?: Array<string | RegExp>;
|
|
36
|
+
/**
|
|
37
|
+
* 不匹配文件路径
|
|
38
|
+
* 从尾部开始匹配
|
|
39
|
+
*/
|
|
40
|
+
nomatchexts?: Array<string | RegExp>;
|
|
41
|
+
matchextss?: string | RegExp;
|
|
42
|
+
/**no
|
|
43
|
+
* 指令
|
|
44
|
+
*/
|
|
45
|
+
matchDirexts?: Array<string | RegExp>;
|
|
46
|
+
nomatchDirexts?: Array<string | RegExp>;
|
|
47
|
+
matchDirextss?: string | RegExp;
|
|
48
|
+
/**
|
|
49
|
+
* 样式
|
|
50
|
+
*/
|
|
51
|
+
matchCsss?: Array<string | RegExp>;
|
|
52
|
+
nomatchCsss?: Array<string | RegExp>;
|
|
53
|
+
matchCssss?: string | RegExp;
|
|
54
|
+
/**
|
|
55
|
+
* 指令文件夹名称
|
|
56
|
+
*/
|
|
57
|
+
directives?: string;
|
|
58
|
+
/**
|
|
59
|
+
* 样式文件夹名称
|
|
60
|
+
*/
|
|
61
|
+
csss?: string;
|
|
62
|
+
csssuffixs?: Array<string>;
|
|
63
|
+
/**
|
|
64
|
+
* 是否缓存
|
|
65
|
+
*/
|
|
66
|
+
isCache?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* 过滤 不匹配 通过头匹配,默认转换成 - 模式匹配的
|
|
69
|
+
* 不区分首字母大小写
|
|
70
|
+
*/
|
|
71
|
+
startss?: Array<string>;
|
|
72
|
+
/**
|
|
73
|
+
* 过滤 不匹配 全匹配 - 模式匹配的
|
|
74
|
+
* 不区分首字母大小写
|
|
75
|
+
*/
|
|
76
|
+
filtes?: Array<string>;
|
|
77
|
+
/**
|
|
78
|
+
* 匹配到的文件路径
|
|
79
|
+
*/
|
|
80
|
+
getFromName?(url: string, name: string, type: string): string;
|
|
81
|
+
/**
|
|
82
|
+
* 控制台是否输出日志
|
|
83
|
+
*/
|
|
84
|
+
log?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* 获取匹配数组
|
|
87
|
+
*/
|
|
88
|
+
isMatch?(url: string, naem: string, names?: Array<string>, config?: Config): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* 获取指令匹配数组
|
|
91
|
+
*/
|
|
92
|
+
isMatchDir?(url: string, name: string, names?: Array<string>, config?: Config): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* 获取样式匹配数组
|
|
95
|
+
*/
|
|
96
|
+
isMatchCss?(url: string, name: string, names?: Array<string>, config?: Config): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* 多个时获取那个
|
|
99
|
+
*/
|
|
100
|
+
getMatchs?(urls: Array<string>, name: string, type: string, config?: Config): string;
|
|
101
|
+
/**
|
|
102
|
+
* 获取指令匹配数组
|
|
103
|
+
*/
|
|
104
|
+
getMatchDirs?(urls: Array<string>, name: string, type: string, config?: Config): string;
|
|
105
|
+
/**
|
|
106
|
+
* 获取样式匹配数组
|
|
107
|
+
*/
|
|
108
|
+
getMatchCsss?(urls: Array<string>, name: string, type: string, config?: Config): string;
|
|
109
|
+
}
|
|
110
|
+
interface FangConfig extends Config {
|
|
111
|
+
/**
|
|
112
|
+
* 是否去掉路径的前缀
|
|
113
|
+
*/
|
|
114
|
+
urlprefix?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* 是否生成json 配置文件
|
|
117
|
+
*/
|
|
118
|
+
isJson?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* 生成json 配置文件名称
|
|
121
|
+
*/
|
|
122
|
+
jsonName?: string;
|
|
123
|
+
/**
|
|
124
|
+
* 格式化的组件的地址
|
|
125
|
+
*/
|
|
126
|
+
urls?: Array<string>;
|
|
127
|
+
/**
|
|
128
|
+
* 格式化的指令的地址
|
|
129
|
+
*/
|
|
130
|
+
dirUrls?: Array<string>;
|
|
131
|
+
/**
|
|
132
|
+
* 格式化的样式的地址
|
|
133
|
+
*/
|
|
134
|
+
cssUrls?: Array<string>;
|
|
135
|
+
}
|
|
136
|
+
declare const config: Config;
|
|
137
|
+
|
|
138
|
+
export { type Config, type FangConfig, config };
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
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
|
+
* dir下面子目录来配置别名
|
|
18
|
+
* 不区分首字母大小写
|
|
19
|
+
*/
|
|
20
|
+
getAliass?: (naem: string, type: string, config: Config) => string[];
|
|
21
|
+
/**
|
|
22
|
+
* 匹配目录数组
|
|
23
|
+
* 从头开始匹配
|
|
24
|
+
*/
|
|
25
|
+
matchs?: Array<string | RegExp>;
|
|
26
|
+
/**
|
|
27
|
+
* 匹配文件路径
|
|
28
|
+
* 从尾部开始匹配
|
|
29
|
+
*/
|
|
30
|
+
matchexts?: Array<string | RegExp>;
|
|
31
|
+
/**
|
|
32
|
+
* 不匹配目录数组
|
|
33
|
+
* 从头开始匹配
|
|
34
|
+
*/
|
|
35
|
+
nomatchs?: Array<string | RegExp>;
|
|
36
|
+
/**
|
|
37
|
+
* 不匹配文件路径
|
|
38
|
+
* 从尾部开始匹配
|
|
39
|
+
*/
|
|
40
|
+
nomatchexts?: Array<string | RegExp>;
|
|
41
|
+
matchextss?: string | RegExp;
|
|
42
|
+
/**no
|
|
43
|
+
* 指令
|
|
44
|
+
*/
|
|
45
|
+
matchDirexts?: Array<string | RegExp>;
|
|
46
|
+
nomatchDirexts?: Array<string | RegExp>;
|
|
47
|
+
matchDirextss?: string | RegExp;
|
|
48
|
+
/**
|
|
49
|
+
* 样式
|
|
50
|
+
*/
|
|
51
|
+
matchCsss?: Array<string | RegExp>;
|
|
52
|
+
nomatchCsss?: Array<string | RegExp>;
|
|
53
|
+
matchCssss?: string | RegExp;
|
|
54
|
+
/**
|
|
55
|
+
* 指令文件夹名称
|
|
56
|
+
*/
|
|
57
|
+
directives?: string;
|
|
58
|
+
/**
|
|
59
|
+
* 样式文件夹名称
|
|
60
|
+
*/
|
|
61
|
+
csss?: string;
|
|
62
|
+
csssuffixs?: Array<string>;
|
|
63
|
+
/**
|
|
64
|
+
* 是否缓存
|
|
65
|
+
*/
|
|
66
|
+
isCache?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* 过滤 不匹配 通过头匹配,默认转换成 - 模式匹配的
|
|
69
|
+
* 不区分首字母大小写
|
|
70
|
+
*/
|
|
71
|
+
startss?: Array<string>;
|
|
72
|
+
/**
|
|
73
|
+
* 过滤 不匹配 全匹配 - 模式匹配的
|
|
74
|
+
* 不区分首字母大小写
|
|
75
|
+
*/
|
|
76
|
+
filtes?: Array<string>;
|
|
77
|
+
/**
|
|
78
|
+
* 匹配到的文件路径
|
|
79
|
+
*/
|
|
80
|
+
getFromName?(url: string, name: string, type: string): string;
|
|
81
|
+
/**
|
|
82
|
+
* 控制台是否输出日志
|
|
83
|
+
*/
|
|
84
|
+
log?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* 获取匹配数组
|
|
87
|
+
*/
|
|
88
|
+
isMatch?(url: string, naem: string, names?: Array<string>, config?: Config): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* 获取指令匹配数组
|
|
91
|
+
*/
|
|
92
|
+
isMatchDir?(url: string, name: string, names?: Array<string>, config?: Config): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* 获取样式匹配数组
|
|
95
|
+
*/
|
|
96
|
+
isMatchCss?(url: string, name: string, names?: Array<string>, config?: Config): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* 多个时获取那个
|
|
99
|
+
*/
|
|
100
|
+
getMatchs?(urls: Array<string>, name: string, type: string, config?: Config): string;
|
|
101
|
+
/**
|
|
102
|
+
* 获取指令匹配数组
|
|
103
|
+
*/
|
|
104
|
+
getMatchDirs?(urls: Array<string>, name: string, type: string, config?: Config): string;
|
|
105
|
+
/**
|
|
106
|
+
* 获取样式匹配数组
|
|
107
|
+
*/
|
|
108
|
+
getMatchCsss?(urls: Array<string>, name: string, type: string, config?: Config): string;
|
|
109
|
+
}
|
|
110
|
+
interface FangConfig extends Config {
|
|
111
|
+
/**
|
|
112
|
+
* 是否去掉路径的前缀
|
|
113
|
+
*/
|
|
114
|
+
urlprefix?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* 是否生成json 配置文件
|
|
117
|
+
*/
|
|
118
|
+
isJson?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* 生成json 配置文件名称
|
|
121
|
+
*/
|
|
122
|
+
jsonName?: string;
|
|
123
|
+
/**
|
|
124
|
+
* 格式化的组件的地址
|
|
125
|
+
*/
|
|
126
|
+
urls?: Array<string>;
|
|
127
|
+
/**
|
|
128
|
+
* 格式化的指令的地址
|
|
129
|
+
*/
|
|
130
|
+
dirUrls?: Array<string>;
|
|
131
|
+
/**
|
|
132
|
+
* 格式化的样式的地址
|
|
133
|
+
*/
|
|
134
|
+
cssUrls?: Array<string>;
|
|
135
|
+
}
|
|
136
|
+
declare const config: Config;
|
|
137
|
+
|
|
138
|
+
export { type Config, type 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 _chunk4A5AX2PJcjs = require('./chunk-4A5AX2PJ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkLIKH5T7Rcjs = require('./chunk-LIKH5T7R.cjs');
|
|
7
7
|
require('./chunk-UNBQUEQ4.cjs');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-OQIBNUVK.cjs');
|
|
9
|
+
require('./chunk-YW7CKAOG.cjs');
|
|
10
10
|
|
|
11
11
|
// packages/index.ts
|
|
12
|
-
var FangComponent = class extends
|
|
12
|
+
var FangComponent = class extends _chunkLIKH5T7Rcjs.component_default {
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.ComponentsResolver =
|
|
17
|
+
exports.ComponentsResolver = _chunk4A5AX2PJcjs.ComponentsResolver; exports.FangComponent = FangComponent;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import FangComponent$1 from './component.cjs';
|
|
2
|
+
export { Config } from './config.cjs';
|
|
3
|
+
export { ComponentsResolver } from './resolver.cjs';
|
|
4
|
+
import 'unplugin-vue-components';
|
|
5
|
+
|
|
6
|
+
declare class FangComponent extends FangComponent$1 {
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { 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-RHYZ76ZY.js";
|
|
4
4
|
import {
|
|
5
5
|
component_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-25JYZGRF.js";
|
|
7
7
|
import "./chunk-DURXCSNX.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-IV2Z7LZ7.js";
|
|
9
|
+
import "./chunk-E3I6537N.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 _chunkYW7CKAOGcjs = require('./chunk-YW7CKAOG.cjs');
|
|
4
4
|
|
|
5
5
|
// packages/library.ts
|
|
6
6
|
function namefilter(config, name) {
|
|
7
|
-
let vm =
|
|
7
|
+
let vm = _chunkYW7CKAOGcjs.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 { ComponentResolveResult, ComponentResolver } 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 };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentResolveResult, ComponentResolver } 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 _chunk4A5AX2PJcjs = require('./chunk-4A5AX2PJ.cjs');
|
|
4
|
+
require('./chunk-LIKH5T7R.cjs');
|
|
5
5
|
require('./chunk-UNBQUEQ4.cjs');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-OQIBNUVK.cjs');
|
|
7
|
+
require('./chunk-YW7CKAOG.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.ComponentsResolver =
|
|
10
|
+
exports.ComponentsResolver = _chunk4A5AX2PJcjs.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-RHYZ76ZY.js";
|
|
4
|
+
import "./chunk-25JYZGRF.js";
|
|
5
5
|
import "./chunk-DURXCSNX.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-IV2Z7LZ7.js";
|
|
7
|
+
import "./chunk-E3I6537N.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 _chunkOQIBNUVKcjs = require('./chunk-OQIBNUVK.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkYW7CKAOGcjs = require('./chunk-YW7CKAOG.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.firstUpper =
|
|
16
|
+
exports.firstUpper = _chunkOQIBNUVKcjs.firstUpper; exports.getComponentNames = _chunkOQIBNUVKcjs.getComponentNames; exports.humpToLine = _chunkYW7CKAOGcjs.humpToLine; exports.styleLog = _chunkOQIBNUVKcjs.styleLog; exports.unmergeObject = _chunkOQIBNUVKcjs.unmergeObject;
|
package/dist/util.d.cts
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.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-IV2Z7LZ7.js";
|
|
7
7
|
import {
|
|
8
8
|
humpToLine
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-E3I6537N.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.21",
|
|
6
6
|
"description ": "unplugin-vue-components插件",
|
|
7
7
|
"author": "fangzhongya ",
|
|
8
8
|
"license": "MIT",
|
|
@@ -18,15 +18,15 @@
|
|
|
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.50",
|
|
22
|
+
"@fangzhongya/utils": "0.0.73",
|
|
23
|
+
"@types/node": "^25.0.3",
|
|
24
24
|
"ts-node": "^10.9.2",
|
|
25
|
-
"tsup": "^8.5.
|
|
25
|
+
"tsup": "^8.5.1",
|
|
26
26
|
"typescript": "^5.9.3",
|
|
27
27
|
"unplugin-vue-components": "^30.0.0",
|
|
28
|
-
"vitest": "^4.0.
|
|
29
|
-
"vue": "^3.5.
|
|
28
|
+
"vitest": "^4.0.16",
|
|
29
|
+
"vue": "^3.5.26"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"fast-glob": "^3.3.3"
|