From e8f50a19640990392f6dcd0a08e43d80328a6db9 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 1 Nov 2022 08:56:18 -0700 Subject: [PATCH] Add Typescript 5.0 to typescript-versions (#560) 5.0 is the new nightly version --- packages/header-parser/test/index.test.ts | 7 ++++--- packages/typescript-versions/src/index.ts | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/header-parser/test/index.test.ts b/packages/header-parser/test/index.test.ts index 562f77b5..4e79a303 100644 --- a/packages/header-parser/test/index.test.ts +++ b/packages/header-parser/test/index.test.ts @@ -169,7 +169,7 @@ describe("isTypeScriptVersion", () => { describe("range", () => { it("works", () => { - expect(TypeScriptVersion.range("4.1")).toEqual(["4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9"]); + expect(TypeScriptVersion.range("4.1")).toEqual(["4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9", "5.0"]); }); it("includes 4.1 onwards", () => { expect(TypeScriptVersion.range("4.1")).toEqual(TypeScriptVersion.supported); @@ -188,6 +188,7 @@ describe("tagsToUpdate", () => { "ts4.7", "ts4.8", "ts4.9", + "ts5.0", "latest", ]); }); @@ -248,8 +249,8 @@ describe("makeTypesVersionsForPackageJson", () => { }`); }); it("asserts when trying to redirect from newest version and below", () => { - expect(() => makeTypesVersionsForPackageJson(["4.9"])).toThrow( - /ts4.9 is too new: it covers all versions of typescript/ + expect(() => makeTypesVersionsForPackageJson(["5.0"])).toThrow( + /ts5.0 is too new: it covers all versions of typescript/ ); }); }); diff --git a/packages/typescript-versions/src/index.ts b/packages/typescript-versions/src/index.ts index 8af68d56..e3962c2f 100644 --- a/packages/typescript-versions/src/index.ts +++ b/packages/typescript-versions/src/index.ts @@ -7,11 +7,13 @@ import assert from "assert"; For the RC: 1. Add a new version to the end of `TypeScriptVersion` and `supported`. + `supported` now contains the shipped versions, the RC, and the nightly. 2. Update failing tests. For the release: 1. Move the newly-released version from `supported` to `shipped`. + `supported` now contains the shipped versions and the nightly. 2. Update failing tests. # How to deprecate an old version on Definitely Typed # @@ -52,7 +54,7 @@ export type UnsupportedTypeScriptVersion = * Parseable and supported TypeScript versions. * Only add to this list if we will support this version on Definitely Typed. */ -export type TypeScriptVersion = "4.1" | "4.2" | "4.3" | "4.4" | "4.5" | "4.6" | "4.7" | "4.8" | "4.9"; +export type TypeScriptVersion = "4.1" | "4.2" | "4.3" | "4.4" | "4.5" | "4.6" | "4.7" | "4.8" | "4.9" | "5.0"; export type AllTypeScriptVersion = UnsupportedTypeScriptVersion | TypeScriptVersion; @@ -60,7 +62,7 @@ export namespace TypeScriptVersion { /** Add to this list when a version actually ships. */ export const shipped: readonly TypeScriptVersion[] = ["4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7", "4.8"]; /** Add to this list when a version is available as typescript@next */ - export const supported: readonly TypeScriptVersion[] = [...shipped, "4.9"]; + export const supported: readonly TypeScriptVersion[] = [...shipped, "4.9", "5.0"]; /** Add to this list when it will no longer be supported on Definitely Typed */ export const unsupported: readonly UnsupportedTypeScriptVersion[] = [ "2.0",