-
Notifications
You must be signed in to change notification settings - Fork 3
TypeScriptをセットアップ #899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScriptをセットアップ #899
Conversation
Deploying utcode-learn with
|
| 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 |
82d6166 to
2ac1f9c
Compare
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sidebars.tsでインポートしているため入れました。
There was a problem hiding this 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.
TypeScriptのセットアップを行いました。 #897 、
src/components/SlideShow/index.tsx、/docs/3-web-servers/05-server/request-response-slide-show/index.tsxでTypeScriptを使用している実態があり、この実態に合わせる形でTypeScriptを導入しました。 一度導入に反対があったため #865 ではPull requestがcloseされましたが、現在では実態に合わせるために導入するのは問題ないだろうとの結論に達しました。TypeScriptの導入にあたっては、次を参考にしています。