Ship 4.7, Deprecate 3.8 (#414)

This commit is contained in:
Nathan Shively-Sanders
2022-03-01 11:14:32 -08:00
committed by GitHub
parent 67a6acee94
commit 5b9bfa55a5
3 changed files with 29 additions and 27 deletions

View File

@@ -40,7 +40,7 @@ describe("parse", () => {
libraryName: "foo",
libraryMajorVersion: 1,
libraryMinorVersion: 2,
typeScriptVersion: "3.8",
typeScriptVersion: "3.9",
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.8",
typeScriptVersion: "3.9",
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.8", () => {
expect(TypeScriptVersion.isSupported("3.8")).toBeTruthy();
it("supports 3.9", () => {
expect(TypeScriptVersion.isSupported("3.9")).toBeTruthy();
});
it("does not support 3.7", () => {
expect(!TypeScriptVersion.isSupported("3.7")).toBeTruthy();
it("does not support 3.8", () => {
expect(!TypeScriptVersion.isSupported("3.8")).toBeTruthy();
});
});
@@ -172,7 +172,7 @@ describe("range", () => {
expect(TypeScriptVersion.range("4.0")).toEqual(["4.0", "4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7"]);
});
it("includes 3.8 onwards", () => {
expect(TypeScriptVersion.range("3.8")).toEqual(TypeScriptVersion.supported);
expect(TypeScriptVersion.range("3.9")).toEqual(TypeScriptVersion.supported);
});
});
@@ -191,8 +191,8 @@ describe("tagsToUpdate", () => {
"latest"
]);
});
it("allows 3.8 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("3.8")).toEqual(
it("allows 3.9 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("3.9")).toEqual(
TypeScriptVersion.supported.map(s => "ts" + s).concat("latest")
);
});
@@ -210,12 +210,7 @@ describe("makeTypesVersionsForPackageJson", () => {
});
});
it("orders versions old to new with old-to-new input", () => {
expect(JSON.stringify(makeTypesVersionsForPackageJson(["3.7", "3.9", "4.0"]), undefined, 4)).toEqual(`{
"<=3.7": {
"*": [
"ts3.7/*"
]
},
expect(JSON.stringify(makeTypesVersionsForPackageJson(["3.9", "4.0", "4.5"]), undefined, 4)).toEqual(`{
"<=3.9": {
"*": [
"ts3.9/*"
@@ -225,16 +220,16 @@ describe("makeTypesVersionsForPackageJson", () => {
"*": [
"ts4.0/*"
]
},
"<=4.5": {
"*": [
"ts4.5/*"
]
}
}`);
});
it("orders versions old to new with new-to-old input", () => {
expect(JSON.stringify(makeTypesVersionsForPackageJson(["4.0", "3.9", "3.7"]), undefined, 4)).toEqual(`{
"<=3.7": {
"*": [
"ts3.7/*"
]
},
expect(JSON.stringify(makeTypesVersionsForPackageJson(["4.5", "4.0", "3.9"]), undefined, 4)).toEqual(`{
"<=3.9": {
"*": [
"ts3.9/*"
@@ -244,6 +239,11 @@ describe("makeTypesVersionsForPackageJson", () => {
"*": [
"ts4.0/*"
]
},
"<=4.5": {
"*": [
"ts4.5/*"
]
}
}`);
});

View File

@@ -133,7 +133,7 @@ testo({
"balzac": "~3"
},
"typesPublisherContentHash": "11",
"typeScriptVersion": "3.8"
"typeScriptVersion": "3.9"
}`);
},
basicNotNeededPackageJson() {

View File

@@ -44,20 +44,21 @@ export type UnsupportedTypeScriptVersion =
| "3.4"
| "3.5"
| "3.6"
| "3.7";
| "3.7"
| "3.8";
/**
* Parseable and supported TypeScript versions.
* Only add to this list if we will support this version on DefinitelyTyped.
*/
export type TypeScriptVersion = "3.8" | "3.9" | "4.0" | "4.1" | "4.2" | "4.3" | "4.4" | "4.5" | "4.6" | "4.7";
export type TypeScriptVersion = "3.9" | "4.0" | "4.1" | "4.2" | "4.3" | "4.4" | "4.5" | "4.6" | "4.7";
export type AllTypeScriptVersion = UnsupportedTypeScriptVersion | TypeScriptVersion;
export namespace TypeScriptVersion {
/** Add to this list when a version actually ships. */
export const shipped: readonly TypeScriptVersion[] = ["3.8", "3.9", "4.0", "4.1", "4.2", "4.3", "4.4", "4.5"];
export const shipped: readonly TypeScriptVersion[] = ["3.9", "4.0", "4.1", "4.2", "4.3", "4.4", "4.5", "4.6"];
/** Add to this list when a version is available as typescript@next */
export const supported: readonly TypeScriptVersion[] = [...shipped, "4.6", "4.7"];
export const supported: readonly TypeScriptVersion[] = [...shipped, "4.7"];
/** Add to this list when it will no longer be supported on Definitely Typed */
export const unsupported: readonly UnsupportedTypeScriptVersion[] = [
"2.0",
@@ -77,7 +78,8 @@ export namespace TypeScriptVersion {
"3.4",
"3.5",
"3.6",
"3.7"
"3.7",
"3.8"
];
export const all: readonly AllTypeScriptVersion[] = [...unsupported, ...supported];
export const lowest = supported[0];