Skip to content

Commit 8ae01bc

Browse files
authored
Replacing tsx with unrun (#3051)
Since `tsdown` is going to keep it anyway, it can replace `tsx`
1 parent 2335a12 commit 8ae01bc

9 files changed

Lines changed: 25 additions & 38 deletions

File tree

.github/workflows/headers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: pnpm install
3232

3333
- name: Check for new headers on IANA.ORG
34-
run: pnpm tsx tools/headers.ts
34+
run: pnpm unrun tools/headers.ts
3535

3636
- name: Check for changes
3737
id: git-state

cjs-test/quick-start.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe("CJS Test", async () => {
66
const listener = (chunk: Buffer) => {
77
out += chunk.toString();
88
};
9-
const quickStart = spawn("tsx", ["quick-start.ts"]);
9+
const quickStart = spawn("unrun", ["quick-start.ts"]);
1010
quickStart.stdout.on("data", listener);
1111
quickStart.stderr.on("data", listener);
1212
const port = givePort("cjs");

compat-test/quick-start.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe("ESM Test", async () => {
1515
const listener = (chunk: Buffer) => {
1616
out += chunk.toString();
1717
};
18-
const quickStart = spawn("tsx", ["quick-start.ts"]);
18+
const quickStart = spawn("unrun", ["quick-start.ts"]);
1919
quickStart.stdout.on("data", listener);
2020
quickStart.stderr.on("data", listener);
2121
await vi.waitFor(() => assert(out.includes(`Listening`)), { timeout: 1e4 });

esm-test/quick-start.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe("ESM Test", async () => {
66
const listener = (chunk: Buffer) => {
77
out += chunk.toString();
88
};
9-
const quickStart = spawn("tsx", ["quick-start.ts"]);
9+
const quickStart = spawn("unrun", ["quick-start.ts"]);
1010
quickStart.stdout.on("data", listener);
1111
quickStart.stderr.on("data", listener);
1212
const port = givePort("esm");

example/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe("Example", async () => {
1313
out += chunk.toString();
1414
};
1515
const matchOut = (regExp: RegExp) => regExp.test(out);
16-
const example = spawn("tsx", ["index.ts"]);
16+
const example = spawn("unrun", ["index.ts"]);
1717
example.stdout.on("data", listener);
1818
const port = givePort("example");
1919
await vi.waitFor(() => assert(out.includes(`Listening`)), { timeout: 1e4 });

example/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"version": "0.0.0",
55
"type": "module",
66
"scripts": {
7-
"start": "tsx index.ts",
7+
"start": "unrun index.ts",
88
"build": "pnpm build:docs && pnpm build:client",
9-
"build:docs": "tsx generate-documentation.ts",
10-
"build:client": "tsx generate-client.ts",
9+
"build:docs": "unrun generate-documentation.ts",
10+
"build:client": "unrun generate-client.ts",
1111
"pretest": "tsc",
1212
"test": "vitest run index.spec.ts"
1313
},

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"type": "module",
44
"scripts": {
55
"start": "pnpm -F example start",
6-
"prebuild": "tsx tools/contributors.ts && tsx tools/license.ts",
6+
"prebuild": "unrun tools/contributors.ts && unrun tools/license.ts",
77
"build": "pnpm -r build",
8-
"pretest": "tsx tools/make-tests.ts",
8+
"pretest": "unrun tools/make-tests.ts",
99
"test": "pnpm -r test",
1010
"bench": "pnpm -F express-zod-api bench",
1111
"lint": "eslint && prettier *.md **/*.md --check",
@@ -25,8 +25,8 @@
2525
"husky": "^9.0.5",
2626
"prettier": "3.6.2",
2727
"tsdown": "^0.16.0",
28-
"tsx": "^4.19.4",
2928
"typescript-eslint": "catalog:dev",
29+
"unrun": "^0.2.6",
3030
"vitest": "^4.0.1"
3131
},
3232
"packageManager": "[email protected]+sha512.da3337267e400fdd3d479a6c68079ac6db01d8ca4f67572083e722775a796788a7a9956613749e000fac20d424b594f7a791a5f4e2e13581c5ef947f26968a40"

pnpm-lock.yaml

Lines changed: 13 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ minimumReleaseAgeExclude:
2929
- typescript
3030
- typescript-eslint
3131
- tsdown
32-
- tsx
32+
- unrun
3333
- vite
3434
- vitest
3535
- zod

0 commit comments

Comments
 (0)