Skip to content

Commit

Permalink
Update TS versions; removing 4.8, shipping 5.6, supporting 5.8 (#1100)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey authored Nov 7, 2024
1 parent 3ee924c commit a4b62cd
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 31 deletions.
6 changes: 6 additions & 0 deletions .changeset/sweet-crews-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@definitelytyped/typescript-packages": patch
"@definitelytyped/typescript-versions": patch
---

Update TS versions; removing 4.8, shipping 5.6, supporting 5.8
2 changes: 1 addition & 1 deletion packages/publisher/test/generate-packages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ testo({
"@types/express": "*"
},
"typesPublisherContentHash": "53300522250468c4161b10d962cac2d9d8f2cfee1b3dfef4b749a7c3ec839275",
"typeScriptVersion": "4.8"
"typeScriptVersion": "4.9"
}`);
},
basicNotNeededPackageJson() {
Expand Down
4 changes: 2 additions & 2 deletions packages/typescript-packages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
},
"dependencies": {
"@definitelytyped/typescript-versions": "workspace:*",
"typescript-4.8": "npm:typescript@~4.8.0-0",
"typescript-4.9": "npm:typescript@~4.9.0-0",
"typescript-5.0": "npm:typescript@~5.0.0-0",
"typescript-5.1": "npm:typescript@~5.1.0-0",
Expand All @@ -31,6 +30,7 @@
"typescript-5.4": "npm:typescript@~5.4.0-0",
"typescript-5.5": "npm:typescript@~5.5.0-0",
"typescript-5.6": "npm:typescript@~5.6.0-0",
"typescript-5.7": "npm:typescript@~5.7.0-0"
"typescript-5.7": "npm:typescript@~5.7.0-0",
"typescript-5.8": "npm:typescript@~5.8.0-0"
}
}
5 changes: 3 additions & 2 deletions packages/typescript-versions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export type AllTypeScriptVersion = UnsupportedTypeScriptVersion | TypeScriptVers

export namespace TypeScriptVersion {
/** Add to this list when a version actually ships. */
export const shipped = ["4.8", "4.9", "5.0", "5.1", "5.2", "5.3", "5.4", "5.5"] as const;
export const shipped = ["4.9", "5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6"] as const;
/** Add to this list when a version is available as typescript@next */
export const supported = [...shipped, "5.6", "5.7"] as const;
export const supported = [...shipped, "5.7", "5.8"] as const;
/** Add to this list when it will no longer be supported on Definitely Typed */
export const unsupported = [
"2.0",
Expand Down Expand Up @@ -74,6 +74,7 @@ export namespace TypeScriptVersion {
"4.5",
"4.6",
"4.7",
"4.8",
] as const;
export const all: readonly AllTypeScriptVersion[] = [...unsupported, ...supported];
export const lowest = supported[0];
Expand Down
21 changes: 11 additions & 10 deletions packages/typescript-versions/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ describe("all", () => {

describe("isSupported", () => {
it("works", () => {
expect(TypeScriptVersion.isSupported("5.1")).toBeTruthy();
expect(TypeScriptVersion.isSupported("5.6")).toBeTruthy();
});
it("supports 4.8", () => {
expect(TypeScriptVersion.isSupported("4.8")).toBeTruthy();
it("supports 4.9", () => {
expect(TypeScriptVersion.isSupported("4.9")).toBeTruthy();
});
it("does not support 4.7", () => {
expect(!TypeScriptVersion.isSupported("4.7")).toBeTruthy();
it("does not support 4.8", () => {
expect(!TypeScriptVersion.isSupported("4.8")).toBeTruthy();
});
});

Expand All @@ -42,10 +42,10 @@ describe("isTypeScriptVersion", () => {

describe("range", () => {
it("works", () => {
expect(TypeScriptVersion.range("4.9")).toEqual(["4.9", "5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6", "5.7"]);
expect(TypeScriptVersion.range("5.0")).toEqual(["5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6", "5.7", "5.8"]);
});
it("includes 4.8 onwards", () => {
expect(TypeScriptVersion.range("4.8")).toEqual(TypeScriptVersion.supported);
it("includes 4.9 onwards", () => {
expect(TypeScriptVersion.range("4.9")).toEqual(TypeScriptVersion.supported);
});
});

Expand All @@ -60,11 +60,12 @@ describe("tagsToUpdate", () => {
"ts5.5",
"ts5.6",
"ts5.7",
"ts5.8",
"latest",
]);
});
it("allows 4.8 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("4.8")).toEqual(
it("allows 4.9 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("4.9")).toEqual(
TypeScriptVersion.supported.map((s) => "ts" + s).concat("latest"),
);
});
Expand Down
26 changes: 10 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a4b62cd

Please sign in to comment.