lexical
lexical copied to clipboard
Feature: [lexical-website] Upgrade docusaurus-plugin-typedoc and typedoc-plugin-markdown
It seems that a lot of improvements have happened to docusaurus-plugin-typedoc, seems to fix some issues that I've noticed with how the docs are generated and organized, but it's a backwards incompatible change.
We should:
- Upgrade these packages
- Update the configuration accordingly (sidebars in particular, but we may also be able to get rid of some of our other plugins that exist just to work around previous bugs)
- Update all of the static links to the documentation in the monorepo (the URL structure changes, but we also only have these references in the README files so it's not a big task)
- Consider adding redirect routes in lexical-website so that old links redirect to their new location rather than 404
Hi @etrepum! Can I be assigned to work on this problem?
Hello, @etrepum I will work on this
Hello @etrepum , I’ve updated all relevant code changes according to the changelog, but I’m encountering a module error.
Here’s the error message I received:
[ERROR] Error: Unable to build website for locale en.
at tryToBuildLocale (/Users/inhwa.son/lexical/node_modules/@docusaurus/core/lib/commands/build.js:54:19)
at async /Users/inhwa.son/lexical/node_modules/@docusaurus/core/lib/commands/build.js:65:9
at async mapAsyncSequential (/Users/inhwa.son/lexical/node_modules/@docusaurus/utils/lib/jsUtils.js:21:24)
at async Command.build (/Users/inhwa.son/lexical/node_modules/@docusaurus/core/lib/commands/build.js:63:5) {
[cause]: TypeError: Cannot read properties of undefined (reading 'addTranslations')
at _classThis.<anonymous> (/Users/inhwa.son/lexical/node_modules/typedoc-plugin-markdown/dist/index.js:94:34)
at triggerEvents (/Users/inhwa.son/lexical/node_modules/typedoc/dist/lib/utils/events.js:192:43)
at triggerApi (/Users/inhwa.son/lexical/node_modules/typedoc/dist/lib/utils/events.js:168:13)
at eventsApi (/Users/inhwa.son/lexical/node_modules/typedoc/dist/lib/utils/events.js:61:18)
at _classThis.trigger (/Users/inhwa.son/lexical/node_modules/typedoc/dist/lib/utils/events.js:390:13)
at _classThis.convert (/Users/inhwa.son/lexical/node_modules/typedoc/dist/lib/converter/converter.js:210:18)
at _classThis.convert (/Users/inhwa.son/lexical/node_modules/typedoc/dist/lib/application.js:296:44)
at generateTypedoc (/Users/inhwa.son/lexical/node_modules/docusaurus-plugin-typedoc/dist/plugin.js:99:31)
at async Object.pluginDocusaurus [as plugin] (/Users/inhwa.son/lexical/node_modules/docusaurus-plugin-typedoc/dist/plugin.js:40:9)
at async initializePlugin (/Users/inhwa.son/lexical/node_modules/@docusaurus/core/lib/server/plugins/init.js:91:32)
}
You can check my commit from here.
Can I ask how to fix these kind of module level errors?
From codebase, I cannot find any usage of addTranslations
Sorry, I am not familiar with all of the changes that have occurred in these packages and their dependencies. It looks like it expects typedoc to have this method https://github.com/typedoc2md/typedoc-plugin-markdown/blob/main/packages/typedoc-plugin-markdown/src/index.ts#L91
Hello, @etrepum
I would like to ask you about ./packages/lexical-website/docs/api/ folder.
As you can see from the changelog, they say
Therefore, I am trying to change:
https://github.com/facebook/lexical/blob/e96ee55b749c0fed8ac03d49044dd5594f0bc32e/packages/lexical-website/sidebars.js#L25
However, it seems that in the folder ./packages/lexical-website/docs/api/, all markdown files are generated during the build process. To manually include all relevant files, where should I refer?
I don't believe it’s efficient to list all the file names here:
Is there a folder or file that manages the creation of all markdown files?
I believe those files are generated by typedoc and the associated plugins. I agree that listing the files is probably not the best way to make the sidebar, but again I am not familiar with how these packages have changed so I really don't know much more about how to solve this