Skip to content

Commit 6b4ac91

Browse files
committed
BREAKING CHANGE: remove libraries option
1 parent 0cabe3d commit 6b4ac91

File tree

3 files changed

+1
-84
lines changed

3 files changed

+1
-84
lines changed

src/core/helpers/libraryResolver.ts

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/core/options.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { join, resolve } from 'path'
22
import { slash, toArray } from '@antfu/utils'
33
import { isPackageExists } from 'local-pkg'
44
import type { ComponentResolver, ComponentResolverObject, Options, ResolvedOptions } from '../types'
5-
import { LibraryResolver } from './helpers/libraryResolver'
65

76
export const defaultOptions: Omit<Required<Options>, 'include' | 'exclude' | 'transformer' | 'globs' |'directives'> = {
87
dirs: 'src/components',
@@ -13,7 +12,6 @@ export const defaultOptions: Omit<Required<Options>, 'include' | 'exclude' | 'tr
1312
directoryAsNamespace: false,
1413
globalNamespaces: [],
1514

16-
libraries: [],
1715
resolvers: [],
1816

1917
importPathTransform: v => v,
@@ -27,9 +25,7 @@ function normalizeResolvers(resolvers: (ComponentResolver | ComponentResolver[])
2725

2826
export function resolveOptions(options: Options, root: string): ResolvedOptions {
2927
const resolved = Object.assign({}, defaultOptions, options) as ResolvedOptions
30-
resolved.libraries = toArray(resolved.libraries).map(i => typeof i === 'string' ? { name: i } : i)
3128
resolved.resolvers = normalizeResolvers(resolved.resolvers)
32-
resolved.resolvers.push(...resolved.libraries.map(lib => LibraryResolver(lib)))
3329
resolved.extensions = toArray(resolved.extensions)
3430

3531
if (resolved.globs) {

src/types.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ export interface ComponentResolverObject {
2222
resolve: ComponentResolverFunction
2323
}
2424
export type ComponentResolver = ComponentResolverFunction | ComponentResolverObject
25-
export interface UILibraryOptions {
26-
name: string
27-
prefix?: string
28-
entries?: string[]
29-
}
3025

3126
export type Matcher = (id: string) => boolean | null | undefined
3227

@@ -97,11 +92,6 @@ export interface Options {
9792
*/
9893
globalNamespaces?: string[]
9994

100-
/**
101-
* comp libraries to use auto import
102-
*/
103-
libraries?: (string | UILibraryOptions)[]
104-
10595
/**
10696
* Pass a custom function to resolve the component importing path from the component name.
10797
*
@@ -153,10 +143,9 @@ export interface Options {
153143

154144
export type ResolvedOptions = Omit<
155145
Required<Options>,
156-
'resolvers'|'libraries'|'extensions'|'dirs'|'globalComponentsDeclaration'
146+
'resolvers'|'extensions'|'dirs'|'globalComponentsDeclaration'
157147
> & {
158148
resolvers: ComponentResolverObject[]
159-
libraries: UILibraryOptions[]
160149
extensions: string[]
161150
dirs: string[]
162151
resolvedDirs: string[]

0 commit comments

Comments
 (0)