diff --git a/package.json b/package.json index d4987be0d..40c8fde70 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "dependencies": { "bundle-require": "^5.0.0", "cac": "^6.7.14", - "chokidar": "^3.6.0", + "chokidar": "^4.0.1", "consola": "^3.2.3", "debug": "^4.3.7", "esbuild": "^0.24.0", @@ -66,7 +66,7 @@ "source-map": "0.8.0-beta.0", "sucrase": "^3.35.0", "tinyexec": "^0.3.0", - "tinyglobby": "^0.2.6", + "tinyglobby": "^0.2.7", "tree-kill": "^1.2.2" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f7f6480c8..f211784fe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^6.7.14 version: 6.7.14 chokidar: - specifier: ^3.6.0 - version: 3.6.0 + specifier: ^4.0.1 + version: 4.0.1 consola: specifier: ^3.2.3 version: 3.2.3 @@ -51,8 +51,8 @@ importers: specifier: ^0.3.0 version: 0.3.0 tinyglobby: - specifier: ^0.2.6 - version: 0.2.6 + specifier: ^0.2.7 + version: 0.2.7 tree-kill: specifier: ^1.2.2 version: 1.2.2 @@ -1132,8 +1132,8 @@ packages: fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - fdir@6.3.0: - resolution: {integrity: sha512-QOnuT+BOtivR77wYvCWHfGt9s4Pz1VIMbD463vegT5MLqNXy8rYFT/lPVEqf/bhYeT6qmqrNHhsX+rWwe3rOCQ==} + fdir@6.4.0: + resolution: {integrity: sha512-3oB133prH1o4j/L5lLW7uOCF1PlD+/It2L0eL/iAqWMB91RBbqTewABqxhj0ibBd90EEmWZq7ntIWzVaWcXTGQ==} peerDependencies: picomatch: ^3 || ^4 peerDependenciesMeta: @@ -1776,8 +1776,8 @@ packages: tinyexec@0.3.0: resolution: {integrity: sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==} - tinyglobby@0.2.6: - resolution: {integrity: sha512-NbBoFBpqfcgd1tCiO8Lkfdk+xrA7mlLR9zgvZcZWQQwU63XAfUePyd6wZBaU93Hqw347lHnwFzttAkemHzzz4g==} + tinyglobby@0.2.7: + resolution: {integrity: sha512-qFWYeNxBQxrOTRHvGjlRdBamy8JFqu6c0bwRru9leE+q8J72tLtlT0L3v+2T7fbLXN7FGzDNBhXkWiJqHUHD9g==} engines: {node: '>=12.0.0'} tinypool@1.0.1: @@ -2823,7 +2823,7 @@ snapshots: dependencies: reusify: 1.0.4 - fdir@6.3.0(picomatch@4.0.2): + fdir@6.4.0(picomatch@4.0.2): optionalDependencies: picomatch: 4.0.2 @@ -3382,9 +3382,9 @@ snapshots: tinyexec@0.3.0: {} - tinyglobby@0.2.6: + tinyglobby@0.2.7: dependencies: - fdir: 6.3.0(picomatch@4.0.2) + fdir: 6.4.0(picomatch@4.0.2) picomatch: 4.0.2 tinypool@1.0.1: {} @@ -3425,7 +3425,7 @@ snapshots: rollup: 4.22.4 source-map: 0.8.0-beta.0 sucrase: 3.35.0 - tinyglobby: 0.2.6 + tinyglobby: 0.2.7 tree-kill: 1.2.2 optionalDependencies: '@microsoft/api-extractor': 7.47.9(@types/node@22.6.1) diff --git a/src/index.ts b/src/index.ts index 425832b57..c63967957 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,7 @@ import fs from 'node:fs' import { Worker } from 'node:worker_threads' import { loadTsConfig } from 'bundle-require' import { exec, type Result as ExecChild } from 'tinyexec' -import { glob } from 'tinyglobby' +import { glob, globSync } from 'tinyglobby' import kill from 'tree-kill' import { version } from '../package.json' import { PrettyError, handleError } from './errors' @@ -400,9 +400,7 @@ export async function build(_options: Options) { typeof options.watch === 'boolean' ? '.' : Array.isArray(options.watch) - ? options.watch.filter( - (path): path is string => typeof path === 'string', - ) + ? options.watch.filter((path) => typeof path === 'string') : options.watch logger.info( @@ -420,10 +418,10 @@ export async function build(_options: Options) { .join(' | ')}`, ) - const watcher = watch(watchPaths, { + const watcher = watch(await glob(watchPaths), { ignoreInitial: true, ignorePermissionErrors: true, - ignored, + ignored: (p) => globSync(p, { ignore: ignored }).length === 0, }) watcher.on('all', async (type, file) => { file = slash(file)