Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replace fast-glob with tinyglobby #6167

Merged
merged 12 commits into from
Oct 1, 2024
4 changes: 2 additions & 2 deletions packages/cspell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@
"cspell-glob": "workspace:*",
"cspell-io": "workspace:*",
"cspell-lib": "workspace:*",
"fast-glob": "^3.3.2",
"fast-json-stable-stringify": "^2.1.0",
"file-entry-cache": "^9.1.0",
"get-stdin": "^9.0.0",
"semver": "^7.6.3",
"strip-ansi": "^7.1.0"
"strip-ansi": "^7.1.0",
"tinyglobby": "^0.2.7"
},
"engines": {
"node": ">=18"
Expand Down
8 changes: 5 additions & 3 deletions packages/cspell/src/app/util/glob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import { posix } from 'node:path';
import type { CSpellUserSettings, Glob } from '@cspell/cspell-types';
import type { GlobPatternWithRoot } from 'cspell-glob';
import { fileOrGlobToGlob, GlobMatcher } from 'cspell-glob';
import type { Options as FastGlobOptions } from 'fast-glob';
import glob from 'fast-glob';
import type { GlobOptions as TinyGlobbyOptions } from 'tinyglobby';
import { glob } from 'tinyglobby';

import { clean } from './util.js';

// cspell:ignore tinyglobby

/**
* This is a subset of IOptions from 'glob'.
*/
Expand All @@ -34,7 +36,7 @@ export async function globP(pattern: string | string[], options?: GlobOptions):
const onlyFiles = options?.nodir;
const dot = options?.dot;
const patterns = typeof pattern === 'string' ? [pattern] : pattern;
const useOptions: FastGlobOptions = clean({
const useOptions: TinyGlobbyOptions = clean({
cwd,
onlyFiles,
dot,
Expand Down
71 changes: 46 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.