Skip to content

Commit 5a171dd

Browse files
crisbetoangular-robot[bot]
authored andcommitted
build: update to TypeScript 5 and drop support for TypeScript 4.8
Bumps up the dev dependency to TS 5 and narrows the required version to exclude 4.8. BREAKING CHANGE: * TypeScript 4.8 is no longer supported.
1 parent 68fda41 commit 5a171dd

File tree

11 files changed

+2747
-1750
lines changed

11 files changed

+2747
-1750
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
"magic-string": "0.30.0",
174174
"mini-css-extract-plugin": "2.7.3",
175175
"minimatch": "~7.4.0",
176-
"ng-packagr": "16.0.0-next.0",
176+
"ng-packagr": "16.0.0-next.1",
177177
"node-fetch": "^2.2.0",
178178
"npm": "^8.11.0",
179179
"npm-package-arg": "10.1.0",
@@ -209,7 +209,7 @@
209209
"tree-kill": "1.2.2",
210210
"ts-node": "^10.9.1",
211211
"tslib": "2.5.0",
212-
"typescript": "5.0.0-beta",
212+
"typescript": "~5.0.2",
213213
"verdaccio": "5.22.1",
214214
"verdaccio-auth-memory": "^10.0.0",
215215
"webpack": "5.76.2",

packages/angular_devkit/build_angular/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@
7676
"@angular/platform-server": "^16.0.0-next.0",
7777
"@angular/service-worker": "^16.0.0-next.0",
7878
"karma": "^6.3.0",
79-
"ng-packagr": "^16.0.0-next.0",
79+
"ng-packagr": "^16.0.0-next.1",
8080
"protractor": "^7.0.0",
8181
"tailwindcss": "^2.0.0 || ^3.0.0",
82-
"typescript": ">=4.8.2 <5.1"
82+
"typescript": ">=4.9.3 <5.1"
8383
},
8484
"peerDependenciesMeta": {
8585
"@angular/localize": {

packages/angular_devkit/schematics_cli/blank/project-files/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dependencies": {
1616
"@angular-devkit/core": "^<%= coreVersion %>",
1717
"@angular-devkit/schematics": "^<%= schematicsVersion %>",
18-
"typescript": "~4.9.3"
18+
"typescript": "~5.0.2"
1919
},
2020
"devDependencies": {
2121
"@types/node": "^14.15.0",

packages/angular_devkit/schematics_cli/schematic/files/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dependencies": {
1616
"@angular-devkit/core": "^<%= coreVersion %>",
1717
"@angular-devkit/schematics": "^<%= schematicsVersion %>",
18-
"typescript": "~4.9.3"
18+
"typescript": "~5.0.2"
1919
},
2020
"devDependencies": {
2121
"@types/node": "^14.15.0",

packages/ngtools/webpack/package.json

+2-2
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.1",
26+
"typescript": ">=4.9.3 <5.1",
2727
"webpack": "^5.54.0"
2828
},
2929
"devDependencies": {
3030
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
3131
"@angular/compiler": "15.2.2",
3232
"@angular/compiler-cli": "15.2.2",
33-
"typescript": "5.0.0-beta",
33+
"typescript": "~5.0.2",
3434
"webpack": "5.76.2"
3535
}
3636
}

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

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

3-
# files fetched on 2023-03-02 from
4-
# https://github.com/microsoft/TypeScript/releases/tag/v5.0-beta
3+
# files fetched on 2023-03-17 from
4+
# https://github.com/microsoft/TypeScript/releases/tag/v5.0.2
55

66
# Commands to download:
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
7+
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.0.2/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.2/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js
99

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

packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts

+44-9
Original file line numberDiff line numberDiff line change
@@ -2335,6 +2335,7 @@ declare namespace ts {
23352335
}
23362336
interface TypeChecker {
23372337
getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type;
2338+
getTypeOfSymbol(symbol: Symbol): Type;
23382339
getDeclaredTypeOfSymbol(symbol: Symbol): Type;
23392340
getPropertiesOfType(type: Type): Symbol[];
23402341
getPropertyOfType(type: Type, propertyName: string): Symbol | undefined;
@@ -2425,6 +2426,21 @@ declare namespace ts {
24252426
getApparentType(type: Type): Type;
24262427
getBaseConstraintOfType(type: Type): Type | undefined;
24272428
getDefaultFromTypeParameter(type: Type): Type | undefined;
2429+
/**
2430+
* True if this type is the `Array` or `ReadonlyArray` type from lib.d.ts.
2431+
* This function will _not_ return true if passed a type which
2432+
* extends `Array` (for example, the TypeScript AST's `NodeArray` type).
2433+
*/
2434+
isArrayType(type: Type): boolean;
2435+
/**
2436+
* True if this type is a tuple type. This function will _not_ return true if
2437+
* passed a type which extends from a tuple.
2438+
*/
2439+
isTupleType(type: Type): boolean;
2440+
/**
2441+
* True if this type is assignable to `ReadonlyArray<any>`.
2442+
*/
2443+
isArrayLikeType(type: Type): boolean;
24282444
getTypePredicateOfSignature(signature: Signature): TypePredicate | undefined;
24292445
/**
24302446
* Depending on the operation performed, it may be appropriate to throw away the checker
@@ -2684,7 +2700,8 @@ declare namespace ts {
26842700
TemplateLiteral = 134217728,
26852701
StringMapping = 268435456,
26862702
Literal = 2944,
2687-
Unit = 109440,
2703+
Unit = 109472,
2704+
Freshable = 2976,
26882705
StringOrNumberLiteral = 384,
26892706
PossiblyFalsy = 117724,
26902707
StringLike = 402653316,
@@ -2736,10 +2753,12 @@ declare namespace ts {
27362753
isClass(): this is InterfaceType;
27372754
isIndexType(): this is IndexType;
27382755
}
2739-
interface LiteralType extends Type {
2756+
interface FreshableType extends Type {
2757+
freshType: FreshableType;
2758+
regularType: FreshableType;
2759+
}
2760+
interface LiteralType extends FreshableType {
27402761
value: string | number | PseudoBigInt;
2741-
freshType: LiteralType;
2742-
regularType: LiteralType;
27432762
}
27442763
interface UniqueESSymbolType extends Type {
27452764
symbol: Symbol;
@@ -2754,7 +2773,7 @@ declare namespace ts {
27542773
interface BigIntLiteralType extends LiteralType {
27552774
value: PseudoBigInt;
27562775
}
2757-
interface EnumType extends Type {
2776+
interface EnumType extends FreshableType {
27582777
}
27592778
enum ObjectFlags {
27602779
None = 0,
@@ -2997,6 +3016,12 @@ declare namespace ts {
29973016
}
29983017
enum ModuleResolutionKind {
29993018
Classic = 1,
3019+
/**
3020+
* @deprecated
3021+
* `NodeJs` was renamed to `Node10` to better reflect the version of Node that it targets.
3022+
* Use the new name or consider switching to a modern module resolution target.
3023+
*/
3024+
NodeJs = 2,
30003025
Node10 = 2,
30013026
Node16 = 3,
30023027
NodeNext = 99,
@@ -4286,7 +4311,6 @@ declare namespace ts {
42864311
negative: boolean;
42874312
base10Value: string;
42884313
}
4289-
function getNodeMajorVersion(): number | undefined;
42904314
enum FileWatcherEventKind {
42914315
Created = 0,
42924316
Changed = 1,
@@ -4698,7 +4722,6 @@ declare namespace ts {
46984722
parent: ConstructorDeclaration;
46994723
name: Identifier;
47004724
};
4701-
function emitModuleKindIsNonNodeESM(moduleKind: ModuleKind): boolean;
47024725
/** @deprecated */
47034726
function createUnparsedSourceFile(text: string): UnparsedSource;
47044727
/** @deprecated */
@@ -5153,7 +5176,6 @@ declare namespace ts {
51535176
function bundlerModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
51545177
function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
51555178
function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
5156-
function shouldAllowImportingTsExtension(compilerOptions: CompilerOptions, fromFileName?: string): boolean | "" | undefined;
51575179
interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, NonRelativeNameResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache {
51585180
}
51595181
interface ModeAwareCache<T> {
@@ -6154,6 +6176,13 @@ declare namespace ts {
61546176
*/
61556177
triggerCharacter?: CompletionsTriggerCharacter;
61566178
triggerKind?: CompletionTriggerKind;
6179+
/**
6180+
* Include a `symbol` property on each completion entry object.
6181+
* Symbols reference cyclic data structures and sometimes an entire TypeChecker instance,
6182+
* so use caution when serializing or retaining completion entries retrieved with this option.
6183+
* @default false
6184+
*/
6185+
includeSymbol?: boolean;
61576186
/** @deprecated Use includeCompletionsForModuleExports */
61586187
includeExternalModuleExports?: boolean;
61596188
/** @deprecated Use includeCompletionsWithInsertText */
@@ -6674,6 +6703,7 @@ declare namespace ts {
66746703
* in the case of InternalSymbolName.ExportEquals and InternalSymbolName.Default.
66756704
*/
66766705
exportName: string;
6706+
exportMapKey?: string;
66776707
moduleSpecifier?: string;
66786708
/** The file name declaring the export's module symbol, if it was an external module */
66796709
fileName?: string;
@@ -6683,7 +6713,6 @@ declare namespace ts {
66836713
isPackageJsonImport?: true;
66846714
}
66856715
interface CompletionEntryDataUnresolved extends CompletionEntryDataAutoImport {
6686-
/** The key in the `ExportMapCache` where the completion entry's `SymbolExportInfo[]` is found */
66876716
exportMapKey: string;
66886717
}
66896718
interface CompletionEntryDataResolved extends CompletionEntryDataAutoImport {
@@ -6711,6 +6740,12 @@ declare namespace ts {
67116740
isFromUncheckedFile?: true;
67126741
isPackageJsonImport?: true;
67136742
isImportStatementCompletion?: true;
6743+
/**
6744+
* For API purposes.
6745+
* Included for non-string completions only when `includeSymbol: true` option is passed to `getCompletionsAtPosition`.
6746+
* @example Get declaration of completion: `symbol.valueDeclaration`
6747+
*/
6748+
symbol?: Symbol;
67146749
/**
67156750
* A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`,
67166751
* that allows TS Server to look up the symbol represented by the completion item, disambiguating

0 commit comments

Comments
 (0)