Skip to content

Commit dff43a7

Browse files
committed
fix(bazel/rules_angular): fix 'NgtscCompilerHost' type incompatibility
This change fixes an issue where the 'NgtscCompilerHost' was not assignable to 'CompilerHost' due to incompatible 'SourceFile' types from different TypeScript versions. The fix involves ensuring that the Angular compiler worker uses the user-configured TypeScript dependency instead of a potentially different version from the root. As part of this, the 'typescript-local' dependency alias is renamed to 'typescript' and the symlinking logic is moved to the worker package.
1 parent 7171dc2 commit dff43a7

10 files changed

Lines changed: 23 additions & 25 deletions

File tree

MODULE.bazel.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
11
load("@rules_angular_npm//:defs.bzl", "npm_link_all_packages")
2-
load("//src/private:symlink_package.bzl", "symlink_package")
3-
4-
package(default_visibility = ["//visibility:public"])
52

63
npm_link_all_packages()
7-
8-
symlink_package(
9-
name = "node_modules/typescript",
10-
src = "@rules_angular_configurable_deps//:typescript",
11-
)

bazel/rules/rules_angular/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ use_repo(npm, "rules_angular_npm")
7575
rules_angular = use_extension("//setup:extensions.bzl", "rules_angular")
7676
rules_angular.setup(
7777
angular_compiler_cli = "//:node_modules/@angular/compiler-cli",
78-
typescript = "//:node_modules/typescript-local",
78+
typescript = "//:node_modules/typescript",
7979
)
8080
use_repo(rules_angular, "rules_angular_configurable_deps")

bazel/rules/rules_angular/MODULE.bazel.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/rules/rules_angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"dependencies": {
2828
"@angular/compiler-cli": "22.0.0-next.1",
29-
"typescript-local": "npm:typescript@5.9.3"
29+
"typescript": "5.9.3"
3030
},
3131
"devDependencies": {
3232
"@angular/build": "22.0.0-next.0",

bazel/rules/rules_angular/pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/rules/rules_angular/src/worker/BUILD.bazel

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ load("//src/private:symlink_package.bzl", "symlink_package")
55

66
package(default_visibility = ["//visibility:public"])
77

8+
# User configured dependencies
89
symlink_package(
910
name = "node_modules/@angular/compiler-cli",
1011
src = "@rules_angular_configurable_deps//:angular_compiler_cli",
1112
)
1213

14+
symlink_package(
15+
name = "node_modules/typescript",
16+
src = "@rules_angular_configurable_deps//:typescript",
17+
)
18+
1319
# ---
1420

1521
copy_file(
@@ -40,13 +46,13 @@ ts_project(
4046
declaration = True,
4147
tsconfig = "tsconfig",
4248
deps = [
43-
"//:node_modules/typescript",
4449
"//:node_modules/json-stable-stringify",
4550
"//:node_modules/lru-cache",
4651
"//:node_modules/memfs",
4752
# NOTE: The Angular compiler in this target is not affecting any compilation
4853
# output, but it's still necessary for some foundational utils like virtual FS.
4954
"//:node_modules/@angular/compiler-cli", # compiler from npm.
55+
"//:node_modules/typescript", # typescript from npm.
5056
],
5157
)
5258

@@ -62,10 +68,10 @@ ts_project(
6268
tsconfig = "tsconfig",
6369
deps = [
6470
":node_modules/@angular/compiler-cli", # user-configured compiler
71+
":node_modules/typescript", # user-configured typescript
6572
"//:node_modules/json-stable-stringify",
6673
"//:node_modules/lru-cache",
6774
"//:node_modules/memfs",
68-
"//:node_modules/typescript",
6975
],
7076
)
7177

bazel/rules/rules_browsers/MODULE.bazel.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/rules/rules_browsers/test/MODULE.bazel.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/rules/rules_sass/MODULE.bazel.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)