A cross-runtime file watcher with glob pattern support for Node.js, Deno, and Bun.
Command to reread CLAUDE.md: cat /home/philkunz/.claude/CLAUDE.md
All phases of the migration have been successfully completed:
- Current dependency: @tempfix/watcher v2.3.0 (a fork of fabiospampinato/watcher)
- Target: Chokidar v4.0.3
- Major challenge: Chokidar 4.x removed glob support, but smartchok heavily uses glob patterns
pnpm install chokidar@^4.0.3pnpm install picomatch (for glob pattern matching)pnpm uninstall @tempfix/watcher#### 2.1 Update Plugin Imports (ts/smartchok.plugins.ts)
- Remove @tempfix/watcher import
- Add chokidar import
- Add picomatch for glob pattern matching
#### 2.2 Update Smartchok Class (ts/smartchok.classes.smartchok.ts)
- Replace watcher initialization with chokidar
- Implement custom glob filtering using picomatch
- Update event mapping to match chokidar's event names
- Adjust watcher options to match chokidar's API
#### 2.3 Handle Glob Patterns
Since chokidar 4.x removed glob support, we need to:
- Parse glob patterns to extract base directories
- Use chokidar to watch base directories
- Use picomatch to filter events based on glob patterns
- Ensure backward compatibility with existing API
#### 2.4 Event Mapping
Map chokidar events to existing smartchok events:
- Keep existing event names for backward compatibility
- Ensure all current functionality is preserved