refactor: TypeScript 6移行にともなうリファクタ/事前生成スクリプトをTypeScript化#102
Conversation
|
@codex[agent] review レビューは当該箇所一件一件に対してコメントを加えて |
Co-authored-by: kyonenya <62150154+kyonenya@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78f9fa793e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| (async () => { | ||
| await generatePosts(); | ||
| await generateBibliography(); | ||
| const posts = JSON.parse( | ||
| fs.readFileSync(path.resolve(__dirname, 'posts.json'), 'utf8'), | ||
| ); | ||
| generateSitemap(posts); | ||
| generateStaticHTML(); | ||
| })().catch((e) => console.error(e)); | ||
| const posts = await generatePostsJson(); | ||
| await Promise.all([ | ||
| generateWorksJson(), | ||
| generateSitemap(posts), | ||
| generateStaticHtml(posts), | ||
| ]); | ||
| })(); |
There was a problem hiding this comment.
この非同期IIFEに .catch(...) が無いため、generatePostsJson / generateSitemap / generateStaticHtml のいずれかが reject すると未処理 Promise rejection となり、Node の既定挙動(--unhandled-rejections=throw)ではプロセス終了に繋がります。listen() 後にこの処理を実行しているため、MarkdownやJSONの一時的な不整合があるだけで開発サーバー自体が落ちる回帰になります。旧実装のように起動処理全体を捕捉してログ化するハンドリングを戻すべきです。
Useful? React with 👍 / 👎.
以下、箇所ごとにコメントします([must]/[recommend]/[nits])。
学習リソース:
|
|
To use Codex here, create a Codex account and connect to github. |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex[agent] review |
レビュー観点を指定してほしいです(例:TS/ESM移行、webpack設定、scriptsのI/O、生成物の差分、Code App互換など)。どのファイル(またはPRのどの差分)にインラインコメントで入れるのが希望か、対象を教えてください。 |
|
To use Codex here, create a Codex account and connect to github. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6375994d9a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
No description provided.