Skip to content

Commit

Permalink
chore: remove ts3.6 support (#296)
Browse files Browse the repository at this point in the history
* chore: remove ts3.6 support

* add Typescript 4.5

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
  • Loading branch information
SimonSchick and sandersn authored Aug 20, 2021
1 parent 387524b commit a916f39
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
35 changes: 18 additions & 17 deletions packages/header-parser/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("parse", () => {
libraryName: "foo",
libraryMajorVersion: 1,
libraryMinorVersion: 2,
typeScriptVersion: "3.6",
typeScriptVersion: "3.7",
nonNpm: false,
projects: ["https://github.com/foo/foo", "https://foo.com"],
contributors: [
Expand All @@ -65,7 +65,7 @@ describe("parse", () => {
libraryName: "foo",
libraryMajorVersion: 1,
libraryMinorVersion: 2,
typeScriptVersion: "3.6",
typeScriptVersion: "3.7",
nonNpm: false,
projects: ["https://github.com/foo/foo", "https://foo.com"],
contributors: [
Expand Down Expand Up @@ -147,11 +147,11 @@ describe("isSupported", () => {
it("works", () => {
expect(TypeScriptVersion.isSupported("4.1")).toBeTruthy();
});
it("supports 3.6", () => {
expect(TypeScriptVersion.isSupported("3.6")).toBeTruthy();
it("supports 3.7", () => {
expect(TypeScriptVersion.isSupported("3.7")).toBeTruthy();
});
it("does not support 3.5", () => {
expect(!TypeScriptVersion.isSupported("3.5")).toBeTruthy();
it("does not support 3.6", () => {
expect(!TypeScriptVersion.isSupported("3.6")).toBeTruthy();
});
});

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

describe("range", () => {
it("works", () => {
expect(TypeScriptVersion.range("3.7")).toEqual(["3.7", "3.8", "3.9", "4.0", "4.1", "4.2", "4.3", "4.4"]);
expect(TypeScriptVersion.range("4.0")).toEqual(["4.0", "4.1", "4.2", "4.3", "4.4", "4.5"]);
});
it("includes 3.6 onwards", () => {
expect(TypeScriptVersion.range("3.6")).toEqual(TypeScriptVersion.supported);
it("includes 3.7 onwards", () => {
expect(TypeScriptVersion.range("3.7")).toEqual(TypeScriptVersion.supported);
});
});

Expand All @@ -185,11 +185,12 @@ describe("tagsToUpdate", () => {
"ts4.2",
"ts4.3",
"ts4.4",
"ts4.5",
"latest"
]);
});
it("allows 3.6 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("3.6")).toEqual(
it("allows 3.7 onwards", () => {
expect(TypeScriptVersion.tagsToUpdate("3.7")).toEqual(
TypeScriptVersion.supported.map(s => "ts" + s).concat("latest")
);
});
Expand All @@ -207,10 +208,10 @@ describe("makeTypesVersionsForPackageJson", () => {
});
});
it("orders versions old to new with old-to-new input", () => {
expect(JSON.stringify(makeTypesVersionsForPackageJson(["3.6", "3.9", "4.0"]), undefined, 4)).toEqual(`{
"<=3.6": {
expect(JSON.stringify(makeTypesVersionsForPackageJson(["3.7", "3.9", "4.0"]), undefined, 4)).toEqual(`{
"<=3.7": {
"*": [
"ts3.6/*"
"ts3.7/*"
]
},
"<=3.9": {
Expand All @@ -226,10 +227,10 @@ describe("makeTypesVersionsForPackageJson", () => {
}`);
});
it("orders versions old to new with new-to-old input", () => {
expect(JSON.stringify(makeTypesVersionsForPackageJson(["4.0", "3.9", "3.6"]), undefined, 4)).toEqual(`{
"<=3.6": {
expect(JSON.stringify(makeTypesVersionsForPackageJson(["4.0", "3.9", "3.7"]), undefined, 4)).toEqual(`{
"<=3.7": {
"*": [
"ts3.6/*"
"ts3.7/*"
]
},
"<=3.9": {
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 @@ -133,7 +133,7 @@ testo({
"balzac": "~3"
},
"typesPublisherContentHash": "11",
"typeScriptVersion": "3.6"
"typeScriptVersion": "3.7"
}`);
},
githubPackageJsonName() {
Expand Down
12 changes: 7 additions & 5 deletions packages/typescript-versions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,21 @@ export type UnsupportedTypeScriptVersion =
| "3.2"
| "3.3"
| "3.4"
| "3.5";
| "3.5"
| "3.6";
/**
* Parseable and supported TypeScript versions.
* Only add to this list if we will support this version on DefinitelyTyped.
*/
export type TypeScriptVersion = "3.6" | "3.7" | "3.8" | "3.9" | "4.0" | "4.1" | "4.2" | "4.3" | "4.4";
export type TypeScriptVersion = "3.7" | "3.8" | "3.9" | "4.0" | "4.1" | "4.2" | "4.3" | "4.4" | "4.5";

export type AllTypeScriptVersion = UnsupportedTypeScriptVersion | TypeScriptVersion;

export namespace TypeScriptVersion {
/** Add to this list when a version actual ships. */
export const shipped: readonly TypeScriptVersion[] = ["3.6", "3.7", "3.8", "3.9", "4.0", "4.1", "4.2", "4.3"];
export const shipped: readonly TypeScriptVersion[] = [ "3.7", "3.8", "3.9", "4.0", "4.1", "4.2", "4.3"];
/** Add to this list when a version is available as typescript@next */
export const supported: readonly TypeScriptVersion[] = [...shipped, "4.4"];
export const supported: readonly TypeScriptVersion[] = [...shipped, "4.4", "4.5"];
/** Add to this list when it will no longer be supported on Definitely Typed */
export const unsupported: readonly UnsupportedTypeScriptVersion[] = [
"2.0",
Expand All @@ -73,7 +74,8 @@ export namespace TypeScriptVersion {
"3.2",
"3.3",
"3.4",
"3.5"
"3.5",
"3.6"
];
export const all: readonly AllTypeScriptVersion[] = [...unsupported, ...supported];
export const lowest = supported[0];
Expand Down

0 comments on commit a916f39

Please sign in to comment.