From 9704346b138ce17997a1c53d4fec09ffd371864c Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Wed, 25 May 2022 08:49:16 +0200 Subject: [PATCH] build: update to TypeScript 4.7 final Bumps up the TypeScript 4.7 for our own build as well as any newly-created apps. --- package.json | 2 +- .../blank/project-files/package.json | 2 +- .../schematic/files/package.json | 2 +- packages/ngtools/webpack/package.json | 2 +- .../Microsoft/TypeScript/BUILD.bazel | 8 ++++---- .../Microsoft/TypeScript/lib/typescript.js | 18 +++++++++--------- .../utility/latest-versions/package.json | 2 +- .../e2e/assets/webpack/test-app/package.json | 2 +- yarn.lock | 12 +++++------- 9 files changed, 24 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index d7a3914ce333..089abaf48aec 100644 --- a/package.json +++ b/package.json @@ -209,7 +209,7 @@ "tree-kill": "1.2.2", "ts-node": "^10.0.0", "tslib": "2.4.0", - "typescript": "4.7.1-rc", + "typescript": "~4.7.2", "verdaccio": "5.10.2", "verdaccio-auth-memory": "^10.0.0", "webpack": "5.72.1", diff --git a/packages/angular_devkit/schematics_cli/blank/project-files/package.json b/packages/angular_devkit/schematics_cli/blank/project-files/package.json index 05e4faa3273e..ff6f7752da66 100644 --- a/packages/angular_devkit/schematics_cli/blank/project-files/package.json +++ b/packages/angular_devkit/schematics_cli/blank/project-files/package.json @@ -15,7 +15,7 @@ "dependencies": { "@angular-devkit/core": "^<%= coreVersion %>", "@angular-devkit/schematics": "^<%= schematicsVersion %>", - "typescript": "~4.6.2" + "typescript": "~4.7.2" }, "devDependencies": { "@types/node": "^14.15.0", diff --git a/packages/angular_devkit/schematics_cli/schematic/files/package.json b/packages/angular_devkit/schematics_cli/schematic/files/package.json index cb22f1ba923b..e3bca47fe1bc 100644 --- a/packages/angular_devkit/schematics_cli/schematic/files/package.json +++ b/packages/angular_devkit/schematics_cli/schematic/files/package.json @@ -15,7 +15,7 @@ "dependencies": { "@angular-devkit/core": "^<%= coreVersion %>", "@angular-devkit/schematics": "^<%= schematicsVersion %>", - "typescript": "~4.6.2" + "typescript": "~4.7.2" }, "devDependencies": { "@types/node": "^14.15.0", diff --git a/packages/ngtools/webpack/package.json b/packages/ngtools/webpack/package.json index e77aed26404d..48ed647168c3 100644 --- a/packages/ngtools/webpack/package.json +++ b/packages/ngtools/webpack/package.json @@ -30,7 +30,7 @@ "@angular-devkit/core": "0.0.0-PLACEHOLDER", "@angular/compiler": "14.0.0-rc.1", "@angular/compiler-cli": "14.0.0-rc.1", - "typescript": "4.7.1-rc", + "typescript": "~4.7.2", "webpack": "5.72.1" } } diff --git a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel index b942565e8b30..23be65fe0fb7 100644 --- a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel +++ b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel @@ -1,11 +1,11 @@ load("//tools:defaults.bzl", "ts_library") -# files fetched on 2022-05-06 from -# https://github.com/microsoft/TypeScript/releases/tag/v4.7-rc +# files fetched on 2022-05-25 from +# https://github.com/microsoft/TypeScript/releases/tag/v4.7.2 # Commands to download: -# curl https://raw.githubusercontent.com/microsoft/TypeScript/v4.7-rc/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/v4.7-rc/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js +# curl https://raw.githubusercontent.com/microsoft/TypeScript/v4.7.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/v4.7.2/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js licenses(["notice"]) # Apache 2.0 diff --git a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js index cd94f8f9414c..8f41c15ff8d8 100644 --- a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js +++ b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js @@ -294,7 +294,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "".concat(ts.versionMajorMinor, ".1-rc"); + ts.version = "4.7.2"; /* @internal */ var Comparison; (function (Comparison) { @@ -59090,9 +59090,9 @@ var ts; t.flags & 2097152 /* TypeFlags.Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 402653316 /* TypeFlags.StringLike */ ? globalStringType : t.flags & 296 /* TypeFlags.NumberLike */ ? globalNumberType : - t.flags & 2112 /* TypeFlags.BigIntLike */ ? getGlobalBigIntType(/*reportErrors*/ languageVersion >= 7 /* ScriptTarget.ES2020 */) : + t.flags & 2112 /* TypeFlags.BigIntLike */ ? getGlobalBigIntType() : t.flags & 528 /* TypeFlags.BooleanLike */ ? globalBooleanType : - t.flags & 12288 /* TypeFlags.ESSymbolLike */ ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= 2 /* ScriptTarget.ES2015 */) : + t.flags & 12288 /* TypeFlags.ESSymbolLike */ ? getGlobalESSymbolType() : t.flags & 67108864 /* TypeFlags.NonPrimitive */ ? emptyObjectType : t.flags & 4194304 /* TypeFlags.Index */ ? keyofConstraintType : t.flags & 2 /* TypeFlags.Unknown */ && !strictNullChecks ? emptyObjectType : @@ -60667,8 +60667,8 @@ var ts; function getGlobalESSymbolConstructorTypeSymbol(reportErrors) { return deferredGlobalESSymbolConstructorTypeSymbol || (deferredGlobalESSymbolConstructorTypeSymbol = getGlobalTypeSymbol("SymbolConstructor", reportErrors)); } - function getGlobalESSymbolType(reportErrors) { - return (deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType("Symbol", /*arity*/ 0, reportErrors))) || emptyObjectType; + function getGlobalESSymbolType() { + return (deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType("Symbol", /*arity*/ 0, /*reportErrors*/ false))) || emptyObjectType; } function getGlobalPromiseType(reportErrors) { return (deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType("Promise", /*arity*/ 1, reportErrors))) || emptyGenericType; @@ -60732,8 +60732,8 @@ var ts; deferredGlobalAwaitedSymbol || (deferredGlobalAwaitedSymbol = getGlobalTypeAliasSymbol("Awaited", /*arity*/ 1, reportErrors) || (reportErrors ? unknownSymbol : undefined)); return deferredGlobalAwaitedSymbol === unknownSymbol ? undefined : deferredGlobalAwaitedSymbol; } - function getGlobalBigIntType(reportErrors) { - return (deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", /*arity*/ 0, reportErrors))) || emptyObjectType; + function getGlobalBigIntType() { + return (deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", /*arity*/ 0, /*reportErrors*/ false))) || emptyObjectType; } /** * Instantiates a global type that is generic with some element type, and returns that instantiation. @@ -64885,7 +64885,7 @@ var ts; if ((globalStringType === source && stringType === target) || (globalNumberType === source && numberType === target) || (globalBooleanType === source && booleanType === target) || - (getGlobalESSymbolType(/*reportErrors*/ false) === source && esSymbolType === target)) { + (getGlobalESSymbolType() === source && esSymbolType === target)) { reportError(ts.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible, targetType, sourceType); } } @@ -82697,7 +82697,7 @@ var ts; var childSymbol = getSymbolAtLocation(childNode); if (childSymbol && childSymbol === testedSymbol) { // If the test was a simple identifier, the above check is sufficient - if (ts.isIdentifier(expr)) { + if (ts.isIdentifier(expr) || ts.isIdentifier(testedNode) && ts.isBinaryExpression(testedNode.parent)) { return true; } // Otherwise we need to ensure the symbol is called on the same target diff --git a/packages/schematics/angular/utility/latest-versions/package.json b/packages/schematics/angular/utility/latest-versions/package.json index 24e3fc814afb..bf3ee8bb0004 100644 --- a/packages/schematics/angular/utility/latest-versions/package.json +++ b/packages/schematics/angular/utility/latest-versions/package.json @@ -15,7 +15,7 @@ "rxjs": "~7.5.0", "tslib": "^2.3.0", "ts-node": "~10.8.0", - "typescript": "~4.6.2", + "typescript": "~4.7.2", "zone.js": "~0.11.4" } } diff --git a/tests/legacy-cli/e2e/assets/webpack/test-app/package.json b/tests/legacy-cli/e2e/assets/webpack/test-app/package.json index cb6d32e1fb7a..d2b815e17012 100644 --- a/tests/legacy-cli/e2e/assets/webpack/test-app/package.json +++ b/tests/legacy-cli/e2e/assets/webpack/test-app/package.json @@ -17,7 +17,7 @@ "devDependencies": { "sass": "^1.32.8", "sass-loader": "^11.0.1", - "typescript": "~4.6.2", + "typescript": "~4.7.2", "webpack": "^5.27.0", "webpack-cli": "^4.5.0" } diff --git a/yarn.lock b/yarn.lock index c8f2212819ce..bcda7b4c7d0b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -177,7 +177,6 @@ "@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#6ee7dd89d71cbdfbd9144e1b84f2090b445e180b": version "0.0.0-2a50bf4f37f041d8b88c743fae45d09b400e917e" - uid "6ee7dd89d71cbdfbd9144e1b84f2090b445e180b" resolved "https://github.com/angular/dev-infra-private-builds.git#6ee7dd89d71cbdfbd9144e1b84f2090b445e180b" dependencies: "@angular-devkit/build-angular" "14.0.0-rc.1" @@ -9405,7 +9404,6 @@ sass@1.52.1, sass@^1.49.9: "sauce-connect-proxy@https://saucelabs.com/downloads/sc-4.7.1-linux.tar.gz": version "0.0.0" - uid e5d7f82ad98251a653d1b0537f1103e49eda5e11 resolved "https://saucelabs.com/downloads/sc-4.7.1-linux.tar.gz#e5d7f82ad98251a653d1b0537f1103e49eda5e11" saucelabs@^1.5.0: @@ -10531,16 +10529,16 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@4.7.1-rc: - version "4.7.1-rc" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.1-rc.tgz#23a0517d36c56de887b4457f29e2d265647bbd7c" - integrity sha512-EQd2NVelDe6ZVc2sO1CSpuSs+RHzY8c2n/kTNQAHw4um/eAXY+ZY4IKoUpNK0wO6C5hN+XcUXR7yqT8VbwwNIQ== - typescript@^4.6.2, typescript@~4.6.2, typescript@~4.6.3: version "4.6.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== +typescript@~4.7.2: + version "4.7.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.2.tgz#1f9aa2ceb9af87cca227813b4310fff0b51593c4" + integrity sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A== + ua-parser-js@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.2.tgz#e2976c34dbfb30b15d2c300b2a53eac87c57a775"