Add 3.9 to shipped versions, remove 2.9 from supported versions

This commit is contained in:
Nathan Shively-Sanders
2020-05-13 15:54:06 -07:00
parent 968fe4534a
commit 32981ebd3a
2 changed files with 21 additions and 23 deletions

View File

@@ -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")
);
});

View File

@@ -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",