Skip to content

Conversation

@cm-dyoshikawa
Copy link
Contributor

@cm-dyoshikawa cm-dyoshikawa commented Oct 27, 2025

Chokidarのbreaking changesを見逃していました 🙏

https://github.com/paulmillr/chokidar

Sep 2024 update: v4 is out! It decreases dependency count from 13 to 1, removes support for globs, adds support for ESM / Common.js modules, and bumps minimum node.js version from v8 to v14. Check out upgrading.

📑 Summary

仕様の変更

  • なし

コードの変更

  • chokidar.watch() に渡すパスをglobパターンから個別のディレクトリパス配列に変更
  • startLocalChangesWatcher 関数の非同期処理を削除(async/await を削除)
  • watchPathGlob パラメータを watchPaths 配列に変更

その他・備考

  • chokidarのglobパターン {articles,books}/**/* が正しく展開されず、ファイル変更を検知できない問題を修正
  • 個別のディレクトリパス(articles/, books/)を配列で渡すことで、正常にホットリロードが動作するようになります

Resolves #584

📋 Tasks

プルリクエストを作成いただく際、お手数ですが以下の内容についてご確認をお願いします。

  • 📖 Contribution Guide を読んだ
  • 👩‍💻 canary ブランチに対するプルリクエストである
  • zenn-cli で実行して正しく動作しているか確認する
  • 不要なコードが含まれていないか( コメントやログの消し忘れに注意 )
  • XSS になるようなコードが含まれていないか
  • モバイル端末での表示が考慮されているか
  • Pull Request の内容は妥当か( 膨らみすぎてないか )

より詳しい内容は Pull Request Policy を参照してください。

- chokidar.watch()のglobパターンを個別のディレクトリパスに変更
- startLocalChangesWatcher関数を非同期から同期に変更
- watchPathGlobパラメータをwatchPathsに変更し、配列で受け取るように修正

Resolves #584

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@cm-dyoshikawa cm-dyoshikawa added the bug 不具合の修正 label Oct 27, 2025
@cm-dyoshikawa cm-dyoshikawa self-assigned this Oct 27, 2025
cm-dyoshikawa and others added 2 commits October 27, 2025 02:27
- モック関数をmockResolvedValueからmockReturnValueに変更(非同期→同期)
- 期待値をglobパターンから配列形式に変更

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@cm-dyoshikawa cm-dyoshikawa marked this pull request as ready for review October 28, 2025 00:58
expect(server.startLocalChangesWatcher).toHaveBeenCalledWith(
mockReturnServer,
`${process.cwd()}/{articles,books}/**/*`
[`${process.cwd()}/articles`, `${process.cwd()}/books`]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

とくにBooksですが、直下だけでなく再帰的に監視してくれるかわかりますか?Booksは chpater > chapter.md の構造であるため気になりました。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確認しました。 chapter.md の変更も検知してくれるので問題ありません!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ご確認ありがとうございます!

Copy link
Member

@cm-wada-yusuke cm-wada-yusuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMです!

@cm-dyoshikawa cm-dyoshikawa merged commit 05d55b4 into canary Oct 28, 2025
3 checks passed
@cm-dyoshikawa cm-dyoshikawa deleted the fix-hotreload branch October 28, 2025 04:12
@cm-dyoshikawa cm-dyoshikawa mentioned this pull request Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 不具合の修正

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zenn-cli v0.2.6以降でホットリロードが機能しない

3 participants