Skip to content

chore(deps): bump chokidar from 4.0.3 to 6.0.0 - #1035

Merged
unhappychoice merged 1 commit into
mainfrom
fix/chokidar-6
Oct 24, 2026
Merged

unhappychoice merged 1 commit into
mainfrom
fix/chokidar-6

Conversation

@unhappychoice

@unhappychoice unhappychoice commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

Replaces #1032, which failed type-checking because chokidar 5+ is ESM-only:

src/server/watcher.ts(1,37): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'.

Changes

  • chokidar ^4.0.3 → ^6.0.0
  • tsconfig.json: module node16 → node20, which lets the CommonJS build require() ESM-only packages (supported natively since Node 22.12)
  • src/server/watcher.ts: use the named watch export instead of the default import (require(esm) returns the module namespace, so the esModuleInterop default would not resolve)
  • package.json: add engines.node: ">=22.22", matching chokidar 6's requirement
  • Jest mock and watcher test updated to the named export
  • The lockfile also drops some stale duplicated @typescript-eslint/* entries that npm deduplicated on reinstall

Breaking change

mdts now requires Node.js 22.22 or later (chokidar 6 requirement). Users on older Node versions get an EBADENGINE warning on install and the CLI fails at startup.

Note that CI reads its Node version from package.json, so with engines set it now runs on the latest Node that satisfies >=22.22, not the runner default.

Verification

  • npm run build and npm test: 142 tests passed, including the CLI e2e tests that run the built CLI against the real chokidar 6
  • npm run lint passes
  • Manual check: the built CLI's WebSocket livereload sends reload-content when a watched file changes, and chokidar 6 fires add with mdts's ignored filter

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Compatibility
    • The project now requires Node.js 22.22 or later. Update your Node.js version before installing or running it.
  • Maintenance
    • Updated file-watching support. Existing watcher behavior remains unchanged.

chokidar 5 is ESM-only and chokidar 6 requires Node.js 22.22+.

- Switch tsconfig module to node20 so the CommonJS build can require()
  the ESM-only package
- Use the named watch export, since require(esm) does not provide the
  esModuleInterop default
- Declare engines.node >=22.22 to match chokidar's requirement

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@netlify

netlify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for mdts-unhappychoice ready!

Name Link
🔨 Latest commit 1361708
🔍 Latest deploy log https://app.netlify.com/projects/mdts-unhappychoice/deploys/6adce06f9c75992788272929
😎 Deploy Preview https://deploy-preview-1035--mdts-unhappychoice.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a452076d-d683-4100-8f08-e23dd9e7a588
Commits

Reviewing files that changed from the base of the PR and between b4e6341 and 1361708.

Files ignored due to path filters: 1
  • package-lock.json is excluded by !**/package-lock.json
Files selected for processing: 5
  • package.json
  • src/server/watcher.ts
  • test/__mocks__/chokidar.ts
  • test/unit/server/watcher.test.ts
  • tsconfig.json

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The project updates its Node.js requirement, Chokidar dependency, and TypeScript module target. The server and its tests now use Chokidar’s named watch export.

Changes: Watcher migration

Layer / File(s) Summary
Runtime and module settings
package.json, tsconfig.json
package.json requires Node.js >=22.22 and updates the Chokidar range to ^6.0.0. tsconfig.json changes the module target from node16 to node20.
Named watcher integration
src/server/watcher.ts, test/__mocks__/chokidar.ts, test/unit/server/watcher.test.ts
The server creates directory, file-pattern, and content watchers with the named watch import. The mock and tests use named exports. Watcher options and tested behavior remain unchanged.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: Minimal · up to 13617

The migration is ready to merge with no established build, startup, or CI compatibility risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the primary change: updating the chokidar dependency from version 4.0.3 to 6.0.0. The related Node.js and module configuration changes support this dependency update.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files. (2 skipped: 2 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.33%. Comparing base (b4e6341) to head (1361708).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1035   +/-   ##
=======================================
  Coverage   99.33%   99.33%           
=======================================
  Files          71       71           
  Lines        1663     1663           
  Branches      400      407    +7     
=======================================
  Hits         1652     1652           
  Misses         10       10           
  Partials        1        1           
Flag Coverage Δ
frontend 99.47% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@unhappychoice
unhappychoice merged commit 7dfb844 into main Oct 24, 2026
11 checks passed
@unhappychoice
unhappychoice deleted the fix/chokidar-6 branch October 24, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant