Skip to content

Conversation

@chvmvd
Copy link
Contributor

@chvmvd chvmvd commented Nov 29, 2025

TypeScriptのセットアップを行いました。 #897src/components/SlideShow/index.tsx/docs/3-web-servers/05-server/request-response-slide-show/index.tsx でTypeScriptを使用している実態があり、この実態に合わせる形でTypeScriptを導入しました。 一度導入に反対があったため #865 ではPull requestがcloseされましたが、現在では実態に合わせるために導入するのは問題ないだろうとの結論に達しました。

TypeScriptの導入にあたっては、次を参考にしています。

@chvmvd chvmvd changed the title DocusaurusをTypeScriptに対応 TypeScriptを追加 Nov 29, 2025
@chvmvd chvmvd changed the title TypeScriptを追加 TypeScriptをセットアップ Nov 29, 2025
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 29, 2025

Deploying utcode-learn with  Cloudflare Pages  Cloudflare Pages

Latest commit: 388c35c
Status: ✅  Deploy successful!
Preview URL: https://9b17a86e.utcode-learn.pages.dev
Branch Preview URL: https://add-typescript-support.utcode-learn.pages.dev

View logs

@chvmvd chvmvd force-pushed the add-typescript-support branch from 82d6166 to 2ac1f9c Compare November 29, 2025 05:20
Copy link
Contributor Author

Choose a reason for hiding this comment

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

初期からこのファイルは存在していましたが、Babelの設定をカスタマイズする際に作成するものであるという説明がドキュメントにあり、Babelの設定はカスタマイズしていないためこのファイルは不要ではないかという理由から削除しました。 cf. https://docusaurus.io/docs/configuration#customizing-babel-configuration
テンプレートにもbabel.config.jsは存在しません。 cf. https://github.com/facebook/docusaurus/tree/c6c0f636a86dfb255ff3b114a29cd86eb165424f/packages/create-docusaurus/templates

},
"dependencies": {
"@docusaurus/core": "^3.9.1",
"@docusaurus/plugin-content-docs": "^3.9.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sidebars.tsでインポートしているため入れました。

@chvmvd chvmvd marked this pull request as ready for review November 29, 2025 05:34
@chvmvd chvmvd requested a review from Copilot November 29, 2025 05:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR sets up TypeScript support for the Docusaurus project to align with existing TypeScript usage in components (e.g., src/components/SlideShow/index.tsx). The setup follows official Docusaurus TypeScript documentation and best practices.

Key changes:

  • Converts JavaScript configuration files to TypeScript with proper type annotations
  • Adds necessary TypeScript development dependencies and type definition packages
  • Removes the redundant babel.config.js file (Docusaurus provides default babel configuration)

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tsconfig.json Adds TypeScript configuration extending @docusaurus/tsconfig with baseUrl set to project root
sidebars.ts Converts sidebars.js to TypeScript with proper SidebarsConfig type import
sidebars.js Removes original JavaScript version (replaced by sidebars.ts)
package.json Adds TypeScript dependencies (@docusaurus/tsconfig, @docusaurus/types, @docusaurus/module-type-aliases, typescript) and @docusaurus/plugin-content-docs for type imports
package-lock.json Updates lock file with new dependencies and appropriate peer dependency markers
docusaurus.config.ts Converts docusaurus.config.js to TypeScript with type imports and satisfies operator for type safety
babel.config.js Removes file as Docusaurus handles babel configuration automatically

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@chvmvd chvmvd merged commit fc00106 into main Dec 6, 2025
3 checks passed
@chvmvd chvmvd deleted the add-typescript-support branch December 6, 2025 12:58
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.

3 participants