diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 23815c9..cf27053 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -49,14 +49,14 @@ function login({ email?: string; } = {}) { cy.then(() => ({ email })).as("user"); - cy.exec( - `npx ts-node -r tsconfig-paths/register ./cypress/support/create-user.ts "${email}"`, - ).then(({ stdout }) => { - const cookieValue = stdout - .replace(/.*(?.*)<\/cookie>.*/s, "$") - .trim(); - cy.setCookie("__session", cookieValue); - }); + cy.exec(`npx tsx ./cypress/support/create-user.ts "${email}"`).then( + ({ stdout }) => { + const cookieValue = stdout + .replace(/.*(?.*)<\/cookie>.*/s, "$") + .trim(); + cy.setCookie("__session", cookieValue); + }, + ); return cy.get("@user"); } @@ -75,9 +75,7 @@ function cleanupUser({ email }: { email?: string } = {}) { } function deleteUserByEmail(email: string) { - cy.exec( - `npx ts-node -r tsconfig-paths/register ./cypress/support/delete-user.ts "${email}"`, - ); + cy.exec(`npx tsx ./cypress/support/delete-user.ts "${email}"`); cy.clearCookie("__session"); } diff --git a/cypress/support/create-user.ts b/cypress/support/create-user.ts index fa33b94..50dd687 100644 --- a/cypress/support/create-user.ts +++ b/cypress/support/create-user.ts @@ -1,6 +1,6 @@ // Use this to create a new user and login with that user // Simply call this with: -// npx ts-node -r tsconfig-paths/register ./cypress/support/create-user.ts username@example.com, +// npx tsx ./cypress/support/create-user.ts username@example.com, // and it will log out the cookie value you can use to interact with the server // as that new user. diff --git a/cypress/support/delete-user.ts b/cypress/support/delete-user.ts index 1350019..da6d48a 100644 --- a/cypress/support/delete-user.ts +++ b/cypress/support/delete-user.ts @@ -1,6 +1,6 @@ // Use this to delete a user by their email // Simply call this with: -// npx ts-node -r tsconfig-paths/register ./cypress/support/delete-user.ts username@example.com, +// npx tsx ./cypress/support/delete-user.ts username@example.com, // and that user will get deleted import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library"; diff --git a/package.json b/package.json index 807e6dd..899440a 100644 --- a/package.json +++ b/package.json @@ -77,8 +77,7 @@ "prisma": "^5.19.1", "start-server-and-test": "^2.0.7", "tailwindcss": "^3.4.10", - "ts-node": "^10.9.2", - "tsconfig-paths": "^4.2.0", + "tsx": "^4.19.0", "typescript": "^5.6.2", "vite": "^5.4.3", "vite-tsconfig-paths": "^4.3.2", @@ -88,6 +87,6 @@ "node": ">=18.0.0" }, "prisma": { - "seed": "ts-node -r tsconfig-paths/register prisma/seed.ts" + "seed": "tsx prisma/seed.ts" } } diff --git a/remix.init/index.js b/remix.init/index.js index 94b1200..132c6a6 100644 --- a/remix.init/index.js +++ b/remix.init/index.js @@ -10,8 +10,8 @@ const semver = require("semver"); const cleanupCypressFiles = ({ fileEntries, packageManager }) => fileEntries.flatMap(([filePath, content]) => { const newContent = content.replace( - new RegExp("npx ts-node", "g"), - packageManager.name === "bun" ? "bun" : `${packageManager.exec} ts-node`, + new RegExp("npx tsx", "g"), + packageManager.name === "bun" ? "bun" : `${packageManager.exec} tsx`, ); return [fs.writeFile(filePath, newContent)]; @@ -87,13 +87,13 @@ const updatePackageJson = ({ APP_NAME, packageJson, packageManager }) => { name: APP_NAME, devDependencies: packageManager.name === "bun" - ? removeUnusedDependencies(devDependencies, ["ts-node"]) + ? removeUnusedDependencies(devDependencies, ["tsx"]) : devDependencies, prisma: { ...prisma, seed: packageManager.name === "bun" - ? prismaSeed.replace("ts-node", "bun") + ? prismaSeed.replace("tsx", "bun") : prismaSeed, }, scripts,