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

intentionallyNotExported does not support Windows path separators #1738

Closed
RunDevelopment opened this issue Oct 15, 2021 · 1 comment
Closed
Labels
bug Functionality does not match expectation

Comments

@RunDevelopment
Copy link
Contributor

Search terms

intentionallyNotExported, Windows

Expected Behavior

When running TypeDoc, I got this warning:

PS C:\Users\micha\Git\refa> npx typedoc
Warning: NodeIdent, defined at src\ast\nodes.ts:64, is referenced by NoParent but not included in the documentation.

So copied the file path of the warning + the type name and used the intentionallyNotExported in my typedoc.json like this:

{
  // other options

  "validation": true,
  "intentionallyNotExported": [
    "src\\ast\\nodes.ts:NodeIdent"
  ]
}

Actual Behavior

This does not work. Luckily, TypeDoc prints a very helpful but also confusing warning:

PS C:\Users\micha\Git\refa> npx typedoc
Warning: NodeIdent, defined at src\ast\nodes.ts:64, is referenced by NoParent but not included in the documentation.
Warning: The following symbols were marked as intentionally not exported, but were either not referenced in the documentation, or were exported:
        src\ast\nodes.ts:NodeIdent

However, using front slashes in the path works:

{
  // other options

  "validation": true,
  "intentionallyNotExported": [
    "src/ast/nodes.ts:NodeIdent"
  ]
}

(Removing the path and only using "NodeIdent" also works as expected.)

It seems like the symbol comparison of the intentionallyNotExported option uses Unix path separators internally and doesn't account for Windows path separators.

The easiest fix for this might be to consistently use Unix path separators internally and to converts the paths from the intentionallyNotExported into Unix paths as well. This could as simple as replacing all backslashes with frontslashes.

Steps to reproduce the bug

Here is a minimal example. Just install all deps (npm ci) and run npx typedoc. You'll see the following on Windows machines:

PS C:\Users\micha\Desktop\example> npx typedoc
Warning: NoParentImpl, defined at src\index.ts:4, is referenced by NoParent but not included in the documentation.
Warning: The following symbols were marked as intentionally not exported, but were either not referenced in the documentation, or were exported:
        src\index.ts:NoParentImpl
Info: Documentation generated at ./docs

Environment

  • Typedoc version: 4.2.4
  • TypeScript version: 0.22.5
  • Node.js version: v16.11.1
  • OS: Win10
@RunDevelopment RunDevelopment added the bug Functionality does not match expectation label Oct 15, 2021
@RunDevelopment RunDevelopment changed the title intentionallyNotExported does not support Windows path separator intentionallyNotExported does not support Windows path separators Oct 15, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Oct 16, 2021

Thanks! Yeah, it was not intentional to print paths in the warning with Windows slashes, everything should use / slashes, since they're much less of a pain to work with.

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