From a916f393b673bd3815f6b2e9b3498bd17a84f57d Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Fri, 20 Aug 2021 09:00:33 -0700 Subject: [PATCH] chore: remove ts3.6 support (#296) * chore: remove ts3.6 support * add Typescript 4.5 Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> --- packages/header-parser/test/index.test.ts | 35 ++++++++++--------- .../publisher/test/generate-packages.test.ts | 2 +- packages/typescript-versions/src/index.ts | 12 ++++--- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/packages/header-parser/test/index.test.ts b/packages/header-parser/test/index.test.ts index 2d0f899bcc..d4a6723b7c 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: "3.6", + typeScriptVersion: "3.7", 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: "3.6", + typeScriptVersion: "3.7", nonNpm: false, projects: ["https://github.com/foo/foo", "https://foo.com"], contributors: [ @@ -147,11 +147,11 @@ describe("isSupported", () => { it("works", () => { expect(TypeScriptVersion.isSupported("4.1")).toBeTruthy(); }); - it("supports 3.6", () => { - expect(TypeScriptVersion.isSupported("3.6")).toBeTruthy(); + it("supports 3.7", () => { + expect(TypeScriptVersion.isSupported("3.7")).toBeTruthy(); }); - it("does not support 3.5", () => { - expect(!TypeScriptVersion.isSupported("3.5")).toBeTruthy(); + it("does not support 3.6", () => { + expect(!TypeScriptVersion.isSupported("3.6")).toBeTruthy(); }); }); @@ -169,10 +169,10 @@ describe("isTypeScriptVersion", () => { describe("range", () => { it("works", () => { - expect(TypeScriptVersion.range("3.7")).toEqual(["3.7", "3.8", "3.9", "4.0", "4.1", "4.2", "4.3", "4.4"]); + expect(TypeScriptVersion.range("4.0")).toEqual(["4.0", "4.1", "4.2", "4.3", "4.4", "4.5"]); }); - it("includes 3.6 onwards", () => { - expect(TypeScriptVersion.range("3.6")).toEqual(TypeScriptVersion.supported); + it("includes 3.7 onwards", () => { + expect(TypeScriptVersion.range("3.7")).toEqual(TypeScriptVersion.supported); }); }); @@ -185,11 +185,12 @@ describe("tagsToUpdate", () => { "ts4.2", "ts4.3", "ts4.4", + "ts4.5", "latest" ]); }); - it("allows 3.6 onwards", () => { - expect(TypeScriptVersion.tagsToUpdate("3.6")).toEqual( + it("allows 3.7 onwards", () => { + expect(TypeScriptVersion.tagsToUpdate("3.7")).toEqual( TypeScriptVersion.supported.map(s => "ts" + s).concat("latest") ); }); @@ -207,10 +208,10 @@ describe("makeTypesVersionsForPackageJson", () => { }); }); it("orders versions old to new with old-to-new input", () => { - expect(JSON.stringify(makeTypesVersionsForPackageJson(["3.6", "3.9", "4.0"]), undefined, 4)).toEqual(`{ - "<=3.6": { + expect(JSON.stringify(makeTypesVersionsForPackageJson(["3.7", "3.9", "4.0"]), undefined, 4)).toEqual(`{ + "<=3.7": { "*": [ - "ts3.6/*" + "ts3.7/*" ] }, "<=3.9": { @@ -226,10 +227,10 @@ describe("makeTypesVersionsForPackageJson", () => { }`); }); it("orders versions old to new with new-to-old input", () => { - expect(JSON.stringify(makeTypesVersionsForPackageJson(["4.0", "3.9", "3.6"]), undefined, 4)).toEqual(`{ - "<=3.6": { + expect(JSON.stringify(makeTypesVersionsForPackageJson(["4.0", "3.9", "3.7"]), undefined, 4)).toEqual(`{ + "<=3.7": { "*": [ - "ts3.6/*" + "ts3.7/*" ] }, "<=3.9": { diff --git a/packages/publisher/test/generate-packages.test.ts b/packages/publisher/test/generate-packages.test.ts index 95e0f0e88a..e525091c37 100644 --- a/packages/publisher/test/generate-packages.test.ts +++ b/packages/publisher/test/generate-packages.test.ts @@ -133,7 +133,7 @@ testo({ "balzac": "~3" }, "typesPublisherContentHash": "11", - "typeScriptVersion": "3.6" + "typeScriptVersion": "3.7" }`); }, githubPackageJsonName() { diff --git a/packages/typescript-versions/src/index.ts b/packages/typescript-versions/src/index.ts index 267b48dfda..e55315ea7b 100644 --- a/packages/typescript-versions/src/index.ts +++ b/packages/typescript-versions/src/index.ts @@ -42,20 +42,21 @@ export type UnsupportedTypeScriptVersion = | "3.2" | "3.3" | "3.4" - | "3.5"; + | "3.5" + | "3.6"; /** * Parseable and supported TypeScript versions. * Only add to this list if we will support this version on DefinitelyTyped. */ -export type TypeScriptVersion = "3.6" | "3.7" | "3.8" | "3.9" | "4.0" | "4.1" | "4.2" | "4.3" | "4.4"; +export type TypeScriptVersion = "3.7" | "3.8" | "3.9" | "4.0" | "4.1" | "4.2" | "4.3" | "4.4" | "4.5"; export type AllTypeScriptVersion = UnsupportedTypeScriptVersion | TypeScriptVersion; export namespace TypeScriptVersion { /** Add to this list when a version actual ships. */ - export const shipped: readonly TypeScriptVersion[] = ["3.6", "3.7", "3.8", "3.9", "4.0", "4.1", "4.2", "4.3"]; + export const shipped: readonly TypeScriptVersion[] = [ "3.7", "3.8", "3.9", "4.0", "4.1", "4.2", "4.3"]; /** Add to this list when a version is available as typescript@next */ - export const supported: readonly TypeScriptVersion[] = [...shipped, "4.4"]; + export const supported: readonly TypeScriptVersion[] = [...shipped, "4.4", "4.5"]; /** Add to this list when it will no longer be supported on Definitely Typed */ export const unsupported: readonly UnsupportedTypeScriptVersion[] = [ "2.0", @@ -73,7 +74,8 @@ export namespace TypeScriptVersion { "3.2", "3.3", "3.4", - "3.5" + "3.5", + "3.6" ]; export const all: readonly AllTypeScriptVersion[] = [...unsupported, ...supported]; export const lowest = supported[0];