Skip to content

Commit

Permalink
chore!: remove typescript 3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpza committed Sep 3, 2024
1 parent 8575a98 commit 98faee6
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 218 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
"@types/node": "^22.5.2",
"@types/ts-expose-internals": "npm:[email protected]",
"@types/ts-node": "npm:ts-node@^10.9.2",
"@types/typescript-3": "npm:[email protected]",
"@types/typescript-4.7": "npm:[email protected]",
"changelogen": "^0.5.5",
"eslint": "9.x",
Expand All @@ -78,7 +77,7 @@
"typescript-eslint": "^8.3.0"
},
"peerDependencies": {
"typescript": ">=3.6.5"
"typescript": ">=4"
},
"dependencies": {
"minimatch": "^10.0.1"
Expand Down
6 changes: 2 additions & 4 deletions src/harmony/harmony-factory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import TS from "typescript";
import { TsTransformPathsContext } from "../types";
import { TsFourSeven, TsThreeEight } from "./versions";
import { TsFourSeven } from "./versions";

/* ****************************************************************************************************************** */
// region: Types
Expand All @@ -18,9 +18,7 @@ export interface HarmonyFactory extends TS.NodeFactory {}
export function createHarmonyFactory(context: TsTransformPathsContext): HarmonyFactory {
return new Proxy(context.tsFactory ?? context.tsInstance, {
get(target, prop) {
if (TsThreeEight.predicate(context)) {
return TsThreeEight.handler(context, prop);
} else if (TsFourSeven.predicate(context)) {
if (TsFourSeven.predicate(context)) {
return TsFourSeven.handler(context, prop);
} else {
// @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'.
Expand Down
1 change: 0 additions & 1 deletion src/harmony/versions/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * as TsThreeEight from "./three-eight";
export * as TsFourSeven from "./four-seven";
158 changes: 0 additions & 158 deletions src/harmony/versions/three-eight.ts

This file was deleted.

2 changes: 0 additions & 2 deletions test/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import ts from "typescript";
import tsThree from "typescript-3";
import tsFourSeven from "typescript-4.7";
import path from "node:path";

export const tsModules = <const>[
["3.6.5", tsThree, "typescript-3"],
["4.7.4", tsFourSeven, "typescript-4.7"],
["Latest", ts, "typescript"],
];
Expand Down
2 changes: 0 additions & 2 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
"ts-jest": "^29.2.4",
"ts-node": "^10.9.2",
"ts-patch": "^3.2.1",
"tsp1": "npm:ts-patch@1.*.*",
"tsp2": "npm:ts-patch@2.*.*",
"typescript": "^5.5.4",
"typescript-3": "npm:[email protected]",
"typescript-4.7": "npm:[email protected]",
"typescript-transform-paths": "portal:../"
},
Expand Down
2 changes: 0 additions & 2 deletions test/prepare.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { symlink } from "node:fs/promises";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { patch } from "ts-patch";
import { patch as patch1 } from "tsp1";
import { patch as patch2 } from "tsp2";

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

patchTypescript("typescript-3", patch1);
patchTypescript("typescript-4.7", patch2);
patchTypescript("typescript", patch);
}
Expand Down
39 changes: 4 additions & 35 deletions test/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5012,7 +5012,7 @@ __metadata:
languageName: node
linkType: hard

"glob@npm:^7.0.0, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.1.7":
"glob@npm:^7.0.0, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6":
version: 7.2.3
resolution: "glob@npm:7.2.3"
dependencies:
Expand Down Expand Up @@ -6635,7 +6635,7 @@ __metadata:
languageName: node
linkType: hard

"minimist@npm:^1.2.0, minimist@npm:^1.2.5, minimist@npm:^1.2.6, minimist@npm:^1.2.8":
"minimist@npm:^1.2.0, minimist@npm:^1.2.6, minimist@npm:^1.2.8":
version: 1.2.8
resolution: "minimist@npm:1.2.8"
checksum: 10c0/19d3fcdca050087b84c2029841a093691a91259a47def2f18222f41e7645a0b7c44ef4b40e88a1e58a40c84d2ef0ee6047c55594d298146d0eb3f6b737c20ce6
Expand Down Expand Up @@ -8096,10 +8096,8 @@ __metadata:
ts-jest: "npm:^29.2.4"
ts-node: "npm:^10.9.2"
ts-patch: "npm:^3.2.1"
tsp1: "npm:ts-patch@1.*.*"
tsp2: "npm:ts-patch@2.*.*"
typescript: "npm:^5.5.4"
typescript-3: "npm:[email protected]"
typescript-4.7: "npm:[email protected]"
typescript-transform-paths: "portal:../"
languageName: unknown
Expand Down Expand Up @@ -8382,7 +8380,7 @@ __metadata:
languageName: node
linkType: hard

"shelljs@npm:^0.8.4, shelljs@npm:^0.8.5":
"shelljs@npm:^0.8.5":
version: 0.8.5
resolution: "shelljs@npm:0.8.5"
dependencies:
Expand Down Expand Up @@ -9170,25 +9168,6 @@ __metadata:
languageName: node
linkType: hard

"tsp1@npm:ts-patch@1.*.*":
version: 1.4.5
resolution: "ts-patch@npm:1.4.5"
dependencies:
chalk: "npm:^4.1.0"
glob: "npm:^7.1.7"
global-prefix: "npm:^3.0.0"
minimist: "npm:^1.2.5"
resolve: "npm:^1.20.0"
shelljs: "npm:^0.8.4"
strip-ansi: "npm:^6.0.0"
peerDependencies:
typescript: ">2.7.0"
bin:
ts-patch: bin/cli.js
checksum: 10c0/3e9b0d3838d0fc930f89000206c586485582c7f7f2746f1e4227a6777b10c06c7642395cd88cbd2950a3938da4146d4e8a1fbe0e02f46624764b9d42a01d7470
languageName: node
linkType: hard

"tsp2@npm:ts-patch@2.*.*":
version: 2.1.0
resolution: "ts-patch@npm:2.1.0"
Expand Down Expand Up @@ -9239,16 +9218,6 @@ __metadata:
languageName: node
linkType: hard

"typescript-3@npm:[email protected]":
version: 3.6.5
resolution: "typescript@npm:3.6.5"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/b6f0d5d2e2325b28460b8cf3a4a1237d79aec9951ad727014d4ca570327cc5947decec5d262044979cc0a9ab63746b58e6d8438d73d33ce8415e5369d0490dff
languageName: node
linkType: hard

"typescript-4.7@npm:[email protected]":
version: 4.7.4
resolution: "typescript@npm:4.7.4"
Expand All @@ -9265,7 +9234,7 @@ __metadata:
dependencies:
minimatch: "npm:^10.0.1"
peerDependencies:
typescript: ">=3.6.5"
typescript: ">=4"
languageName: node
linkType: soft

Expand Down
13 changes: 1 addition & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -341,16 +341,6 @@ __metadata:
languageName: node
linkType: hard

"@types/typescript-3@npm:[email protected]":
version: 3.9.10
resolution: "typescript@npm:3.9.10"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/863cc06070fa18a0f9c6a83265fb4922a8b51bf6f2c6760fb0b73865305ce617ea4bc6477381f9f4b7c3a8cb4a455b054f5469e6e41307733fe6a2bd9aae82f8
languageName: node
linkType: hard

"@types/typescript-4.7@npm:[email protected]":
version: 4.7.4
resolution: "typescript@npm:4.7.4"
Expand Down Expand Up @@ -2995,7 +2985,6 @@ __metadata:
"@types/node": "npm:^22.5.2"
"@types/ts-expose-internals": "npm:[email protected]"
"@types/ts-node": "npm:ts-node@^10.9.2"
"@types/typescript-3": "npm:[email protected]"
"@types/typescript-4.7": "npm:[email protected]"
changelogen: "npm:^0.5.5"
eslint: "npm:9.x"
Expand All @@ -3007,7 +2996,7 @@ __metadata:
typescript: "npm:^5.5.4"
typescript-eslint: "npm:^8.3.0"
peerDependencies:
typescript: ">=3.6.5"
typescript: ">=4"
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 98faee6

Please sign in to comment.