unplugin-vue-components
Advanced tools
Comparing version 0.18.5 to 0.19.0
import * as esbuild from 'esbuild'; | ||
import { Options } from './types'; | ||
import { Options } from './types.js'; | ||
import '@rollup/pluginutils'; | ||
@@ -4,0 +4,0 @@ import 'unplugin'; |
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkX46PG6OBjs = require('./chunk-X46PG6OB.js'); | ||
require('./chunk-I3PYM4HQ.js'); | ||
var _chunkDZERNDUJjs = require('./chunk-DZERNDUJ.js'); | ||
require('./chunk-TMX2H7L5.js'); | ||
require('./chunk-6F4PWJZI.js'); | ||
// src/esbuild.ts | ||
var esbuild_default = _chunkX46PG6OBjs.unplugin_default.esbuild; | ||
var esbuild_default = _chunkDZERNDUJjs.unplugin_default.esbuild; | ||
@@ -10,0 +10,0 @@ |
@@ -1,3 +0,3 @@ | ||
import { Options } from './types'; | ||
export { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, UILibraryOptions } from './types'; | ||
import { Options } from './types.js'; | ||
export { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, TypeImport } from './types.js'; | ||
import * as unplugin from 'unplugin'; | ||
@@ -4,0 +4,0 @@ import '@rollup/pluginutils'; |
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkX46PG6OBjs = require('./chunk-X46PG6OB.js'); | ||
var _chunkDZERNDUJjs = require('./chunk-DZERNDUJ.js'); | ||
@@ -8,3 +8,3 @@ | ||
var _chunkI3PYM4HQjs = require('./chunk-I3PYM4HQ.js'); | ||
var _chunkTMX2H7L5js = require('./chunk-TMX2H7L5.js'); | ||
require('./chunk-6F4PWJZI.js'); | ||
@@ -16,2 +16,2 @@ | ||
exports.camelCase = _chunkI3PYM4HQjs.camelCase; exports.default = _chunkX46PG6OBjs.unplugin_default; exports.kebabCase = _chunkI3PYM4HQjs.kebabCase; exports.pascalCase = _chunkI3PYM4HQjs.pascalCase; | ||
exports.camelCase = _chunkTMX2H7L5js.camelCase; exports.default = _chunkDZERNDUJjs.unplugin_default; exports.kebabCase = _chunkTMX2H7L5js.kebabCase; exports.pascalCase = _chunkTMX2H7L5js.pascalCase; |
@@ -1,2 +0,2 @@ | ||
import { Options } from './types'; | ||
import { Options } from './types.js'; | ||
import '@rollup/pluginutils'; | ||
@@ -3,0 +3,0 @@ import 'unplugin'; |
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkX46PG6OBjs = require('./chunk-X46PG6OB.js'); | ||
require('./chunk-I3PYM4HQ.js'); | ||
var _chunkDZERNDUJjs = require('./chunk-DZERNDUJ.js'); | ||
require('./chunk-TMX2H7L5.js'); | ||
require('./chunk-6F4PWJZI.js'); | ||
@@ -11,7 +11,7 @@ | ||
config.plugins = config.plugins || []; | ||
config.plugins.unshift(_chunkX46PG6OBjs.unplugin_default.webpack(options)); | ||
config.plugins.unshift(_chunkDZERNDUJjs.unplugin_default.webpack(options)); | ||
}); | ||
this.nuxt.hook("vite:extend", async (vite) => { | ||
vite.config.plugins = vite.config.plugins || []; | ||
vite.config.plugins.push(_chunkX46PG6OBjs.unplugin_default.vite(options)); | ||
vite.config.plugins.push(_chunkDZERNDUJjs.unplugin_default.vite(options)); | ||
}); | ||
@@ -18,0 +18,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { ComponentResolver, ComponentResolveResult, UILibraryOptions, ComponentResolverObject } from './types'; | ||
import { ComponentResolver, ComponentResolveResult } from './types.js'; | ||
import '@rollup/pluginutils'; | ||
@@ -400,5 +400,2 @@ import 'unplugin'; | ||
declare function tryLoadVeturTags(name: string): string[] | undefined; | ||
declare function LibraryResolver(options: UILibraryOptions): ComponentResolverObject; | ||
export { AntDesignVueResolver, AntDesignVueResolverOptions, ArcoResolver, ArcoResolverOptions, DevResolverOptions, DevUiResolver, ElementPlusResolver, ElementPlusResolverOptions, ElementUiResolver, ElementUiResolverOptions, HeadlessUiResolver, HeadlessUiResolverOptions, IduxResolver, IduxResolverOptions, InklineResolver, LibraryResolver, NaiveUiResolver, PrimeVueResolver, PrimeVueResolverOptions, QuasarResolver, TDesignResolver, TDesignResolverOptions, VantResolver, VantResolverOptions, VarletUIResolver, VarletUIResolverOptions, VeuiResolver, VeuiResolverOptions, ViewUiResolver, VueUseComponentsResolver, Vuetify3Resolver, VuetifyResolver, getResolved, tryLoadVeturTags }; | ||
export { AntDesignVueResolver, AntDesignVueResolverOptions, ArcoResolver, ArcoResolverOptions, DevResolverOptions, DevUiResolver, ElementPlusResolver, ElementPlusResolverOptions, ElementUiResolver, ElementUiResolverOptions, HeadlessUiResolver, HeadlessUiResolverOptions, IduxResolver, IduxResolverOptions, InklineResolver, NaiveUiResolver, PrimeVueResolver, PrimeVueResolverOptions, QuasarResolver, TDesignResolver, TDesignResolverOptions, VantResolver, VantResolverOptions, VarletUIResolver, VarletUIResolverOptions, VeuiResolver, VeuiResolverOptions, ViewUiResolver, VueUseComponentsResolver, Vuetify3Resolver, VuetifyResolver, getResolved }; |
import * as unplugin from 'unplugin'; | ||
import { Options } from './types'; | ||
import { Options } from './types.js'; | ||
import '@rollup/pluginutils'; | ||
@@ -4,0 +4,0 @@ import '@antfu/utils'; |
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkX46PG6OBjs = require('./chunk-X46PG6OB.js'); | ||
require('./chunk-I3PYM4HQ.js'); | ||
var _chunkDZERNDUJjs = require('./chunk-DZERNDUJ.js'); | ||
require('./chunk-TMX2H7L5.js'); | ||
require('./chunk-6F4PWJZI.js'); | ||
// src/rollup.ts | ||
var rollup_default = _chunkX46PG6OBjs.unplugin_default.rollup; | ||
var rollup_default = _chunkDZERNDUJjs.unplugin_default.rollup; | ||
@@ -10,0 +10,0 @@ |
@@ -5,7 +5,22 @@ import { FilterPattern } from '@rollup/pluginutils'; | ||
interface ImportInfo { | ||
interface ImportInfoLegacy { | ||
/** | ||
* @deprecated renamed to `as` | ||
*/ | ||
name?: string; | ||
/** | ||
* @deprecated renamed to `name` | ||
*/ | ||
importName?: string; | ||
/** | ||
* @deprecated renamed to `from` | ||
*/ | ||
path: string; | ||
sideEffects?: SideEffectsInfo; | ||
} | ||
interface ImportInfo { | ||
as?: string; | ||
name?: string; | ||
from: string; | ||
} | ||
declare type SideEffectsInfo = (ImportInfo | string)[] | ImportInfo | string | undefined; | ||
@@ -22,7 +37,2 @@ interface ComponentInfo extends ImportInfo { | ||
declare type ComponentResolver = ComponentResolverFunction | ComponentResolverObject; | ||
interface UILibraryOptions { | ||
name: string; | ||
prefix?: string; | ||
entries?: string[]; | ||
} | ||
declare type Matcher = (id: string) => boolean | null | undefined; | ||
@@ -86,6 +96,2 @@ declare type Transformer = (code: string, id: string, path: string, query: Record<string, string>) => Awaitable<TransformResult | null>; | ||
/** | ||
* comp libraries to use auto import | ||
*/ | ||
libraries?: (string | UILibraryOptions)[]; | ||
/** | ||
* Pass a custom function to resolve the component importing path from the component name. | ||
@@ -132,6 +138,9 @@ * | ||
directives?: boolean; | ||
/** | ||
* Only provide types of components in library (registered globally) | ||
**/ | ||
types?: TypeImport[]; | ||
} | ||
declare type ResolvedOptions = Omit<Required<Options>, 'resolvers' | 'libraries' | 'extensions' | 'dirs' | 'globalComponentsDeclaration'> & { | ||
declare type ResolvedOptions = Omit<Required<Options>, 'resolvers' | 'extensions' | 'dirs' | 'globalComponentsDeclaration'> & { | ||
resolvers: ComponentResolverObject[]; | ||
libraries: UILibraryOptions[]; | ||
extensions: string[]; | ||
@@ -145,3 +154,7 @@ dirs: string[]; | ||
declare type ComponentsImportMap = Record<string, string[] | undefined>; | ||
interface TypeImport { | ||
from: string; | ||
names: string[]; | ||
} | ||
export { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, UILibraryOptions }; | ||
export { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, TypeImport }; |
import { Plugin } from 'vite'; | ||
import { Options, PublicPluginAPI } from './types'; | ||
import { Options, PublicPluginAPI } from './types.js'; | ||
import '@rollup/pluginutils'; | ||
@@ -4,0 +4,0 @@ import 'unplugin'; |
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkX46PG6OBjs = require('./chunk-X46PG6OB.js'); | ||
require('./chunk-I3PYM4HQ.js'); | ||
var _chunkDZERNDUJjs = require('./chunk-DZERNDUJ.js'); | ||
require('./chunk-TMX2H7L5.js'); | ||
require('./chunk-6F4PWJZI.js'); | ||
// src/vite.ts | ||
var vite_default = _chunkX46PG6OBjs.unplugin_default.vite; | ||
var vite_default = _chunkDZERNDUJjs.unplugin_default.vite; | ||
@@ -10,0 +10,0 @@ |
import * as webpack from 'webpack'; | ||
import { Options } from './types'; | ||
import { Options } from './types.js'; | ||
import '@rollup/pluginutils'; | ||
@@ -4,0 +4,0 @@ import 'unplugin'; |
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkX46PG6OBjs = require('./chunk-X46PG6OB.js'); | ||
require('./chunk-I3PYM4HQ.js'); | ||
var _chunkDZERNDUJjs = require('./chunk-DZERNDUJ.js'); | ||
require('./chunk-TMX2H7L5.js'); | ||
require('./chunk-6F4PWJZI.js'); | ||
// src/webpack.ts | ||
var webpack_default = _chunkX46PG6OBjs.unplugin_default.webpack; | ||
var webpack_default = _chunkDZERNDUJjs.unplugin_default.webpack; | ||
@@ -10,0 +10,0 @@ |
{ | ||
"name": "unplugin-vue-components", | ||
"version": "0.18.5", | ||
"version": "0.19.0", | ||
"packageManager": "pnpm@6.32.3", | ||
"description": "Components auto importing for Vue", | ||
@@ -91,3 +92,3 @@ "homepage": "https://github.com/antfu/unplugin-vue-components", | ||
"chokidar": "^3.5.3", | ||
"debug": "^4.3.3", | ||
"debug": "^4.3.4", | ||
"fast-glob": "^3.2.11", | ||
@@ -98,25 +99,25 @@ "local-pkg": "^0.4.1", | ||
"resolve": "^1.22.0", | ||
"unplugin": "^0.4.0" | ||
"unplugin": "^0.6.1" | ||
}, | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^0.18.8", | ||
"@babel/parser": "^7.17.3", | ||
"@babel/traverse": "^7.17.3", | ||
"@antfu/eslint-config": "^0.20.2", | ||
"@babel/parser": "^7.17.9", | ||
"@babel/traverse": "^7.17.9", | ||
"@babel/types": "^7.17.0", | ||
"@types/debug": "^4.1.7", | ||
"@types/minimatch": "^3.0.5", | ||
"@types/node": "^17.0.21", | ||
"@types/node": "^17.0.23", | ||
"@types/resolve": "^1.20.1", | ||
"@typescript-eslint/eslint-plugin": "^5.14.0", | ||
"@typescript-eslint/eslint-plugin": "^5.18.0", | ||
"bumpp": "^7.1.1", | ||
"compare-versions": "^4.1.3", | ||
"element-plus": "^2.0.5", | ||
"eslint": "^8.10.0", | ||
"element-plus": "^2.1.8", | ||
"eslint": "^8.13.0", | ||
"esno": "^0.14.1", | ||
"pathe": "^0.2.0", | ||
"rollup": "^2.70.0", | ||
"tsup": "5.12.1", | ||
"typescript": "^4.6.2", | ||
"vite": "^2.8.6", | ||
"vitest": "^0.6.0", | ||
"rollup": "^2.70.1", | ||
"tsup": "5.12.4", | ||
"typescript": "^4.6.3", | ||
"vite": "^2.9.1", | ||
"vitest": "^0.9.2", | ||
"vue": "3.2.31" | ||
@@ -123,0 +124,0 @@ }, |
@@ -241,2 +241,29 @@ # unplugin-vue-components | ||
## Types for global registered components | ||
Some libraries might register some global components for you to use anywhere (e.g. Vue Router provides `<RouterLink>` and `<RouterView>`). Since they are global available, there is no need for this plugin to import them. However, those are commonly not TypeScript friendly, and you might need to register their types manually. | ||
Thus `unplugin-vue-components` provided a way to only register types for global components. | ||
```ts | ||
Components({ | ||
dts: true, | ||
types: [{ | ||
from: 'vue-router', | ||
names: ['RouterLink', 'RouterView'], | ||
}], | ||
}) | ||
``` | ||
So the `RouterLink` and `RouterView` will be presented in `components.d.ts`. | ||
By default, `unplugin-vue-components` detects supported libraries automatically (e.g. `vue-router`) when their are installed in the workspace. If you want to disable it completely, you can pass an empty array to it: | ||
```ts | ||
Components({ | ||
// Disable type only registration | ||
types: [], | ||
}) | ||
``` | ||
## Migrate from `vite-plugin-components` | ||
@@ -304,2 +331,3 @@ | ||
// also accepts a path for custom filename | ||
// default: `true` if package typescript is installed | ||
dts: false, | ||
@@ -306,0 +334,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
362
18
153849
4603
1
+ Addedunplugin@0.6.3(transitive)
+ Addedwebpack-sources@3.2.3(transitive)
- Removedunplugin@0.4.0(transitive)
Updateddebug@^4.3.4
Updatedunplugin@^0.6.1