Skip to content

Commit 4fee1a2

Browse files
committed
Replace fast-glob with tinyglobby
1 parent 5e39b6c commit 4fee1a2

File tree

4 files changed

+37
-35
lines changed

4 files changed

+37
-35
lines changed

packages/tailwindcss-language-server/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"dset": "3.1.4",
6868
"enhanced-resolve": "^5.16.1",
6969
"esbuild": "^0.25.0",
70-
"fast-glob": "3.2.4",
7170
"find-up": "5.0.0",
7271
"jiti": "^2.3.3",
7372
"klona": "2.0.4",
@@ -85,6 +84,7 @@
8584
"stack-trace": "0.0.10",
8685
"tailwindcss": "3.4.17",
8786
"tailwindcss-v4": "npm:[email protected]",
87+
"tinyglobby": "^0.2.12",
8888
"tsconfck": "^3.1.4",
8989
"tsconfig-paths": "^4.2.0",
9090
"typescript": "5.3.3",

packages/tailwindcss-language-server/src/project-locator.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import * as os from 'node:os'
21
import * as path from 'node:path'
32
import * as fs from 'node:fs/promises'
4-
import glob from 'fast-glob'
3+
import { glob } from 'tinyglobby'
54
import picomatch from 'picomatch'
65
import type { Settings } from '@tailwindcss/language-service/src/util/state'
76
import { CONFIG_GLOB, CSS_GLOB } from './lib/constants'
@@ -276,14 +275,14 @@ export class ProjectLocator {
276275

277276
private async findConfigs(): Promise<ConfigEntry[]> {
278277
// Look for config files and CSS files
279-
let files = await glob([`**/${CONFIG_GLOB}`, `**/${CSS_GLOB}`], {
278+
let files = await glob({
279+
patterns: [`**/${CONFIG_GLOB}`, `**/${CSS_GLOB}`],
280280
cwd: this.base,
281281
ignore: this.settings.tailwindCSS.files.exclude,
282282
onlyFiles: true,
283283
absolute: true,
284-
suppressErrors: true,
284+
followSymbolicLinks: true,
285285
dot: true,
286-
concurrency: Math.max(os.cpus().length, 1),
287286
})
288287

289288
let realpaths = await Promise.all(files.map((file) => fs.realpath(file)))

packages/tailwindcss-language-server/tests/prepare.mjs

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,23 @@ import { exec } from 'node:child_process'
22
import * as path from 'node:path'
33
import { fileURLToPath } from 'node:url'
44
import { promisify } from 'node:util'
5-
import glob from 'fast-glob'
5+
import { glob } from 'tinyglobby'
66

77
const __dirname = path.dirname(fileURLToPath(import.meta.url))
88

9-
const fixtures = glob.sync(['tests/fixtures/*/package.json', 'tests/fixtures/v4/*/package.json'], {
10-
cwd: path.resolve(__dirname, '..'),
9+
const root = path.resolve(__dirname, '..')
10+
11+
const fixtures = await glob({
12+
cwd: root,
13+
patterns: ['tests/fixtures/*/package.json', 'tests/fixtures/v4/*/package.json'],
14+
absolute: true,
1115
})
1216

1317
const execAsync = promisify(exec)
1418

1519
await Promise.all(
1620
fixtures.map(async (fixture) => {
17-
console.log(`Installing dependencies for ${fixture}`)
21+
console.log(`Installing dependencies for ${path.relative(root, fixture)}`)
1822

1923
await execAsync('npm install', { cwd: path.dirname(fixture) })
2024
}),

pnpm-lock.yaml

+24-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)