Skip to content

Commit 8e282e0

Browse files
committed
build: update to TypeScript 6
Updates the repo to the TypeScript 6 beta in order to catch any breakages ahead of the final release.
1 parent 72498b4 commit 8e282e0

File tree

9 files changed

+782
-687
lines changed

9 files changed

+782
-687
lines changed

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ use_repo(yq, "yq_toolchains")
4949
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
5050
rules_ts_ext.deps(
5151
name = "components_npm_typescript",
52-
# Obtained by: curl --silent https://registry.npmjs.org/typescript/5.9.2 | jq -r '.dist.integrity'
53-
ts_integrity = "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
54-
ts_version = "5.9.2",
52+
# Obtained by: curl --silent https://registry.npmjs.org/typescript/6.0.0-beta | jq -r '.dist.integrity'
53+
ts_integrity = "sha512-CldZdztDpQRLM1HC6WDQjQkQN5Ub5zRau737a1diGh3lPmb9oRsaWHk1y5iqK0o7+1bNJ0oXfEGRkAogFZBL+Q==",
54+
ts_version = "6.0.0-beta",
5555
)
5656
use_repo(rules_ts_ext, **{"npm_typescript": "components_npm_typescript"})
5757

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.

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@
7878
"sass": "1.97.3",
7979
"shelljs": "^0.10.0",
8080
"ts-node": "10.9.2",
81-
"typescript": "~5.9.2"
81+
"typescript": "6.0.0-beta"
8282
}
8383
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@
145145
"tsickle": "0.46.3",
146146
"tslint": "^6.1.3",
147147
"tsutils": "^3.21.0",
148-
"typescript": "5.9.2",
148+
"typescript": "6.0.0-beta",
149149
"vrsource-tslint-rules": "6.0.0",
150150
"yaml": "^2.8.1",
151151
"yargs": "^18.0.0",
152152
"zx": "^8.0.0"
153153
},
154154
"pnpm": {
155155
"overrides": {
156-
"typescript": "5.9.2"
156+
"typescript": "6.0.0-beta"
157157
},
158158
"onlyBuiltDependencies": [],
159159
"packageExtensions": {

pnpm-lock.yaml

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

pnpm-workspace.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ packages:
1818
- src/youtube-player
1919

2020
catalog:
21-
'@angular-devkit/build-angular': 21.2.0
22-
'@angular-devkit/core': 21.2.0
23-
'@angular-devkit/schematics': 21.2.0
24-
'@angular/build': 21.2.0
25-
'@angular/cli': 21.2.0
26-
'@angular/common': 21.2.0
27-
'@angular/compiler-cli': 21.2.0
28-
'@angular/compiler': 21.2.0
29-
'@angular/core': 21.2.0
30-
'@angular/ssr': 21.2.0
31-
'@angular/forms': 21.2.0
32-
'@angular/localize': 21.2.0
33-
'@angular/platform-browser': 21.2.0
34-
'@angular/platform-browser-dynamic': 21.2.0
35-
'@angular/platform-server': 21.2.0
36-
'@angular/router': 21.2.0
37-
'@schematics/angular': 21.2.0
21+
'@angular-devkit/build-angular': 22.0.0-next.0
22+
'@angular-devkit/core': 22.0.0-next.0
23+
'@angular-devkit/schematics': 22.0.0-next.0
24+
'@angular/build': 22.0.0-next.0
25+
'@angular/cli': 22.0.0-next.0
26+
'@angular/common': 22.0.0-next.0
27+
'@angular/compiler-cli': 22.0.0-next.0
28+
'@angular/compiler': 22.0.0-next.0
29+
'@angular/core': 22.0.0-next.0
30+
'@angular/ssr': 22.0.0-next.0
31+
'@angular/forms': 22.0.0-next.0
32+
'@angular/localize': 22.0.0-next.0
33+
'@angular/platform-browser': 22.0.0-next.0
34+
'@angular/platform-browser-dynamic': 22.0.0-next.0
35+
'@angular/platform-server': 22.0.0-next.0
36+
'@angular/router': 22.0.0-next.0
37+
'@schematics/angular': 22.0.0-next.0
3838
'rxjs': ^6.6.7
3939

4040
# The minimum age of a release to be considered for dependency installation.

src/cdk/schematics/utils/ast.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ import {getAppModulePath} from '@schematics/angular/utility/ng-ast-utils';
1616
import * as ts from 'typescript';
1717
import {getProjectMainFile} from './project-main-file';
1818

19+
/**
20+
* Temporary type until the CLI starts bundling TS6.
21+
*
22+
* TODO(crisbeto): clean this up eventually.
23+
*/
24+
export type AnyDuringTs6Migration = any;
25+
1926
/** Reads file given path and returns TypeScript source file. */
2027
export function parseSourceFile(host: Tree, path: string): ts.SourceFile {
2128
const buffer = host.read(path);
@@ -55,7 +62,12 @@ export function addModuleImportToModule(
5562
throw new SchematicsException(`Module not found: ${modulePath}`);
5663
}
5764

58-
const changes = addImportToModule(moduleSource, modulePath, moduleName, src);
65+
const changes = addImportToModule(
66+
moduleSource as AnyDuringTs6Migration,
67+
modulePath,
68+
moduleName,
69+
src,
70+
);
5971
const recorder = host.beginUpdate(modulePath);
6072

6173
changes.forEach(change => {

src/cdk/schematics/utils/build-component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {dirname, join, resolve} from 'path';
3636
import * as ts from 'typescript';
3737
import {getProjectFromWorkspace} from './get-project';
3838
import {getDefaultComponentOptions, isStandaloneSchematic} from './schematic-options';
39+
import {AnyDuringTs6Migration} from './ast';
3940

4041
/**
4142
* Build a default project path for generating.
@@ -83,7 +84,7 @@ function addDeclarationToNgModule(options: ComponentOptions): Rule {
8384
const classifiedName = strings.classify(`${options.name}Component`);
8485

8586
const declarationChanges = addDeclarationToModule(
86-
source,
87+
source as AnyDuringTs6Migration,
8788
modulePath,
8889
classifiedName,
8990
relativePath,
@@ -103,7 +104,7 @@ function addDeclarationToNgModule(options: ComponentOptions): Rule {
103104

104105
const exportRecorder = host.beginUpdate(modulePath);
105106
const exportChanges = addExportToModule(
106-
source,
107+
source as AnyDuringTs6Migration,
107108
modulePath,
108109
strings.classify(`${options.name}Component`),
109110
relativePath,

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{
44
"compilerOptions": {
55
"outDir": "./dist/packages/all",
6+
"rootDir": "./",
67
"experimentalDecorators": true,
78
"module": "esnext",
89
"moduleResolution": "bundler",

0 commit comments

Comments
 (0)