From 32981ebd3a7490b93e8c57abe01b44fba5583929 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 13 May 2020 15:54:06 -0700 Subject: [PATCH 1/2] Add 3.9 to shipped versions, remove 2.9 from supported versions --- packages/header-parser/test/index.test.ts | 12 ++++----- packages/typescript-versions/src/index.ts | 32 +++++++++++------------ 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/packages/header-parser/test/index.test.ts b/packages/header-parser/test/index.test.ts index 2b5384fc79..d573fc6088 100644 --- a/packages/header-parser/test/index.test.ts +++ b/packages/header-parser/test/index.test.ts @@ -131,11 +131,11 @@ describe("isSupported", () => { it("works", () => { expect(TypeScriptVersion.isSupported("3.7")).toBeTruthy(); }); - it("supports 2.9", () => { - expect(TypeScriptVersion.isSupported("2.9")).toBeTruthy(); + it("supports 3.0", () => { + expect(TypeScriptVersion.isSupported("3.0")).toBeTruthy(); }); - it("does not support 2.8", () => { - expect(!TypeScriptVersion.isSupported("2.8")).toBeTruthy(); + it("does not support 2.9", () => { + expect(!TypeScriptVersion.isSupported("2.9")).toBeTruthy(); }); }); @@ -177,8 +177,8 @@ describe("tagsToUpdate", () => { "latest" ]); }); - it("allows 2.9 onwards", () => { - expect(TypeScriptVersion.tagsToUpdate("2.9")).toEqual( + it("allows 3.0 onwards", () => { + expect(TypeScriptVersion.tagsToUpdate("3.0")).toEqual( TypeScriptVersion.supported.map(s => "ts" + s).concat("latest") ); }); diff --git a/packages/typescript-versions/src/index.ts b/packages/typescript-versions/src/index.ts index 3a02c76cd2..fedc4da02d 100644 --- a/packages/typescript-versions/src/index.ts +++ b/packages/typescript-versions/src/index.ts @@ -27,31 +27,28 @@ import assert from "assert"; */ /** Parseable but unsupported TypeScript versions. */ -export type UnsupportedTypeScriptVersion = "2.0" | "2.1" | "2.2" | "2.3" | "2.4" | "2.5" | "2.6" | "2.7" | "2.8"; +export type UnsupportedTypeScriptVersion = + | "2.0" + | "2.1" + | "2.2" + | "2.3" + | "2.4" + | "2.5" + | "2.6" + | "2.7" + | "2.8" + | "2.9"; /** * Parseable and supported TypeScript versions. * Only add to this list if we will support this version on DefinitelyTyped. */ -export type TypeScriptVersion = - | "2.9" - | "3.0" - | "3.1" - | "3.2" - | "3.3" - | "3.4" - | "3.5" - | "3.6" - | "3.7" - | "3.8" - | "3.9" - | "4.0"; +export type TypeScriptVersion = "3.0" | "3.1" | "3.2" | "3.3" | "3.4" | "3.5" | "3.6" | "3.7" | "3.8" | "3.9" | "4.0"; export type AllTypeScriptVersion = UnsupportedTypeScriptVersion | TypeScriptVersion; export namespace TypeScriptVersion { /** Add to this list when a version actual ships. */ export const shipped: readonly TypeScriptVersion[] = [ - "2.9", "3.0", "3.1", "3.2", @@ -60,10 +57,11 @@ export namespace TypeScriptVersion { "3.5", "3.6", "3.7", - "3.8" + "3.8", + "3.9" ]; /** Add to this list when a version is available as typescript@next */ - export const supported: readonly TypeScriptVersion[] = [...shipped, "3.9", "4.0"]; + export const supported: readonly TypeScriptVersion[] = [...shipped, "4.0"]; /** Add to this list when it will no longer be supported on Definitely Typed */ export const unsupported: readonly UnsupportedTypeScriptVersion[] = [ "2.0", From 2942b76bf1ca4879bea34c9f662ff7c61a627b7e Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 13 May 2020 16:02:19 -0700 Subject: [PATCH 2/2] Update header-parser too --- packages/header-parser/src/index.ts | 2 +- packages/header-parser/test/index.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/header-parser/src/index.ts b/packages/header-parser/src/index.ts index b0f9cffd5b..d18be35105 100644 --- a/packages/header-parser/src/index.ts +++ b/packages/header-parser/src/index.ts @@ -231,7 +231,7 @@ const typeScriptVersionLineParser: pm.Parser = pm const typeScriptVersionParser: pm.Parser = pm .regexp(/\r?\n/) .then(typeScriptVersionLineParser) - .fallback("2.9"); + .fallback("3.0"); export function parseTypeScriptVersionLine(line: string): AllTypeScriptVersion { const result = typeScriptVersionLineParser.parse(line); diff --git a/packages/header-parser/test/index.test.ts b/packages/header-parser/test/index.test.ts index d573fc6088..501a19cbe4 100644 --- a/packages/header-parser/test/index.test.ts +++ b/packages/header-parser/test/index.test.ts @@ -40,7 +40,7 @@ describe("parse", () => { libraryName: "foo", libraryMajorVersion: 1, libraryMinorVersion: 2, - typeScriptVersion: "2.9", + typeScriptVersion: "3.0", nonNpm: false, projects: ["https://github.com/foo/foo", "https://foo.com"], contributors: [ @@ -65,7 +65,7 @@ describe("parse", () => { libraryName: "foo", libraryMajorVersion: 1, libraryMinorVersion: 2, - typeScriptVersion: "2.9", + typeScriptVersion: "3.0", nonNpm: false, projects: ["https://github.com/foo/foo", "https://foo.com"], contributors: [