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

Failed to find any packages in pnpm workspace #2238

Closed
linonetwo opened this issue Apr 14, 2023 · 7 comments
Closed

Failed to find any packages in pnpm workspace #2238

linonetwo opened this issue Apr 14, 2023 · 7 comments
Labels
bug Functionality does not match expectation

Comments

@linonetwo
Copy link

linonetwo commented Apr 14, 2023

Search terms

pnpm monorepo workspace

Expected Behavior

Generate a HTML website I guess.

Actual Behavior

pnpm run build:doc

> memeloop-monorepo@ build:doc /Users/linonetwo/Desktop/repo/memeloop
> typedoc

[info] Converting project at ./
[error] Project at ./ has entryPointStrategy set to packages, but nested packages are not supported.
[info] Merging converted projects
[error] Failed to convert one or more packages, result will not be merged together.
 ELIFECYCLE  Command failed with exit code 3.
  "scripts": {
    "build:doc": "typedoc"
  },

Steps to reproduce the bug

plugins/memeloop-plugin/typedoc.json

{
  "$schema": "https://typedoc.org/schema.json",
  "extends": ["../../typedoc.base.json"],
  "entryPoints": ["src/index.ts"]
}

typedoc.json

{
  "$schema": "https://typedoc.org/schema.json",
  "entryPoints": ["plugins/*"],
  "out": "docs",
  "name": "Memeloop Docs",
  "entryPointStrategy": "packages",
  "includeVersion": true
}

typedoc.base.json

{
  "$schema": "https://typedoc.org/schema.json",
  "includeVersion": true
}

pnpm-workspace.yaml

packages:
  # core packages
  - 'packages/*'
  # plugins, each can be use as needed
  - 'plugins/*'

Environment

  • Typedoc version: 0.24.1
  • TypeScript version: 5.0.4
  • Node.js version: 18
  • OS: Mac
@linonetwo linonetwo added the bug Functionality does not match expectation label Apr 14, 2023
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 14, 2023

plugins/memeloop-plugin/typedoc.json

This sets the entry point strategy to packages, which expects directories as entry points, but passes a TS file... so yes, that won't work.

Packages mode expects one or more directories containing package.json to be provided as the entry points.

@linonetwo
Copy link
Author

linonetwo commented Apr 14, 2023

I understand, but change it to

{
  "extends": ["../../typedoc.json"],
  "entryPoints": ["."]
}

also has this error.

I'm following https://github.com/Gerrit0/typedoc-packages-example/blob/master/packages/foo/typedoc.json example, which doesn't work for me.

Also will it faster to process plugins/memeloop-plugin/dist/index.d.ts instead of plugins/memeloop-plugin/src/index.ts ?

@linonetwo
Copy link
Author

Where should I run the pnpm exec typedoc? At monorepo root or in a package like plugins/memeloop-plugin?

@linonetwo
Copy link
Author

linonetwo commented Apr 14, 2023

Update the issue description, I run typedoc in the project root, still not working.

Also changed all config to have "entryPoints": ["."] which "containing package.json "

@linonetwo
Copy link
Author

SHould I change it to

"entryPoints": ["packages/*", "plugins/*"]

to match pnpm-workspace.yaml

@linonetwo
Copy link
Author

linonetwo commented Apr 14, 2023

This works, I test it out. Maybe you should update the example repo and doc.

But with new error.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 15, 2023

The website says

Expects all entry points to be directories to run TypeDoc within. After each entry point has been run through TypeDoc, the projects will be merged together and rendered to a single site.

I'm not sure how to make that clearer... packages mode is intended to be more of a build-orchestration mode than a directly generate docs mode. It's a convenient wrapper to let monorepos that don't need control over rebuilding some packages generate documentation for each package and then merge them together.

Also will it faster to process plugins/memeloop-plugin/dist/index.d.ts instead of plugins/memeloop-plugin/src/index.ts ?

Generally, no, and the former won't work anyways unless you set up special tsconfig files for typedoc's use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants