Ship 5.1, deprecate 4.3 (#683)

This commit is contained in:
Nathan Shively-Sanders
2023-06-01 15:22:43 -07:00
committed by GitHub
parent f5a6721d7d
commit 405c8ce741
3 changed files with 15 additions and 13 deletions

View File

@@ -40,7 +40,7 @@ describe("parse", () => {
libraryName: "foo",
libraryMajorVersion: 1,
libraryMinorVersion: 2,
typeScriptVersion: "4.3",
typeScriptVersion: "4.4",
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: "4.3",
typeScriptVersion: "4.4",
nonNpm: false,
projects: ["https://github.com/foo/foo", "https://foo.com"],
contributors: [
@@ -147,11 +147,11 @@ describe("isSupported", () => {
it("works", () => {
expect(TypeScriptVersion.isSupported("4.5")).toBeTruthy();
});
it("supports 4.3", () => {
expect(TypeScriptVersion.isSupported("4.3")).toBeTruthy();
it("supports 4.4", () => {
expect(TypeScriptVersion.isSupported("4.4")).toBeTruthy();
});
it("does not support 4.2", () => {
expect(!TypeScriptVersion.isSupported("4.2")).toBeTruthy();
it("does not support 4.3", () => {
expect(!TypeScriptVersion.isSupported("4.3")).toBeTruthy();
});
});
@@ -180,8 +180,8 @@ describe("tagsToUpdate", () => {
it("works", () => {
expect(TypeScriptVersion.tagsToUpdate("5.0")).toEqual(["ts5.0", "ts5.1", "ts5.2", "latest"]);
});
it("allows 4.2 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("4.3")).toEqual(
it("allows 4.4 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("4.4")).toEqual(
TypeScriptVersion.supported.map((s) => "ts" + s).concat("latest")
);
});

View File

@@ -143,7 +143,7 @@ testo({
"balzac": "~3"
},
"typesPublisherContentHash": "11",
"typeScriptVersion": "4.3"
"typeScriptVersion": "4.4"
}`);
},
basicNotNeededPackageJson() {

View File

@@ -51,20 +51,21 @@ export type UnsupportedTypeScriptVersion =
| "3.9"
| "4.0"
| "4.1"
| "4.2";
| "4.2"
| "4.3";
/**
* Parseable and supported TypeScript versions.
* Only add to this list if we will support this version on Definitely Typed.
*/
export type TypeScriptVersion = "4.3" | "4.4" | "4.5" | "4.6" | "4.7" | "4.8" | "4.9" | "5.0" | "5.1" | "5.2";
export type TypeScriptVersion = "4.4" | "4.5" | "4.6" | "4.7" | "4.8" | "4.9" | "5.0" | "5.1" | "5.2";
export type AllTypeScriptVersion = UnsupportedTypeScriptVersion | TypeScriptVersion;
export namespace TypeScriptVersion {
/** Add to this list when a version actually ships. */
export const shipped: readonly TypeScriptVersion[] = ["4.3", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9", "5.0"];
export const shipped: readonly TypeScriptVersion[] = ["4.4", "4.5", "4.6", "4.7", "4.8", "4.9", "5.0", "5.1"];
/** Add to this list when a version is available as typescript@next */
export const supported: readonly TypeScriptVersion[] = [...shipped, "5.1", "5.2"];
export const supported: readonly TypeScriptVersion[] = [...shipped, "5.2"];
/** Add to this list when it will no longer be supported on Definitely Typed */
export const unsupported: readonly UnsupportedTypeScriptVersion[] = [
"2.0",
@@ -90,6 +91,7 @@ export namespace TypeScriptVersion {
"4.0",
"4.1",
"4.2",
"4.3",
];
export const all: readonly AllTypeScriptVersion[] = [...unsupported, ...supported];
export const lowest = supported[0];