Skip to content

Commit d6881ad

Browse files
committed
chore!: remove typescript 3 support
1 parent 322ad77 commit d6881ad

File tree

9 files changed

+18
-278
lines changed

9 files changed

+18
-278
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
"@types/node": "^22.5.2",
6767
"@types/ts-expose-internals": "npm:ts-expose-internals@4.9.5",
6868
"@types/ts-node": "npm:ts-node@^10.9.2",
69-
"@types/typescript-3": "npm:typescript@3.x",
70-
"@types/typescript-4.7": "npm:typescript@4.9.x",
69+
"@types/typescript-4.7": "npm:typescript@4.7.x",
7170
"changelogen": "^0.5.5",
7271
"eslint": "9.x",
7372
"globals": "^15.9.0",
@@ -78,7 +77,7 @@
7877
"typescript-eslint": "^8.3.0"
7978
},
8079
"peerDependencies": {
81-
"typescript": ">=3.6.5"
80+
"typescript": ">=4"
8281
},
8382
"dependencies": {
8483
"minimatch": "^9.0.5"

src/harmony/harmony-factory.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import TS from "typescript";
22
import { TsTransformPathsContext } from "../types";
3-
import { TsFourSeven, TsThreeEight } from "./versions";
3+
import { TsFourSeven } from "./versions";
44

55
/* ****************************************************************************************************************** */
66
// region: Types
@@ -18,9 +18,7 @@ export interface HarmonyFactory extends TS.NodeFactory {}
1818
export function createHarmonyFactory(context: TsTransformPathsContext): HarmonyFactory {
1919
return new Proxy(context.tsFactory ?? context.tsInstance, {
2020
get(target, prop) {
21-
if (TsThreeEight.predicate(context)) {
22-
return TsThreeEight.handler(context, prop);
23-
} else if (TsFourSeven.predicate(context)) {
21+
if (TsFourSeven.predicate(context)) {
2422
return TsFourSeven.handler(context, prop);
2523
} else {
2624
// @ts-expect-error TS(7053) FIXME: Element implicitly has an 'any' type because expression of type 'string | symbol' can't be used to index type 'typeof import("typescript") | NodeFactory'.

src/harmony/versions/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export * as TsThreeEight from "./three-eight";
21
export * as TsFourSeven from "./four-seven";

src/harmony/versions/three-eight.ts

Lines changed: 0 additions & 158 deletions
This file was deleted.

test/config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import ts from "typescript";
2-
import tsThree from "typescript-3";
32
import tsFourSeven from "typescript-4.7";
43
import tsFiveFive from "typescript-5.5";
54
import tsFiveSix from "typescript-5.6";
65
import path from "node:path";
76

87
export const tsModules = <const>[
9-
["3.6.5", tsThree, "typescript-3"],
108
["4.7.4", tsFourSeven, "typescript-4.7"],
119
["5.5.4", tsFiveFive, "typescript-5.5"],
1210
["5.6.3", tsFiveSix, "typescript-5.6"],

test/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"tsp1": "npm:ts-patch@1.*.*",
2323
"tsp2": "npm:ts-patch@2.*.*",
2424
"typescript": "^5.7.2",
25-
"typescript-3": "npm:typescript@3.6.5",
2625
"typescript-4.7": "npm:typescript@4.7.4",
2726
"typescript-5.5": "npm:typescript@5.5.4",
2827
"typescript-5.6": "npm:typescript@5.6.3",

test/prepare.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { symlink } from "node:fs/promises";
44
import { dirname, resolve } from "node:path";
55
import { fileURLToPath } from "node:url";
66
import { patch } from "ts-patch";
7-
import { patch as patch1 } from "tsp1";
87
import { patch as patch2 } from "tsp2";
98

109
const __dirname = dirname(fileURLToPath(import.meta.url)); // https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules
@@ -28,7 +27,6 @@ function patchTsModules() {
2827
tspatch(["tsc.js", "typescript.js"], { basedir, dir: basedir });
2928
}
3029

31-
patchTypescript("typescript-3", patch1);
3230
patchTypescript("typescript-4.7", patch2);
3331
patchTypescript("typescript-5.5", patch);
3432
patchTypescript("typescript-5.6", patch);

test/yarn.lock

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8095,7 +8095,6 @@ __metadata:
80958095
tsp1: "npm:ts-patch@1.*.*"
80968096
tsp2: "npm:ts-patch@2.*.*"
80978097
typescript: "npm:^5.7.2"
8098-
typescript-3: "npm:typescript@3.6.5"
80998098
typescript-4.7: "npm:typescript@4.7.4"
81008099
typescript-5.5: "npm:typescript@5.5.4"
81018100
typescript-5.6: "npm:typescript@5.6.3"
@@ -9237,16 +9236,6 @@ __metadata:
92379236
languageName: node
92389237
linkType: hard
92399238

9240-
"typescript-3@npm:typescript@3.6.5":
9241-
version: 3.6.5
9242-
resolution: "typescript@npm:3.6.5"
9243-
bin:
9244-
tsc: bin/tsc
9245-
tsserver: bin/tsserver
9246-
checksum: 10c0/b6f0d5d2e2325b28460b8cf3a4a1237d79aec9951ad727014d4ca570327cc5947decec5d262044979cc0a9ab63746b58e6d8438d73d33ce8415e5369d0490dff
9247-
languageName: node
9248-
linkType: hard
9249-
92509239
"typescript-4.7@npm:typescript@4.7.4":
92519240
version: 4.7.4
92529241
resolution: "typescript@npm:4.7.4"
@@ -9283,7 +9272,7 @@ __metadata:
92839272
dependencies:
92849273
minimatch: "npm:^9.0.5"
92859274
peerDependencies:
9286-
typescript: ">=3.6.5"
9275+
typescript: ">=4"
92879276
languageName: node
92889277
linkType: soft
92899278

0 commit comments

Comments
 (0)