Skip to content

Commit

Permalink
fix: swap to tsx over ts-node
Browse files Browse the repository at this point in the history
chore: lock tsx to 4.2.1 to mitigate test coverage reporting 100% when not testing compiled js
  • Loading branch information
jacobheun committed Feb 4, 2024
1 parent f683c88 commit 7b8bf3e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .taprc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim: set filetype=yaml :
disable-coverage: false
allow-empty-coverage: true
allow-incomplete-coverage: true
allow-empty-coverage: false
allow-incomplete-coverage: false
plugin:
- "@tapjs/sinon"
- "!@tapjs/intercept"
Expand Down
2 changes: 1 addition & 1 deletion lib/content/clean.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ts-node
#!/usr/bin/env tsx
// This file is managed by code-skeleton. Do not make changes.

import { rmSync } from "node:fs";
Expand Down
4 changes: 2 additions & 2 deletions lib/content/update-shebang.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env ts-node
#!/usr/bin/env tsx

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

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

async function updateShebang (path: string) {
Expand Down
9 changes: 8 additions & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,16 @@ export default async function (root: string, variables: Variables) {
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.0.0",
"tap": "^18.7.0",
"ts-node": "^10.0.0",
"tsx": "4.2.1",
"typescript": "^5.0.0"
},
"overrides": {
// Needed with the 4.2.1 tsx version lock to fix code coverage
// https://github.com/privatenumber/tsx/issues/433
"@tapjs/tsx": {
"tsx": "$tsx"
}
},
removeDependencies: [
"@types/tap",
"@tsconfig/node18"
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.0.0",
"tap": "^18.7.0",
"ts-node": "^10.0.0",
"typescript": "5.2.2"
"tsx": "4.2.1",
"typescript": "^5.0.0"
},
"peerDependencies": {
"code-skeleton": "^2.0.0"
},
"overrides": {
"@tapjs/tsx": {
"tsx": "$tsx"
}
},
"skeleton": {
"module": ".",
"variables": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/clean.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ts-node
#!/usr/bin/env tsx
// This file is managed by code-skeleton. Do not make changes.

import { rmSync } from "node:fs";
Expand Down
4 changes: 2 additions & 2 deletions scripts/update-shebang.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env ts-node
#!/usr/bin/env tsx

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

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

async function updateShebang (path: string) {
Expand Down

0 comments on commit 7b8bf3e

Please sign in to comment.