From 945ddf9efcca89cd80fdda9f9e8dbfd2c5fe6494 Mon Sep 17 00:00:00 2001 From: Matt Leon Date: Thu, 27 Mar 2025 12:08:48 +0000 Subject: [PATCH] remove more tsx usage --- package-lock.json | 45 ------------------------------ packages/cf/e2e.test.ts | 2 +- packages/cf/package.json | 4 +-- packages/cf/tsconfig.json | 1 + packages/core/tsconfig.json | 3 +- packages/web/package.json | 9 +++--- packages/web/tools/build-sample.ts | 4 +-- packages/web/tsconfig.json | 1 + 8 files changed, 11 insertions(+), 58 deletions(-) diff --git a/package-lock.json b/package-lock.json index e933b23b..7a9e8685 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2872,19 +2872,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-tsconfig": { - "version": "4.7.5", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", - "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, "node_modules/get-uri": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.4.tgz", @@ -4315,16 +4302,6 @@ "node": ">=4" } }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, "node_modules/safe-array-concat": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", @@ -4943,26 +4920,6 @@ "dev": true, "license": "0BSD" }, - "node_modules/tsx": { - "version": "4.20.3", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.3.tgz", - "integrity": "sha512-qjbnuR9Tr+FJOMBqJCW5ehvIo/buZq7vH7qD7JziU98h6l3qGy0a/yPFjwO+y0/T7GFpNgNAvEcPPVfyT8rrPQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "~0.25.0", - "get-tsconfig": "^4.7.5" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, "node_modules/typed-array-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", @@ -5927,7 +5884,6 @@ "esbuild": "0.25.5", "js-beautify": "1.15.4", "puppeteer": "24.10.2", - "tsx": "4.20.3", "typescript": "5.8.3", "wrangler": "4.20.3" } @@ -5992,7 +5948,6 @@ "esbuild": "0.25.5", "npm-run-all": "4.1.5", "simple-git": "3.28.0", - "tsx": "4.20.3", "typescript": "5.8.3" } }, diff --git a/packages/cf/e2e.test.ts b/packages/cf/e2e.test.ts index 44be9f48..16cb70c5 100644 --- a/packages/cf/e2e.test.ts +++ b/packages/cf/e2e.test.ts @@ -4,7 +4,7 @@ import { readFile } from "node:fs/promises"; import { dirname, join, resolve } from "node:path"; import { test } from "node:test"; import { fileURLToPath } from "node:url"; -import { fixturePath } from "@bitextual/test/util.js"; +import { fixturePath } from "@bitextual/test/util.ts"; import beautify from "js-beautify"; import puppeteer, { type Browser } from "puppeteer"; import wranglerConf from "./wrangler.json" with { type: "json" }; diff --git a/packages/cf/package.json b/packages/cf/package.json index 94cd192b..55c82c3f 100644 --- a/packages/cf/package.json +++ b/packages/cf/package.json @@ -10,8 +10,7 @@ "read-errors": "node --env-file=.env read-errors.ts", "read-events": "node --env-file=.env read-events.ts", "serve": "wrangler pages dev dist", - "//": "we still need tsx here for resource management support", - "test": "tsx e2e.test.ts", + "test": "node e2e.test.ts", "test-post-deploy": "node post-deploy.test.ts", "typecheck": "tsc && tsc --project functions", "pretypecheck": "wrangler types" @@ -24,7 +23,6 @@ "esbuild": "0.25.5", "js-beautify": "1.15.4", "puppeteer": "24.10.2", - "tsx": "4.20.3", "typescript": "5.8.3", "wrangler": "4.20.3" }, diff --git a/packages/cf/tsconfig.json b/packages/cf/tsconfig.json index 1abcd60a..fb3aa4e4 100644 --- a/packages/cf/tsconfig.json +++ b/packages/cf/tsconfig.json @@ -4,6 +4,7 @@ "compilerOptions": { "module": "nodenext", "noEmit": true, + "allowImportingTsExtensions": true, "resolveJsonModule": true }, "include": ["*.ts"] diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 25582ae5..90473edf 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -2,8 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": ["@tsconfig/strictest/tsconfig.json"], "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler", + "module": "nodenext", "noEmit": true, "target": "esnext", "allowImportingTsExtensions": true diff --git a/packages/web/package.json b/packages/web/package.json index f79f7c55..139f95cd 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -4,10 +4,10 @@ "private": true, "scripts": { "build": "npm-run-all --parallel build-css build-deps build-index build-static build-worker build-sample", - "build-css": "tsx tools/copy-css.ts", - "build-deps": "tsx tools/copy-deps.ts", - "build-index": "tsx tools/build-index.ts", - "build-sample": "tsx tools/build-sample.ts", + "build-css": "node tools/copy-css.ts", + "build-deps": "node tools/copy-deps.ts", + "build-index": "node tools/build-index.ts", + "build-sample": "node tools/build-sample.ts", "build-static": "mkdir -p dist && cp -R static/* dist", "build-worker": "esbuild src/worker.ts --bundle --minify --sourcemap --format=esm --external:module --target=es2022 --outfile=dist/worker.js", "clean": "rm -rf build dist", @@ -24,7 +24,6 @@ "esbuild": "0.25.5", "npm-run-all": "4.1.5", "simple-git": "3.28.0", - "tsx": "4.20.3", "typescript": "5.8.3" }, "dependencies": { diff --git a/packages/web/tools/build-sample.ts b/packages/web/tools/build-sample.ts index 02b75f59..dff249ab 100644 --- a/packages/web/tools/build-sample.ts +++ b/packages/web/tools/build-sample.ts @@ -1,7 +1,7 @@ import { mkdirSync, writeFileSync } from "node:fs"; import path from "node:path"; -import { go } from "@bitextual/cli/main.js"; -import { fixturePath } from "@bitextual/test/util.js"; +import { go } from "@bitextual/cli/main.ts"; +import { fixturePath } from "@bitextual/test/util.ts"; const bovaryFrenchPath = fixturePath("bovary.french.epub"); const bovaryEnglishPath = fixturePath("bovary.english.epub"); diff --git a/packages/web/tsconfig.json b/packages/web/tsconfig.json index 7c6ccb95..1bd37740 100644 --- a/packages/web/tsconfig.json +++ b/packages/web/tsconfig.json @@ -3,6 +3,7 @@ "extends": ["@tsconfig/strictest/tsconfig.json"], "compilerOptions": { "module": "nodenext", + "target": "esnext", "noEmit": true, "types": [], "resolveJsonModule": true,