Skip to content

Commit

Permalink
build: update to TypeScript 5 and drop support for TypeScript 4.8
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
crisbeto authored and angular-robot[bot] committed Mar 17, 2023
1 parent 68fda41 commit 5a171dd
Show file tree
Hide file tree
Showing 11 changed files with 2,747 additions and 1,750 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
"magic-string": "0.30.0",
"mini-css-extract-plugin": "2.7.3",
"minimatch": "~7.4.0",
"ng-packagr": "16.0.0-next.0",
"ng-packagr": "16.0.0-next.1",
"node-fetch": "^2.2.0",
"npm": "^8.11.0",
"npm-package-arg": "10.1.0",
Expand Down Expand Up @@ -209,7 +209,7 @@
"tree-kill": "1.2.2",
"ts-node": "^10.9.1",
"tslib": "2.5.0",
"typescript": "5.0.0-beta",
"typescript": "~5.0.2",
"verdaccio": "5.22.1",
"verdaccio-auth-memory": "^10.0.0",
"webpack": "5.76.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
"@angular/platform-server": "^16.0.0-next.0",
"@angular/service-worker": "^16.0.0-next.0",
"karma": "^6.3.0",
"ng-packagr": "^16.0.0-next.0",
"ng-packagr": "^16.0.0-next.1",
"protractor": "^7.0.0",
"tailwindcss": "^2.0.0 || ^3.0.0",
"typescript": ">=4.8.2 <5.1"
"typescript": ">=4.9.3 <5.1"
},
"peerDependenciesMeta": {
"@angular/localize": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@angular-devkit/core": "^<%= coreVersion %>",
"@angular-devkit/schematics": "^<%= schematicsVersion %>",
"typescript": "~4.9.3"
"typescript": "~5.0.2"
},
"devDependencies": {
"@types/node": "^14.15.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@angular-devkit/core": "^<%= coreVersion %>",
"@angular-devkit/schematics": "^<%= schematicsVersion %>",
"typescript": "~4.9.3"
"typescript": "~5.0.2"
},
"devDependencies": {
"@types/node": "^14.15.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/ngtools/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
"dependencies": {},
"peerDependencies": {
"@angular/compiler-cli": "^16.0.0-next.0",
"typescript": ">=4.8.2 <5.1",
"typescript": ">=4.9.3 <5.1",
"webpack": "^5.54.0"
},
"devDependencies": {
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"@angular/compiler": "15.2.2",
"@angular/compiler-cli": "15.2.2",
"typescript": "5.0.0-beta",
"typescript": "~5.0.2",
"webpack": "5.76.2"
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
load("//tools:defaults.bzl", "ts_library")

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

# Commands to download:
# 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
# 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
# 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
# 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

licenses(["notice"]) # Apache 2.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2335,6 +2335,7 @@ declare namespace ts {
}
interface TypeChecker {
getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type;
getTypeOfSymbol(symbol: Symbol): Type;
getDeclaredTypeOfSymbol(symbol: Symbol): Type;
getPropertiesOfType(type: Type): Symbol[];
getPropertyOfType(type: Type, propertyName: string): Symbol | undefined;
Expand Down Expand Up @@ -2425,6 +2426,21 @@ declare namespace ts {
getApparentType(type: Type): Type;
getBaseConstraintOfType(type: Type): Type | undefined;
getDefaultFromTypeParameter(type: Type): Type | undefined;
/**
* True if this type is the `Array` or `ReadonlyArray` type from lib.d.ts.
* This function will _not_ return true if passed a type which
* extends `Array` (for example, the TypeScript AST's `NodeArray` type).
*/
isArrayType(type: Type): boolean;
/**
* True if this type is a tuple type. This function will _not_ return true if
* passed a type which extends from a tuple.
*/
isTupleType(type: Type): boolean;
/**
* True if this type is assignable to `ReadonlyArray<any>`.
*/
isArrayLikeType(type: Type): boolean;
getTypePredicateOfSignature(signature: Signature): TypePredicate | undefined;
/**
* Depending on the operation performed, it may be appropriate to throw away the checker
Expand Down Expand Up @@ -2684,7 +2700,8 @@ declare namespace ts {
TemplateLiteral = 134217728,
StringMapping = 268435456,
Literal = 2944,
Unit = 109440,
Unit = 109472,
Freshable = 2976,
StringOrNumberLiteral = 384,
PossiblyFalsy = 117724,
StringLike = 402653316,
Expand Down Expand Up @@ -2736,10 +2753,12 @@ declare namespace ts {
isClass(): this is InterfaceType;
isIndexType(): this is IndexType;
}
interface LiteralType extends Type {
interface FreshableType extends Type {
freshType: FreshableType;
regularType: FreshableType;
}
interface LiteralType extends FreshableType {
value: string | number | PseudoBigInt;
freshType: LiteralType;
regularType: LiteralType;
}
interface UniqueESSymbolType extends Type {
symbol: Symbol;
Expand All @@ -2754,7 +2773,7 @@ declare namespace ts {
interface BigIntLiteralType extends LiteralType {
value: PseudoBigInt;
}
interface EnumType extends Type {
interface EnumType extends FreshableType {
}
enum ObjectFlags {
None = 0,
Expand Down Expand Up @@ -2997,6 +3016,12 @@ declare namespace ts {
}
enum ModuleResolutionKind {
Classic = 1,
/**
* @deprecated
* `NodeJs` was renamed to `Node10` to better reflect the version of Node that it targets.
* Use the new name or consider switching to a modern module resolution target.
*/
NodeJs = 2,
Node10 = 2,
Node16 = 3,
NodeNext = 99,
Expand Down Expand Up @@ -4286,7 +4311,6 @@ declare namespace ts {
negative: boolean;
base10Value: string;
}
function getNodeMajorVersion(): number | undefined;
enum FileWatcherEventKind {
Created = 0,
Changed = 1,
Expand Down Expand Up @@ -4698,7 +4722,6 @@ declare namespace ts {
parent: ConstructorDeclaration;
name: Identifier;
};
function emitModuleKindIsNonNodeESM(moduleKind: ModuleKind): boolean;
/** @deprecated */
function createUnparsedSourceFile(text: string): UnparsedSource;
/** @deprecated */
Expand Down Expand Up @@ -5153,7 +5176,6 @@ declare namespace ts {
function bundlerModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
function shouldAllowImportingTsExtension(compilerOptions: CompilerOptions, fromFileName?: string): boolean | "" | undefined;
interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, NonRelativeNameResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache {
}
interface ModeAwareCache<T> {
Expand Down Expand Up @@ -6154,6 +6176,13 @@ declare namespace ts {
*/
triggerCharacter?: CompletionsTriggerCharacter;
triggerKind?: CompletionTriggerKind;
/**
* Include a `symbol` property on each completion entry object.
* Symbols reference cyclic data structures and sometimes an entire TypeChecker instance,
* so use caution when serializing or retaining completion entries retrieved with this option.
* @default false
*/
includeSymbol?: boolean;
/** @deprecated Use includeCompletionsForModuleExports */
includeExternalModuleExports?: boolean;
/** @deprecated Use includeCompletionsWithInsertText */
Expand Down Expand Up @@ -6674,6 +6703,7 @@ declare namespace ts {
* in the case of InternalSymbolName.ExportEquals and InternalSymbolName.Default.
*/
exportName: string;
exportMapKey?: string;
moduleSpecifier?: string;
/** The file name declaring the export's module symbol, if it was an external module */
fileName?: string;
Expand All @@ -6683,7 +6713,6 @@ declare namespace ts {
isPackageJsonImport?: true;
}
interface CompletionEntryDataUnresolved extends CompletionEntryDataAutoImport {
/** The key in the `ExportMapCache` where the completion entry's `SymbolExportInfo[]` is found */
exportMapKey: string;
}
interface CompletionEntryDataResolved extends CompletionEntryDataAutoImport {
Expand Down Expand Up @@ -6711,6 +6740,12 @@ declare namespace ts {
isFromUncheckedFile?: true;
isPackageJsonImport?: true;
isImportStatementCompletion?: true;
/**
* For API purposes.
* Included for non-string completions only when `includeSymbol: true` option is passed to `getCompletionsAtPosition`.
* @example Get declaration of completion: `symbol.valueDeclaration`
*/
symbol?: Symbol;
/**
* A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`,
* that allows TS Server to look up the symbol represented by the completion item, disambiguating
Expand Down
Loading

0 comments on commit 5a171dd

Please sign in to comment.