Skip to content

Commit 59a2a90

Browse files
committed
rollback
1 parent 582d711 commit 59a2a90

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/core/options.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { ComponentResolver, ComponentResolverObject, Options, ResolvedOptio
22
import { join, resolve } from 'node:path'
33
import { slash, toArray } from '@antfu/utils'
44
import { getPackageInfoSync, isPackageExists } from 'local-pkg'
5-
import { convertPathToPattern } from 'tinyglobby'
65
import { detectTypeImports } from './type-imports/detect'
76

87
export const defaultOptions: Omit<Required<Options>, 'include' | 'exclude' | 'excludeNames' | 'transformer' | 'globs' | 'globsExclude' | 'directives' | 'types' | 'version'> = {
@@ -64,8 +63,8 @@ export function resolveOptions(options: Options, root: string): ResolvedOptions
6463
i = i.slice(1)
6564
}
6665
return resolved.deep
67-
? prefix + join(convertPathToPattern(i), slash(`**/*.${extsGlob}`))
68-
: prefix + join(convertPathToPattern(i), slash(`*.${extsGlob}`))
66+
? prefix + slash(join(i, `**/*.${extsGlob}`))
67+
: prefix + slash(join(i, `*.${extsGlob}`))
6968
})
7069

7170
if (!resolved.extensions.length)

test/__snapshots__/search.test.ts.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ exports[`search > should with namespace 1`] = `
123123
`;
124124

125125
exports[`search > should work 1`] = `
126+
[
127+
"/Users/ilyal/f/unplugin-vue-components/examples/vite-vue3/src/components/**/*.vue",
128+
]
129+
`;
130+
131+
exports[`search > should work 2`] = `
126132
[
127133
{
128134
"as": "Avatar",

test/search.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ describe('search', () => {
1818
ctx.setRoot(root)
1919
ctx.searchGlob()
2020

21+
expect(ctx.options.globs).toMatchSnapshot()
2122
expect(cleanup(ctx.componentNameMap)).toMatchSnapshot()
2223
})
2324

0 commit comments

Comments
 (0)