-
-
Notifications
You must be signed in to change notification settings - Fork 198
feat(plugin-typedoc): Upgrade to TypeDoc v0.28 with new API #2790
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 upgrades the TypeDoc plugin to use TypeDoc v0.28.14 and typedoc-plugin-markdown v4.9.0, migrating from the previous v0.24.8 and v3.17.1 versions respectively. The upgrade necessitates API changes to align with TypeDoc's new architecture, while maintaining similar output rendering.
- Updated TypeDoc and typedoc-plugin-markdown to their latest major versions
- Migrated to new TypeDoc v0.28 API including
Application.bootstrapWithPlugins()andapp.outputs.writeOutput() - Adjusted configuration options to match new defaults and maintain output consistency
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updated dependency versions and added new transitive dependencies required by TypeDoc v0.28 |
| packages/plugin-typedoc/package.json | Bumped typedoc to 0.28.14 and typedoc-plugin-markdown to 4.9.0 |
| packages/plugin-typedoc/src/index.ts | Migrated to new TypeDoc v0.28 API with bootstrapWithPlugins and outputs.writeOutput methods, added new configuration options |
| packages/plugin-typedoc/src/patch.ts | Removed README.md to index.md rename (now handled by entryFileName config) |
| packages/plugin-typedoc/src/utils.ts | Removed unused transformModuleName function |
| e2e/fixtures/plugin-typedoc/index.test.ts | Updated test expectations to match new TypeDoc output format (function names now include parentheses, module naming changed from underscores to hyphens) |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
I removed this because it was not being used.
| await fs.rename( | ||
| path.join(absoluteApiDir, 'README.md'), | ||
| path.join(absoluteApiDir, 'index.md'), | ||
| ); |
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.
I updated it to use the entryFileName option instead.
| app.options.addReader(new TSConfigReader()); | ||
| load(app); | ||
| app.bootstrap({ | ||
| const app = await Application.bootstrapWithPlugins({ |
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.
Since the constructor of the Application class has been made private, initialization is now done using the bootstrapWithPlugins method instead.
| const app = await Application.bootstrapWithPlugins({ | ||
| name: config.title, | ||
| entryPoints, | ||
| theme: 'markdown', |
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.
The theme option is no longer needed; instead, it is now specified via the writeOutput method.
| async config(config) { | ||
| const app = new Application(); | ||
| docRoot = config.root; | ||
| app.options.addReader(new TSConfigReader()); |
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.
TSConfigReader is now included by default when using the bootstrapWithPlugins method.
| entryPoints, | ||
| theme: 'markdown', | ||
| disableSources: true, | ||
| router: 'kind', |
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.
Since the default output directory structure has changed, I added an option so that it can generate the same structure as before.
| hideMembersSymbol: true, | ||
| allReflectionsHaveOwnDocument: true, |
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.
These options have been removed and are no longer available.
| await app.generateDocs(project, absoluteApiDir); | ||
| const absoluteApiDir = path.join(config.root!, outDir); | ||
| await app.outputs.writeOutput( | ||
| { name: 'markdown', path: absoluteApiDir }, | ||
| project, | ||
| ); |
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.
Since the generateDocs method was changed to output HTML files, I updated the code to use the writeOutput method instead.
|
I don’t have a Windows machine, so I can’t figure out why it’s failing on Windows in the end-to-end tests 😢 |
I currently do not have a Windows machine too. I will do some troubleshooting when I have a Windows machine today or tomorrow. |
Summary
I updated the versions of TypeDoc and typedoc-plugin-markdown.
There were several changes to the default settings, but I’ve made adjustments so that the output is rendered as similarly as possible to the previous version.
Related Issue
close #2479
Checklist