Skip to content

Commit 18acb7f

Browse files
committed
chore!: remove typescript 4.7 support
1 parent d6881ad commit 18acb7f

File tree

14 files changed

+13
-386
lines changed

14 files changed

+13
-386
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
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-4.7": "npm:typescript@4.7.x",
7069
"changelogen": "^0.5.5",
7170
"eslint": "9.x",
7271
"globals": "^15.9.0",
@@ -77,7 +76,7 @@
7776
"typescript-eslint": "^8.3.0"
7877
},
7978
"peerDependencies": {
80-
"typescript": ">=4"
79+
"typescript": ">=5"
8180
},
8281
"dependencies": {
8382
"minimatch": "^9.0.5"

src/harmony/harmony-factory.ts

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

src/harmony/index.ts

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

src/harmony/utils.ts

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

src/harmony/versions/four-seven.ts

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

src/harmony/versions/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/transformer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import path from "node:path";
22
import ts, { CompilerOptions } from "typescript";
33
import { RunMode, TsNodeState, TsTransformPathsConfig, TsTransformPathsContext, VisitorContext } from "./types";
44
import { nodeVisitor } from "./visitor";
5-
import { createHarmonyFactory } from "./harmony";
65
import { Minimatch } from "minimatch";
76
import { createSyntheticEmitHost, getTsNodeRegistrationProperties } from "./utils/ts-helpers";
87
import { TransformerExtras } from "ts-patch";
@@ -139,7 +138,7 @@ export default function transformer(
139138
getVisitor() {
140139
return nodeVisitor.bind(this);
141140
},
142-
factory: createHarmonyFactory(tsTransformPathsContext),
141+
factory: (tsTransformPathsContext.tsFactory ?? tsTransformPathsContext.tsInstance) as ts.NodeFactory,
143142
};
144143

145144
return tsInstance.visitEachChild(sourceFile, visitorContext.getVisitor(), transformationContext);

src/types.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import ts, { CompilerOptions, EmitHost, Pattern, SourceFile } from "typescript";
22
import { PluginConfig } from "ts-patch";
33
import { Minimatch } from "minimatch";
44

5-
import { HarmonyFactory } from "./harmony";
6-
75
/* ****************************************************************************************************************** */
86
// region: TS Types
97
/* ****************************************************************************************************************** */
@@ -49,7 +47,7 @@ export interface TsTransformPathsContext {
4947
}
5048

5149
export interface VisitorContext extends TsTransformPathsContext {
52-
readonly factory: HarmonyFactory;
50+
readonly factory: ts.NodeFactory;
5351
readonly sourceFile: ts.SourceFile;
5452
readonly isDeclarationFile: boolean;
5553
readonly originalSourceFile: ts.SourceFile;

test/config.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
import ts from "typescript";
2-
import tsFourSeven from "typescript-4.7";
3-
import tsFiveFive from "typescript-5.5";
4-
import tsFiveSix from "typescript-5.6";
52
import path from "node:path";
63

7-
export const tsModules = <const>[
8-
["4.7.4", tsFourSeven, "typescript-4.7"],
9-
["5.5.4", tsFiveFive, "typescript-5.5"],
10-
["5.6.3", tsFiveSix, "typescript-5.6"],
11-
["Latest", ts, "typescript"],
12-
];
4+
export const tsModules = <const>[["Latest", ts, "typescript"]];
135

146
export const projectsPaths = path.join(__dirname, "./projects");
157
export const transformerPath = require.resolve("typescript-transform-paths");

test/package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@
1919
"ts-jest": "^29.2.4",
2020
"ts-node": "^10.9.2",
2121
"ts-patch": "^3.3.0",
22-
"tsp1": "npm:ts-patch@1.*.*",
23-
"tsp2": "npm:ts-patch@2.*.*",
2422
"typescript": "^5.7.2",
25-
"typescript-4.7": "npm:typescript@4.7.4",
26-
"typescript-5.5": "npm:typescript@5.5.4",
27-
"typescript-5.6": "npm:typescript@5.6.3",
2823
"typescript-transform-paths": "portal:../"
2924
},
3025
"workspaces": [

0 commit comments

Comments
 (0)