Skip to content

Commit f3070f2

Browse files
crisbetoangular-robot[bot]
authored andcommitted
build: update to TypeScript 5.0
Updates the repo to TypeScript 5.0.0-beta. The remaining usages in tests and schematics will be updated once the 5.0 final version is released.
1 parent eb8387b commit f3070f2

File tree

13 files changed

+169387
-176077
lines changed

13 files changed

+169387
-176077
lines changed

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,22 @@
6464
},
6565
"devDependencies": {
6666
"@ampproject/remapping": "2.2.0",
67-
"@angular/animations": "16.0.0-next.0",
67+
"@angular/animations": "16.0.0-next.1",
6868
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#704eca8e2057602b57618ffcb1d7495a27598113",
69-
"@angular/cdk": "15.2.0",
70-
"@angular/common": "16.0.0-next.0",
71-
"@angular/compiler": "16.0.0-next.0",
72-
"@angular/compiler-cli": "16.0.0-next.0",
73-
"@angular/core": "16.0.0-next.0",
74-
"@angular/forms": "16.0.0-next.0",
75-
"@angular/localize": "16.0.0-next.0",
76-
"@angular/material": "15.2.0",
69+
"@angular/cdk": "15.2.1",
70+
"@angular/common": "16.0.0-next.1",
71+
"@angular/compiler": "16.0.0-next.1",
72+
"@angular/compiler-cli": "16.0.0-next.1",
73+
"@angular/core": "16.0.0-next.1",
74+
"@angular/forms": "16.0.0-next.1",
75+
"@angular/localize": "16.0.0-next.1",
76+
"@angular/material": "15.2.1",
7777
"@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#61a1b6d9759eb39db0522418f09d237a8688026e",
78-
"@angular/platform-browser": "16.0.0-next.0",
79-
"@angular/platform-browser-dynamic": "16.0.0-next.0",
80-
"@angular/platform-server": "16.0.0-next.0",
81-
"@angular/router": "16.0.0-next.0",
82-
"@angular/service-worker": "16.0.0-next.0",
78+
"@angular/platform-browser": "16.0.0-next.1",
79+
"@angular/platform-browser-dynamic": "16.0.0-next.1",
80+
"@angular/platform-server": "16.0.0-next.1",
81+
"@angular/router": "16.0.0-next.1",
82+
"@angular/service-worker": "16.0.0-next.1",
8383
"@babel/core": "7.21.0",
8484
"@babel/generator": "7.21.1",
8585
"@babel/helper-annotate-as-pure": "7.18.6",
@@ -210,7 +210,7 @@
210210
"tree-kill": "1.2.2",
211211
"ts-node": "^10.0.0",
212212
"tslib": "2.5.0",
213-
"typescript": "4.9.5",
213+
"typescript": "5.0.0-beta",
214214
"verdaccio": "5.21.2",
215215
"verdaccio-auth-memory": "^10.0.0",
216216
"webpack": "5.75.0",

packages/angular_devkit/build_angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"ng-packagr": "^16.0.0-next.0",
8080
"protractor": "^7.0.0",
8181
"tailwindcss": "^2.0.0 || ^3.0.0",
82-
"typescript": ">=4.8.2 <5.0"
82+
"typescript": ">=4.8.2 <5.1"
8383
},
8484
"peerDependenciesMeta": {
8585
"@angular/localize": {

packages/angular_devkit/build_angular/src/builders/browser-esbuild/angular/jit-resource-transformer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function visitDecorator(
107107
ts.isObjectLiteralElementLike(node)
108108
? visitComponentMetadata(nodeFactory, node, styleReplacements, resourceImportDeclarations)
109109
: node,
110-
);
110+
) as ts.NodeArray<ts.ObjectLiteralElementLike>;
111111

112112
// replace properties with updated properties
113113
if (styleReplacements.length > 0) {
@@ -185,7 +185,7 @@ function visitComponentMetadata(
185185
generateJitInlineUri(contents, 'style'),
186186
resourceImportDeclarations,
187187
);
188-
});
188+
}) as ts.NodeArray<ts.Expression>;
189189

190190
// Inline styles should be placed first
191191
styleReplacements.unshift(...inlineStyles);
@@ -212,7 +212,7 @@ function visitComponentMetadata(
212212
generateJitFileUri(url, 'style'),
213213
resourceImportDeclarations,
214214
);
215-
});
215+
}) as ts.NodeArray<ts.Expression>;
216216

217217
// External styles are applied after any inline styles
218218
styleReplacements.push(...externalStyles);

packages/angular_devkit/core/src/workspace/core_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ describe('readWorkspace', () => {
216216
},
217217
};
218218

219-
_test_addWorkspaceFile('wrong.format', 99);
219+
_test_addWorkspaceFile('wrong.format', 99 as WorkspaceFormat);
220220
try {
221221
await readWorkspace(requestedPath, host, WorkspaceFormat.JSON);
222222
} finally {

packages/ngtools/webpack/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
"dependencies": {},
2424
"peerDependencies": {
2525
"@angular/compiler-cli": "^16.0.0-next.0",
26-
"typescript": ">=4.8.2 <5.0",
26+
"typescript": ">=4.8.2 <5.1",
2727
"webpack": "^5.54.0"
2828
},
2929
"devDependencies": {
3030
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
3131
"@angular/compiler": "15.2.0",
3232
"@angular/compiler-cli": "15.2.0",
33-
"typescript": "4.9.5",
33+
"typescript": "5.0.0-beta",
3434
"webpack": "5.75.0"
3535
}
3636
}

packages/ngtools/webpack/src/transformers/elide_imports_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ describe('@ngtools/webpack transformers', () => {
819819
return ts.visitEachChild(node, (child) => visit(child), context);
820820
};
821821

822-
return (node) => ts.visitNode(node, visit);
822+
return (node) => ts.visitNode(node, visit) as ts.SourceFile;
823823
};
824824

825825
it('should not elide import when ShorthandPropertyAssignment is transformed to PropertyAssignment', () => {

packages/ngtools/webpack/src/transformers/replace_resources.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function replaceResources(
6060
return sourceFile;
6161
}
6262

63-
const updatedSourceFile = ts.visitNode(sourceFile, visitNode);
63+
const updatedSourceFile = ts.visitNode(sourceFile, visitNode) as ts.SourceFile;
6464
if (resourceImportDeclarations.length) {
6565
// Add resource imports
6666
return context.factory.updateSourceFile(
@@ -118,7 +118,7 @@ function visitDecorator(
118118
inlineStyleFileExtension,
119119
)
120120
: node,
121-
);
121+
) as ts.NodeArray<ts.ObjectLiteralElementLike>;
122122

123123
// replace properties with updated properties
124124
if (styleReplacements.length > 0) {
@@ -214,7 +214,7 @@ function visitComponentMetadata(
214214
}
215215

216216
return createResourceImport(nodeFactory, url, resourceImportDeclarations, moduleKind);
217-
});
217+
}) as ts.NodeArray<ts.Expression>;
218218

219219
// Styles should be placed first
220220
if (isInlineStyle) {

packages/ngtools/webpack/src/transformers/spec_helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function createTypescriptContext(
2525
noEmitOnError: useLibs,
2626
allowJs: true,
2727
newLine: ts.NewLineKind.LineFeed,
28-
moduleResolution: ts.ModuleResolutionKind.NodeJs,
28+
moduleResolution: ts.ModuleResolutionKind.Node10,
2929
module: ts.ModuleKind.ES2020,
3030
target: ts.ScriptTarget.ES2020,
3131
skipLibCheck: true,

packages/schematics/angular/no_typescript_runtime_dep_spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8+
89
const fs = require('fs');
910
const path = require('path');
1011

packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
load("//tools:defaults.bzl", "ts_library")
22

3-
# files fetched on 2022-09-01 from
4-
# https://github.com/microsoft/TypeScript/releases/tag/v4.9.3
3+
# files fetched on 2023-03-02 from
4+
# https://github.com/microsoft/TypeScript/releases/tag/v5.0-beta
55

66
# Commands to download:
7-
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v4.9.3/lib/typescript.d.ts -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts
8-
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v4.9.3/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js
7+
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.0-beta/lib/typescript.d.ts -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts
8+
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.0-beta/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js
99

1010
licenses(["notice"]) # Apache 2.0
1111

0 commit comments

Comments
 (0)