From 70baaaa9f67fff6f9fac45417a58b736185fbe3b Mon Sep 17 00:00:00 2001 From: Vladimir Date: Sat, 12 Oct 2024 02:24:44 +0200 Subject: [PATCH] fix(vitest): use `fast-glob` instead of `tinyglobby` in Vitest (#6688) --- packages/vitest/LICENSE.md | 350 ++++++++++++++++-- packages/vitest/package.json | 2 +- packages/vitest/rollup.config.js | 5 +- packages/vitest/src/node/workspace.ts | 11 +- .../src/node/workspace/resolveWorkspace.ts | 10 +- pnpm-lock.yaml | 98 ++--- test/cli/test/__snapshots__/list.test.ts.snap | 40 +- 7 files changed, 404 insertions(+), 112 deletions(-) diff --git a/packages/vitest/LICENSE.md b/packages/vitest/LICENSE.md index 08ae60e2ad89..6e60241fa8d6 100644 --- a/packages/vitest/LICENSE.md +++ b/packages/vitest/LICENSE.md @@ -57,6 +57,90 @@ 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 @@ -585,18 +669,53 @@ Repository: https://github.com/mmkal/expect-type.git --------------------------------------- -## fdir +## fast-glob License: MIT -By: thecodrr -Repository: git+https://github.com/thecodrr/fdir.git +By: Denis Malinochkin +Repository: mrmlnc/fast-glob -> Copyright 2023 Abdullah Atta +> The MIT License (MIT) > -> 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 (c) Denis Malinochkin > -> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> 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 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. +> 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 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. --------------------------------------- @@ -715,6 +834,58 @@ 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 @@ -732,6 +903,35 @@ 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 @@ -882,6 +1082,34 @@ 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 @@ -1094,6 +1322,34 @@ 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 @@ -1140,6 +1396,63 @@ 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 @@ -1273,29 +1586,6 @@ Repository: git+https://github.com/antfu/strip-literal.git --------------------------------------- -## tinyglobby -License: ISC -By: Superchupu -Repository: git+https://github.com/SuperchupuDev/tinyglobby.git - -> ISC License -> -> Copyright (c) 2024 Madeline Gurriarán -> -> 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. - ---------------------------------------- - ## to-regex-range License: MIT By: Jon Schlinkert, Rouven Weßling diff --git a/packages/vitest/package.json b/packages/vitest/package.json index f645e71ea591..a81b818a97ac 100644 --- a/packages/vitest/package.json +++ b/packages/vitest/package.json @@ -190,6 +190,7 @@ "chai-subset": "^1.6.0", "cli-truncate": "^4.0.0", "expect-type": "^0.19.0", + "fast-glob": "3.3.2", "find-up": "^6.3.0", "flatted": "^3.3.1", "get-tsconfig": "^4.7.6", @@ -201,7 +202,6 @@ "pretty-format": "^29.7.0", "prompts": "^2.4.2", "strip-literal": "^2.1.0", - "tinyglobby": "^0.2.6", "ws": "^8.18.0" } } diff --git a/packages/vitest/rollup.config.js b/packages/vitest/rollup.config.js index 953a2de6c3df..43da5739deb5 100644 --- a/packages/vitest/rollup.config.js +++ b/packages/vitest/rollup.config.js @@ -8,7 +8,7 @@ import nodeResolve from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import json from '@rollup/plugin-json' import license from 'rollup-plugin-license' -import { globSync } from 'tinyglobby' +import fg from 'fast-glob' import c from 'tinyrainbow' import { defineConfig } from 'rollup' @@ -198,8 +198,7 @@ function licensePlugin() { preserveSymlinks: false, }), ) - const [licenseFile] = globSync([`${pkgDir}/LICENSE*`], { - expandDirectories: false, + const [licenseFile] = fg.sync(`${pkgDir}/LICENSE*`, { caseSensitiveMatch: false, }) if (licenseFile) { diff --git a/packages/vitest/src/node/workspace.ts b/packages/vitest/src/node/workspace.ts index 96ed2f784feb..4139ec194e29 100644 --- a/packages/vitest/src/node/workspace.ts +++ b/packages/vitest/src/node/workspace.ts @@ -17,7 +17,7 @@ import type { } from 'vite' import { ViteNodeRunner } from 'vite-node/client' import { ViteNodeServer } from 'vite-node/server' -import { glob } from 'tinyglobby' +import fg from 'fast-glob' import type { Typechecker } from '../typecheck/typechecker' import { deepMerge, nanoid } from '../utils/base' import { setup } from '../api/setup' @@ -296,13 +296,14 @@ export class WorkspaceProject { } async globFiles(include: string[], exclude: string[], cwd: string) { - return glob(include, { - absolute: true, + const globOptions: fg.Options = { dot: true, cwd, ignore: exclude, - expandDirectories: false, - }) + } + + const files = await fg(include, globOptions) + return files.map(file => resolve(cwd, file)) } async isTargetFile(id: string, source?: string): Promise { diff --git a/packages/vitest/src/node/workspace/resolveWorkspace.ts b/packages/vitest/src/node/workspace/resolveWorkspace.ts index 168966332b09..8229d0e15bb9 100644 --- a/packages/vitest/src/node/workspace/resolveWorkspace.ts +++ b/packages/vitest/src/node/workspace/resolveWorkspace.ts @@ -1,7 +1,7 @@ import { existsSync, promises as fs } from 'node:fs' import { isMainThread } from 'node:worker_threads' import { dirname, relative, resolve } from 'pathe' -import { type GlobOptions, glob } from 'tinyglobby' +import fg from 'fast-glob' import { mergeConfig } from 'vite' import type { Vitest } from '../core' import type { UserConfig, UserWorkspaceConfig, WorkspaceProjectConfiguration } from '../types/config' @@ -209,12 +209,14 @@ async function resolveWorkspaceProjectConfigs( } if (workspaceGlobMatches.length) { - const globOptions: GlobOptions = { + const globOptions: fg.Options = { absolute: true, dot: true, onlyFiles: false, cwd: vitest.config.root, - expandDirectories: false, + markDirectories: true, + // TODO: revert option when we go back to tinyglobby + // expandDirectories: false, ignore: [ '**/node_modules/**', // temporary vite config file @@ -224,7 +226,7 @@ async function resolveWorkspaceProjectConfigs( ], } - const workspacesFs = await glob(workspaceGlobMatches, globOptions) + const workspacesFs = await fg.glob(workspaceGlobMatches, globOptions) await Promise.all(workspacesFs.map(async (filepath) => { // directories are allowed with a glob like `packages/*` diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ea42f499ec2a..dd38e19f1d4f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -953,6 +953,9 @@ importers: expect-type: specifier: ^0.19.0 version: 0.19.0 + fast-glob: + specifier: 3.3.2 + version: 3.3.2 find-up: specifier: ^6.3.0 version: 6.3.0 @@ -986,9 +989,6 @@ importers: strip-literal: specifier: ^2.1.0 version: 2.1.0 - tinyglobby: - specifier: ^0.2.6 - version: 0.2.6 ws: specifier: ^8.18.0 version: 8.18.0 @@ -1257,7 +1257,7 @@ importers: version: 3.4.37(typescript@5.5.4) webdriverio: specifier: latest - version: 9.1.2 + version: 9.1.5 test/global-setup: devDependencies: @@ -1381,7 +1381,7 @@ importers: version: link:../../packages/vitest webdriverio: specifier: latest - version: 9.1.2 + version: 9.1.5 test/workspaces: devDependencies: @@ -4359,8 +4359,8 @@ packages: resolution: {integrity: sha512-RED2vcdX5Zdd6r+K+aWcjK4douxjJY4LP/8YvvavgqM0TURd5PDI0Y7IEz7+BIJOT4Uh+3atZawIN9/3yWFeag==} engines: {node: ^16.13 || >=18} - '@wdio/config@9.1.2': - resolution: {integrity: sha512-M8jDFgTxOeljv5M75em7oCu2cV16jHWH6HWj5CD3ZNzaMeHf+EkIuHNyREJjt8PCnssehzXD26TF63tGPHdksA==} + '@wdio/config@9.1.3': + resolution: {integrity: sha512-fozjb5Jl26QqQoZ2lJc8uZwzK2iKKmIfNIdNvx5JmQt78ybShiPuWWgu/EcHYDvAiZwH76K59R1Gp4lNmmEDew==} engines: {node: '>=18.20.0'} '@wdio/logger@8.28.0': @@ -4371,8 +4371,8 @@ packages: resolution: {integrity: sha512-kcHL86RmNbcQP+Gq/vQUGlArfU6IIcbbnNp32rRIraitomZow+iEoc519rdQmSVusDozMS5DZthkgDdxK+vz6Q==} engines: {node: ^16.13 || >=18} - '@wdio/logger@9.1.0': - resolution: {integrity: sha512-1Rfg9VCy87I9IrViA1ned1Rqa66JwhCzdEo8rA8T3Ro6lBfOEwDbK1XW8ETKLWcweddzGeFalfVnvUlNgPmFdA==} + '@wdio/logger@9.1.3': + resolution: {integrity: sha512-cumRMK/gE1uedBUw3WmWXOQ7HtB6DR8EyKQioUz2P0IJtRRpglMBdZV7Svr3b++WWawOuzZHMfbTkJQmaVt8Gw==} engines: {node: '>=18.20.0'} '@wdio/protocols@8.32.0': @@ -4400,8 +4400,8 @@ packages: resolution: {integrity: sha512-86lcYROTapOJuFd9ouomFDfzDnv3Kn+jE0RmqfvN9frZAeLVJ5IKjX9M6HjplsyTZhjGO1uCaehmzx+HJus33Q==} engines: {node: ^16.13 || >=18} - '@wdio/types@9.1.2': - resolution: {integrity: sha512-mROY3xSBBNujSH0Opo3Sfi1QUm3l7HbVQ8/bDmPCwHXOeYlx0q14rLyyZI3LrN5uJ0KPpuNrVgE36NFaG8+xxw==} + '@wdio/types@9.1.3': + resolution: {integrity: sha512-oQrzLQBqn/+HXSJJo01NEfeKhzwuDdic7L8PDNxv5ySKezvmLDYVboQfoSDRtpAdfAZCcxuU9L4Jw7iTf6WV3g==} engines: {node: '>=18.20.0'} '@wdio/utils@8.32.2': @@ -4412,8 +4412,8 @@ packages: resolution: {integrity: sha512-leYcCUSaAdLUCVKqRKNgMCASPOUo/VvOTKETiZ/qpdY2azCBt/KnLugtiycCzakeYg6Kp+VIjx5fkm0M7y4qhA==} engines: {node: ^16.13 || >=18} - '@wdio/utils@9.1.2': - resolution: {integrity: sha512-8APCnvJjHkG/6KwXtrPhEYR29Ph+vs1Gx2mGRnbYXNgbworfPEIZETpienHXhDEbINdqSb7EY5LkapIjP7nKbg==} + '@wdio/utils@9.1.3': + resolution: {integrity: sha512-dYeOzq9MTh8jYRZhzo/DYyn+cKrhw7h0/5hgyXkbyk/wHwF/uLjhATPmfaCr9+MARSEdiF7wwU8iRy/V0jfsLg==} engines: {node: '>=18.20.0'} '@yeger/debounce@2.0.9': @@ -6384,8 +6384,8 @@ packages: html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} - htmlfy@0.2.1: - resolution: {integrity: sha512-HoomFHQ3av1uhq+7FxJTq4Ns0clAD+tGbQNrSd0WFY3UAjjUk6G3LaWEqdgmIXYkY4pexZiyZ3ykZJhQlM0J5A==} + htmlfy@0.3.2: + resolution: {integrity: sha512-FsxzfpeDYRqn1emox9VpxMPfGjADoUmmup8D604q497R0VNxiXs4ZZTN2QzkaMA5C9aHGUoe1iQRVSm+HK9xuA==} htmlparser2@9.1.0: resolution: {integrity: sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==} @@ -9453,8 +9453,8 @@ packages: resolution: {integrity: sha512-GoRR94m3yL8tWC9Myf+xIBSdVK8fi1ilZgEZZaYT8+XIWewR02dvrC6rml+/2ZjXUQzeee0RFGDwk9IC7cyYrg==} engines: {node: ^16.13 || >=18} - webdriver@9.1.2: - resolution: {integrity: sha512-NjeYVTCSMwQrd+EDpSSB8YnSNzYeEPU2IoJhvjaXUwTEhoaIvz6x6fM4UqCbm/ph8lZ1uWux43fqIcfDzFQl5Q==} + webdriver@9.1.5: + resolution: {integrity: sha512-0W1CsGtAPVEiINkL4r/HSSkVvPwEQmQho0YMAFGiubFPPmMQGM60KgtHErpNjOJggDyN2TKvdoCGQpW1YQ4Jlg==} engines: {node: '>=18.20.0'} webdriverio@8.32.2: @@ -9475,8 +9475,8 @@ packages: devtools: optional: true - webdriverio@9.1.2: - resolution: {integrity: sha512-Yk/OmxUmse6YVBMr+iM5zH3LKiy07cJQsq19qL2Zj29+2I3b8kK8uGxx8+DhqYF/A/MVwHUFxACzQDYsdW6pjw==} + webdriverio@9.1.5: + resolution: {integrity: sha512-X2l6bT3/oxDeBlsjra985BnHFmqRnYNFB+qpGrCd/vXKPOexagsFVB3430BCE+PXQTS7TLuB6r/iuP3QR8jI0g==} engines: {node: '>=18.20.0'} peerDependencies: puppeteer-core: ^22.3.0 @@ -11704,7 +11704,7 @@ snapshots: '@puppeteer/browsers@2.3.1': dependencies: - debug: 4.3.6 + debug: 4.3.7 extract-zip: 2.0.1 progress: 2.0.3 proxy-agent: 6.4.0 @@ -13089,11 +13089,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@wdio/config@9.1.2': + '@wdio/config@9.1.3': dependencies: - '@wdio/logger': 9.1.0 - '@wdio/types': 9.1.2 - '@wdio/utils': 9.1.2 + '@wdio/logger': 9.1.3 + '@wdio/types': 9.1.3 + '@wdio/utils': 9.1.3 decamelize: 6.0.0 deepmerge-ts: 7.1.0 glob: 10.4.1 @@ -13115,7 +13115,7 @@ snapshots: loglevel-plugin-prefix: 0.8.4 strip-ansi: 7.1.0 - '@wdio/logger@9.1.0': + '@wdio/logger@9.1.3': dependencies: chalk: 5.3.0 loglevel: 1.8.1 @@ -13144,7 +13144,7 @@ snapshots: dependencies: '@types/node': 20.14.15 - '@wdio/types@9.1.2': + '@wdio/types@9.1.3': dependencies: '@types/node': 20.14.15 @@ -13184,11 +13184,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@wdio/utils@9.1.2': + '@wdio/utils@9.1.3': dependencies: '@puppeteer/browsers': 2.3.1 - '@wdio/logger': 9.1.0 - '@wdio/types': 9.1.2 + '@wdio/logger': 9.1.3 + '@wdio/types': 9.1.3 decamelize: 6.0.0 deepmerge-ts: 7.1.0 edgedriver: 5.6.1 @@ -15303,7 +15303,7 @@ snapshots: geckodriver@4.4.3: dependencies: - '@wdio/logger': 9.1.0 + '@wdio/logger': 9.1.3 '@zip.js/zip.js': 2.7.48 decamelize: 6.0.0 http-proxy-agent: 7.0.2 @@ -15360,7 +15360,7 @@ snapshots: dependencies: basic-ftp: 5.0.3 data-uri-to-buffer: 5.0.1 - debug: 4.3.6 + debug: 4.3.7 fs-extra: 8.1.0 transitivePeerDependencies: - supports-color @@ -15591,7 +15591,7 @@ snapshots: html-escaper@2.0.2: {} - htmlfy@0.2.1: {} + htmlfy@0.3.2: {} htmlparser2@9.1.0: dependencies: @@ -15701,7 +15701,7 @@ snapshots: importx@0.4.3: dependencies: bundle-require: 5.0.0(esbuild@0.23.0) - debug: 4.3.6 + debug: 4.3.7 esbuild: 0.23.0 jiti: 2.0.0-beta.2 jiti-v1: jiti@1.21.6 @@ -17022,7 +17022,7 @@ snapshots: dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 agent-base: 7.1.0 - debug: 4.3.6 + debug: 4.3.7 get-uri: 6.0.1 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.5 @@ -17305,7 +17305,7 @@ snapshots: proxy-agent@6.4.0: dependencies: agent-base: 7.1.0 - debug: 4.3.6 + debug: 4.3.7 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.5 lru-cache: 7.18.3 @@ -17962,7 +17962,7 @@ snapshots: socks-proxy-agent@8.0.2: dependencies: agent-base: 7.1.0 - debug: 4.3.6 + debug: 4.3.7 socks: 2.7.1 transitivePeerDependencies: - supports-color @@ -19088,7 +19088,7 @@ snapshots: dependencies: chalk: 4.1.2 commander: 9.5.0 - debug: 4.3.6 + debug: 4.3.7 transitivePeerDependencies: - supports-color @@ -19138,15 +19138,15 @@ snapshots: - supports-color - utf-8-validate - webdriver@9.1.2: + webdriver@9.1.5: dependencies: '@types/node': 20.14.15 '@types/ws': 8.5.12 - '@wdio/config': 9.1.2 - '@wdio/logger': 9.1.0 + '@wdio/config': 9.1.3 + '@wdio/logger': 9.1.3 '@wdio/protocols': 9.0.8 - '@wdio/types': 9.1.2 - '@wdio/utils': 9.1.2 + '@wdio/types': 9.1.3 + '@wdio/utils': 9.1.3 deepmerge-ts: 7.1.0 ws: 8.18.0 transitivePeerDependencies: @@ -19220,23 +19220,23 @@ snapshots: - supports-color - utf-8-validate - webdriverio@9.1.2: + webdriverio@9.1.5: dependencies: '@types/node': 20.14.15 '@types/sinonjs__fake-timers': 8.1.5(patch_hash=ggdsr7nrdrzokhhihsihc2hdja) - '@wdio/config': 9.1.2 - '@wdio/logger': 9.1.0 + '@wdio/config': 9.1.3 + '@wdio/logger': 9.1.3 '@wdio/protocols': 9.0.8 '@wdio/repl': 9.0.8 - '@wdio/types': 9.1.2 - '@wdio/utils': 9.1.2 + '@wdio/types': 9.1.3 + '@wdio/utils': 9.1.3 archiver: 7.0.1 aria-query: 5.3.0 cheerio: 1.0.0 css-shorthand-properties: 1.1.1 css-value: 0.0.1 grapheme-splitter: 1.0.4 - htmlfy: 0.2.1 + htmlfy: 0.3.2 import-meta-resolve: 4.0.0 is-plain-obj: 4.1.0 jszip: 3.10.1 @@ -19248,7 +19248,7 @@ snapshots: rgb2hex: 0.2.5 serialize-error: 11.0.3 urlpattern-polyfill: 10.0.0 - webdriver: 9.1.2 + webdriver: 9.1.5 transitivePeerDependencies: - bufferutil - supports-color diff --git a/test/cli/test/__snapshots__/list.test.ts.snap b/test/cli/test/__snapshots__/list.test.ts.snap index 11811ce654a3..efc6f0b467ad 100644 --- a/test/cli/test/__snapshots__/list.test.ts.snap +++ b/test/cli/test/__snapshots__/list.test.ts.snap @@ -1,7 +1,13 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`basic output shows error 1`] = ` -"Error: describe error +"Error: top level error + ❯ top-level-error.test.ts:1:7 + 1| throw new Error('top level error') + | ^ + 2| + +Error: describe error ❯ describe-error.test.ts:4:9 2| 3| describe('describe error', () => { @@ -10,12 +16,6 @@ exports[`basic output shows error 1`] = ` 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,7 +60,13 @@ math.test.ts > failing test `; exports[`json output shows error 1`] = ` -"Error: describe error +"Error: top level error + ❯ top-level-error.test.ts:1:7 + 1| throw new Error('top level error') + | ^ + 2| + +Error: describe error ❯ describe-error.test.ts:4:9 2| 3| describe('describe error', () => { @@ -69,17 +75,17 @@ exports[`json output shows error 1`] = ` 5| 6| it('wont run', () => { -Error: top level error +" +`; + +exports[`json with a file output shows error 1`] = ` +"Error: top level error ❯ top-level-error.test.ts:1:7 1| throw new Error('top level error') | ^ 2| -" -`; - -exports[`json with a file output shows error 1`] = ` -"Error: describe error +Error: describe error ❯ describe-error.test.ts:4:9 2| 3| describe('describe error', () => { @@ -88,11 +94,5 @@ exports[`json with a file output shows error 1`] = ` 5| 6| it('wont run', () => { -Error: top level error - ❯ top-level-error.test.ts:1:7 - 1| throw new Error('top level error') - | ^ - 2| - " `;