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

Generating JSON doesn't seem to generate anything. #1610

Closed
zthun opened this issue Jun 23, 2021 · 3 comments
Closed

Generating JSON doesn't seem to generate anything. #1610

zthun opened this issue Jun 23, 2021 · 3 comments
Labels
bug Functionality does not match expectation

Comments

@zthun
Copy link

zthun commented Jun 23, 2021

Search terms

JSON

Expected Behavior

When executing typedoc with a json output, the json file should output the full documentation.

Actual Behavior

It looks like something changed in the latest version that broke legacy json generation in monorepos when generating the docs in each individual package. Note that I have not converted my repository to use the new monorepo features yet.

{
	"id": 0,
	"name": "@zthun/lint-janitor",
	"kind": 0,
	"kindString": "Project",
	"flags": {},
	"originalName": "",
	"sources": [
		{
			"fileName": "index.ts",
			"line": 1,
			"character": 0
		}
	]
}

This was working fine in version 0.20.36.

Steps to reproduce the bug

git clone https://github.com/zthun/janitor.git
cd janitor
yarn install
yarn build

Look at the generated json at packages/lint-janitor/docs

The previous version generated the correct output:

git checkout fa4cfcdb8cd2f8856f2adf897d0a5aeaf2af813a
yarn install
yarn build

Environment

  • Typedoc version: 0.21.0
  • TypeScript version: 4.3.4
  • Node.js version: 16.3.0
  • OS: MacOS BigSur 11.4
@zthun zthun added the bug Functionality does not match expectation label Jun 23, 2021
@Unnvaldr
Copy link
Contributor

Unnvaldr commented Jun 23, 2021

It works fine on Windows, so I think it's related to Linux/MacOS path handling (needs further research).

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 25, 2021

This is a weird one... I can repro with WSL. No idea what's going on yet though.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 25, 2021

Well, that was an interesting investigation. The behavior you are seeing is correct. The bug is actually that Windows "works". On Linux & Mac OS, TypeDoc correctly removes everything that would be included from an excluded file. The behavior of exclude changed in 0.21 to not only apply to entry point discovery, which is why the previous version didn't show this bug.

module.exports = {
  out: 'docs/typedoc',
  json: 'docs/typedoc.json',
  exclude: ['src/index.ts'],        // <-- The culprit, remove this.
  excludePrivate: true,
  tsconfig: 'tsconfig.bin.json',
  entryPoints: ['src/index.ts']
};

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

3 participants