@fangzhongya/vue-components 0.1.3-2 → 0.1.3-3

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 CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkXOPU65DWcjs = require('./chunk-XOPU65DW.cjs');
3
+ var _chunkREFE2VTScjs = require('./chunk-REFE2VTS.cjs');
4
4
 
5
5
 
6
- var _chunkIGEUOPSAcjs = require('./chunk-IGEUOPSA.cjs');
6
+ var _chunkX23FY6UKcjs = require('./chunk-X23FY6UK.cjs');
7
7
 
8
8
 
9
9
  var _chunkEOQLSHQ7cjs = require('./chunk-EOQLSHQ7.cjs');
@@ -59,12 +59,12 @@ function setJson(obj) {
59
59
  }
60
60
  function ComponentsResolverArchive(config2 = {}) {
61
61
  const configs = _chunkEOQLSHQ7cjs.unmergeObject.call(void 0,
62
- _chunkIGEUOPSAcjs.config,
62
+ _chunkX23FY6UKcjs.config,
63
63
  archiveConfig,
64
64
  2,
65
65
  true
66
66
  );
67
- const fangComp = new (0, _chunkXOPU65DWcjs.component_default)(
67
+ const fangComp = new (0, _chunkREFE2VTScjs.component_default)(
68
68
  _chunkEOQLSHQ7cjs.unmergeObject.call(void 0, configs, config2, 1)
69
69
  );
70
70
  setJson(fangComp.config);
package/dist/archive.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  component_default
3
- } from "./chunk-RP2KHS5V.js";
3
+ } from "./chunk-F2JM6AXK.js";
4
4
  import {
5
5
  config
6
- } from "./chunk-KSHI5GQ7.js";
6
+ } from "./chunk-S6QJIPBZ.js";
7
7
  import {
8
8
  unmergeObject
9
9
  } from "./chunk-UOAON6WT.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  component_default
3
- } from "./chunk-RP2KHS5V.js";
3
+ } from "./chunk-F2JM6AXK.js";
4
4
  import {
5
5
  config
6
- } from "./chunk-KSHI5GQ7.js";
6
+ } from "./chunk-S6QJIPBZ.js";
7
7
  import {
8
8
  unmergeObject
9
9
  } from "./chunk-UOAON6WT.js";
@@ -146,23 +146,50 @@ var FangComponent = class {
146
146
  */
147
147
  #getUrls() {
148
148
  const url = this.#getFgUrl();
149
+ const reg = new RegExp("^" + this.#curDir);
150
+ const catalogue = this.config.catalogue;
151
+ let isUrl = (key) => {
152
+ if (catalogue && catalogue.length > 0) {
153
+ for (let index = 0; index < catalogue.length; index++) {
154
+ const element = catalogue[index];
155
+ if (typeof element == "string") {
156
+ const uk = key.replace(reg, "");
157
+ if (uk.startsWith(element)) {
158
+ return true;
159
+ }
160
+ } else {
161
+ const is = element.test(key);
162
+ if (is) {
163
+ return true;
164
+ }
165
+ }
166
+ }
167
+ return false;
168
+ }
169
+ return true;
170
+ };
149
171
  if (url) {
150
- this.#comUrls = fastGlob.sync(url, {
172
+ const globs = fastGlob.sync(url, {
151
173
  onlyFiles: false,
152
174
  absolute: true
175
+ }) || [];
176
+ this.#comUrls = globs.filter((key) => {
177
+ return isUrl(key);
153
178
  });
154
179
  }
155
180
  if (this.config.directives) {
156
- const durl = this.config.dir + "**/" + this.config.directives + "/*.js";
157
- this.#dirUrls = fastGlob.sync(durl, {
181
+ const durl = this.config.dir + "**/" + this.config.directives + "/*.{js,ts}";
182
+ const globs = fastGlob.sync(durl, {
158
183
  onlyFiles: false,
159
184
  absolute: true
160
185
  }) || [];
186
+ this.#dirUrls = globs.filter((key) => {
187
+ return isUrl(key);
188
+ });
161
189
  }
162
190
  if (this.config.urlprefix) {
163
191
  if (this.config.dir) {
164
192
  const dir = this.config.dir;
165
- const reg = new RegExp("^" + this.#curDir);
166
193
  const urls = [];
167
194
  const dirUrls = [];
168
195
  this.#comUrls?.forEach((key) => {
@@ -146,23 +146,50 @@ var FangComponent = class {
146
146
  */
147
147
  #getUrls() {
148
148
  const url = this.#getFgUrl();
149
+ const reg = new RegExp("^" + this.#curDir);
150
+ const catalogue = this.config.catalogue;
151
+ let isUrl = (key) => {
152
+ if (catalogue && catalogue.length > 0) {
153
+ for (let index = 0; index < catalogue.length; index++) {
154
+ const element = catalogue[index];
155
+ if (typeof element == "string") {
156
+ const uk = key.replace(reg, "");
157
+ if (uk.startsWith(element)) {
158
+ return true;
159
+ }
160
+ } else {
161
+ const is = element.test(key);
162
+ if (is) {
163
+ return true;
164
+ }
165
+ }
166
+ }
167
+ return false;
168
+ }
169
+ return true;
170
+ };
149
171
  if (url) {
150
- this.#comUrls = _fastglob2.default.sync(url, {
172
+ const globs = _fastglob2.default.sync(url, {
151
173
  onlyFiles: false,
152
174
  absolute: true
175
+ }) || [];
176
+ this.#comUrls = globs.filter((key) => {
177
+ return isUrl(key);
153
178
  });
154
179
  }
155
180
  if (this.config.directives) {
156
- const durl = this.config.dir + "**/" + this.config.directives + "/*.js";
157
- this.#dirUrls = _fastglob2.default.sync(durl, {
181
+ const durl = this.config.dir + "**/" + this.config.directives + "/*.{js,ts}";
182
+ const globs = _fastglob2.default.sync(durl, {
158
183
  onlyFiles: false,
159
184
  absolute: true
160
185
  }) || [];
186
+ this.#dirUrls = globs.filter((key) => {
187
+ return isUrl(key);
188
+ });
161
189
  }
162
190
  if (this.config.urlprefix) {
163
191
  if (this.config.dir) {
164
192
  const dir = this.config.dir;
165
- const reg = new RegExp("^" + this.#curDir);
166
193
  const urls = [];
167
194
  const dirUrls = [];
168
195
  _optionalChain([this, 'access', _3 => _3.#comUrls, 'optionalAccess', _4 => _4.forEach, 'call', _5 => _5((key) => {
@@ -1,17 +1,17 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkXOPU65DWcjs = require('./chunk-XOPU65DW.cjs');
3
+ var _chunkREFE2VTScjs = require('./chunk-REFE2VTS.cjs');
4
4
 
5
5
 
6
- var _chunkIGEUOPSAcjs = require('./chunk-IGEUOPSA.cjs');
6
+ var _chunkX23FY6UKcjs = require('./chunk-X23FY6UK.cjs');
7
7
 
8
8
 
9
9
  var _chunkEOQLSHQ7cjs = require('./chunk-EOQLSHQ7.cjs');
10
10
 
11
11
  // packages/resolver.ts
12
12
  function ComponentsResolver(config2 = {}) {
13
- const configs = _chunkEOQLSHQ7cjs.unmergeObject.call(void 0, _chunkIGEUOPSAcjs.config, config2, 1);
14
- const fangComp = new (0, _chunkXOPU65DWcjs.component_default)(configs);
13
+ const configs = _chunkEOQLSHQ7cjs.unmergeObject.call(void 0, _chunkX23FY6UKcjs.config, config2, 1);
14
+ const fangComp = new (0, _chunkREFE2VTScjs.component_default)(configs);
15
15
  return [
16
16
  {
17
17
  type: "component",
@@ -23,6 +23,7 @@ var config = {
23
23
  * 不区分首字母大小写
24
24
  */
25
25
  aliass: {},
26
+ catalogue: [],
26
27
  /**
27
28
  * 匹配数组
28
29
  * '' 表示匹配当前文件名
@@ -23,6 +23,7 @@ var config = {
23
23
  * 不区分首字母大小写
24
24
  */
25
25
  aliass: {},
26
+ catalogue: [],
26
27
  /**
27
28
  * 匹配数组
28
29
  * '' 表示匹配当前文件名
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkXOPU65DWcjs = require('./chunk-XOPU65DW.cjs');
3
+ var _chunkREFE2VTScjs = require('./chunk-REFE2VTS.cjs');
4
4
  require('./chunk-EOQLSHQ7.cjs');
5
5
 
6
6
 
7
- exports.default = _chunkXOPU65DWcjs.component_default;
7
+ exports.default = _chunkREFE2VTScjs.component_default;
package/dist/component.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  component_default
3
- } from "./chunk-RP2KHS5V.js";
3
+ } from "./chunk-F2JM6AXK.js";
4
4
  import "./chunk-UOAON6WT.js";
5
5
  export {
6
6
  component_default as default
package/dist/config.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkIGEUOPSAcjs = require('./chunk-IGEUOPSA.cjs');
3
+ var _chunkX23FY6UKcjs = require('./chunk-X23FY6UK.cjs');
4
4
 
5
5
 
6
- exports.config = _chunkIGEUOPSAcjs.config;
6
+ exports.config = _chunkX23FY6UKcjs.config;
package/dist/config.d.ts CHANGED
@@ -24,6 +24,10 @@ interface Config {
24
24
  aliass?: {
25
25
  [key: string]: string;
26
26
  };
27
+ /**
28
+ * 目录过滤
29
+ */
30
+ catalogue?: Array<string | RegExp>;
27
31
  /**
28
32
  * 匹配数组
29
33
  * '' 表示匹配当前文件名
package/dist/config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  config
3
- } from "./chunk-KSHI5GQ7.js";
3
+ } from "./chunk-S6QJIPBZ.js";
4
4
  export {
5
5
  config
6
6
  };
package/dist/index.cjs CHANGED
@@ -1,16 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkIDASQ7MYcjs = require('./chunk-IDASQ7MY.cjs');
3
+ var _chunkRVDK57KVcjs = require('./chunk-RVDK57KV.cjs');
4
4
 
5
5
 
6
- var _chunkXOPU65DWcjs = require('./chunk-XOPU65DW.cjs');
7
- require('./chunk-IGEUOPSA.cjs');
6
+ var _chunkREFE2VTScjs = require('./chunk-REFE2VTS.cjs');
7
+ require('./chunk-X23FY6UK.cjs');
8
8
  require('./chunk-EOQLSHQ7.cjs');
9
9
 
10
10
  // packages/index.ts
11
- var FangComponent = class extends _chunkXOPU65DWcjs.component_default {
11
+ var FangComponent = class extends _chunkREFE2VTScjs.component_default {
12
12
  };
13
13
 
14
14
 
15
15
 
16
- exports.ComponentsResolver = _chunkIDASQ7MYcjs.ComponentsResolver; exports.FangComponent = FangComponent;
16
+ exports.ComponentsResolver = _chunkRVDK57KVcjs.ComponentsResolver; exports.FangComponent = FangComponent;
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ComponentsResolver
3
- } from "./chunk-AFNW2ZXY.js";
3
+ } from "./chunk-4ELSL4L3.js";
4
4
  import {
5
5
  component_default
6
- } from "./chunk-RP2KHS5V.js";
7
- import "./chunk-KSHI5GQ7.js";
6
+ } from "./chunk-F2JM6AXK.js";
7
+ import "./chunk-S6QJIPBZ.js";
8
8
  import "./chunk-UOAON6WT.js";
9
9
 
10
10
  // packages/index.ts
package/dist/resolver.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkIDASQ7MYcjs = require('./chunk-IDASQ7MY.cjs');
4
- require('./chunk-XOPU65DW.cjs');
5
- require('./chunk-IGEUOPSA.cjs');
3
+ var _chunkRVDK57KVcjs = require('./chunk-RVDK57KV.cjs');
4
+ require('./chunk-REFE2VTS.cjs');
5
+ require('./chunk-X23FY6UK.cjs');
6
6
  require('./chunk-EOQLSHQ7.cjs');
7
7
 
8
8
 
9
- exports.ComponentsResolver = _chunkIDASQ7MYcjs.ComponentsResolver;
9
+ exports.ComponentsResolver = _chunkRVDK57KVcjs.ComponentsResolver;
package/dist/resolver.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  ComponentsResolver
3
- } from "./chunk-AFNW2ZXY.js";
4
- import "./chunk-RP2KHS5V.js";
5
- import "./chunk-KSHI5GQ7.js";
3
+ } from "./chunk-4ELSL4L3.js";
4
+ import "./chunk-F2JM6AXK.js";
5
+ import "./chunk-S6QJIPBZ.js";
6
6
  import "./chunk-UOAON6WT.js";
7
7
  export {
8
8
  ComponentsResolver
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.3-2",
5
+ "version": "0.1.3-3",
6
6
  "description ": "unplugin-vue-components插件",
7
7
  "author": "fangzhongya ",
8
8
  "license": "MIT",