sveltejs/language-tools

Drop `fast-glob` dependency from `svelte-check`

benmccann opened this issue · 2 comments

Description

Removing it would remove 18 dependencies: https://npmgraph.js.org/?q=fast-glob

It would still be pulled in via chokidar in the short-term, but chokidar 4 will remove it.

svelte-check pulling in fast-glob is responsible for 16% of the dependencies in a new SvelteKit project

Proposed solution

The usage looks pretty simple and I don't think we need a library to help

Alternatives

Use tiny-glob, which SvelteKit already uses. That won't add dependencies since the user is already downloading tiny-glob. Or maybe switch to fdir

Additional Information, eg. Screenshots

No response

It actually should be a devDependencies because it's bundled by rollup. But It can also be removed as part of #2364 since fast-glob doesn't handle it.

Found one problem. Although we didn't mention the --ignore option can be a glob in the doc. But because it is directly passed to fast-glob, it can be.

ignore: ['node_modules/**'].concat(filePathsToIgnore.map((ignore) => `${ignore}/**`))

Not sure if we consider this as a breaking change. tiny-glob also doesn't have options for ignore so we can't replace it with it. Or we can replace it with typescript's ts.sys.readDirectory. it only supports limited glob patterns but I doubt anyone would use complex glob patterns here.