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

excludeNotDocumented causes warnings in packages strategy #2231

Closed
akphi opened this issue Apr 9, 2023 · 3 comments
Closed

excludeNotDocumented causes warnings in packages strategy #2231

akphi opened this issue Apr 9, 2023 · 3 comments
Labels
bug Functionality does not match expectation
Milestone

Comments

@akphi
Copy link
Contributor

akphi commented Apr 9, 2023

Search terms

exclude, excludeNotDocumented, packages strategy

Expected Behavior

Should not see any warnings

Actual Behavior

See warnings and quite make out what they are about

Steps to reproduce the bug

See Gerrit0/typedoc-packages-example#2

The code that causes the warnings is

import { SKIP } from "serializr";

/**
 * some comments
 */
type Skipped = typeof SKIP;

export const deserializeArray = (): Skipped => {
  throw new Error("");
};

export const serializeArray = (): Skipped => {
  throw new Error("");
};

export class ActionState {
  private _messageFormatter: ((message: string) => string) | undefined;

  setMessageFormatter(val: ((message: string) => string) | undefined): void {}
}

export class SomeType {
  response!: string & { data?: object };
}

and the warnings that I got

[warning] Serialized project contained a reflection with id node_modules/serializr/lib/constants.d.ts __type 3 but it was not present in deserialized project.
[warning] Serialized project contained a reflection with id node_modules/serializr/lib/constants.d.ts __type 6 but it was not present in deserialized project.
[warning] Serialized project contained a reflection with id packages/test/src/index.ts __type 11 but it was not present in deserialized project.
[warning] Serialized project contained a reflection with id packages/test/src/index.ts __type 12 but it was not present in deserialized project.
[warning] Serialized project contained a reflection with id packages/test/src/index.ts message 13 but it was not present in deserialized project.
[warning] Serialized project contained a reflection with id packages/test/src/index.ts __type 17 but it was not present in deserialized project.
[warning] Serialized project contained a reflection with id packages/test/src/index.ts __type 18 but it was not present in deserialized project.
[warning] Serialized project contained a reflection with id packages/test/src/index.ts message 19 but it was not present in deserialized project.
[warning] Serialized project contained a reflection with id packages/test/src/index.ts __type 24 but it was not present in deserialized project.
[warning] Serialized project contained a reflection with id packages/test/src/index.ts __type.data 25 but it was not present in deserialized project.

Note that these warnings original form was something like [warning] Serialized project contained a reflection with id 25 but it was not present in deserialized project., but I poke into the source code to do some debugging and print out the source file as well as the qualifiedName

For the case of message and data, I'm not sure how to fix them, previously on version 0.23.0, I used the legacy packages strategy and excludeNotDocumented worked fine.

Now the warnings from node_modules/serializr/lib/constants.d.ts is odd because I have excludeExternals=true in my typedoc.json

I also bumped into similar warnings when trying to enable flags like excludePrivate

Environment

  • Typedoc version: 0.24.1
  • TypeScript version: 5.0.4
  • Node.js version: 16.8.0
  • OS: MacOS 13.3 (22E252)
@akphi akphi added the bug Functionality does not match expectation label Apr 9, 2023
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 9, 2023

This is probably a bug in the removeReflection routine, where it doesn't fully remove reflections from the project. It didn't show up on the previous version since there wasn't any structure validation.

@Gerrit0 Gerrit0 added this to the v0.24.2 milestone Apr 10, 2023
@akphi
Copy link
Contributor Author

akphi commented Apr 10, 2023

@Gerrit0 as usual, thanks for your incredible effort and speed 🙏 really appreciate man!

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 10, 2023

Probably not going to get to release this for a couple days -- I want to get the other issues in this milestone done too, and likely going to be a busy week at work :)

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