Skip to content

Commit c995ed5

Browse files
alan-agius4clydin
authored andcommitted
feat(@angular/cli): support TypeScript 4.6
Adds support for TypeScript 4.6.
1 parent 0b55bab commit c995ed5

File tree

16 files changed

+5128
-3180
lines changed

16 files changed

+5128
-3180
lines changed

package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,21 @@
6464
},
6565
"devDependencies": {
6666
"@ampproject/remapping": "1.1.1",
67-
"@angular/animations": "13.1.3",
67+
"@angular/animations": "13.3.0-rc.0",
6868
"@angular/cdk": "13.1.3",
69-
"@angular/common": "13.1.3",
70-
"@angular/compiler": "13.1.3",
71-
"@angular/compiler-cli": "13.1.3",
72-
"@angular/core": "13.1.3",
69+
"@angular/common": "13.3.0-rc.0",
70+
"@angular/compiler": "13.3.0-rc.0",
71+
"@angular/compiler-cli": "13.3.0-rc.0",
72+
"@angular/core": "13.3.0-rc.0",
7373
"@angular/dev-infra-private": "https://github.com./angular/dev-infra-private-builds.git#3a34722a82fb0e8cd3fa00dfc5476767a35e021a",
74-
"@angular/forms": "13.1.3",
75-
"@angular/localize": "13.1.3",
74+
"@angular/forms": "13.3.0-rc.0",
75+
"@angular/localize": "13.3.0-rc.0",
7676
"@angular/material": "13.1.3",
77-
"@angular/platform-browser": "13.1.3",
78-
"@angular/platform-browser-dynamic": "13.1.3",
79-
"@angular/platform-server": "13.1.3",
80-
"@angular/router": "13.1.3",
81-
"@angular/service-worker": "13.1.3",
77+
"@angular/platform-browser": "13.3.0-rc.0",
78+
"@angular/platform-browser-dynamic": "13.3.0-rc.0",
79+
"@angular/platform-server": "13.3.0-rc.0",
80+
"@angular/router": "13.3.0-rc.0",
81+
"@angular/service-worker": "13.3.0-rc.0",
8282
"@babel/core": "7.16.12",
8383
"@babel/generator": "7.16.8",
8484
"@babel/helper-annotate-as-pure": "7.16.7",
@@ -215,7 +215,7 @@
215215
"tree-kill": "1.2.2",
216216
"ts-node": "^10.0.0",
217217
"tslib": "2.3.1",
218-
"typescript": "4.5.5",
218+
"typescript": "4.6.2",
219219
"verdaccio": "5.5.1",
220220
"verdaccio-auth-memory": "^10.0.0",
221221
"webpack": "5.67.0",

packages/angular_devkit/architect/src/architect.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function _createJobHandlerFromBuilderInfo(
100100
value: {
101101
...output.value,
102102
...(target ? { target } : 0),
103-
} as json.JsonObject,
103+
} as unknown as json.JsonObject,
104104
};
105105
} else {
106106
return output;

packages/angular_devkit/architect/src/schedule-by-name.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export async function scheduleByName(
9494
...output,
9595
...(options.target ? { target: options.target } : 0),
9696
info,
97-
} as BuilderOutput),
97+
} as unknown as BuilderOutput),
9898
),
9999
shareReplay(),
100100
);

packages/angular_devkit/build_angular/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@
7575
"esbuild": "0.14.22"
7676
},
7777
"peerDependencies": {
78-
"@angular/compiler-cli": "^13.0.0",
79-
"@angular/localize": "^13.0.0",
80-
"@angular/service-worker": "^13.0.0",
78+
"@angular/compiler-cli": "^13.0.0 || ^13.3.0-rc.0",
79+
"@angular/localize": "^13.0.0 || ^13.3.0-rc.0",
80+
"@angular/service-worker": "^13.0.0 || ^13.3.0-rc.0",
8181
"karma": "^6.3.0",
8282
"ng-packagr": "^13.0.0",
8383
"protractor": "^7.0.0",
8484
"tailwindcss": "^2.0.0 || ^3.0.0",
85-
"typescript": ">=4.4.3 <4.6"
85+
"typescript": ">=4.4.3 <4.7"
8686
},
8787
"peerDependenciesMeta": {
8888
"@angular/localize": {

packages/angular_devkit/build_optimizer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"source-map": "0.7.3",
1414
"tslib": "2.3.1",
15-
"typescript": "4.5.5"
15+
"typescript": "4.6.2"
1616
},
1717
"peerDependencies": {
1818
"webpack": "^5.30.0"

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.5.2"
18+
"typescript": "~4.6.2"
1919
},
2020
"devDependencies": {
2121
"@types/node": "^12.11.1",

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.5.2"
18+
"typescript": "~4.6.2"
1919
},
2020
"devDependencies": {
2121
"@types/node": "^12.11.1",

packages/ngtools/webpack/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
"dependencies": {},
2424
"peerDependencies": {
2525
"@angular/compiler-cli": "^13.0.0",
26-
"typescript": ">=4.4.3 <4.6",
26+
"typescript": ">=4.4.3 <4.7",
2727
"webpack": "^5.30.0"
2828
},
2929
"devDependencies": {
3030
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
31-
"@angular/compiler": "13.1.3",
32-
"@angular/compiler-cli": "13.1.3",
33-
"typescript": "4.5.5",
31+
"@angular/compiler": "13.3.0-rc.0",
32+
"@angular/compiler-cli": "13.3.0-rc.0",
33+
"typescript": "4.6.2",
3434
"webpack": "5.67.0"
3535
}
3636
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ describe('@ngtools/webpack transformers', () => {
9393
let AppComponent = class AppComponent {
9494
constructor() { this.title = 'app'; }
9595
};
96-
AppComponent = (0, tslib_1.__decorate)([
96+
AppComponent = tslib_1.__decorate([
9797
(0, core_1.Component)({
9898
selector: 'app-root',
9999
template: require("./app.component.html?ngResource"),

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

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

3-
# files fetched on 2021-12-10 from
4-
# https://github.com./microsoft/TypeScript/releases/tag/v4.5.2
3+
# files fetched on 2022-03-11 from
4+
# https://github.com./microsoft/TypeScript/releases/tag/v4.6.2
5+
6+
# Commands to download:
7+
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v4.6.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/v4.6.2/lib/typescript.js -o packages/schematics/angular/third_party/github.com./Microsoft/TypeScript/lib/typescript.js
9+
510
licenses(["notice"]) # Apache 2.0
611

712
exports_files([

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

+29-16
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ and limitations under the License.
1414
***************************************************************************** */
1515

1616
declare namespace ts {
17-
const versionMajorMinor = "4.5";
17+
const versionMajorMinor = "4.6";
1818
/** The version of the TypeScript compiler release */
1919
const version: string;
2020
/**
@@ -572,7 +572,7 @@ declare namespace ts {
572572
}
573573
export interface JSDocContainer {
574574
}
575-
export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | EndOfFileToken;
575+
export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | EndOfFileToken;
576576
export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
577577
export type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
578578
export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
@@ -897,7 +897,7 @@ declare namespace ts {
897897
export interface TypePredicateNode extends TypeNode {
898898
readonly kind: SyntaxKind.TypePredicate;
899899
readonly parent: SignatureDeclaration | JSDocTypeExpression;
900-
readonly assertsModifier?: AssertsToken;
900+
readonly assertsModifier?: AssertsKeyword;
901901
readonly parameterName: Identifier | ThisTypeNode;
902902
readonly type?: TypeNode;
903903
}
@@ -968,7 +968,7 @@ declare namespace ts {
968968
}
969969
export interface MappedTypeNode extends TypeNode, Declaration {
970970
readonly kind: SyntaxKind.MappedType;
971-
readonly readonlyToken?: ReadonlyToken | PlusToken | MinusToken;
971+
readonly readonlyToken?: ReadonlyKeyword | PlusToken | MinusToken;
972972
readonly typeParameter: TypeParameterDeclaration;
973973
readonly nameType?: TypeNode;
974974
readonly questionToken?: QuestionToken | PlusToken | MinusToken;
@@ -1465,7 +1465,7 @@ declare namespace ts {
14651465
}
14661466
export interface ForOfStatement extends IterationStatement {
14671467
readonly kind: SyntaxKind.ForOfStatement;
1468-
readonly awaitModifier?: AwaitKeywordToken;
1468+
readonly awaitModifier?: AwaitKeyword;
14691469
readonly initializer: ForInitializer;
14701470
readonly expression: Expression;
14711471
}
@@ -1652,7 +1652,7 @@ declare namespace ts {
16521652
readonly kind: SyntaxKind.AssertEntry;
16531653
readonly parent: AssertClause;
16541654
readonly name: AssertionKey;
1655-
readonly value: StringLiteral;
1655+
readonly value: Expression;
16561656
}
16571657
export interface AssertClause extends Node {
16581658
readonly kind: SyntaxKind.AssertClause;
@@ -1702,7 +1702,7 @@ declare namespace ts {
17021702
readonly name: Identifier;
17031703
readonly isTypeOnly: boolean;
17041704
}
1705-
export interface ExportSpecifier extends NamedDeclaration {
1705+
export interface ExportSpecifier extends NamedDeclaration, JSDocContainer {
17061706
readonly kind: SyntaxKind.ExportSpecifier;
17071707
readonly parent: NamedExports;
17081708
readonly isTypeOnly: boolean;
@@ -1720,19 +1720,23 @@ declare namespace ts {
17201720
readonly parent: ImportClause & {
17211721
readonly isTypeOnly: true;
17221722
};
1723-
} | ImportSpecifier & {
1723+
} | ImportSpecifier & ({
1724+
readonly isTypeOnly: true;
1725+
} | {
17241726
readonly parent: NamedImports & {
17251727
readonly parent: ImportClause & {
17261728
readonly isTypeOnly: true;
17271729
};
17281730
};
1729-
} | ExportSpecifier & {
1731+
}) | ExportSpecifier & ({
1732+
readonly isTypeOnly: true;
1733+
} | {
17301734
readonly parent: NamedExports & {
17311735
readonly parent: ExportDeclaration & {
17321736
readonly isTypeOnly: true;
17331737
};
17341738
};
1735-
};
1739+
});
17361740
/**
17371741
* This is either an `export =` or an `export default` declaration.
17381742
* Unless `isExportEquals` is set, this node was parsed as an `export default`.
@@ -3078,6 +3082,7 @@ declare namespace ts {
30783082
ES2019 = 6,
30793083
ES2020 = 7,
30803084
ES2021 = 8,
3085+
ES2022 = 9,
30813086
ESNext = 99,
30823087
JSON = 100,
30833088
Latest = 99
@@ -3343,7 +3348,7 @@ declare namespace ts {
33433348
createTrue(): TrueLiteral;
33443349
createFalse(): FalseLiteral;
33453350
createModifier<T extends ModifierSyntaxKind>(kind: T): ModifierToken<T>;
3346-
createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[];
3351+
createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[] | undefined;
33473352
createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName;
33483353
updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName;
33493354
createComputedPropertyName(expression: Expression): ComputedPropertyName;
@@ -3575,8 +3580,8 @@ declare namespace ts {
35753580
updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
35763581
createAssertClause(elements: NodeArray<AssertEntry>, multiLine?: boolean): AssertClause;
35773582
updateAssertClause(node: AssertClause, elements: NodeArray<AssertEntry>, multiLine?: boolean): AssertClause;
3578-
createAssertEntry(name: AssertionKey, value: StringLiteral): AssertEntry;
3579-
updateAssertEntry(node: AssertEntry, name: AssertionKey, value: StringLiteral): AssertEntry;
3583+
createAssertEntry(name: AssertionKey, value: Expression): AssertEntry;
3584+
updateAssertEntry(node: AssertEntry, name: AssertionKey, value: Expression): AssertEntry;
35803585
createNamespaceImport(name: Identifier): NamespaceImport;
35813586
updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport;
35823587
createNamespaceExport(name: Identifier): NamespaceExport;
@@ -5351,7 +5356,11 @@ declare namespace ts {
53515356
traceResolution?: boolean;
53525357
[option: string]: CompilerOptionsValue | undefined;
53535358
}
5354-
type ReportEmitErrorSummary = (errorCount: number) => void;
5359+
type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void;
5360+
interface ReportFileInError {
5361+
fileName: string;
5362+
line: number;
5363+
}
53555364
interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
53565365
createDirectory?(path: string): void;
53575366
/**
@@ -5559,6 +5568,7 @@ declare namespace ts {
55595568
isTypeParameter(): this is TypeParameter;
55605569
isClassOrInterface(): this is InterfaceType;
55615570
isClass(): this is InterfaceType;
5571+
isIndexType(): this is IndexType;
55625572
}
55635573
interface TypeReference {
55645574
typeArguments?: readonly Type[];
@@ -5567,6 +5577,7 @@ declare namespace ts {
55675577
getDeclaration(): SignatureDeclaration;
55685578
getTypeParameters(): TypeParameter[] | undefined;
55695579
getParameters(): Symbol[];
5580+
getTypeParameterAtPosition(pos: number): Type;
55705581
getReturnType(): Type;
55715582
getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[];
55725583
getJsDocTags(): JSDocTagInfo[];
@@ -5753,8 +5764,9 @@ declare namespace ts {
57535764
* @param position A zero-based index of the character where you want the entries
57545765
* @param options An object describing how the request was triggered and what kinds
57555766
* of code actions can be returned with the completions.
5767+
* @param formattingSettings settings needed for calling formatting functions.
57565768
*/
5757-
getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): WithMetadata<CompletionInfo> | undefined;
5769+
getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined, formattingSettings?: FormatCodeSettings): WithMetadata<CompletionInfo> | undefined;
57585770
/**
57595771
* Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`.
57605772
*
@@ -6586,6 +6598,7 @@ declare namespace ts {
65866598
externalModuleName = "external module name",
65876599
/**
65886600
* <JsxTagName attribute1 attribute2={0} />
6601+
* @deprecated
65896602
*/
65906603
jsxAttribute = "JSX attribute",
65916604
/** String literal */
@@ -6855,7 +6868,7 @@ declare namespace ts {
68556868
/** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */
68566869
const createModifier: <T extends ModifierSyntaxKind>(kind: T) => ModifierToken<T>;
68576870
/** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */
6858-
const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[];
6871+
const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[] | undefined;
68596872
/** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */
68606873
const createQualifiedName: (left: EntityName, right: string | Identifier) => QualifiedName;
68616874
/** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */

0 commit comments

Comments
 (0)