Skip to content

Commit 66610ce

Browse files
jskiller1404stasik1404fruneen
authored
Migrate from ts-node to tsx (#383)
* chore: migrate from ts-node-dev to tsx * fix: Remove pnpm-lock.yaml from root * fix: Rewritten all modules to ESM * chore: update pnpm-lock.yaml and package.json dependencies, remove unused dotenv imports, and adjust environment variable schema * chore: replace ts-node with tsx in Dockerfiles and update tsconfig settings * fix: migrate all files to esm to avoid nextjs build errors * fix: update next.config.js to next.config.mjs for ESM compatibility --------- Co-authored-by: stasik1404 <s.kanashuk@golance.com> Co-authored-by: fruneen <fruneen@gmail.com>
1 parent 3fb1367 commit 66610ce

41 files changed

Lines changed: 32954 additions & 9726 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/prisma/apps/api/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You can start the application in two ways:
3939

4040
### Development Tools
4141

42-
- **Automatic Restart**: Utilizes [ts-node-dev](https://github.com/wclr/ts-node-dev) for automatic application restart on code changes.
42+
- **Automatic Restart**: Utilizes [tsx](https://tsx.is/) for automatic application restart on code changes.
4343
- **Code Quality**: Enforces code linting with [ESLint](https://eslint.org/) and formatting with [Prettier](https://prettier.io/).
4444
- **TypeScript Support**: Full support for TypeScript for a better development experience.
4545

examples/prisma/apps/api/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
"packageManager": "pnpm@9.5.0",
88
"scripts": {
99
"build": "tsc",
10-
"dev": "NODE_ENV=development APP_ENV=development ts-node-dev --respawn --transpile-only src/app.ts",
10+
"dev": "NODE_ENV=development APP_ENV=development tsx watch --env-file=.env src/app.ts",
1111
"start": "ts-node src/app.ts",
1212
"migrate-dev": "cd packages/database && pnpm prisma migrate dev",
1313
"migrate": "cd packages/database && pnpm prisma migrate deploy",
14-
"schedule-dev": "NODE_ENV=development APP_ENV=development ts-node-dev --respawn --transpile-only src/scheduler.ts",
14+
"schedule-dev": "NODE_ENV=development APP_ENV=development tsx watch --env-file=.env src/scheduler.ts",
1515
"schedule": "ts-node src/scheduler.ts",
1616
"test:unit": "jest --runInBand -c ./jest.config.js --collectCoverage false",
1717
"tsc": "tsc --noEmit --watch",
@@ -31,6 +31,7 @@
3131
"app-constants": "workspace:*",
3232
"app-types": "workspace:*",
3333
"bcryptjs": "2.4.3",
34+
"database": "workspace:*",
3435
"dayjs": "1.11.10",
3536
"dotenv": "16.0.3",
3637
"google-auth-library": "8.7.0",
@@ -57,8 +58,7 @@
5758
"schemas": "workspace:*",
5859
"socket.io": "4.6.1",
5960
"winston": "3.8.2",
60-
"zod": "3.21.4",
61-
"database": "workspace:*"
61+
"zod": "3.21.4"
6262
},
6363
"devDependencies": {
6464
"@shelf/jest-mongodb": "4.2.0",
@@ -79,6 +79,7 @@
7979
"@types/node": "22.10.10",
8080
"@types/node-schedule": "2.1.0",
8181
"@types/psl": "1.1.0",
82+
"database": "workspace:*",
8283
"eslint": "8.56.0",
8384
"eslint-config-custom": "workspace:*",
8485
"jest": "29.7.0",
@@ -88,10 +89,9 @@
8889
"prettier-config-custom": "workspace:*",
8990
"ts-jest": "29.1.2",
9091
"ts-node": "10.9.1",
91-
"ts-node-dev": "2.0.0",
9292
"tsconfig": "workspace:*",
93-
"typescript": "5.2.2",
94-
"database": "workspace:*"
93+
"tsx": "4.20.4",
94+
"typescript": "5.2.2"
9595
},
9696
"lint-staged": {
9797
"*.ts": [

0 commit comments

Comments
 (0)