Skip to content

Commit

Permalink
Drop support for TS 4.9, mark TS 5.7 as shipped (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey authored Nov 25, 2024
1 parent 36dd121 commit 3af1e86
Show file tree
Hide file tree
Showing 15 changed files with 124 additions and 117 deletions.
6 changes: 6 additions & 0 deletions .changeset/khaki-peas-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@definitelytyped/typescript-packages": patch
"@definitelytyped/typescript-versions": patch
---

Drop support for TS 4.9, mark TS 5.7 as shipped
11 changes: 11 additions & 0 deletions .changeset/tiny-camels-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@definitelytyped/typescript-packages": patch
"@definitelytyped/typescript-versions": patch
"@definitelytyped/definitions-parser": patch
"@definitelytyped/eslint-plugin": patch
"@definitelytyped/dts-critic": patch
"dts-gen": patch
"@definitelytyped/dtslint": patch
---

Use TS 5.7
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"knip": "^5.36.3",
"prettier": "^3.3.3",
"ts-jest": "^29.2.5",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
},
"pnpm": {
"overrides": {
Expand Down
2 changes: 1 addition & 1 deletion packages/definitions-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"devDependencies": {
"@types/pacote": "^11.1.8",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
},
"peerDependencies": {
"typescript": "*"
Expand Down
2 changes: 1 addition & 1 deletion packages/dts-critic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"dependencies": {
"@definitelytyped/header-parser": "workspace:*",
"typescript": "^5.6.3",
"typescript": "^5.7.2",
"yargs": "^17.7.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/dts-gen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"dts-dom": "^3.7.0",
"parse-git-config": "^3.0.0",
"typescript": "^5.6.3",
"typescript": "^5.7.2",
"yargs": "^17.7.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/dtslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@types/eslint": "^8.56.12",
"@types/semver": "^7.5.8",
"@types/strip-json-comments": "^3.0.0",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
},
"engines": {
"node": ">=18.18.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"glob": "^10.4.5",
"jest-file-snapshot": "^0.7.0",
"strip-ansi": "^6.0.1",
"typescript": "^5.6.3",
"typescript": "^5.7.2",
"typescript-5.4": "npm:typescript@~5.4.0-0",
"typescript-5.5": "npm:typescript@~5.5.0-0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/mergebot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"jest-file-snapshot": "^0.7.0",
"rimraf": "^5.0.10",
"seroval": "^1.1.1",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
},
"scripts": {
"prestart": "pnpm run build",
Expand Down
2 changes: 1 addition & 1 deletion packages/publisher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"longjohn": "^0.2.12",
"pacote": "^20.0.0",
"semver": "^7.6.3",
"typescript": "^5.6.3",
"typescript": "^5.7.2",
"yargs": "^17.7.2"
},
"devDependencies": {
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 @@ -169,7 +169,7 @@ testo({
"@types/express": "*"
},
"typesPublisherContentHash": "53300522250468c4161b10d962cac2d9d8f2cfee1b3dfef4b749a7c3ec839275",
"typeScriptVersion": "4.9"
"typeScriptVersion": "5.0"
}`);
},
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.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",
"typescript-5.2": "npm:typescript@~5.2.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.9", "5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6"] as const;
export const shipped = ["5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6", "5.7"] as const;
/** Add to this list when a version is available as typescript@next */
export const supported = [...shipped, "5.7", "5.8"] as const;
export const supported = [...shipped, "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 @@ -75,6 +75,7 @@ export namespace TypeScriptVersion {
"4.6",
"4.7",
"4.8",
"4.9",
] as const;
export const all: readonly AllTypeScriptVersion[] = [...unsupported, ...supported];
export const lowest = supported[0];
Expand Down
21 changes: 10 additions & 11 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.6")).toBeTruthy();
});
it("supports 4.9", () => {
expect(TypeScriptVersion.isSupported("4.9")).toBeTruthy();
it("supports 5.0", () => {
expect(TypeScriptVersion.isSupported("5.0")).toBeTruthy();
});
it("does not support 4.8", () => {
expect(!TypeScriptVersion.isSupported("4.8")).toBeTruthy();
it("does not support 4.9", () => {
expect(!TypeScriptVersion.isSupported("4.9")).toBeTruthy();
});
});

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

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

describe("tagsToUpdate", () => {
it("works", () => {
expect(TypeScriptVersion.tagsToUpdate("5.0")).toEqual([
"ts5.0",
expect(TypeScriptVersion.tagsToUpdate("5.1")).toEqual([
"ts5.1",
"ts5.2",
"ts5.3",
Expand All @@ -64,8 +63,8 @@ describe("tagsToUpdate", () => {
"latest",
]);
});
it("allows 4.9 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("4.9")).toEqual(
it("allows 5.0 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("5.0")).toEqual(
TypeScriptVersion.supported.map((s) => "ts" + s).concat("latest"),
);
});
Expand Down
Loading

0 comments on commit 3af1e86

Please sign in to comment.