Skip to content

Commit

Permalink
fix(builder): ng-doc throws an error if a page was removed from the f…
Browse files Browse the repository at this point in the history
…ile system
  • Loading branch information
skoropadas committed Apr 13, 2023
1 parent 974050d commit 515e8b7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions libs/builder/engine/builder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {isPresent} from '@ng-doc/core';
import * as console from 'console';
import * as esbuild from 'esbuild';
import * as fs from 'fs';
import * as path from 'path';
Expand All @@ -16,7 +17,7 @@ import {
takeUntil,
tap,
} from 'rxjs/operators';
import {Project, SourceFile} from 'ts-morph';
import {InterfaceDeclaration, Project, SourceFile} from 'ts-morph';

import {createProject, emitBuiltOutput, isFileEntity} from '../helpers';
import {NgDocBuilderContext, NgDocBuiltOutput} from '../interfaces';
Expand Down Expand Up @@ -70,10 +71,8 @@ export class NgDocBuilder {
entityLifeCycle(this, this.project, watcher, API_PATTERN, NgDocApiEntity),
).pipe(
bufferUntilOnce(watcher.onReady()),
map((entities: NgDocEntity[][]) => entities.flat()),
bufferDebounce(50),
map((entities: NgDocEntity[][]) => entities.flat()),
share(),
map((entities: NgDocEntity[][][]) => entities.flat(2)),
);

return entities.pipe(
Expand Down Expand Up @@ -189,7 +188,7 @@ export class NgDocBuilder {
: this.entities
.asArray()
.filter(isFileEntity)
.filter((e: NgDocFileEntity<unknown>) => e.compilable)
.filter((e: NgDocFileEntity<unknown>) => e.compilable && !e.destroyed)
.map((e: NgDocFileEntity<unknown>) => e.sourceFile)
).map((s: SourceFile) => s.getFilePath()),
tsconfig: this.context.tsConfig,
Expand Down

0 comments on commit 515e8b7

Please sign in to comment.