Skip to content

Commit 4b0dca9

Browse files
committed
Merge branch 'next' into tsdown-next
2 parents 09b0012 + b89d0ef commit 4b0dca9

18 files changed

+1245
-9828
lines changed

README.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,8 @@ import { sum } from "@utils/sum";
6060
### 3. Usage
6161

6262
- **Compile with `tsc`** — Use [ts-patch](https://github.com/nonara/ts-patch)
63-
64-
- **Use with ts-node** — Add `typescript-transform-paths/register` to `require` config.
65-
66-
`tsconfig.json`
67-
68-
```jsonc
69-
{
70-
"ts-node": {
71-
"transpileOnly": true,
72-
"require": [ "typescript-transform-paths/register" ],
73-
},
74-
"compilerOptions" { /* ... */ }
75-
}
76-
```
77-
78-
- **Use with node** — Use the register script: `node -r typescript-transform-paths/register src/index.ts`
63+
- **ts-node** — See [wiki](https://github.com/LeDDGroup/typescript-transform-paths/wiki/Integration-with-nx)
64+
- **nx** — See [wiki](https://github.com/LeDDGroup/typescript-transform-paths/wiki/Integration-with-ts%E2%80%90node)
7965

8066
## Virtual Directories
8167

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
".": {
88
"types": "./dist/index.d.ts",
99
"default": "./dist/index.js"
10-
},
11-
"./register": "./dist/register-entry.js"
10+
}
1211
},
1312
"files": [
1413
"dist",

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export type { TsTransformPathsConfig } from "./types";
2-
export { register } from "./register";
32

43
export { default } from "./transformer";

src/register-entry.ts

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

src/register.ts

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

src/utils/get-relative-path.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function getIsFsCaseSensitive() {
4747
}
4848

4949
/** @private The Export is only for unit tests */
50-
export function getMatchPortion(from: string, to: string) {
50+
export function getMatchPortion(from: string, to: string): string {
5151
const lowerFrom = from.toLocaleLowerCase();
5252
const lowerTo = to.toLocaleLowerCase();
5353

test/jest.config.ts

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

test/package.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,17 @@
22
"private": true,
33
"license": "MIT",
44
"scripts": {
5-
"test": "jest",
6-
"g:ts-node": "cd $INIT_CWD && ts-node",
5+
"test": "node --test --import tsx 'tests/**/*.test.ts'",
76
"postinstall": "node prepare.mjs"
87
},
98
"devDependencies": {
10-
"@nrwl/cli": "^15.9.7",
11-
"@nrwl/js": "^15.9.7",
12-
"@nrwl/node": "^15.9.7",
13-
"@nrwl/workspace": "^15.9.7",
149
"@tsconfig/node18": "^18.2.4",
15-
"@types/jest": "^29.5.14",
10+
"@tsconfig/node22": "^22.0.2",
11+
"@types/node": "^24.3.0",
1612
"@types/ts-expose-internals": "npm:ts-expose-internals@^4.9.5",
17-
"jest": "^29.7.0",
18-
"ts-jest": "^29.2.4",
19-
"ts-node": "^10.9.2",
13+
"escape-string-regexp": "^5.0.0",
2014
"ts-patch": "^3.3.0",
15+
"tsx": "^4.20.4",
2116
"typescript": "^5.7.2",
2217
"typescript-transform-paths": "portal:../"
2318
},

test/prepare.mjs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
// @ts-check
2-
import { existsSync } from "node:fs";
3-
import { symlink } from "node:fs/promises";
42
import { dirname, resolve } from "node:path";
53
import { fileURLToPath } from "node:url";
64
import { patch } from "ts-patch";
75

86
const __dirname = dirname(fileURLToPath(import.meta.url)); // https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules
97

10-
async function symlinkTsNode() {
11-
// we need to patch the root package node_modules in order for it to locate ts-node for the register tests.
12-
// installing ts-node as a depenency in the root is not an option since it would create two copies of ts-node
13-
// thus messing with the mocks in the tests
14-
const target = resolve(__dirname, "node_modules/ts-node");
15-
const path = resolve(__dirname, "../node_modules/ts-node");
16-
17-
if (!existsSync(path)) await symlink(target, path, "junction");
18-
}
19-
208
function patchTsModules() {
219
const rootDir = __dirname;
2210

@@ -30,4 +18,3 @@ function patchTsModules() {
3018
}
3119

3220
patchTsModules();
33-
await symlinkTsNode();

test/tests/extras.test.ts

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

0 commit comments

Comments
 (0)