Skip to content

Feature: [lexical-website] Upgrade docusaurus-plugin-typedoc and typedoc-plugin-markdown #6072

Closed

Description

@etrepum

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

Activity

  1. added
    enhancement
    on May 9, 2024
  2. added
    good first issue
    contribution-week
    on May 10, 2024
  3. TropicolX commented on May 20, 2024

    @TropicolX

    Hi @etrepum! Can I be assigned to work on this problem?

  4. inhwaS commented on Oct 18, 2024

    @inhwaS

    Hello, @etrepum I will work on this

  5. inhwaS commented on Oct 24, 2024

    @inhwaS

    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

  6. etrepum commented on Oct 24, 2024

    @etrepum
    CollaboratorAuthor

    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

  7. inhwaS commented on Oct 25, 2024

    @inhwaS

    Hello, @etrepum
    I would like to ask you about ./packages/lexical-website/docs/api/ folder.
    As you can see from the changelog, they say
    Screenshot 2024-10-25 at 10 48 22
    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:
    Screenshot 2024-10-25 at 10 49 08
    Is there a folder or file that manages the creation of all markdown files?

  8. etrepum commented on Oct 25, 2024

    @etrepum
    CollaboratorAuthor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    contribution-weekenhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions