unplugin-vue-components 0.22.2 → 0.22.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/README.md +1 -0
- package/dist/{chunk-TBD7G7VM.mjs → chunk-II7G4AEZ.mjs} +10 -18
- package/dist/{chunk-YPBVGE6A.js → chunk-SMCETF6M.js} +9 -17
- package/dist/esbuild.d.ts +1 -1
- package/dist/esbuild.js +2 -2
- package/dist/esbuild.mjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/nuxt.js +3 -3
- package/dist/nuxt.mjs +1 -1
- package/dist/resolvers.d.ts +24 -1
- package/dist/resolvers.js +63 -53
- package/dist/resolvers.mjs +64 -54
- package/dist/rollup.d.ts +1 -1
- package/dist/rollup.js +2 -2
- package/dist/rollup.mjs +1 -1
- package/dist/vite.js +2 -2
- package/dist/vite.mjs +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +2 -2
- package/dist/webpack.mjs +1 -1
- package/package.json +19 -19
package/README.md
CHANGED
|
@@ -202,6 +202,7 @@ Supported Resolvers:
|
|
|
202
202
|
- [View UI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/view-ui.ts)
|
|
203
203
|
- [Vuetify](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/vuetify.ts)
|
|
204
204
|
- [VueUse Components](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/vueuse.ts)
|
|
205
|
+
- [VueUse Directives](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/vueuse-directive.ts)
|
|
205
206
|
- [Dev UI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/devui.ts)
|
|
206
207
|
|
|
207
208
|
```ts
|
|
@@ -11,9 +11,6 @@ import {
|
|
|
11
11
|
shouldTransform,
|
|
12
12
|
stringifyComponentImport
|
|
13
13
|
} from "./chunk-667B3WUW.mjs";
|
|
14
|
-
import {
|
|
15
|
-
__require
|
|
16
|
-
} from "./chunk-AKU6F3WT.mjs";
|
|
17
14
|
|
|
18
15
|
// src/core/unplugin.ts
|
|
19
16
|
import { existsSync as existsSync2 } from "fs";
|
|
@@ -28,9 +25,8 @@ import { slash as slash3, throttle, toArray as toArray2 } from "@antfu/utils";
|
|
|
28
25
|
|
|
29
26
|
// src/core/options.ts
|
|
30
27
|
import { join, resolve } from "path";
|
|
31
|
-
import { createRequire } from "module";
|
|
32
28
|
import { slash, toArray } from "@antfu/utils";
|
|
33
|
-
import { isPackageExists as isPackageExists2 } from "local-pkg";
|
|
29
|
+
import { getPackageInfoSync, isPackageExists as isPackageExists2 } from "local-pkg";
|
|
34
30
|
|
|
35
31
|
// src/core/type-imports/detect.ts
|
|
36
32
|
import { isPackageExists } from "local-pkg";
|
|
@@ -103,20 +99,14 @@ function resolveOptions(options, root) {
|
|
|
103
99
|
resolved.types = detectTypeImports();
|
|
104
100
|
resolved.types = resolved.types || [];
|
|
105
101
|
resolved.root = root;
|
|
106
|
-
resolved.transformer = options.transformer || getVueVersion() || "vue3";
|
|
107
|
-
resolved.directives = typeof options.directives === "boolean" ? options.directives : !resolved.resolvers.some((i) => i.type === "directive") ? false : getVueVersion() === "vue3";
|
|
102
|
+
resolved.transformer = options.transformer || getVueVersion(root) || "vue3";
|
|
103
|
+
resolved.directives = typeof options.directives === "boolean" ? options.directives : !resolved.resolvers.some((i) => i.type === "directive") ? false : getVueVersion(root) === "vue3";
|
|
108
104
|
return resolved;
|
|
109
105
|
}
|
|
110
|
-
|
|
111
|
-
function getVueVersion() {
|
|
106
|
+
function getVueVersion(root) {
|
|
112
107
|
var _a;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const version = ((_a = vue == null ? void 0 : vue.default) == null ? void 0 : _a.version) || (vue == null ? void 0 : vue.version) || "3";
|
|
116
|
-
return version.startsWith("2.") ? "vue2" : "vue3";
|
|
117
|
-
} catch {
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
108
|
+
const version = ((_a = getPackageInfoSync("vue", { paths: [root] })) == null ? void 0 : _a.version) || "3";
|
|
109
|
+
return version.startsWith("2.") ? "vue2" : "vue3";
|
|
120
110
|
}
|
|
121
111
|
|
|
122
112
|
// src/core/fs/glob.ts
|
|
@@ -308,7 +298,7 @@ import { importModule, isPackageExists as isPackageExists3 } from "local-pkg";
|
|
|
308
298
|
var getRenderFnStart = (ast) => {
|
|
309
299
|
var _a, _b;
|
|
310
300
|
const renderFn = ast.program.body.find(
|
|
311
|
-
(node) => node.type === "VariableDeclaration" && node.declarations[0].id.type === "Identifier" && node.declarations[0].id.name
|
|
301
|
+
(node) => node.type === "VariableDeclaration" && node.declarations[0].id.type === "Identifier" && ["render", "_sfc_render"].includes(node.declarations[0].id.name)
|
|
312
302
|
);
|
|
313
303
|
const start = (_b = (_a = renderFn == null ? void 0 : renderFn.declarations[0].init) == null ? void 0 : _a.body) == null ? void 0 : _b.start;
|
|
314
304
|
if (start === null || start === void 0)
|
|
@@ -331,7 +321,10 @@ async function resolveVue22(code, s) {
|
|
|
331
321
|
nodes.push(node);
|
|
332
322
|
}
|
|
333
323
|
});
|
|
324
|
+
if (nodes.length === 0)
|
|
325
|
+
return [];
|
|
334
326
|
const results = [];
|
|
327
|
+
const renderStart = getRenderFnStart(ast);
|
|
335
328
|
for (const node of nodes) {
|
|
336
329
|
const { callee, arguments: args } = node;
|
|
337
330
|
if (callee.type !== "Identifier" || callee.name !== "_c" || ((_a = args[1]) == null ? void 0 : _a.type) !== "ObjectExpression")
|
|
@@ -341,7 +334,6 @@ async function resolveVue22(code, s) {
|
|
|
341
334
|
)) == null ? void 0 : _b.value;
|
|
342
335
|
if (!directives || directives.type !== "ArrayExpression")
|
|
343
336
|
continue;
|
|
344
|
-
const renderStart = getRenderFnStart(ast);
|
|
345
337
|
for (const directive of directives.elements) {
|
|
346
338
|
if ((directive == null ? void 0 : directive.type) !== "ObjectExpression")
|
|
347
339
|
continue;
|
|
@@ -12,9 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
var _chunk2GXY7E6Xjs = require('./chunk-2GXY7E6X.js');
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
var _chunkEZUCZHGVjs = require('./chunk-EZUCZHGV.js');
|
|
17
|
-
|
|
18
15
|
// src/core/unplugin.ts
|
|
19
16
|
var _fs = require('fs');
|
|
20
17
|
var _unplugin = require('unplugin');
|
|
@@ -28,7 +25,6 @@ var _utils = require('@antfu/utils');
|
|
|
28
25
|
|
|
29
26
|
// src/core/options.ts
|
|
30
27
|
|
|
31
|
-
var _module = require('module');
|
|
32
28
|
|
|
33
29
|
var _localpkg = require('local-pkg');
|
|
34
30
|
|
|
@@ -103,20 +99,14 @@ function resolveOptions(options, root) {
|
|
|
103
99
|
resolved.types = detectTypeImports();
|
|
104
100
|
resolved.types = resolved.types || [];
|
|
105
101
|
resolved.root = root;
|
|
106
|
-
resolved.transformer = options.transformer || getVueVersion() || "vue3";
|
|
107
|
-
resolved.directives = typeof options.directives === "boolean" ? options.directives : !resolved.resolvers.some((i) => i.type === "directive") ? false : getVueVersion() === "vue3";
|
|
102
|
+
resolved.transformer = options.transformer || getVueVersion(root) || "vue3";
|
|
103
|
+
resolved.directives = typeof options.directives === "boolean" ? options.directives : !resolved.resolvers.some((i) => i.type === "directive") ? false : getVueVersion(root) === "vue3";
|
|
108
104
|
return resolved;
|
|
109
105
|
}
|
|
110
|
-
|
|
111
|
-
function getVueVersion() {
|
|
106
|
+
function getVueVersion(root) {
|
|
112
107
|
var _a;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const version = ((_a = vue == null ? void 0 : vue.default) == null ? void 0 : _a.version) || (vue == null ? void 0 : vue.version) || "3";
|
|
116
|
-
return version.startsWith("2.") ? "vue2" : "vue3";
|
|
117
|
-
} catch (e2) {
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
108
|
+
const version = ((_a = _localpkg.getPackageInfoSync.call(void 0, "vue", { paths: [root] })) == null ? void 0 : _a.version) || "3";
|
|
109
|
+
return version.startsWith("2.") ? "vue2" : "vue3";
|
|
120
110
|
}
|
|
121
111
|
|
|
122
112
|
// src/core/fs/glob.ts
|
|
@@ -308,7 +298,7 @@ async function transformComponent(code, transformer2, s, ctx, sfcPath) {
|
|
|
308
298
|
var getRenderFnStart = (ast) => {
|
|
309
299
|
var _a, _b;
|
|
310
300
|
const renderFn = ast.program.body.find(
|
|
311
|
-
(node) => node.type === "VariableDeclaration" && node.declarations[0].id.type === "Identifier" && node.declarations[0].id.name
|
|
301
|
+
(node) => node.type === "VariableDeclaration" && node.declarations[0].id.type === "Identifier" && ["render", "_sfc_render"].includes(node.declarations[0].id.name)
|
|
312
302
|
);
|
|
313
303
|
const start = (_b = (_a = renderFn == null ? void 0 : renderFn.declarations[0].init) == null ? void 0 : _a.body) == null ? void 0 : _b.start;
|
|
314
304
|
if (start === null || start === void 0)
|
|
@@ -331,7 +321,10 @@ async function resolveVue22(code, s) {
|
|
|
331
321
|
nodes.push(node);
|
|
332
322
|
}
|
|
333
323
|
});
|
|
324
|
+
if (nodes.length === 0)
|
|
325
|
+
return [];
|
|
334
326
|
const results = [];
|
|
327
|
+
const renderStart = getRenderFnStart(ast);
|
|
335
328
|
for (const node of nodes) {
|
|
336
329
|
const { callee, arguments: args } = node;
|
|
337
330
|
if (callee.type !== "Identifier" || callee.name !== "_c" || ((_a = args[1]) == null ? void 0 : _a.type) !== "ObjectExpression")
|
|
@@ -341,7 +334,6 @@ async function resolveVue22(code, s) {
|
|
|
341
334
|
)) == null ? void 0 : _b.value;
|
|
342
335
|
if (!directives || directives.type !== "ArrayExpression")
|
|
343
336
|
continue;
|
|
344
|
-
const renderStart = getRenderFnStart(ast);
|
|
345
337
|
for (const directive of directives.elements) {
|
|
346
338
|
if ((directive == null ? void 0 : directive.type) !== "ObjectExpression")
|
|
347
339
|
continue;
|
package/dist/esbuild.d.ts
CHANGED
package/dist/esbuild.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSMCETF6Mjs = require('./chunk-SMCETF6M.js');
|
|
4
4
|
require('./chunk-2GXY7E6X.js');
|
|
5
5
|
require('./chunk-EZUCZHGV.js');
|
|
6
6
|
require('./chunk-6F4PWJZI.js');
|
|
7
7
|
|
|
8
8
|
// src/esbuild.ts
|
|
9
|
-
var esbuild_default =
|
|
9
|
+
var esbuild_default = _chunkSMCETF6Mjs.unplugin_default.esbuild;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
module.exports = esbuild_default;
|
package/dist/esbuild.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSMCETF6Mjs = require('./chunk-SMCETF6M.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -13,4 +13,4 @@ require('./chunk-6F4PWJZI.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.camelCase = _chunk2GXY7E6Xjs.camelCase; exports.default =
|
|
16
|
+
exports.camelCase = _chunk2GXY7E6Xjs.camelCase; exports.default = _chunkSMCETF6Mjs.unplugin_default; exports.kebabCase = _chunk2GXY7E6Xjs.kebabCase; exports.pascalCase = _chunk2GXY7E6Xjs.pascalCase;
|
package/dist/index.mjs
CHANGED
package/dist/nuxt.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSMCETF6Mjs = require('./chunk-SMCETF6M.js');
|
|
4
4
|
require('./chunk-2GXY7E6X.js');
|
|
5
5
|
require('./chunk-EZUCZHGV.js');
|
|
6
6
|
require('./chunk-6F4PWJZI.js');
|
|
@@ -9,11 +9,11 @@ require('./chunk-6F4PWJZI.js');
|
|
|
9
9
|
function nuxt_default(options) {
|
|
10
10
|
this.extendBuild((config) => {
|
|
11
11
|
config.plugins = config.plugins || [];
|
|
12
|
-
config.plugins.unshift(
|
|
12
|
+
config.plugins.unshift(_chunkSMCETF6Mjs.unplugin_default.webpack(options));
|
|
13
13
|
});
|
|
14
14
|
this.nuxt.hook("vite:extend", async (vite) => {
|
|
15
15
|
vite.config.plugins = vite.config.plugins || [];
|
|
16
|
-
vite.config.plugins.push(
|
|
16
|
+
vite.config.plugins.push(_chunkSMCETF6Mjs.unplugin_default.vite(options));
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
package/dist/nuxt.mjs
CHANGED
package/dist/resolvers.d.ts
CHANGED
|
@@ -36,6 +36,12 @@ interface AntDesignVueResolverOptions {
|
|
|
36
36
|
* use commonjs build default false
|
|
37
37
|
*/
|
|
38
38
|
cjs?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* rename package
|
|
41
|
+
*
|
|
42
|
+
* @default 'ant-design-vue'
|
|
43
|
+
*/
|
|
44
|
+
packageName?: string;
|
|
39
45
|
}
|
|
40
46
|
/**
|
|
41
47
|
* Resolver for Ant Design Vue
|
|
@@ -100,6 +106,10 @@ interface ElementUiResolverOptions {
|
|
|
100
106
|
* @default 'css'
|
|
101
107
|
*/
|
|
102
108
|
importStyle?: boolean | 'css' | 'sass';
|
|
109
|
+
/**
|
|
110
|
+
* exclude component name, if match do not resolve the name
|
|
111
|
+
*/
|
|
112
|
+
exclude?: RegExp;
|
|
103
113
|
}
|
|
104
114
|
/**
|
|
105
115
|
* Resolver for Element-UI
|
|
@@ -141,6 +151,12 @@ interface IduxResolverOptions {
|
|
|
141
151
|
* @default 'default'
|
|
142
152
|
*/
|
|
143
153
|
importStyleTheme?: string;
|
|
154
|
+
/**
|
|
155
|
+
* The scope of the packages.
|
|
156
|
+
*
|
|
157
|
+
* @default '@idux'
|
|
158
|
+
*/
|
|
159
|
+
scope?: string;
|
|
144
160
|
}
|
|
145
161
|
/**
|
|
146
162
|
* Resolver for `@idux/cdk`, `@idux/components` and ``@idux/pro``
|
|
@@ -334,6 +350,13 @@ declare function Vuetify3Resolver(): ComponentResolver;
|
|
|
334
350
|
*/
|
|
335
351
|
declare function VueUseComponentsResolver(): ComponentResolver;
|
|
336
352
|
|
|
353
|
+
/**
|
|
354
|
+
* Resolver for VueUse
|
|
355
|
+
*
|
|
356
|
+
* @link https://github.com/vueuse/vueuse
|
|
357
|
+
*/
|
|
358
|
+
declare function VueUseDirectiveResolver(): ComponentResolver;
|
|
359
|
+
|
|
337
360
|
/**
|
|
338
361
|
* Resolver for Quasar
|
|
339
362
|
*
|
|
@@ -459,4 +482,4 @@ interface BootstrapVueResolverOptions {
|
|
|
459
482
|
*/
|
|
460
483
|
declare function BootstrapVueResolver(_options?: BootstrapVueResolverOptions): ComponentResolver[];
|
|
461
484
|
|
|
462
|
-
export { AntDesignVueResolver, AntDesignVueResolverOptions, ArcoResolver, ArcoResolverOptions, BootstrapVueResolver, BootstrapVueResolverOptions, DevResolverOptions, DevUiResolver, ElementPlusResolver, ElementPlusResolverOptions, ElementUiResolver, ElementUiResolverOptions, HeadlessUiResolver, HeadlessUiResolverOptions, IduxResolver, IduxResolverOptions, InklineResolver, LayuiVueResolver, LayuiVueResolverOptions, NaiveUiResolver, PrimeVueResolver, PrimeVueResolverOptions, QuasarResolver, TDesignResolver, TDesignResolverOptions, VantResolver, VantResolverOptions, VarletUIResolver, VarletUIResolverOptions, VeuiResolver, VeuiResolverOptions, ViewUiResolver, VueUseComponentsResolver, Vuetify3Resolver, VuetifyResolver, getResolved };
|
|
485
|
+
export { AntDesignVueResolver, AntDesignVueResolverOptions, ArcoResolver, ArcoResolverOptions, BootstrapVueResolver, BootstrapVueResolverOptions, DevResolverOptions, DevUiResolver, ElementPlusResolver, ElementPlusResolverOptions, ElementUiResolver, ElementUiResolverOptions, HeadlessUiResolver, HeadlessUiResolverOptions, IduxResolver, IduxResolverOptions, InklineResolver, LayuiVueResolver, LayuiVueResolverOptions, NaiveUiResolver, PrimeVueResolver, PrimeVueResolverOptions, QuasarResolver, TDesignResolver, TDesignResolverOptions, VantResolver, VantResolverOptions, VarletUIResolver, VarletUIResolverOptions, VeuiResolver, VeuiResolverOptions, ViewUiResolver, VueUseComponentsResolver, VueUseDirectiveResolver, Vuetify3Resolver, VuetifyResolver, getResolved };
|
package/dist/resolvers.js
CHANGED
|
@@ -175,12 +175,13 @@ function getSideEffects(compName, options) {
|
|
|
175
175
|
if (!importStyle)
|
|
176
176
|
return;
|
|
177
177
|
const lib = options.cjs ? "lib" : "es";
|
|
178
|
+
const packageName = (options == null ? void 0 : options.packageName) || "ant-design-vue";
|
|
178
179
|
if (importStyle === "less" || importLess) {
|
|
179
180
|
const styleDir = getStyleDir(compName);
|
|
180
|
-
return
|
|
181
|
+
return `${packageName}/${lib}/${styleDir}/style`;
|
|
181
182
|
} else {
|
|
182
183
|
const styleDir = getStyleDir(compName);
|
|
183
|
-
return
|
|
184
|
+
return `${packageName}/${lib}/${styleDir}/style/css`;
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
var primitiveNames = ["Affix", "Anchor", "AnchorLink", "AutoComplete", "AutoCompleteOptGroup", "AutoCompleteOption", "Alert", "Avatar", "AvatarGroup", "BackTop", "Badge", "BadgeRibbon", "Breadcrumb", "BreadcrumbItem", "BreadcrumbSeparator", "Button", "ButtonGroup", "Calendar", "Card", "CardGrid", "CardMeta", "Collapse", "CollapsePanel", "Carousel", "Cascader", "Checkbox", "CheckboxGroup", "Col", "Comment", "ConfigProvider", "DatePicker", "MonthPicker", "WeekPicker", "RangePicker", "QuarterPicker", "Descriptions", "DescriptionsItem", "Divider", "Dropdown", "DropdownButton", "Drawer", "Empty", "Form", "FormItem", "FormItemRest", "Grid", "Input", "InputGroup", "InputPassword", "InputSearch", "Textarea", "Image", "ImagePreviewGroup", "InputNumber", "Layout", "LayoutHeader", "LayoutSider", "LayoutFooter", "LayoutContent", "List", "ListItem", "ListItemMeta", "Menu", "MenuDivider", "MenuItem", "MenuItemGroup", "SubMenu", "Mentions", "MentionsOption", "Modal", "Statistic", "StatisticCountdown", "PageHeader", "Pagination", "Popconfirm", "Popover", "Progress", "Radio", "RadioButton", "RadioGroup", "Rate", "Result", "Row", "Select", "SelectOptGroup", "SelectOption", "Skeleton", "SkeletonButton", "SkeletonAvatar", "SkeletonInput", "SkeletonImage", "Slider", "Space", "Spin", "Steps", "Step", "Switch", "Table", "TableColumn", "TableColumnGroup", "TableSummary", "TableSummaryRow", "TableSummaryCell", "Transfer", "Tree", "TreeNode", "DirectoryTree", "TreeSelect", "TreeSelectNode", "Tabs", "TabPane", "Tag", "CheckableTag", "TimePicker", "TimeRangePicker", "Timeline", "TimelineItem", "Tooltip", "Typography", "TypographyLink", "TypographyParagraph", "TypographyText", "TypographyTitle", "Upload", "UploadDragger", "LocaleProvider"];
|
|
@@ -206,8 +207,8 @@ function AntDesignVueResolver(options = {}) {
|
|
|
206
207
|
}
|
|
207
208
|
if (isAntdv(name) && !((_a = options == null ? void 0 : options.exclude) == null ? void 0 : _a.includes(name))) {
|
|
208
209
|
const importName = name.slice(1);
|
|
209
|
-
const { cjs = false } = options;
|
|
210
|
-
const path =
|
|
210
|
+
const { cjs = false, packageName = "ant-design-vue" } = options;
|
|
211
|
+
const path = `${packageName}/${cjs ? "lib" : "es"}`;
|
|
211
212
|
return {
|
|
212
213
|
name: importName,
|
|
213
214
|
from: path,
|
|
@@ -218,8 +219,8 @@ function AntDesignVueResolver(options = {}) {
|
|
|
218
219
|
};
|
|
219
220
|
}
|
|
220
221
|
|
|
221
|
-
// node_modules/.pnpm/compare-versions@
|
|
222
|
-
|
|
222
|
+
// node_modules/.pnpm/compare-versions@5.0.1/node_modules/compare-versions/lib/esm/index.js
|
|
223
|
+
var compareVersions = (v1, v2) => {
|
|
223
224
|
const n1 = validateAndParse(v1);
|
|
224
225
|
const n2 = validateAndParse(v2);
|
|
225
226
|
const p1 = n1.pop();
|
|
@@ -233,40 +234,20 @@ function compareVersions(v1, v2) {
|
|
|
233
234
|
return p1 ? -1 : 1;
|
|
234
235
|
}
|
|
235
236
|
return 0;
|
|
236
|
-
}
|
|
237
|
-
var validate = (v) => typeof v === "string" && /^[v\d]/.test(v) && semver.test(v);
|
|
237
|
+
};
|
|
238
238
|
var compare = (v1, v2, operator) => {
|
|
239
239
|
assertValidOperator(operator);
|
|
240
240
|
const res = compareVersions(v1, v2);
|
|
241
241
|
return operatorResMap[operator].includes(res);
|
|
242
242
|
};
|
|
243
|
-
var satisfies = (v, r) => {
|
|
244
|
-
const m = r.match(/^([<>=~^]+)/);
|
|
245
|
-
const op = m ? m[1] : "=";
|
|
246
|
-
if (op !== "^" && op !== "~")
|
|
247
|
-
return compare(v, r, op);
|
|
248
|
-
const [v1, v2, v3] = validateAndParse(v);
|
|
249
|
-
const [r1, r2, r3] = validateAndParse(r);
|
|
250
|
-
if (compareStrings(v1, r1) !== 0)
|
|
251
|
-
return false;
|
|
252
|
-
if (op === "^") {
|
|
253
|
-
return compareSegments([v2, v3], [r2, r3]) >= 0;
|
|
254
|
-
}
|
|
255
|
-
if (compareStrings(v2, r2) !== 0)
|
|
256
|
-
return false;
|
|
257
|
-
return compareStrings(v3, r3) >= 0;
|
|
258
|
-
};
|
|
259
|
-
compareVersions.validate = validate;
|
|
260
|
-
compareVersions.compare = compare;
|
|
261
|
-
compareVersions.sastisfies = satisfies;
|
|
262
243
|
var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
|
|
263
|
-
var validateAndParse = (
|
|
264
|
-
if (typeof
|
|
244
|
+
var validateAndParse = (version) => {
|
|
245
|
+
if (typeof version !== "string") {
|
|
265
246
|
throw new TypeError("Invalid argument expected string");
|
|
266
247
|
}
|
|
267
|
-
const match =
|
|
248
|
+
const match = version.match(semver);
|
|
268
249
|
if (!match) {
|
|
269
|
-
throw new Error(`Invalid argument not valid semver ('${
|
|
250
|
+
throw new Error(`Invalid argument not valid semver ('${version}' received)`);
|
|
270
251
|
}
|
|
271
252
|
match.shift();
|
|
272
253
|
return match;
|
|
@@ -289,7 +270,7 @@ var compareStrings = (a, b) => {
|
|
|
289
270
|
};
|
|
290
271
|
var compareSegments = (a, b) => {
|
|
291
272
|
for (let i = 0; i < Math.max(a.length, b.length); i++) {
|
|
292
|
-
const r = compareStrings(a[i] || 0, b[i] || 0);
|
|
273
|
+
const r = compareStrings(a[i] || "0", b[i] || "0");
|
|
293
274
|
if (r !== 0)
|
|
294
275
|
return r;
|
|
295
276
|
}
|
|
@@ -305,14 +286,10 @@ var operatorResMap = {
|
|
|
305
286
|
var allowedOperators = Object.keys(operatorResMap);
|
|
306
287
|
var assertValidOperator = (op) => {
|
|
307
288
|
if (typeof op !== "string") {
|
|
308
|
-
throw new TypeError(
|
|
309
|
-
`Invalid operator type, expected string but got ${typeof op}`
|
|
310
|
-
);
|
|
289
|
+
throw new TypeError(`Invalid operator type, expected string but got ${typeof op}`);
|
|
311
290
|
}
|
|
312
291
|
if (allowedOperators.indexOf(op) === -1) {
|
|
313
|
-
throw new Error(
|
|
314
|
-
`Invalid operator, expected one of ${allowedOperators.join("|")}`
|
|
315
|
-
);
|
|
292
|
+
throw new Error(`Invalid operator, expected one of ${allowedOperators.join("|")}`);
|
|
316
293
|
}
|
|
317
294
|
};
|
|
318
295
|
|
|
@@ -355,13 +332,13 @@ function resolveComponent(name, options) {
|
|
|
355
332
|
}
|
|
356
333
|
const partialName = _chunk2GXY7E6Xjs.kebabCase.call(void 0, name.slice(2));
|
|
357
334
|
const { version, ssr } = options;
|
|
358
|
-
if (
|
|
335
|
+
if (compare(version, "1.1.0-beta.1", ">=")) {
|
|
359
336
|
return {
|
|
360
337
|
name,
|
|
361
338
|
from: `element-plus/${ssr ? "lib" : "es"}`,
|
|
362
339
|
sideEffects: getSideEffects2(partialName, options)
|
|
363
340
|
};
|
|
364
|
-
} else if (
|
|
341
|
+
} else if (compare(version, "1.0.2-beta.28", ">=")) {
|
|
365
342
|
return {
|
|
366
343
|
from: `element-plus/es/el-${partialName}`,
|
|
367
344
|
sideEffects: getSideEffectsLegacy(partialName, options)
|
|
@@ -376,16 +353,16 @@ function resolveComponent(name, options) {
|
|
|
376
353
|
function resolveDirective(name, options) {
|
|
377
354
|
if (!options.directives)
|
|
378
355
|
return;
|
|
379
|
-
const
|
|
356
|
+
const directives2 = {
|
|
380
357
|
Loading: { importName: "ElLoadingDirective", styleName: "loading" },
|
|
381
358
|
Popover: { importName: "ElPopoverDirective", styleName: "popover" },
|
|
382
359
|
InfiniteScroll: { importName: "ElInfiniteScroll", styleName: "infinite-scroll" }
|
|
383
360
|
};
|
|
384
|
-
const directive =
|
|
361
|
+
const directive = directives2[name];
|
|
385
362
|
if (!directive)
|
|
386
363
|
return;
|
|
387
364
|
const { version, ssr } = options;
|
|
388
|
-
if (
|
|
365
|
+
if (compare(version, "1.1.0-beta.1", ">=")) {
|
|
389
366
|
return {
|
|
390
367
|
name: directive.importName,
|
|
391
368
|
from: `element-plus/${ssr ? "lib" : "es"}`,
|
|
@@ -451,6 +428,8 @@ function ElementUiResolver(options = {}) {
|
|
|
451
428
|
return {
|
|
452
429
|
type: "component",
|
|
453
430
|
resolve: (name) => {
|
|
431
|
+
if (options.exclude && name.match(options.exclude))
|
|
432
|
+
return;
|
|
454
433
|
if (/^El[A-Z]/.test(name)) {
|
|
455
434
|
const compName = name.slice(2);
|
|
456
435
|
const partialName = _chunk2GXY7E6Xjs.kebabCase.call(void 0, compName);
|
|
@@ -554,7 +533,7 @@ function IduxResolver(options = {}) {
|
|
|
554
533
|
return {
|
|
555
534
|
type: "component",
|
|
556
535
|
resolve: (name) => {
|
|
557
|
-
const { importStyle, importStyleTheme = "default", exclude = [] } = options;
|
|
536
|
+
const { importStyle, importStyleTheme = "default", exclude = [], scope = "@idux" } = options;
|
|
558
537
|
if (exclude.includes(name))
|
|
559
538
|
return;
|
|
560
539
|
const packageName = getPackageName(name);
|
|
@@ -565,7 +544,7 @@ function IduxResolver(options = {}) {
|
|
|
565
544
|
const nameIndex = packageName === "pro" ? 2 : 1;
|
|
566
545
|
dirname = _chunk2GXY7E6Xjs.kebabCase.call(void 0, name).split("-")[nameIndex];
|
|
567
546
|
}
|
|
568
|
-
const path =
|
|
547
|
+
const path = `${scope}/${packageName}/${dirname}`;
|
|
569
548
|
let sideEffects;
|
|
570
549
|
if (packageName !== "cdk" && importStyle)
|
|
571
550
|
sideEffects = `${path}/style/themes/${importStyle === "css" ? `${importStyleTheme}_css` : importStyleTheme}`;
|
|
@@ -793,8 +772,8 @@ function VarletUIResolver(options = {}) {
|
|
|
793
772
|
{
|
|
794
773
|
type: "directive",
|
|
795
774
|
resolve: (name) => {
|
|
796
|
-
const { directives = true } = options;
|
|
797
|
-
if (!
|
|
775
|
+
const { directives: directives2 = true } = options;
|
|
776
|
+
if (!directives2)
|
|
798
777
|
return;
|
|
799
778
|
if (!varDirectives.includes(name))
|
|
800
779
|
return;
|
|
@@ -878,7 +857,7 @@ function getSideEffects6(componentName) {
|
|
|
878
857
|
];
|
|
879
858
|
if (/^Table|^Slider|^Tab/.test(componentName))
|
|
880
859
|
sideEffects.push("element-resize-detector");
|
|
881
|
-
if (
|
|
860
|
+
if (componentName.startsWith("Date"))
|
|
882
861
|
sideEffects.push("js-calendar");
|
|
883
862
|
return sideEffects;
|
|
884
863
|
}
|
|
@@ -963,6 +942,32 @@ function VueUseComponentsResolver() {
|
|
|
963
942
|
};
|
|
964
943
|
}
|
|
965
944
|
|
|
945
|
+
// src/core/resolvers/vueuse-directive.ts
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
var directives;
|
|
949
|
+
function VueUseDirectiveResolver() {
|
|
950
|
+
return {
|
|
951
|
+
type: "directive",
|
|
952
|
+
resolve: (name) => {
|
|
953
|
+
if (!directives) {
|
|
954
|
+
let indexesJson;
|
|
955
|
+
try {
|
|
956
|
+
const corePath = _localpkg.resolveModule.call(void 0, "@vueuse/core") || process.cwd();
|
|
957
|
+
const path = _localpkg.resolveModule.call(void 0, "@vueuse/core/indexes.json") || _localpkg.resolveModule.call(void 0, "@vueuse/metadata/index.json") || _localpkg.resolveModule.call(void 0, "@vueuse/metadata/index.json", { paths: [corePath] });
|
|
958
|
+
indexesJson = JSON.parse(_fs.readFileSync.call(void 0, path, "utf-8"));
|
|
959
|
+
directives = indexesJson.functions.filter((i) => i.directive && i.name).map(({ name: name2 }) => name2[0].toUpperCase() + name2.slice(1));
|
|
960
|
+
} catch (error) {
|
|
961
|
+
console.error(error);
|
|
962
|
+
throw new Error("[vue-components] failed to load @vueuse/core, have you installed it?");
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
if (directives && directives.includes(name))
|
|
966
|
+
return { name: `v${name}`, as: name, from: "@vueuse/components" };
|
|
967
|
+
}
|
|
968
|
+
};
|
|
969
|
+
}
|
|
970
|
+
|
|
966
971
|
// src/core/resolvers/quasar.ts
|
|
967
972
|
|
|
968
973
|
|
|
@@ -1203,7 +1208,7 @@ function getSideEffects8(importName, options) {
|
|
|
1203
1208
|
return;
|
|
1204
1209
|
if (fileName.includes("-") && fileName !== "input-number") {
|
|
1205
1210
|
const prefix2 = fileName.slice(0, fileName.indexOf("-"));
|
|
1206
|
-
const container = ["anchor", "avatar", "breadcrumb", "checkbox", "dropdown", "form", "input", "list", "menu", "radio", "slider", "swiper", "color-picker", "text", "collapse"];
|
|
1211
|
+
const container = ["anchor", "avatar", "breadcrumb", "checkbox", "dropdown", "form", "input", "list", "menu", "radio", "slider", "swiper", "color-picker", "text", "collapse", "timeline"];
|
|
1207
1212
|
if (container.includes(prefix2))
|
|
1208
1213
|
fileName = prefix2;
|
|
1209
1214
|
}
|
|
@@ -1223,10 +1228,14 @@ function getSideEffects8(importName, options) {
|
|
|
1223
1228
|
fileName = "steps";
|
|
1224
1229
|
if (fileName === "check-tag")
|
|
1225
1230
|
fileName = "tag";
|
|
1226
|
-
if (["time-range-picker", "time-range-picker-panel"].includes(fileName))
|
|
1231
|
+
if (["time-range-picker", "time-range-picker-panel", "time-picker-panel"].includes(fileName))
|
|
1227
1232
|
fileName = "time-picker";
|
|
1228
|
-
if (["date-range-picker", "date-range-picker-panel"].includes(fileName))
|
|
1233
|
+
if (["date-range-picker", "date-range-picker-panel", "date-picker-panel"].includes(fileName))
|
|
1229
1234
|
fileName = "date-picker";
|
|
1235
|
+
if (["color-picker", "color-picker-panel"].includes(fileName))
|
|
1236
|
+
fileName = "color-picker";
|
|
1237
|
+
if (["enhanced-table", "base-table"].includes(fileName))
|
|
1238
|
+
fileName = "table";
|
|
1230
1239
|
if (importStyle === "less")
|
|
1231
1240
|
return `tdesign-${library}/esm/${fileName}/style`;
|
|
1232
1241
|
return `tdesign-${library}/es/${fileName}/style`;
|
|
@@ -1408,7 +1417,7 @@ var COMPONENT_ALIASES = {
|
|
|
1408
1417
|
BDdText: "BDropdownText",
|
|
1409
1418
|
BDropdownItemBtn: "BDropdownItemButton",
|
|
1410
1419
|
BFile: "BFormFile",
|
|
1411
|
-
|
|
1420
|
+
BDatepicker: "BFormDatepicker",
|
|
1412
1421
|
BInput: "BFormInput",
|
|
1413
1422
|
BNavDd: "BNavItemDropdown",
|
|
1414
1423
|
BNavDropdown: "BNavItemDropdown",
|
|
@@ -1477,5 +1486,6 @@ function BootstrapVueResolver(_options = {}) {
|
|
|
1477
1486
|
|
|
1478
1487
|
|
|
1479
1488
|
|
|
1480
|
-
|
|
1489
|
+
|
|
1490
|
+
exports.AntDesignVueResolver = AntDesignVueResolver; exports.ArcoResolver = ArcoResolver; exports.BootstrapVueResolver = BootstrapVueResolver; exports.DevUiResolver = DevUiResolver; exports.ElementPlusResolver = ElementPlusResolver; exports.ElementUiResolver = ElementUiResolver; exports.HeadlessUiResolver = HeadlessUiResolver; exports.IduxResolver = IduxResolver; exports.InklineResolver = InklineResolver; exports.LayuiVueResolver = LayuiVueResolver; exports.NaiveUiResolver = NaiveUiResolver; exports.PrimeVueResolver = PrimeVueResolver; exports.QuasarResolver = QuasarResolver; exports.TDesignResolver = TDesignResolver; exports.VantResolver = VantResolver; exports.VarletUIResolver = VarletUIResolver; exports.VeuiResolver = VeuiResolver; exports.ViewUiResolver = ViewUiResolver; exports.VueUseComponentsResolver = VueUseComponentsResolver; exports.VueUseDirectiveResolver = VueUseDirectiveResolver; exports.Vuetify3Resolver = Vuetify3Resolver; exports.VuetifyResolver = VuetifyResolver; exports.getResolved = getResolved;
|
|
1481
1491
|
exports.default = module.exports;
|
package/dist/resolvers.mjs
CHANGED
|
@@ -175,12 +175,13 @@ function getSideEffects(compName, options) {
|
|
|
175
175
|
if (!importStyle)
|
|
176
176
|
return;
|
|
177
177
|
const lib = options.cjs ? "lib" : "es";
|
|
178
|
+
const packageName = (options == null ? void 0 : options.packageName) || "ant-design-vue";
|
|
178
179
|
if (importStyle === "less" || importLess) {
|
|
179
180
|
const styleDir = getStyleDir(compName);
|
|
180
|
-
return
|
|
181
|
+
return `${packageName}/${lib}/${styleDir}/style`;
|
|
181
182
|
} else {
|
|
182
183
|
const styleDir = getStyleDir(compName);
|
|
183
|
-
return
|
|
184
|
+
return `${packageName}/${lib}/${styleDir}/style/css`;
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
var primitiveNames = ["Affix", "Anchor", "AnchorLink", "AutoComplete", "AutoCompleteOptGroup", "AutoCompleteOption", "Alert", "Avatar", "AvatarGroup", "BackTop", "Badge", "BadgeRibbon", "Breadcrumb", "BreadcrumbItem", "BreadcrumbSeparator", "Button", "ButtonGroup", "Calendar", "Card", "CardGrid", "CardMeta", "Collapse", "CollapsePanel", "Carousel", "Cascader", "Checkbox", "CheckboxGroup", "Col", "Comment", "ConfigProvider", "DatePicker", "MonthPicker", "WeekPicker", "RangePicker", "QuarterPicker", "Descriptions", "DescriptionsItem", "Divider", "Dropdown", "DropdownButton", "Drawer", "Empty", "Form", "FormItem", "FormItemRest", "Grid", "Input", "InputGroup", "InputPassword", "InputSearch", "Textarea", "Image", "ImagePreviewGroup", "InputNumber", "Layout", "LayoutHeader", "LayoutSider", "LayoutFooter", "LayoutContent", "List", "ListItem", "ListItemMeta", "Menu", "MenuDivider", "MenuItem", "MenuItemGroup", "SubMenu", "Mentions", "MentionsOption", "Modal", "Statistic", "StatisticCountdown", "PageHeader", "Pagination", "Popconfirm", "Popover", "Progress", "Radio", "RadioButton", "RadioGroup", "Rate", "Result", "Row", "Select", "SelectOptGroup", "SelectOption", "Skeleton", "SkeletonButton", "SkeletonAvatar", "SkeletonInput", "SkeletonImage", "Slider", "Space", "Spin", "Steps", "Step", "Switch", "Table", "TableColumn", "TableColumnGroup", "TableSummary", "TableSummaryRow", "TableSummaryCell", "Transfer", "Tree", "TreeNode", "DirectoryTree", "TreeSelect", "TreeSelectNode", "Tabs", "TabPane", "Tag", "CheckableTag", "TimePicker", "TimeRangePicker", "Timeline", "TimelineItem", "Tooltip", "Typography", "TypographyLink", "TypographyParagraph", "TypographyText", "TypographyTitle", "Upload", "UploadDragger", "LocaleProvider"];
|
|
@@ -206,8 +207,8 @@ function AntDesignVueResolver(options = {}) {
|
|
|
206
207
|
}
|
|
207
208
|
if (isAntdv(name) && !((_a = options == null ? void 0 : options.exclude) == null ? void 0 : _a.includes(name))) {
|
|
208
209
|
const importName = name.slice(1);
|
|
209
|
-
const { cjs = false } = options;
|
|
210
|
-
const path =
|
|
210
|
+
const { cjs = false, packageName = "ant-design-vue" } = options;
|
|
211
|
+
const path = `${packageName}/${cjs ? "lib" : "es"}`;
|
|
211
212
|
return {
|
|
212
213
|
name: importName,
|
|
213
214
|
from: path,
|
|
@@ -218,8 +219,8 @@ function AntDesignVueResolver(options = {}) {
|
|
|
218
219
|
};
|
|
219
220
|
}
|
|
220
221
|
|
|
221
|
-
// node_modules/.pnpm/compare-versions@
|
|
222
|
-
|
|
222
|
+
// node_modules/.pnpm/compare-versions@5.0.1/node_modules/compare-versions/lib/esm/index.js
|
|
223
|
+
var compareVersions = (v1, v2) => {
|
|
223
224
|
const n1 = validateAndParse(v1);
|
|
224
225
|
const n2 = validateAndParse(v2);
|
|
225
226
|
const p1 = n1.pop();
|
|
@@ -233,40 +234,20 @@ function compareVersions(v1, v2) {
|
|
|
233
234
|
return p1 ? -1 : 1;
|
|
234
235
|
}
|
|
235
236
|
return 0;
|
|
236
|
-
}
|
|
237
|
-
var validate = (v) => typeof v === "string" && /^[v\d]/.test(v) && semver.test(v);
|
|
237
|
+
};
|
|
238
238
|
var compare = (v1, v2, operator) => {
|
|
239
239
|
assertValidOperator(operator);
|
|
240
240
|
const res = compareVersions(v1, v2);
|
|
241
241
|
return operatorResMap[operator].includes(res);
|
|
242
242
|
};
|
|
243
|
-
var satisfies = (v, r) => {
|
|
244
|
-
const m = r.match(/^([<>=~^]+)/);
|
|
245
|
-
const op = m ? m[1] : "=";
|
|
246
|
-
if (op !== "^" && op !== "~")
|
|
247
|
-
return compare(v, r, op);
|
|
248
|
-
const [v1, v2, v3] = validateAndParse(v);
|
|
249
|
-
const [r1, r2, r3] = validateAndParse(r);
|
|
250
|
-
if (compareStrings(v1, r1) !== 0)
|
|
251
|
-
return false;
|
|
252
|
-
if (op === "^") {
|
|
253
|
-
return compareSegments([v2, v3], [r2, r3]) >= 0;
|
|
254
|
-
}
|
|
255
|
-
if (compareStrings(v2, r2) !== 0)
|
|
256
|
-
return false;
|
|
257
|
-
return compareStrings(v3, r3) >= 0;
|
|
258
|
-
};
|
|
259
|
-
compareVersions.validate = validate;
|
|
260
|
-
compareVersions.compare = compare;
|
|
261
|
-
compareVersions.sastisfies = satisfies;
|
|
262
243
|
var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
|
|
263
|
-
var validateAndParse = (
|
|
264
|
-
if (typeof
|
|
244
|
+
var validateAndParse = (version) => {
|
|
245
|
+
if (typeof version !== "string") {
|
|
265
246
|
throw new TypeError("Invalid argument expected string");
|
|
266
247
|
}
|
|
267
|
-
const match =
|
|
248
|
+
const match = version.match(semver);
|
|
268
249
|
if (!match) {
|
|
269
|
-
throw new Error(`Invalid argument not valid semver ('${
|
|
250
|
+
throw new Error(`Invalid argument not valid semver ('${version}' received)`);
|
|
270
251
|
}
|
|
271
252
|
match.shift();
|
|
272
253
|
return match;
|
|
@@ -289,7 +270,7 @@ var compareStrings = (a, b) => {
|
|
|
289
270
|
};
|
|
290
271
|
var compareSegments = (a, b) => {
|
|
291
272
|
for (let i = 0; i < Math.max(a.length, b.length); i++) {
|
|
292
|
-
const r = compareStrings(a[i] || 0, b[i] || 0);
|
|
273
|
+
const r = compareStrings(a[i] || "0", b[i] || "0");
|
|
293
274
|
if (r !== 0)
|
|
294
275
|
return r;
|
|
295
276
|
}
|
|
@@ -305,14 +286,10 @@ var operatorResMap = {
|
|
|
305
286
|
var allowedOperators = Object.keys(operatorResMap);
|
|
306
287
|
var assertValidOperator = (op) => {
|
|
307
288
|
if (typeof op !== "string") {
|
|
308
|
-
throw new TypeError(
|
|
309
|
-
`Invalid operator type, expected string but got ${typeof op}`
|
|
310
|
-
);
|
|
289
|
+
throw new TypeError(`Invalid operator type, expected string but got ${typeof op}`);
|
|
311
290
|
}
|
|
312
291
|
if (allowedOperators.indexOf(op) === -1) {
|
|
313
|
-
throw new Error(
|
|
314
|
-
`Invalid operator, expected one of ${allowedOperators.join("|")}`
|
|
315
|
-
);
|
|
292
|
+
throw new Error(`Invalid operator, expected one of ${allowedOperators.join("|")}`);
|
|
316
293
|
}
|
|
317
294
|
};
|
|
318
295
|
|
|
@@ -355,13 +332,13 @@ function resolveComponent(name, options) {
|
|
|
355
332
|
}
|
|
356
333
|
const partialName = kebabCase(name.slice(2));
|
|
357
334
|
const { version, ssr } = options;
|
|
358
|
-
if (
|
|
335
|
+
if (compare(version, "1.1.0-beta.1", ">=")) {
|
|
359
336
|
return {
|
|
360
337
|
name,
|
|
361
338
|
from: `element-plus/${ssr ? "lib" : "es"}`,
|
|
362
339
|
sideEffects: getSideEffects2(partialName, options)
|
|
363
340
|
};
|
|
364
|
-
} else if (
|
|
341
|
+
} else if (compare(version, "1.0.2-beta.28", ">=")) {
|
|
365
342
|
return {
|
|
366
343
|
from: `element-plus/es/el-${partialName}`,
|
|
367
344
|
sideEffects: getSideEffectsLegacy(partialName, options)
|
|
@@ -376,16 +353,16 @@ function resolveComponent(name, options) {
|
|
|
376
353
|
function resolveDirective(name, options) {
|
|
377
354
|
if (!options.directives)
|
|
378
355
|
return;
|
|
379
|
-
const
|
|
356
|
+
const directives2 = {
|
|
380
357
|
Loading: { importName: "ElLoadingDirective", styleName: "loading" },
|
|
381
358
|
Popover: { importName: "ElPopoverDirective", styleName: "popover" },
|
|
382
359
|
InfiniteScroll: { importName: "ElInfiniteScroll", styleName: "infinite-scroll" }
|
|
383
360
|
};
|
|
384
|
-
const directive =
|
|
361
|
+
const directive = directives2[name];
|
|
385
362
|
if (!directive)
|
|
386
363
|
return;
|
|
387
364
|
const { version, ssr } = options;
|
|
388
|
-
if (
|
|
365
|
+
if (compare(version, "1.1.0-beta.1", ">=")) {
|
|
389
366
|
return {
|
|
390
367
|
name: directive.importName,
|
|
391
368
|
from: `element-plus/${ssr ? "lib" : "es"}`,
|
|
@@ -451,6 +428,8 @@ function ElementUiResolver(options = {}) {
|
|
|
451
428
|
return {
|
|
452
429
|
type: "component",
|
|
453
430
|
resolve: (name) => {
|
|
431
|
+
if (options.exclude && name.match(options.exclude))
|
|
432
|
+
return;
|
|
454
433
|
if (/^El[A-Z]/.test(name)) {
|
|
455
434
|
const compName = name.slice(2);
|
|
456
435
|
const partialName = kebabCase(compName);
|
|
@@ -554,7 +533,7 @@ function IduxResolver(options = {}) {
|
|
|
554
533
|
return {
|
|
555
534
|
type: "component",
|
|
556
535
|
resolve: (name) => {
|
|
557
|
-
const { importStyle, importStyleTheme = "default", exclude = [] } = options;
|
|
536
|
+
const { importStyle, importStyleTheme = "default", exclude = [], scope = "@idux" } = options;
|
|
558
537
|
if (exclude.includes(name))
|
|
559
538
|
return;
|
|
560
539
|
const packageName = getPackageName(name);
|
|
@@ -565,7 +544,7 @@ function IduxResolver(options = {}) {
|
|
|
565
544
|
const nameIndex = packageName === "pro" ? 2 : 1;
|
|
566
545
|
dirname = kebabCase(name).split("-")[nameIndex];
|
|
567
546
|
}
|
|
568
|
-
const path =
|
|
547
|
+
const path = `${scope}/${packageName}/${dirname}`;
|
|
569
548
|
let sideEffects;
|
|
570
549
|
if (packageName !== "cdk" && importStyle)
|
|
571
550
|
sideEffects = `${path}/style/themes/${importStyle === "css" ? `${importStyleTheme}_css` : importStyleTheme}`;
|
|
@@ -793,8 +772,8 @@ function VarletUIResolver(options = {}) {
|
|
|
793
772
|
{
|
|
794
773
|
type: "directive",
|
|
795
774
|
resolve: (name) => {
|
|
796
|
-
const { directives = true } = options;
|
|
797
|
-
if (!
|
|
775
|
+
const { directives: directives2 = true } = options;
|
|
776
|
+
if (!directives2)
|
|
798
777
|
return;
|
|
799
778
|
if (!varDirectives.includes(name))
|
|
800
779
|
return;
|
|
@@ -878,7 +857,7 @@ function getSideEffects6(componentName) {
|
|
|
878
857
|
];
|
|
879
858
|
if (/^Table|^Slider|^Tab/.test(componentName))
|
|
880
859
|
sideEffects.push("element-resize-detector");
|
|
881
|
-
if (
|
|
860
|
+
if (componentName.startsWith("Date"))
|
|
882
861
|
sideEffects.push("js-calendar");
|
|
883
862
|
return sideEffects;
|
|
884
863
|
}
|
|
@@ -963,16 +942,42 @@ function VueUseComponentsResolver() {
|
|
|
963
942
|
};
|
|
964
943
|
}
|
|
965
944
|
|
|
945
|
+
// src/core/resolvers/vueuse-directive.ts
|
|
946
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
947
|
+
import { resolveModule as resolveModule2 } from "local-pkg";
|
|
948
|
+
var directives;
|
|
949
|
+
function VueUseDirectiveResolver() {
|
|
950
|
+
return {
|
|
951
|
+
type: "directive",
|
|
952
|
+
resolve: (name) => {
|
|
953
|
+
if (!directives) {
|
|
954
|
+
let indexesJson;
|
|
955
|
+
try {
|
|
956
|
+
const corePath = resolveModule2("@vueuse/core") || process.cwd();
|
|
957
|
+
const path = resolveModule2("@vueuse/core/indexes.json") || resolveModule2("@vueuse/metadata/index.json") || resolveModule2("@vueuse/metadata/index.json", { paths: [corePath] });
|
|
958
|
+
indexesJson = JSON.parse(readFileSync2(path, "utf-8"));
|
|
959
|
+
directives = indexesJson.functions.filter((i) => i.directive && i.name).map(({ name: name2 }) => name2[0].toUpperCase() + name2.slice(1));
|
|
960
|
+
} catch (error) {
|
|
961
|
+
console.error(error);
|
|
962
|
+
throw new Error("[vue-components] failed to load @vueuse/core, have you installed it?");
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
if (directives && directives.includes(name))
|
|
966
|
+
return { name: `v${name}`, as: name, from: "@vueuse/components" };
|
|
967
|
+
}
|
|
968
|
+
};
|
|
969
|
+
}
|
|
970
|
+
|
|
966
971
|
// src/core/resolvers/quasar.ts
|
|
967
972
|
import { promises as fs } from "fs";
|
|
968
|
-
import { resolveModule as
|
|
973
|
+
import { resolveModule as resolveModule3 } from "local-pkg";
|
|
969
974
|
function QuasarResolver() {
|
|
970
975
|
let components5 = [];
|
|
971
976
|
return {
|
|
972
977
|
type: "component",
|
|
973
978
|
resolve: async (name) => {
|
|
974
979
|
if (!components5.length) {
|
|
975
|
-
const quasarApiListPath =
|
|
980
|
+
const quasarApiListPath = resolveModule3("quasar/dist/transforms/api-list.json");
|
|
976
981
|
if (quasarApiListPath)
|
|
977
982
|
components5 = JSON.parse(await fs.readFile(quasarApiListPath, "utf-8"));
|
|
978
983
|
}
|
|
@@ -1203,7 +1208,7 @@ function getSideEffects8(importName, options) {
|
|
|
1203
1208
|
return;
|
|
1204
1209
|
if (fileName.includes("-") && fileName !== "input-number") {
|
|
1205
1210
|
const prefix2 = fileName.slice(0, fileName.indexOf("-"));
|
|
1206
|
-
const container = ["anchor", "avatar", "breadcrumb", "checkbox", "dropdown", "form", "input", "list", "menu", "radio", "slider", "swiper", "color-picker", "text", "collapse"];
|
|
1211
|
+
const container = ["anchor", "avatar", "breadcrumb", "checkbox", "dropdown", "form", "input", "list", "menu", "radio", "slider", "swiper", "color-picker", "text", "collapse", "timeline"];
|
|
1207
1212
|
if (container.includes(prefix2))
|
|
1208
1213
|
fileName = prefix2;
|
|
1209
1214
|
}
|
|
@@ -1223,10 +1228,14 @@ function getSideEffects8(importName, options) {
|
|
|
1223
1228
|
fileName = "steps";
|
|
1224
1229
|
if (fileName === "check-tag")
|
|
1225
1230
|
fileName = "tag";
|
|
1226
|
-
if (["time-range-picker", "time-range-picker-panel"].includes(fileName))
|
|
1231
|
+
if (["time-range-picker", "time-range-picker-panel", "time-picker-panel"].includes(fileName))
|
|
1227
1232
|
fileName = "time-picker";
|
|
1228
|
-
if (["date-range-picker", "date-range-picker-panel"].includes(fileName))
|
|
1233
|
+
if (["date-range-picker", "date-range-picker-panel", "date-picker-panel"].includes(fileName))
|
|
1229
1234
|
fileName = "date-picker";
|
|
1235
|
+
if (["color-picker", "color-picker-panel"].includes(fileName))
|
|
1236
|
+
fileName = "color-picker";
|
|
1237
|
+
if (["enhanced-table", "base-table"].includes(fileName))
|
|
1238
|
+
fileName = "table";
|
|
1230
1239
|
if (importStyle === "less")
|
|
1231
1240
|
return `tdesign-${library}/esm/${fileName}/style`;
|
|
1232
1241
|
return `tdesign-${library}/es/${fileName}/style`;
|
|
@@ -1408,7 +1417,7 @@ var COMPONENT_ALIASES = {
|
|
|
1408
1417
|
BDdText: "BDropdownText",
|
|
1409
1418
|
BDropdownItemBtn: "BDropdownItemButton",
|
|
1410
1419
|
BFile: "BFormFile",
|
|
1411
|
-
|
|
1420
|
+
BDatepicker: "BFormDatepicker",
|
|
1412
1421
|
BInput: "BFormInput",
|
|
1413
1422
|
BNavDd: "BNavItemDropdown",
|
|
1414
1423
|
BNavDropdown: "BNavItemDropdown",
|
|
@@ -1474,6 +1483,7 @@ export {
|
|
|
1474
1483
|
VeuiResolver,
|
|
1475
1484
|
ViewUiResolver,
|
|
1476
1485
|
VueUseComponentsResolver,
|
|
1486
|
+
VueUseDirectiveResolver,
|
|
1477
1487
|
Vuetify3Resolver,
|
|
1478
1488
|
VuetifyResolver,
|
|
1479
1489
|
getResolved
|
package/dist/rollup.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ import { Options } from './types.js';
|
|
|
3
3
|
import '@rollup/pluginutils';
|
|
4
4
|
import '@antfu/utils';
|
|
5
5
|
|
|
6
|
-
declare const _default: (options
|
|
6
|
+
declare const _default: (options: Options) => unplugin.RollupPlugin;
|
|
7
7
|
|
|
8
8
|
export { _default as default };
|
package/dist/rollup.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSMCETF6Mjs = require('./chunk-SMCETF6M.js');
|
|
4
4
|
require('./chunk-2GXY7E6X.js');
|
|
5
5
|
require('./chunk-EZUCZHGV.js');
|
|
6
6
|
require('./chunk-6F4PWJZI.js');
|
|
7
7
|
|
|
8
8
|
// src/rollup.ts
|
|
9
|
-
var rollup_default =
|
|
9
|
+
var rollup_default = _chunkSMCETF6Mjs.unplugin_default.rollup;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
module.exports = rollup_default;
|
package/dist/rollup.mjs
CHANGED
package/dist/vite.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSMCETF6Mjs = require('./chunk-SMCETF6M.js');
|
|
4
4
|
require('./chunk-2GXY7E6X.js');
|
|
5
5
|
require('./chunk-EZUCZHGV.js');
|
|
6
6
|
require('./chunk-6F4PWJZI.js');
|
|
7
7
|
|
|
8
8
|
// src/vite.ts
|
|
9
|
-
var vite_default =
|
|
9
|
+
var vite_default = _chunkSMCETF6Mjs.unplugin_default.vite;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
module.exports = vite_default;
|
package/dist/vite.mjs
CHANGED
package/dist/webpack.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ import '@rollup/pluginutils';
|
|
|
4
4
|
import 'unplugin';
|
|
5
5
|
import '@antfu/utils';
|
|
6
6
|
|
|
7
|
-
declare const _default: (options
|
|
7
|
+
declare const _default: (options: Options) => webpack.WebpackPluginInstance;
|
|
8
8
|
|
|
9
9
|
export { _default as default };
|
package/dist/webpack.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSMCETF6Mjs = require('./chunk-SMCETF6M.js');
|
|
4
4
|
require('./chunk-2GXY7E6X.js');
|
|
5
5
|
require('./chunk-EZUCZHGV.js');
|
|
6
6
|
require('./chunk-6F4PWJZI.js');
|
|
7
7
|
|
|
8
8
|
// src/webpack.ts
|
|
9
|
-
var webpack_default =
|
|
9
|
+
var webpack_default = _chunkSMCETF6Mjs.unplugin_default.webpack;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
module.exports = webpack_default;
|
package/dist/webpack.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-vue-components",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.6",
|
|
4
4
|
"packageManager": "pnpm@7.1.5",
|
|
5
5
|
"description": "Components auto importing for Vue",
|
|
6
6
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
@@ -88,34 +88,34 @@
|
|
|
88
88
|
"@rollup/pluginutils": "^4.2.1",
|
|
89
89
|
"chokidar": "^3.5.3",
|
|
90
90
|
"debug": "^4.3.4",
|
|
91
|
-
"fast-glob": "^3.2.
|
|
91
|
+
"fast-glob": "^3.2.12",
|
|
92
92
|
"local-pkg": "^0.4.2",
|
|
93
|
-
"magic-string": "^0.26.
|
|
93
|
+
"magic-string": "^0.26.3",
|
|
94
94
|
"minimatch": "^5.1.0",
|
|
95
95
|
"resolve": "^1.22.1",
|
|
96
|
-
"unplugin": "^0.9.
|
|
96
|
+
"unplugin": "^0.9.5"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
|
-
"@antfu/eslint-config": "^0.
|
|
100
|
-
"@babel/parser": "^7.
|
|
101
|
-
"@babel/types": "^7.
|
|
99
|
+
"@antfu/eslint-config": "^0.26.3",
|
|
100
|
+
"@babel/parser": "^7.19.0",
|
|
101
|
+
"@babel/types": "^7.19.0",
|
|
102
102
|
"@types/debug": "^4.1.7",
|
|
103
|
-
"@types/minimatch": "^
|
|
104
|
-
"@types/node": "^18.
|
|
103
|
+
"@types/minimatch": "^5.1.2",
|
|
104
|
+
"@types/node": "^18.7.16",
|
|
105
105
|
"@types/resolve": "^1.20.2",
|
|
106
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
106
|
+
"@typescript-eslint/eslint-plugin": "^5.36.2",
|
|
107
107
|
"bumpp": "^8.2.1",
|
|
108
|
-
"compare-versions": "^
|
|
109
|
-
"element-plus": "^2.2.
|
|
110
|
-
"eslint": "^8.
|
|
108
|
+
"compare-versions": "^5.0.1",
|
|
109
|
+
"element-plus": "^2.2.16",
|
|
110
|
+
"eslint": "^8.23.0",
|
|
111
111
|
"esno": "^0.16.3",
|
|
112
112
|
"estree-walker": "^3.0.1",
|
|
113
|
-
"pathe": "^0.3.
|
|
114
|
-
"rollup": "^2.
|
|
115
|
-
"tsup": "^6.2.
|
|
116
|
-
"typescript": "^4.
|
|
117
|
-
"vite": "^3.0
|
|
118
|
-
"vitest": "^0.
|
|
113
|
+
"pathe": "^0.3.7",
|
|
114
|
+
"rollup": "^2.79.0",
|
|
115
|
+
"tsup": "^6.2.3",
|
|
116
|
+
"typescript": "^4.8.3",
|
|
117
|
+
"vite": "^3.1.0",
|
|
118
|
+
"vitest": "^0.23.2",
|
|
119
119
|
"vue": "3.2.37"
|
|
120
120
|
}
|
|
121
121
|
}
|