Skip to content

Commit 193515f

Browse files
committed
Refactor TypeScript configs and dev scripts for NodeNext
1 parent f1cf66a commit 193515f

19 files changed

Lines changed: 61 additions & 42 deletions

File tree

apps/api/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ COPY --from=installer /app .
4343
# Expose port if needed
4444
EXPOSE 3001
4545

46-
CMD node apps/api/dist/index.js
46+
CMD ["node", "apps/api/dist/index.js"]

apps/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"scripts": {
55
"start": "node dist/index.js",
6-
"dev": "tsup --watch --onSuccess \"node dist/index.cjs\"",
6+
"dev": "tsx watch src/index.ts",
77
"build": "tsc",
88
"format-and-lint": "biome check .",
99
"format-and-lint:fix": "biome check . --write"

apps/api/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { pgFindAirportFlights, pgHealthCheck, pgShutdown, prisma } from "@sr24/d
77
import { rdsConnect, rdsGetSingle, rdsGetTimeSeries, rdsHealthCheck, rdsShutdown, rdsSub } from "@sr24/db/redis";
88
import type { AirportLong, ControllerLong, DashboardData, InitialData, PilotLong, RedisAll } from "@sr24/types/interface";
99
import Fastify from "fastify";
10-
import type { Prisma } from "../../../packages/db/src/generated/prisma";
11-
import { authPlugin } from "./plugins";
12-
import { getMetar, getTaf } from "./weather";
10+
import type { Prisma } from "../../../packages/db/src/generated/prisma/index.js";
11+
import { authPlugin } from "./plugins.js";
12+
import { getMetar, getTaf } from "./weather.js";
1313

1414
let initialData: InitialData | null = null;
1515
let dashboardData: DashboardData | null = null;

apps/api/tsconfig.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{
22
"extends": "@sr24/typescript-config/base.json",
33
"compilerOptions": {
4+
"target": "ES2022",
5+
"module": "NodeNext",
6+
"moduleResolution": "NodeNext",
7+
"lib": ["ES2022"],
8+
"types": ["node"],
9+
"rootDir": "src",
410
"outDir": "dist",
5-
"rootDir": "src"
11+
"noEmit": false
612
},
713
"include": ["src"],
814
"exclude": ["dist"]

apps/ingestion/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ ENV NODE_ENV=production
4040
# Copy only the compiled files and dependencies
4141
COPY --from=installer /app .
4242

43-
CMD node apps/ingestion/dist/index.js
43+
CMD ["node", "apps/ingestion/dist/index.js"]

apps/ingestion/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"scripts": {
55
"start": "node dist/index.js",
6-
"dev": "tsup --watch --onSuccess \"node dist/index.cjs\"",
6+
"dev": "tsx watch src/index.ts",
77
"build": "tsc",
88
"format-and-lint": "biome check .",
99
"format-and-lint:fix": "biome check . --write"

apps/ingestion/tsconfig.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{
22
"extends": "@sr24/typescript-config/base.json",
33
"compilerOptions": {
4+
"target": "ES2022",
5+
"module": "NodeNext",
6+
"moduleResolution": "NodeNext",
7+
"lib": ["ES2022"],
8+
"types": ["node"],
9+
"rootDir": "src",
410
"outDir": "dist",
5-
"rootDir": "src"
11+
"noEmit": false
612
},
713
"include": ["src"],
814
"exclude": ["dist"]

apps/updater/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ ENV NODE_ENV=production
3333
# Copy only the compiled files and dependencies
3434
COPY --from=installer /app .
3535

36-
CMD node apps/updater/dist/index.js
36+
CMD ["node", "apps/updater/dist/index.js"]

apps/updater/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"scripts": {
55
"start": "node dist/index.js",
6-
"dev": "tsup --watch --onSuccess \"node dist/index.cjs\"",
6+
"dev": "tsx watch src/index.ts",
77
"build": "tsc",
88
"format-and-lint": "biome check .",
99
"format-and-lint:fix": "biome check . --write"

apps/updater/tsconfig.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{
22
"extends": "@sr24/typescript-config/base.json",
33
"compilerOptions": {
4+
"target": "ES2022",
5+
"module": "NodeNext",
6+
"moduleResolution": "NodeNext",
7+
"lib": ["ES2022"],
8+
"types": ["node"],
9+
"rootDir": "src",
410
"outDir": "dist",
5-
"rootDir": "src"
11+
"noEmit": false
612
},
713
"include": ["src"],
814
"exclude": ["dist"]

0 commit comments

Comments
 (0)