Skip to content
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

Global input options not taken into account in a monorepo #2838

Open
jjanvier opened this issue Jan 28, 2025 · 3 comments
Open

Global input options not taken into account in a monorepo #2838

jjanvier opened this issue Jan 28, 2025 · 3 comments
Labels
no bug This is expected behavior

Comments

@jjanvier
Copy link

jjanvier commented Jan 28, 2025

Search terms

Input, Options, Packages, Monorepro

Expected Behavior

I have a monorepo like this.

typedoc.json
libs/
  |-- foo/
        |-- src/
  |-- bar/
        |-- src/

With this configuration, I expect the Caching category to not appear in the documentation.

{
  "entryPointStrategy": "packages",
  "entryPoints": [
    "libs/foo",
    "libs/bar",
  ],
  "cleanOutputDir": true,
  "packageOptions": {
    "entryPoints": ["src/index.ts"]
  },
  "excludeCategories": ["Caching"], // not working
  "excludeNotDocumented": true, // not working
  "outputs": [
    {
      "name": "html",
      "path": "docs/tsdoc",
      "options": {
        "navigation": {
          "includeCategories": true,
          "includeGroups": true,
          "excludeReferences": false,
          "includeFolders": false
        }
      }
    }
  ]
}

Actual Behavior

The problem is that the Caching category appears in the documentation. As well as undocumented stuff.

To make them disappear, I must add a libs/foo/typedoc.json file with the following configuration.

{
  "excludeCategories": ["Caching"], 
  "excludeNotDocumented": true
}

But that's not what I want, as all root configurations would use this file. (I have several root configuration, to build different documentations)

Environment

  • Typedoc version: 0.27.6
  • TypeScript version: 5.7.3
  • Node.js version: v18.20.5
  • OS: MacOs

Is there something I'm doing wrong? Or is it a bug?

@jjanvier jjanvier added the bug Functionality does not match expectation label Jan 28, 2025
@jjanvier jjanvier changed the title Global input options not taken into account Global input options not taken into account in a monorepo Jan 28, 2025
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 28, 2025

See https://typedoc.org/documents/Options.Package_Options.html

Packages mode is special, options must be set where they are used.

@jjanvier
Copy link
Author

Hello @Gerrit0 :) Thanks for you answer. What does it mean? That what I want to achieve is impossible?

@Gerrit0 Gerrit0 added the no bug This is expected behavior label Jan 31, 2025
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 31, 2025

You can use the packageOptions option to set the option in the root configuration and tell TypeDoc to copy it to each package, but that option takes effect during conversion, not during rendering, so it needs to be set in the package project's configuration.

@Gerrit0 Gerrit0 removed the bug Functionality does not match expectation label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no bug This is expected behavior
Projects
None yet
Development

No branches or pull requests

2 participants