Skip to content

Commit

Permalink
Update for TS 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Mar 7, 2024
1 parent d887c24 commit 04db2a6
Show file tree
Hide file tree
Showing 12 changed files with 123 additions and 109 deletions.
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": "^4.0.2",
"prettier": "^3.2.2",
"ts-jest": "^29.1.1",
"typescript": "^5.3.3"
"typescript": "^5.4.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.3.3"
"typescript": "^5.4.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.3.3",
"typescript": "^5.4.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.3.3",
"typescript": "^5.4.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.2",
"@types/semver": "^7.5.5",
"@types/strip-json-comments": "^3.0.0",
"typescript": "^5.3.3"
"typescript": "^5.4.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 @@ -39,7 +39,7 @@
"glob": "^10.3.10",
"jest-file-snapshot": "^0.5.0",
"strip-ansi": "^6.0.1",
"typescript": "^5.3.3"
"typescript": "^5.4.2"
},
"engines": {
"node": ">=18.18.0"
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": "^17.0.5",
"semver": "^7.5.4",
"typescript": "^5.3.3",
"typescript": "^5.4.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 @@ -156,7 +156,7 @@ testo({
"@types/madeira": "^1"
},
"typesPublisherContentHash": "05febc04df55db2687c2ac05a291177c2f4fd90f76d679faaf1b01896fe5600c",
"typeScriptVersion": "4.6"
"typeScriptVersion": "4.7"
}`);
},
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,14 +22,14 @@
},
"dependencies": {
"@definitelytyped/typescript-versions": "workspace:*",
"typescript-4.6": "npm:typescript@~4.6.0-0",
"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",
"typescript-5.1": "npm:typescript@~5.1.0-0",
"typescript-5.2": "npm:typescript@~5.2.0-0",
"typescript-5.3": "npm:typescript@~5.3.0-0",
"typescript-5.4": "npm:typescript@~5.4.0-0"
"typescript-5.4": "npm:typescript@~5.4.0-0",
"typescript-5.5": "npm:typescript@~5.5.0-0"
}
}
14 changes: 7 additions & 7 deletions packages/typescript-versions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import assert from "assert";
For the RC:
1. Add a new version to the end of `TypeScriptVersion` and `supported`.
1. Add a new version to the end of `supported`.
`supported` now contains the shipped versions, the RC, and the nightly.
2. Add the new version to `packages/typescript-packages/package.json`.
3. Update failing tests.
Expand All @@ -20,10 +20,9 @@ import assert from "assert";
# How to deprecate an old version on Definitely Typed #
1. Move the old version from `TypeScriptVersion` to `UnsupportedTypeScriptVersion`.
2. Move the old version from `shipped` to `unsupported`.
3. Remove the old version from `packages/typescript-packages/package.json`.
4. Update failing tests.
1. Move the old version from `shipped` to `unsupported`.
2. Remove the old version from `packages/typescript-packages/package.json`.
3. Update failing tests.
Currently, it's possible to release a new version and deprecate an old version
at the same time because of the way release schedule overlaps.
Expand All @@ -42,9 +41,9 @@ export type AllTypeScriptVersion = UnsupportedTypeScriptVersion | TypeScriptVers

export namespace TypeScriptVersion {
/** Add to this list when a version actually ships. */
export const shipped = ["4.6", "4.7", "4.8", "4.9", "5.0", "5.1", "5.2", "5.3"] as const;
export const shipped = ["4.7", "4.8", "4.9", "5.0", "5.1", "5.2", "5.3", "5.4"] as const;
/** Add to this list when a version is available as typescript@next */
export const supported = [...shipped, "5.4"] as const;
export const supported = [...shipped, "5.5"] 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 +72,7 @@ export namespace TypeScriptVersion {
"4.3",
"4.4",
"4.5",
"4.6",
] as const;
export const all: readonly AllTypeScriptVersion[] = [...unsupported, ...supported];
export const lowest = supported[0];
Expand Down
28 changes: 18 additions & 10 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.6", () => {
expect(TypeScriptVersion.isSupported("4.6")).toBeTruthy();
it("supports 4.7", () => {
expect(TypeScriptVersion.isSupported("4.7")).toBeTruthy();
});
it("does not support 4.5", () => {
expect(!TypeScriptVersion.isSupported("4.5")).toBeTruthy();
it("does not support 4.6", () => {
expect(!TypeScriptVersion.isSupported("4.6")).toBeTruthy();
});
});

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

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

describe("tagsToUpdate", () => {
it("works", () => {
expect(TypeScriptVersion.tagsToUpdate("5.0")).toEqual(["ts5.0", "ts5.1", "ts5.2", "ts5.3", "ts5.4", "latest"]);
expect(TypeScriptVersion.tagsToUpdate("5.0")).toEqual([
"ts5.0",
"ts5.1",
"ts5.2",
"ts5.3",
"ts5.4",
"ts5.5",
"latest",
]);
});
it("allows 4.6 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("4.6")).toEqual(
it("allows 4.7 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("4.7")).toEqual(
TypeScriptVersion.supported.map((s) => "ts" + s).concat("latest"),
);
});
Expand Down
Loading

0 comments on commit 04db2a6

Please sign in to comment.