Vigia

将 chokidar 从 5.x 升级到 6.x

根据 TypeScript 类型自动比较 chokidar 5.0.0 与 6.0.0 的公开 API。签名变化表示可能存在不兼容变更,并非确定结论。

概要

已删除的导入路径0
已删除的导出1
已修改的签名7
已删除的类或接口成员33
已修改的类或接口成员4
新增弃用0
要求变化(engines、peer 依赖)1
新增导出4

已删除的导出

importexportkind之前
chokidarWatchHelperclassclass

已修改的签名

export之前之后
chokidar · watch(paths: string | string[], options?: Partial<BasicOpts & { ignored: Matcher | Matcher[]; awaitWriteFinish: boolean | Partial<AWF>; }> | undefined): FSWatcher(paths: string | string[], options?: Partial<BasicOptions & { ignored: Matcher | Matcher[]; awaitWriteFinish: boolean | Partial<AWF>; }> | undefined): FSWatcher
chokidar · default{ watch: (paths: string | string[], options?: Partial<BasicOpts & { ignored: Matcher | Matcher[]; awaitWriteFinish: boolean | Partial<AWF>; }> | undefined) => FSWatcher; FSWatcher: typeof FSWatcher; }{ watch: (paths: string | string[], options?: Partial<BasicOptions & { ignored: Matcher | Matcher[]; awaitWriteFinish: boolean | Partial<AWF>; }> | undefined) => FSWatcher; FSWatcher: typeof FSWatcher; }
chokidar · Throttler{ timeoutObject: NodeJS.Timeout; clear: () => void; count: number; }{ timeoutObject: SchedulerTimer; clear: (invokeRelease?: boolean | undefined) => number; count: number; }
chokidar · ThrottleType"readdir" | "watch" | "add" | "remove" | "change""add" | "change" | "readdir" | "watch" | "remove"
chokidar · MatcherObjectinterface{ path: string; recursive?: boolean | undefined; }
chokidar · ChokidarOptions{ persistent?: boolean | undefined; ignoreInitial?: boolean | undefined; followSymlinks?: boolean | undefined; cwd?: string | undefined; usePolling?: boolean | undefined; interval?: number | undefined; binaryInterval?: number | undefined; alwaysStat?: boolean | undefined; depth?: number | undefined; ignorePermissionErrors?: boolean | undefined; atomic?: number | boolean | undefined; ignored?: Matcher | Matcher[] | undefined; awaitWriteFinish?: boolean | Partial<AWF> | undefined; }{ persistent?: boolean | undefined; ignoreInitial?: boolean | undefined; followSymlinks?: boolean | undefined; cwd?: string | undefined; backend?: WatchBackend | undefined; usePolling?: boolean | undefined; pollingInterval?: number | undefined; pollingBinaryInterval?: number | undefined; interval?: number | undefined; binaryInterval?: number | undefined; alwaysStat?: boolean | undefined; depth?: number | undefined; ignorePermissionErrors?: boolean | undefined; atomic?: number | boolean | undefined; ignored?: Matcher | Matcher[] | undefined; awaitWriteFinish?: boolean | Partial<AWF> | undefined…
chokidar · FSWInstanceOptionsBasicOpts & { ignored: Matcher[]; awaitWriteFinish: false | AWF; }BasicOptions & { ignored: readonly Matcher[]; awaitWriteFinish: false | AWF; backendStrategy: BackendStrategy; backendCapabilities: Readonly<{ kind: BackendStrategy; polling: boolean; recursive: boolean; perDirectory: boolean; }>; }

已删除的类或接口成员

memberimport之前
FSWatcher._emitchokidar(event: EventName, path: string, stats?: any): Promise<FSWatcher | undefined>
FSWatcher._removechokidar(directory: string, item: string, isDirectory?: boolean | undefined): void
FSWatcher._closerschokidarMap<string, any[]>
FSWatcher._emitRawchokidar(ev: WatchEventType, path: string, opts: unknown): void
FSWatcher._streamschokidarSet<ReaddirpStream>
FSWatcher._watchedchokidarMap<string, DirEntry>
FSWatcher._readdirpchokidar(root: string, opts?: any): any
FSWatcher._throttlechokidar(actionType: ThrottleType, path: string, timeout: number): false | Throttler
FSWatcher._closeFilechokidar(path: string): void
FSWatcher._closePathchokidar(path: string): void
FSWatcher._emitReadychokidar(): void
FSWatcher._isIgnoredchokidar(path: string, stats?: any): boolean
FSWatcher._throttledchokidarMap<ThrottleType, Map<any, any>>
FSWatcher._readyCountchokidarnumber
FSWatcher._boundRemovechokidar(dir: string, item: string): void
FSWatcher._handleErrorchokidar(error: Error): boolean | Error
FSWatcher._isntIgnoredchokidar(path: string, stat?: any): boolean
FSWatcher._userIgnoredchokidarMatchFunction | undefined
FSWatcher._closePromisechokidarPromise<void> | undefined
FSWatcher._ignoredPathschokidarSet<Matcher>
FSWatcher._readyEmittedchokidarboolean
FSWatcher._symlinkPathschokidarMap<string, string | boolean>
FSWatcher._addPathCloserchokidar(path: string, closer: () => void): void
FSWatcher._getWatchedDirchokidar(directory: string): DirEntry
FSWatcher._nodeFsHandlerchokidarNodeFsHandler
FSWatcher._pendingWriteschokidarMap<string, any>
FSWatcher._addIgnoredPathchokidar(matcher: Matcher): void
FSWatcher._incrReadyCountchokidar(): number
FSWatcher._pendingUnlinkschokidarMap<string, [event: EventName, path: string, stats?: any]>
FSWatcher._getWatchHelperschokidar(path: string): WatchHelper
FSWatcher._awaitWriteFinishchokidar(path: string, threshold: number, event: EventName, awfEmit: (err?: Error | undefined, stat?: any) => void): void
FSWatcher._removeIgnoredPathchokidar(matcher: Matcher): void
FSWatcher._hasReadPermissionschokidar(stats: Stats): boolean

已修改的类或接口成员

member之前之后
FSWatcher.add(paths_: string | string[], _origAdd?: string | undefined, _internal?: boolean | undefined): FSWatcher(paths_: string | string[]): FSWatcher
FSWatcher.constructor(_opts?: Partial<BasicOpts & { ignored: Matcher | Matcher[]; awaitWriteFinish: boolean | Partial<AWF>; }> | undefined): FSWatcher(_opts?: Partial<BasicOptions & { ignored: Matcher | Matcher[]; awaitWriteFinish: boolean | Partial<AWF>; }> | undefined, scheduler?: Scheduler | undefined): FSWatcher
FSWatcher.emitWithAll(event: EventName, args: EmitArgs): voidany
FSWatcherEventMap.raw[ev: WatchEventType, path: string, opts: unknown][ev: WatchEventType, path: string | null, opts: unknown]

新增弃用

未发现。

要求变化(engines、peer 依赖)

之前之后
engines.node>= 20.19.0—
新增导出 (4)
importexportkind
chokidarSchedulerinterface
chokidarWatchBackendtype
chokidarSchedulerTimerinterface
chokidarBackendStrategytype

把这些数据交给你的 AI 智能体

Vigia 是免费的 MCP 服务器:你的编程智能体在写代码之前就能检查版本、不兼容变更和安全漏洞。无需注册,无需 API 密钥。

claude mcp add --transport http vigia https://vigia.coredls.cloud/mcp

添加到 Cursor添加到 VS Code★ 在 GitHub 上加星

任何其他 MCP 客户端
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }

智能体技能(SKILL.md):告诉智能体何时使用 Vigia · 用于拉取请求的 GitHub Action

常见问题

将 chokidar 从 5 升级到 6 有哪些不兼容变更?

在 chokidar 5.0.0 与 6.0.0 之间,Vigia 发现 1 个已删除的导出、7 个已修改的签名,以及 37 个已删除或修改的类或接口成员。

chokidar 6 中弃用了哪些内容?

chokidar 6.0.0 中有 0 个导出或成员新被标记为弃用。

供智能体使用

GET https://vigia.coredls.cloud/v1/packages/npm/chokidar/upgrade?from=5.0.0&to=6.0.0