Add Typescript 5.0 to typescript-versions (#560)

5.0 is the new nightly version
This commit is contained in:
Nathan Shively-Sanders
2022-11-01 08:56:18 -07:00
committed by GitHub
parent 1e122a9925
commit e8f50a1964
2 changed files with 8 additions and 5 deletions

View File

@@ -169,7 +169,7 @@ describe("isTypeScriptVersion", () => {
describe("range", () => {
it("works", () => {
expect(TypeScriptVersion.range("4.1")).toEqual(["4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9"]);
expect(TypeScriptVersion.range("4.1")).toEqual(["4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9", "5.0"]);
});
it("includes 4.1 onwards", () => {
expect(TypeScriptVersion.range("4.1")).toEqual(TypeScriptVersion.supported);
@@ -188,6 +188,7 @@ describe("tagsToUpdate", () => {
"ts4.7",
"ts4.8",
"ts4.9",
"ts5.0",
"latest",
]);
});
@@ -248,8 +249,8 @@ describe("makeTypesVersionsForPackageJson", () => {
}`);
});
it("asserts when trying to redirect from newest version and below", () => {
expect(() => makeTypesVersionsForPackageJson(["4.9"])).toThrow(
/ts4.9 is too new: it covers all versions of typescript/
expect(() => makeTypesVersionsForPackageJson(["5.0"])).toThrow(
/ts5.0 is too new: it covers all versions of typescript/
);
});
});

View File

@@ -7,11 +7,13 @@ import assert from "assert";
For the RC:
1. Add a new version to the end of `TypeScriptVersion` and `supported`.
`supported` now contains the shipped versions, the RC, and the nightly.
2. Update failing tests.
For the release:
1. Move the newly-released version from `supported` to `shipped`.
`supported` now contains the shipped versions and the nightly.
2. Update failing tests.
# How to deprecate an old version on Definitely Typed #
@@ -52,7 +54,7 @@ export type UnsupportedTypeScriptVersion =
* Parseable and supported TypeScript versions.
* Only add to this list if we will support this version on Definitely Typed.
*/
export type TypeScriptVersion = "4.1" | "4.2" | "4.3" | "4.4" | "4.5" | "4.6" | "4.7" | "4.8" | "4.9";
export type TypeScriptVersion = "4.1" | "4.2" | "4.3" | "4.4" | "4.5" | "4.6" | "4.7" | "4.8" | "4.9" | "5.0";
export type AllTypeScriptVersion = UnsupportedTypeScriptVersion | TypeScriptVersion;
@@ -60,7 +62,7 @@ export namespace TypeScriptVersion {
/** Add to this list when a version actually ships. */
export const shipped: readonly TypeScriptVersion[] = ["4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7", "4.8"];
/** Add to this list when a version is available as typescript@next */
export const supported: readonly TypeScriptVersion[] = [...shipped, "4.9"];
export const supported: readonly TypeScriptVersion[] = [...shipped, "4.9", "5.0"];
/** Add to this list when it will no longer be supported on Definitely Typed */
export const unsupported: readonly UnsupportedTypeScriptVersion[] = [
"2.0",