diff --git a/packages/ui/client/auto-imports.d.ts b/packages/ui/client/auto-imports.d.ts index e5a11a01d5a7..033546ed30f2 100644 --- a/packages/ui/client/auto-imports.d.ts +++ b/packages/ui/client/auto-imports.d.ts @@ -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') } diff --git a/packages/vitest/LICENSE.md b/packages/vitest/LICENSE.md index 375bf139ecfe..3d484daa9062 100644 --- a/packages/vitest/LICENSE.md +++ b/packages/vitest/LICENSE.md @@ -57,90 +57,6 @@ Repository: git+https://github.com/antfu/install-pkg.git --------------------------------------- -## @nodelib/fs.scandir -License: MIT -Repository: https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir - -> The MIT License (MIT) -> -> Copyright (c) Denis Malinochkin -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all -> copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -> SOFTWARE. - ---------------------------------------- - -## @nodelib/fs.stat -License: MIT -Repository: https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat - -> The MIT License (MIT) -> -> Copyright (c) Denis Malinochkin -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all -> copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -> SOFTWARE. - ---------------------------------------- - -## @nodelib/fs.walk -License: MIT -Repository: https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk - -> The MIT License (MIT) -> -> Copyright (c) Denis Malinochkin -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all -> copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -> SOFTWARE. - ---------------------------------------- - ## @sinonjs/commons License: BSD-3-Clause Repository: git+https://github.com/sinonjs/commons.git @@ -461,53 +377,18 @@ Repository: https://github.com/mathiasbynens/emoji-regex.git --------------------------------------- -## fast-glob +## fdir License: MIT -By: Denis Malinochkin -Repository: mrmlnc/fast-glob +By: thecodrr +Repository: git+https://github.com/thecodrr/fdir.git -> The MIT License (MIT) -> -> Copyright (c) Denis Malinochkin -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: +> Copyright 2023 Abdullah Atta > -> The above copyright notice and this permission notice shall be included in all -> copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -> SOFTWARE. - ---------------------------------------- - -## fastq -License: ISC -By: Matteo Collina -Repository: git+https://github.com/mcollina/fastq.git - -> Copyright (c) 2015-2020, Matteo Collina +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > -> Permission to use, copy, modify, and/or distribute this software for any -> purpose with or without fee is hereby granted, provided that the above -> copyright notice and this permission notice appear in all copies. +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > -> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------- @@ -626,58 +507,6 @@ Repository: privatenumber/get-tsconfig --------------------------------------- -## glob-parent -License: ISC -By: Gulp Team, Elan Shanker, Blaine Bublitz -Repository: gulpjs/glob-parent - -> The ISC License -> -> Copyright (c) 2015, 2019 Elan Shanker -> -> Permission to use, copy, modify, and/or distribute this software for any -> purpose with or without fee is hereby granted, provided that the above -> copyright notice and this permission notice appear in all copies. -> -> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ---------------------------------------- - -## is-extglob -License: MIT -By: Jon Schlinkert -Repository: jonschlinkert/is-extglob - -> The MIT License (MIT) -> -> Copyright (c) 2014-2016, Jon Schlinkert -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - ## is-fullwidth-code-point License: MIT By: Sindre Sorhus @@ -695,35 +524,6 @@ Repository: sindresorhus/is-fullwidth-code-point --------------------------------------- -## is-glob -License: MIT -By: Jon Schlinkert, Brian Woodward, Daniel Perez -Repository: micromatch/is-glob - -> The MIT License (MIT) -> -> Copyright (c) 2014-2017, Jon Schlinkert. -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - ## is-number License: MIT By: Jon Schlinkert, Olsten Larck, Rouven Weßling @@ -874,34 +674,6 @@ Repository: sindresorhus/log-update --------------------------------------- -## merge2 -License: MIT -Repository: git@github.com:teambition/merge2.git - -> The MIT License (MIT) -> -> Copyright (c) 2014-2020 Teambition -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all -> copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -> SOFTWARE. - ---------------------------------------- - ## micromatch License: MIT By: Jon Schlinkert, Amila Welihinda, Bogdan Chadkin, Brian Woodward, Devon Govett, Elan Shanker, Fabrício Matté, Martin Kolárik, Olsten Larck, Paul Miller, Tom Byrer, Tyler Akins, Peter Bright, Kuba Juszczyk @@ -1114,34 +886,6 @@ Repository: terkelg/prompts --------------------------------------- -## queue-microtask -License: MIT -By: Feross Aboukhadijeh -Repository: git://github.com/feross/queue-microtask.git - -> The MIT License (MIT) -> -> Copyright (c) Feross Aboukhadijeh -> -> Permission is hereby granted, free of charge, to any person obtaining a copy of -> this software and associated documentation files (the "Software"), to deal in -> the Software without restriction, including without limitation the rights to -> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -> the Software, and to permit persons to whom the Software is furnished to do so, -> subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all -> copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---------------------------------------- - ## resolve-pkg-maps License: MIT By: Hiroki Osame @@ -1188,63 +932,6 @@ Repository: sindresorhus/restore-cursor --------------------------------------- -## reusify -License: MIT -By: Matteo Collina -Repository: git+https://github.com/mcollina/reusify.git - -> The MIT License (MIT) -> -> Copyright (c) 2015 Matteo Collina -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all -> copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -> SOFTWARE. - ---------------------------------------- - -## run-parallel -License: MIT -By: Feross Aboukhadijeh -Repository: git://github.com/feross/run-parallel.git - -> The MIT License (MIT) -> -> Copyright (c) Feross Aboukhadijeh -> -> Permission is hereby granted, free of charge, to any person obtaining a copy of -> this software and associated documentation files (the "Software"), to deal in -> the Software without restriction, including without limitation the rights to -> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -> the Software, and to permit persons to whom the Software is furnished to do so, -> subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all -> copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---------------------------------------- - ## signal-exit License: ISC By: Ben Coe @@ -1378,6 +1065,35 @@ Repository: git+https://github.com/antfu/strip-literal.git --------------------------------------- +## tinyglobby +License: MIT +By: Superchupu +Repository: git+https://github.com/SuperchupuDev/tinyglobby.git + +> MIT License +> +> Copyright (c) 2024 Madeline Gurriarán +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + ## to-regex-range License: MIT By: Jon Schlinkert, Rouven Weßling diff --git a/packages/vitest/package.json b/packages/vitest/package.json index 67739ab72cfd..f644c15fdce1 100644 --- a/packages/vitest/package.json +++ b/packages/vitest/package.json @@ -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", @@ -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" } } diff --git a/packages/vitest/rollup.config.js b/packages/vitest/rollup.config.js index 5218a10769e0..d96378fe7e55 100644 --- a/packages/vitest/rollup.config.js +++ b/packages/vitest/rollup.config.js @@ -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) @@ -198,7 +198,7 @@ function licensePlugin() { preserveSymlinks: false, }), ) - const [licenseFile] = fg.sync(`${pkgDir}/LICENSE*`, { + const [licenseFile] = globSync(`${pkgDir}/LICENSE*`, { caseSensitiveMatch: false, }) if (licenseFile) { diff --git a/packages/vitest/src/node/project.ts b/packages/vitest/src/node/project.ts index 1e156da24c5c..a4255284f3dc 100644 --- a/packages/vitest/src/node/project.ts +++ b/packages/vitest/src/node/project.ts @@ -21,9 +21,9 @@ 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 mm from 'micromatch' import { isAbsolute, join, relative } from 'pathe' +import { glob, type GlobOptions } from 'tinyglobby' import { ViteNodeRunner } from 'vite-node/client' import { ViteNodeServer } from 'vite-node/server' import { setup } from '../api/setup' @@ -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 diff --git a/packages/vitest/src/node/workspace/fast-glob-pattern.ts b/packages/vitest/src/node/workspace/fast-glob-pattern.ts deleted file mode 100644 index bf84f736a34c..000000000000 --- a/packages/vitest/src/node/workspace/fast-glob-pattern.ts +++ /dev/null @@ -1,77 +0,0 @@ -type Pattern = string -type PatternTypeOptions = any - -// copy of fast-glob's isDynamicPattern until it's implemented on tinyglobby -// https://github.com/SuperchupuDev/tinyglobby/issues/28 -// https://github.com/mrmlnc/fast-glob/blob/da648078ae87bce81fcd42e64d5b2b1360c47b09/src/utils/pattern.ts#L35 - -/* -MIT License - -Copyright (c) Denis Malinochkin - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -const ESCAPE_SYMBOL = '\\' - -const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/ -const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*\]/ -const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/ -const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/ -const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./ - -export function isDynamicPattern(pattern: Pattern, options: PatternTypeOptions = {}): boolean { - /** - * A special case with an empty string is necessary for matching patterns that start with a forward slash. - * An empty string cannot be a dynamic pattern. - * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'. - */ - if (pattern === '') { - return false - } - - /** - * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check - * filepath directly (without read directory). - */ - if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { - return true - } - - if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { - return true - } - - if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { - return true - } - - if (options.braceExpansion !== false && hasBraceExpansion(pattern)) { - return true - } - - return false -} - -function hasBraceExpansion(pattern: string): boolean { - const openingBraceIndex = pattern.indexOf('{') - - if (openingBraceIndex === -1) { - return false - } - - const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1) - - if (closingBraceIndex === -1) { - return false - } - - const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex) - - return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent) -} diff --git a/packages/vitest/src/node/workspace/resolveWorkspace.ts b/packages/vitest/src/node/workspace/resolveWorkspace.ts index 84451100456f..e3180fc35bb0 100644 --- a/packages/vitest/src/node/workspace/resolveWorkspace.ts +++ b/packages/vitest/src/node/workspace/resolveWorkspace.ts @@ -4,15 +4,14 @@ import { existsSync, promises as fs } from 'node:fs' import os from 'node:os' import { limitConcurrency } from '@vitest/runner/utils' import { deepClone, toArray } from '@vitest/utils' -import fg from 'fast-glob' import { dirname, relative, resolve } from 'pathe' +import { glob, type GlobOptions, isDynamicPattern } from 'tinyglobby' import { mergeConfig } from 'vite' import { configFiles as defaultConfigFiles } from '../../constants' import { wildcardPatternToRegExp } from '../../utils/base' import { isTTY } from '../../utils/env' import { initializeProject, TestProject } from '../project' import { withLabel } from '../reporters/renderers/utils' -import { isDynamicPattern } from './fast-glob-pattern' export async function resolveWorkspace( vitest: Vitest, @@ -357,14 +356,12 @@ async function resolveTestProjectConfigs( } if (workspaceGlobMatches.length) { - const globOptions: fg.Options = { + const globOptions: GlobOptions = { absolute: true, dot: true, onlyFiles: false, cwd: vitest.config.root, - markDirectories: true, - // TODO: revert option when we go back to tinyglobby - // expandDirectories: false, + expandDirectories: false, ignore: [ '**/node_modules/**', // temporary vite config file @@ -374,7 +371,7 @@ async function resolveTestProjectConfigs( ], } - const workspacesFs = await fg.glob(workspaceGlobMatches, globOptions) + const workspacesFs = await glob(workspaceGlobMatches, globOptions) await Promise.all(workspacesFs.map(async (path) => { // directories are allowed with a glob like `packages/*` diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c7f066c8088d..7e5a2620d50d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -968,9 +968,6 @@ importers: cli-truncate: specifier: ^4.0.0 version: 4.0.0 - fast-glob: - specifier: 3.3.2 - version: 3.3.2 find-up: specifier: ^6.3.0 version: 6.3.0 @@ -1004,6 +1001,9 @@ importers: strip-literal: specifier: ^2.1.1 version: 2.1.1 + tinyglobby: + specifier: ^0.2.10 + version: 0.2.10 ws: specifier: ^8.18.0 version: 8.18.0 diff --git a/test/cli/test/__snapshots__/list.test.ts.snap b/test/cli/test/__snapshots__/list.test.ts.snap index 2dc10a05972d..44ddb5f3b14e 100644 --- a/test/cli/test/__snapshots__/list.test.ts.snap +++ b/test/cli/test/__snapshots__/list.test.ts.snap @@ -1,13 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`basic output shows error 1`] = ` -"Error: top level error - ❯ top-level-error.test.ts:1:7 - 1| throw new Error('top level error') - | ^ - 2| - -Error: describe error +"Error: describe error ❯ describe-error.test.ts:4:9 2| 3| describe('describe error', () => { @@ -16,6 +10,12 @@ Error: describe error 5| 6| it('wont run', () => { +Error: top level error + ❯ top-level-error.test.ts:1:7 + 1| throw new Error('top level error') + | ^ + 2| + " `; @@ -60,13 +60,7 @@ math.test.ts > failing test `; exports[`json output shows error 1`] = ` -"Error: top level error - ❯ top-level-error.test.ts:1:7 - 1| throw new Error('top level error') - | ^ - 2| - -Error: describe error +"Error: describe error ❯ describe-error.test.ts:4:9 2| 3| describe('describe error', () => { @@ -75,17 +69,17 @@ Error: describe error 5| 6| it('wont run', () => { -" -`; - -exports[`json with a file output shows error 1`] = ` -"Error: top level error +Error: top level error ❯ top-level-error.test.ts:1:7 1| throw new Error('top level error') | ^ 2| -Error: describe error +" +`; + +exports[`json with a file output shows error 1`] = ` +"Error: describe error ❯ describe-error.test.ts:4:9 2| 3| describe('describe error', () => { @@ -94,5 +88,11 @@ Error: describe error 5| 6| it('wont run', () => { +Error: top level error + ❯ top-level-error.test.ts:1:7 + 1| throw new Error('top level error') + | ^ + 2| + " `;