Skip to content

Commit 7b8bf3e

Browse files
committed
fix: swap to tsx over ts-node
chore: lock tsx to 4.2.1 to mitigate test coverage reporting 100% when not testing compiled js
1 parent f683c88 commit 7b8bf3e

File tree

7 files changed

+23
-11
lines changed

7 files changed

+23
-11
lines changed

.taprc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# vim: set filetype=yaml :
22
disable-coverage: false
3-
allow-empty-coverage: true
4-
allow-incomplete-coverage: true
3+
allow-empty-coverage: false
4+
allow-incomplete-coverage: false
55
plugin:
66
- "@tapjs/sinon"
77
- "!@tapjs/intercept"

lib/content/clean.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env ts-node
1+
#!/usr/bin/env tsx
22
// This file is managed by code-skeleton. Do not make changes.
33

44
import { rmSync } from "node:fs";

lib/content/update-shebang.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#!/usr/bin/env ts-node
1+
#!/usr/bin/env tsx
22

33
import { spawnSync } from "node:child_process";
44
import { readFile, writeFile } from "node:fs/promises";
55
import { dirname, resolve } from "node:path";
66

77
const ROOT = dirname(__dirname);
8-
const tsShebang = "#!/usr/bin/env ts-node";
8+
const tsShebang = "#!/usr/bin/env tsx";
99
const jsShebang = "#!/usr/bin/env node";
1010

1111
async function updateShebang (path: string) {

lib/index.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,16 @@ export default async function (root: string, variables: Variables) {
7676
"@typescript-eslint/parser": "^6.0.0",
7777
"eslint": "^8.0.0",
7878
"tap": "^18.7.0",
79-
"ts-node": "^10.0.0",
79+
"tsx": "4.2.1",
8080
"typescript": "^5.0.0"
8181
},
82+
"overrides": {
83+
// Needed with the 4.2.1 tsx version lock to fix code coverage
84+
// https://github.com/privatenumber/tsx/issues/433
85+
"@tapjs/tsx": {
86+
"tsx": "$tsx"
87+
}
88+
},
8289
removeDependencies: [
8390
"@types/tap",
8491
"@tsconfig/node18"

package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,17 @@
3333
"@typescript-eslint/parser": "^6.0.0",
3434
"eslint": "^8.0.0",
3535
"tap": "^18.7.0",
36-
"ts-node": "^10.0.0",
37-
"typescript": "5.2.2"
36+
"tsx": "4.2.1",
37+
"typescript": "^5.0.0"
3838
},
3939
"peerDependencies": {
4040
"code-skeleton": "^2.0.0"
4141
},
42+
"overrides": {
43+
"@tapjs/tsx": {
44+
"tsx": "$tsx"
45+
}
46+
},
4247
"skeleton": {
4348
"module": ".",
4449
"variables": {

scripts/clean.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env ts-node
1+
#!/usr/bin/env tsx
22
// This file is managed by code-skeleton. Do not make changes.
33

44
import { rmSync } from "node:fs";

scripts/update-shebang.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#!/usr/bin/env ts-node
1+
#!/usr/bin/env tsx
22

33
import { spawnSync } from "node:child_process";
44
import { readFile, writeFile } from "node:fs/promises";
55
import { dirname, resolve } from "node:path";
66

77
const ROOT = dirname(__dirname);
8-
const tsShebang = "#!/usr/bin/env ts-node";
8+
const tsShebang = "#!/usr/bin/env tsx";
99
const jsShebang = "#!/usr/bin/env node";
1010

1111
async function updateShebang (path: string) {

0 commit comments

Comments
 (0)