Skip to content

Commit

Permalink
Drop support for TypeScript 4.7, support TypeScript 5.5 (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Jun 24, 2024
1 parent 69a7910 commit 2c5e174
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 27 deletions.
7 changes: 7 additions & 0 deletions .changeset/late-dots-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@definitelytyped/typescript-packages": patch
"@definitelytyped/typescript-versions": patch
"@definitelytyped/header-parser": patch
---

Drop support for TypeScript 4.7, support TypeScript 5.5
12 changes: 6 additions & 6 deletions packages/header-parser/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ describe("makeTypesVersionsForPackageJson", () => {
});
});
it("orders versions old to new with old-to-new input", () => {
expect(JSON.stringify(makeTypesVersionsForPackageJson(["4.7", "5.0", "5.2"]), undefined, 4)).toEqual(`{
"<=4.7": {
expect(JSON.stringify(makeTypesVersionsForPackageJson(["4.8", "5.0", "5.2"]), undefined, 4)).toEqual(`{
"<=4.8": {
"*": [
"ts4.7/*"
"ts4.8/*"
]
},
"<=5.0": {
Expand All @@ -131,10 +131,10 @@ describe("makeTypesVersionsForPackageJson", () => {
}`);
});
it("orders versions old to new with new-to-old input", () => {
expect(JSON.stringify(makeTypesVersionsForPackageJson(["5.2", "5.0", "4.7"]), undefined, 4)).toEqual(`{
"<=4.7": {
expect(JSON.stringify(makeTypesVersionsForPackageJson(["5.2", "5.0", "4.8"]), undefined, 4)).toEqual(`{
"<=4.8": {
"*": [
"ts4.7/*"
"ts4.8/*"
]
},
"<=5.0": {
Expand Down
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 @@ -157,7 +157,7 @@ testo({
"@types/madeira": "^1"
},
"typesPublisherContentHash": "05febc04df55db2687c2ac05a291177c2f4fd90f76d679faaf1b01896fe5600c",
"typeScriptVersion": "4.7"
"typeScriptVersion": "4.8"
}`);
},
basicNotNeededPackageJson() {
Expand Down
1 change: 0 additions & 1 deletion 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.7": "npm:typescript@~4.7.0-0",
"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",
Expand Down
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.7", "4.8", "4.9", "5.0", "5.1", "5.2", "5.3", "5.4"] as const;
export const shipped = ["4.8", "4.9", "5.0", "5.1", "5.2", "5.3", "5.4", "5.5"] as const;
/** Add to this list when a version is available as typescript@next */
export const supported = [...shipped, "5.5", "5.6"] as const;
export const supported = [...shipped, "5.6"] 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 @@ -73,6 +73,7 @@ export namespace TypeScriptVersion {
"4.4",
"4.5",
"4.6",
"4.7",
] as const;
export const all: readonly AllTypeScriptVersion[] = [...unsupported, ...supported];
export const lowest = supported[0];
Expand Down
16 changes: 8 additions & 8 deletions packages/typescript-versions/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ describe("isSupported", () => {
it("works", () => {
expect(TypeScriptVersion.isSupported("5.1")).toBeTruthy();
});
it("supports 4.7", () => {
expect(TypeScriptVersion.isSupported("4.7")).toBeTruthy();
it("supports 4.8", () => {
expect(TypeScriptVersion.isSupported("4.8")).toBeTruthy();
});
it("does not support 4.6", () => {
expect(!TypeScriptVersion.isSupported("4.6")).toBeTruthy();
it("does not support 4.7", () => {
expect(!TypeScriptVersion.isSupported("4.7")).toBeTruthy();
});
});

Expand All @@ -44,8 +44,8 @@ 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"]);
});
it("includes 4.7 onwards", () => {
expect(TypeScriptVersion.range("4.7")).toEqual(TypeScriptVersion.supported);
it("includes 4.8 onwards", () => {
expect(TypeScriptVersion.range("4.8")).toEqual(TypeScriptVersion.supported);
});
});

Expand All @@ -62,8 +62,8 @@ describe("tagsToUpdate", () => {
"latest",
]);
});
it("allows 4.7 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("4.7")).toEqual(
it("allows 4.8 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("4.8")).toEqual(
TypeScriptVersion.supported.map((s) => "ts" + s).concat("latest"),
);
});
Expand Down
9 changes: 0 additions & 9 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 2c5e174

Please sign in to comment.