Skip to content

Commit 1d7fceb

Browse files
crisbetoclydin
authored andcommitted
build: update to TypeScript 6
Updates the repo to TypeScript 6 and resolves the resulting test failures.
1 parent 108fe07 commit 1d7fceb

File tree

49 files changed

+333
-442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+333
-442
lines changed

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ use_repo(npm, "npm")
165165
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
166166
rules_ts_ext.deps(
167167
name = "angular_cli_npm_typescript",
168-
# Obtained by: npm info typescript@5.9.3 dist.integrity
169-
ts_integrity = "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
170-
ts_version = "5.9.3",
168+
# Obtained by: npm info typescript@6.0.0-beta dist.integrity
169+
ts_integrity = "sha512-CldZdztDpQRLM1HC6WDQjQkQN5Ub5zRau737a1diGh3lPmb9oRsaWHk1y5iqK0o7+1bNJ0oXfEGRkAogFZBL+Q==",
170+
ts_version = "6.0.0-beta",
171171
)
172172
use_repo(rules_ts_ext, **{"npm_typescript": "angular_cli_npm_typescript"})
173173

MODULE.bazel.lock

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

modules/testing/builder/projects/hello-world-app/src/tsconfig.server.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"extends": "./tsconfig.app.json",
33
"compilerOptions": {
44
"outDir": "../dist-server",
5-
"baseUrl": "./",
6-
"types": ["@angular/localize", "node"]
5+
"types": ["@angular/localize", "node", "@types/express"]
76
},
87
"files": [
98
"main.server.ts"

modules/testing/builder/src/test-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export async function browserBuild(
8080
scheduleOptions?: ScheduleOptions,
8181
): Promise<BrowserBuildOutput> {
8282
const run = await architect.scheduleTarget(target, overrides, scheduleOptions);
83-
const output = (await run.result) as BuilderOutput & { outputs: { path: string }[] };
83+
const output = await run.result;
8484
expect(output.success).toBe(true);
8585

8686
if (!output.success) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"semver": "7.7.4",
128128
"source-map-support": "0.5.21",
129129
"tslib": "2.8.1",
130-
"typescript": "5.9.3",
130+
"typescript": "6.0.0-beta",
131131
"undici": "7.22.0",
132132
"unenv": "^1.10.0",
133133
"verdaccio": "6.2.9",

packages/angular/build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"postcss": "^8.4.0",
7474
"tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0",
7575
"tslib": "^2.3.0",
76-
"typescript": ">=5.9 <6.0",
76+
"typescript": ">=5.9 <6.1",
7777
"vitest": "^4.0.8"
7878
},
7979
"peerDependenciesMeta": {

packages/angular/build/src/builders/application/tests/behavior/rebuild-errors_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
3333
import { Directive, Input } from '@angular/core';
3434
@Directive({ selector: 'dir', standalone: false })
3535
export class Dir {
36-
@Input() foo: number;
36+
@Input() foo!: number;
3737
}
3838
`;
3939

packages/angular/build/src/builders/application/tests/behavior/typescript-isolated-modules_spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
5555
tsconfig.compilerOptions.isolatedModules = true;
5656
tsconfig.compilerOptions.jsx = 'react-jsx';
5757

58+
// There's an implicit `any`, because we don't include the React typings.
59+
tsconfig.compilerOptions.noImplicitAny = false;
60+
5861
return JSON.stringify(tsconfig);
5962
});
6063

packages/angular/build/src/builders/application/tests/behavior/typescript-path-mapping_spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
8383
tsconfig.compilerOptions.paths = {
8484
'app-module': ['./a.js'],
8585
};
86+
tsconfig.compilerOptions.allowJs = true;
8687

8788
return JSON.stringify(tsconfig);
8889
});

packages/angular/build/src/builders/application/tests/behavior/typescript-resolve-json_spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
2020
// Enable tsconfig resolveJsonModule option in tsconfig
2121
await harness.modifyFile('tsconfig.json', (content) => {
2222
const tsconfig = JSON.parse(content);
23-
tsconfig.compilerOptions.moduleResolution = 'node';
23+
tsconfig.compilerOptions.moduleResolution = 'node16';
24+
tsconfig.compilerOptions.module = 'node16';
2425
tsconfig.compilerOptions.resolveJsonModule = true;
2526

2627
return JSON.stringify(tsconfig);
@@ -44,7 +45,8 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
4445
// Enable tsconfig resolveJsonModule option in tsconfig
4546
await harness.modifyFile('tsconfig.json', (content) => {
4647
const tsconfig = JSON.parse(content);
47-
tsconfig.compilerOptions.moduleResolution = 'node';
48+
tsconfig.compilerOptions.moduleResolution = 'node16';
49+
tsconfig.compilerOptions.module = 'node16';
4850
tsconfig.compilerOptions.resolveJsonModule = undefined;
4951

5052
return JSON.stringify(tsconfig);
@@ -73,7 +75,8 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
7375
// Enable tsconfig resolveJsonModule option in tsconfig
7476
await harness.modifyFile('tsconfig.json', (content) => {
7577
const tsconfig = JSON.parse(content);
76-
tsconfig.compilerOptions.moduleResolution = 'node';
78+
tsconfig.compilerOptions.moduleResolution = 'node16';
79+
tsconfig.compilerOptions.module = 'node16';
7780
tsconfig.compilerOptions.resolveJsonModule = false;
7881

7982
return JSON.stringify(tsconfig);

0 commit comments

Comments
 (0)