Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 3.9 to shipped versions, remove 2.9 from supported versions #18

Merged
merged 2 commits into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/header-parser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const typeScriptVersionLineParser: pm.Parser<AllTypeScriptVersion> = pm
const typeScriptVersionParser: pm.Parser<AllTypeScriptVersion> = pm
.regexp(/\r?\n/)
.then(typeScriptVersionLineParser)
.fallback<TypeScriptVersion>("2.9");
.fallback<TypeScriptVersion>("3.0");

export function parseTypeScriptVersionLine(line: string): AllTypeScriptVersion {
const result = typeScriptVersionLineParser.parse(line);
Expand Down
16 changes: 8 additions & 8 deletions packages/header-parser/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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: [
Expand Down Expand Up @@ -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();
});
});

Expand Down Expand Up @@ -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")
);
});
Expand Down
32 changes: 15 additions & 17 deletions packages/typescript-versions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down