Skip to content

Commit 9e91463

Browse files
committed
build: add diagnose return type annotation for windows bazel builds
Due to the Windows Bazel directory structure, TypeScript can not safely infer the return type of the `diagnose` function in the parallel worker module. The return type should ideally be explicit regardless and so a return type is now provided for the function.
1 parent a5962ac commit 9e91463

File tree

1 file changed

+5
-1
lines changed
  • packages/angular_devkit/build_angular/src/tools/esbuild/angular/compilation

1 file changed

+5
-1
lines changed

packages/angular_devkit/build_angular/src/tools/esbuild/angular/compilation/parallel-worker.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
import type { PartialMessage } from 'esbuild';
910
import assert from 'node:assert';
1011
import { randomUUID } from 'node:crypto';
1112
import { type MessagePort, receiveMessageOnPort } from 'node:worker_threads';
@@ -98,7 +99,10 @@ export async function initialize(request: InitRequest) {
9899
};
99100
}
100101

101-
export async function diagnose() {
102+
export async function diagnose(): Promise<{
103+
errors?: PartialMessage[];
104+
warnings?: PartialMessage[];
105+
}> {
102106
assert(compilation);
103107

104108
const diagnostics = await compilation.diagnoseFiles();

0 commit comments

Comments
 (0)