Skip to content

Commit

Permalink
fix: Hidden module-namespaces
Browse files Browse the repository at this point in the history
Fixes #1396
  • Loading branch information
Gerrit0 committed Nov 25, 2020
1 parent fc1d58e commit 88fa674
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/lib/converter/converter.ts
Expand Up @@ -195,7 +195,10 @@ export class Converter extends ChildableComponent<
const wantedKinds: ts.SyntaxKind[] = {
[ReflectionKind.Project]: [ts.SyntaxKind.SourceFile],
[ReflectionKind.Module]: [ts.SyntaxKind.SourceFile],
[ReflectionKind.Namespace]: [ts.SyntaxKind.ModuleDeclaration],
[ReflectionKind.Namespace]: [
ts.SyntaxKind.ModuleDeclaration,
ts.SyntaxKind.SourceFile,
],
[ReflectionKind.Enum]: [ts.SyntaxKind.EnumDeclaration],
[ReflectionKind.EnumMember]: [ts.SyntaxKind.EnumMember],
[ReflectionKind.Variable]: [ts.SyntaxKind.VariableDeclaration],
Expand Down
9 changes: 4 additions & 5 deletions src/lib/converter/plugins/CommentPlugin.ts
Expand Up @@ -140,7 +140,9 @@ export class CommentPlugin extends ConverterComponent {
comment.removeTags("event");
}

if (reflection.kindOf(ReflectionKind.Module)) {
if (
reflection.kindOf(ReflectionKind.Module | ReflectionKind.Namespace)
) {
comment.removeTags("packagedocumentation");
}
}
Expand Down Expand Up @@ -274,10 +276,7 @@ export class CommentPlugin extends ConverterComponent {
const project = context.project;
const reflections = Object.values(project.reflections);

// remove signatures
// TODO: This doesn't really belong here. Removing comments due to @hidden yes, but private/protected no.
// it needs to be here for now because users can use @public/@private/@protected to override visibility.
// the converter should probably have a post resolve step in which it handles the excludePrivate/protected options.
// Remove hidden reflections
const hidden = reflections.filter((reflection) =>
CommentPlugin.isHidden(
reflection,
Expand Down

0 comments on commit 88fa674

Please sign in to comment.