Skip to content

Commit

Permalink
build: update to TypeScript 5.2
Browse files Browse the repository at this point in the history
Updates the repo to TypeScript 5.2.
  • Loading branch information
crisbeto committed Aug 29, 2023
1 parent e36cbd0 commit 3ab25ce
Show file tree
Hide file tree
Showing 13 changed files with 12,023 additions and 9,524 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -211,7 +211,7 @@
"tree-kill": "1.2.2",
"ts-node": "^10.9.1",
"tslib": "2.6.2",
"typescript": "5.1.6",
"typescript": "5.2.2",
"verdaccio": "5.26.1",
"verdaccio-auth-memory": "^10.0.0",
"vite": "4.4.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular_devkit/build_angular/package.json
Expand Up @@ -87,7 +87,7 @@
"ng-packagr": "^16.0.0 || ^16.2.0-next.0",
"protractor": "^7.0.0",
"tailwindcss": "^2.0.0 || ^3.0.0",
"typescript": ">=4.9.3 <5.2"
"typescript": ">=4.9.3 <5.3"
},
"peerDependenciesMeta": {
"@angular/localize": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ngtools/webpack/package.json
Expand Up @@ -30,7 +30,7 @@
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"@angular/compiler": "17.0.0-next.1",
"@angular/compiler-cli": "17.0.0-next.1",
"typescript": "5.1.6",
"typescript": "5.2.2",
"webpack": "5.88.2"
}
}
15 changes: 10 additions & 5 deletions packages/ngtools/webpack/src/transformers/elide_imports_spec.ts
Expand Up @@ -366,8 +366,9 @@ describe('@ngtools/webpack transformers', () => {
import { __decorate } from "tslib";
import { Decorator } from './decorator';
export let Foo = class Foo { constructor(param) { } };
let Foo = class Foo { constructor(param) { } };
Foo = __decorate([ Decorator() ], Foo);
export { Foo };
`;

const { program, compilerHost } = createTypescriptContext(
Expand Down Expand Up @@ -404,8 +405,9 @@ describe('@ngtools/webpack transformers', () => {
import { __decorate } from "tslib";
import { Decorator } from './decorator';
export let Foo = class Foo { constructor(param) { } };
let Foo = class Foo { constructor(param) { } };
Foo = __decorate([ Decorator() ], Foo);
export { Foo };
`;

const { program, compilerHost } = createTypescriptContext(
Expand Down Expand Up @@ -455,8 +457,9 @@ describe('@ngtools/webpack transformers', () => {
const test = createElement("p", null, "123");
export let Foo = class Foo { constructor(param) { } };
let Foo = class Foo { constructor(param) { } };
Foo = __decorate([ Decorator() ], Foo);
export { Foo };
`;

const { program, compilerHost } = createTypescriptContext(
Expand Down Expand Up @@ -494,8 +497,9 @@ describe('@ngtools/webpack transformers', () => {
import { __decorate } from "tslib";
import { Decorator } from './decorator';
export let Foo = class Foo { ngOnChanges(changes) { } };
let Foo = class Foo { ngOnChanges(changes) { } };
Foo = __decorate([ Decorator() ], Foo);
export { Foo };
`;

const { program, compilerHost } = createTypescriptContext(
Expand Down Expand Up @@ -533,8 +537,9 @@ describe('@ngtools/webpack transformers', () => {
import { Decorator } from './decorator';
import { Service } from './service';
export let Foo = class Foo { constructor(param) { } };
let Foo = class Foo { constructor(param) { } };
Foo = __decorate([ Decorator(), __metadata("design:paramtypes", [Service]) ], Foo);
export { Foo };
`;

const { program, compilerHost } = createTypescriptContext(
Expand Down
30 changes: 20 additions & 10 deletions packages/ngtools/webpack/src/transformers/replace_resources_spec.ts
Expand Up @@ -50,7 +50,7 @@ describe('@ngtools/webpack transformers', () => {
import __NG_CLI_RESOURCE__2 from "./app.component.2.css?ngResource";
import { Component } from '@angular/core';
export let AppComponent = class AppComponent {
let AppComponent = class AppComponent {
constructor() {
this.title = 'app';
}
Expand All @@ -62,6 +62,7 @@ describe('@ngtools/webpack transformers', () => {
styles: [__NG_CLI_RESOURCE__1, __NG_CLI_RESOURCE__2]
})
], AppComponent);
export { AppComponent };
`;

const result = transform(input);
Expand Down Expand Up @@ -89,9 +90,10 @@ describe('@ngtools/webpack transformers', () => {
const tslib_1 = require("tslib");
const core_1 = require("@angular/core");
let AppComponent = exports.AppComponent = class AppComponent {
let AppComponent = class AppComponent {
constructor() { this.title = 'app'; }
};
exports.AppComponent = AppComponent;
exports.AppComponent = AppComponent = tslib_1.__decorate([
(0, core_1.Component)({
selector: 'app-root',
Expand Down Expand Up @@ -119,7 +121,7 @@ describe('@ngtools/webpack transformers', () => {
import { __decorate } from "tslib";
import __NG_CLI_RESOURCE__0 from "./app.component.svg?ngResource";
import { Component } from '@angular/core';
export let AppComponent = class AppComponent {
let AppComponent = class AppComponent {
constructor() {
this.title = 'app';
}
Expand All @@ -130,6 +132,7 @@ describe('@ngtools/webpack transformers', () => {
template: __NG_CLI_RESOURCE__0
})
], AppComponent);
export { AppComponent };
`;

const result = transform(input);
Expand All @@ -156,7 +159,7 @@ describe('@ngtools/webpack transformers', () => {
import __NG_CLI_RESOURCE__1 from "./app.component.css?ngResource";
import { Component } from '@angular/core';
export let AppComponent = class AppComponent {
let AppComponent = class AppComponent {
constructor() {
this.title = 'app';
}
Expand All @@ -168,6 +171,7 @@ describe('@ngtools/webpack transformers', () => {
styles: ["a { color: red }", __NG_CLI_RESOURCE__1]
})
], AppComponent);
export { AppComponent };
`;

const result = transform(input);
Expand All @@ -194,7 +198,7 @@ describe('@ngtools/webpack transformers', () => {
import __NG_CLI_RESOURCE__2 from "./app.component.2.css?ngResource";
import { Component } from '@angular/core';
export let AppComponent = class AppComponent {
let AppComponent = class AppComponent {
constructor() {
this.title = 'app';
}
Expand All @@ -206,6 +210,7 @@ describe('@ngtools/webpack transformers', () => {
styles: [__NG_CLI_RESOURCE__1, __NG_CLI_RESOURCE__2]
})
], AppComponent);
export { AppComponent };
`;

const result = transform(input);
Expand All @@ -232,7 +237,7 @@ describe('@ngtools/webpack transformers', () => {
import __NG_CLI_RESOURCE__2 from "./app.component.2.css?ngResource";
import { Component as NgComponent } from '@angular/core';
export let AppComponent = class AppComponent {
let AppComponent = class AppComponent {
constructor() {
this.title = 'app';
}
Expand All @@ -244,6 +249,7 @@ describe('@ngtools/webpack transformers', () => {
styles: [__NG_CLI_RESOURCE__1, __NG_CLI_RESOURCE__2]
})
], AppComponent);
export { AppComponent };
`;

const { program } = createTypescriptContext(input);
Expand Down Expand Up @@ -274,7 +280,7 @@ describe('@ngtools/webpack transformers', () => {
import __NG_CLI_RESOURCE__2 from "./app.component.2.css?ngResource";
import * as ng from '@angular/core';
export let AppComponent = class AppComponent {
let AppComponent = class AppComponent {
constructor() {
this.title = 'app';
}
Expand All @@ -286,6 +292,7 @@ describe('@ngtools/webpack transformers', () => {
styles: [__NG_CLI_RESOURCE__1, __NG_CLI_RESOURCE__2]
})
], AppComponent);
export { AppComponent };
`;

const result = transform(input);
Expand Down Expand Up @@ -318,7 +325,7 @@ describe('@ngtools/webpack transformers', () => {
import { Component } from '@angular/core';
export let AppComponent = class AppComponent {
let AppComponent = class AppComponent {
constructor() {
this.obj = [
{
Expand All @@ -336,6 +343,7 @@ describe('@ngtools/webpack transformers', () => {
styles: [__NG_CLI_RESOURCE__1]
})
], AppComponent);
export { AppComponent };
`;

const result = transform(input);
Expand Down Expand Up @@ -365,7 +373,7 @@ describe('@ngtools/webpack transformers', () => {
import { __decorate } from "tslib";
import { Component } from 'foo';
export let AppComponent = class AppComponent {
let AppComponent = class AppComponent {
constructor() {
this.obj = [
{
Expand All @@ -383,6 +391,7 @@ describe('@ngtools/webpack transformers', () => {
styleUrls: ['./app.component.css']
})
], AppComponent);
export { AppComponent };
`;

const result = transform(input);
Expand All @@ -405,7 +414,7 @@ describe('@ngtools/webpack transformers', () => {
const output = `
import { __decorate } from "tslib";
import { Component } from '@angular/core';
export let AppComponent = class AppComponent {
let AppComponent = class AppComponent {
constructor() {
this.title = 'app';
}
Expand All @@ -417,6 +426,7 @@ describe('@ngtools/webpack transformers', () => {
styleUrls: ['./app.component.css', './app.component.2.css']
})
], AppComponent);
export { AppComponent };
`;

const result = transform(input, false);
Expand Down
@@ -1,11 +1,11 @@
load("//tools:defaults.bzl", "ts_library")

# files fetched on 2023-06-02 from
# https://github.com/microsoft/TypeScript/releases/tag/v5.1.3
# https://github.com/microsoft/TypeScript/releases/tag/v5.2.2

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

licenses(["notice"]) # Apache 2.0

Expand Down

0 comments on commit 3ab25ce

Please sign in to comment.