Skip to content

Commit

Permalink
chore: use tinyglobby instead of fast-glob in Vitest
Browse files Browse the repository at this point in the history
This reverts commit 70baaaa.
  • Loading branch information
benmccann committed Dec 19, 2024
1 parent 78b62ff commit 1421ef9
Show file tree
Hide file tree
Showing 9 changed files with 2,546 additions and 2,844 deletions.
9 changes: 9 additions & 0 deletions packages/ui/client/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,13 @@ declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
// @ts-ignore
export type { ViewportSize } from './composables/browser'
import('./composables/browser')
// @ts-ignore
export type { ModuleType, ModuleNode, ModuleLink, ModuleGraph, ModuleGraphController, ModuleGraphConfig, ModuleLabelItem } from './composables/module-graph'
import('./composables/module-graph')
// @ts-ignore
export type { Params } from './composables/params'
import('./composables/params')
}
356 changes: 36 additions & 320 deletions packages/vitest/LICENSE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@
"cac": "^6.7.14",
"chai-subset": "^1.6.0",
"cli-truncate": "^4.0.0",
"fast-glob": "3.3.2",
"find-up": "^6.3.0",
"flatted": "^3.3.2",
"get-tsconfig": "^4.8.1",
Expand All @@ -202,6 +201,7 @@
"pretty-format": "^29.7.0",
"prompts": "^2.4.2",
"strip-literal": "^2.1.1",
"tinyglobby": "^0.2.10",
"ws": "^8.18.0"
}
}
5 changes: 3 additions & 2 deletions packages/vitest/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { fileURLToPath } from 'node:url'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import nodeResolve from '@rollup/plugin-node-resolve'
import fg from 'fast-glob'
import { dirname, join, normalize, resolve } from 'pathe'
import { defineConfig } from 'rollup'
import dts from 'rollup-plugin-dts'
import esbuild from 'rollup-plugin-esbuild'
import license from 'rollup-plugin-license'
import { globSync } from 'tinyglobby'
import c from 'tinyrainbow'

const require = createRequire(import.meta.url)
Expand Down Expand Up @@ -198,7 +198,8 @@ function licensePlugin() {
preserveSymlinks: false,
}),
)
const [licenseFile] = fg.sync(`${pkgDir}/LICENSE*`, {
const [licenseFile] = globSync([`${pkgDir}/LICENSE*`], {
expandDirectories: false,
caseSensitiveMatch: false,
})
if (licenseFile) {
Expand Down
6 changes: 3 additions & 3 deletions packages/vitest/src/node/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { rm } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import path from 'node:path'
import { deepMerge, nanoid, slash } from '@vitest/utils'
import fg from 'fast-glob'
import { glob, GlobOptions } from 'tinyglobby'
import mm from 'micromatch'
import { isAbsolute, join, relative } from 'pathe'
import { ViteNodeRunner } from 'vite-node/client'
Expand Down Expand Up @@ -413,13 +413,13 @@ export class TestProject {

/** @internal */
async globFiles(include: string[], exclude: string[], cwd: string) {
const globOptions: fg.Options = {
const globOptions: GlobOptions = {
dot: true,
cwd,
ignore: exclude,
}

const files = await fg(include, globOptions)
const files = await glob(include, globOptions)
// keep the slashes consistent with Vite
// we are not using the pathe here because it normalizes the drive letter on Windows
// and we want to keep it the same as working dir
Expand Down
Loading

0 comments on commit 1421ef9

Please sign in to comment.