Skip to content

Commit 56eeb3a

Browse files
fix ts errors
1 parent bec083c commit 56eeb3a

File tree

7 files changed

+48
-21
lines changed

7 files changed

+48
-21
lines changed

apps/items-service/bun.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"@opentelemetry/semantic-conventions": "^1.37.0",
1313
"postgres": "^3.4.4",
1414
},
15+
"devDependencies": {
16+
"bun-types": "^1.3.1",
17+
},
1518
},
1619
},
1720
"packages": {
@@ -213,6 +216,8 @@
213216

214217
"@types/pg-pool": ["@types/[email protected]", "", { "dependencies": { "@types/pg": "*" } }, "sha512-TaAUE5rq2VQYxab5Ts7WZhKNmuN78Q6PiFonTDdpbx8a1H0M1vhy3rhiMjl+e2iHmogyMw7jZF4FrE6eJUy5HQ=="],
215218

219+
"@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA=="],
220+
216221
"@types/tedious": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw=="],
217222

218223
"acorn": ["[email protected]", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg=="],
@@ -227,6 +232,8 @@
227232

228233
"bignumber.js": ["[email protected]", "", {}, "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ=="],
229234

235+
"bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-NMrcy7smratanWJ2mMXdpatalovtxVggkj11bScuWuiOoXTiKIu2eVS1/7qbyI/4yHedtsn175n4Sm4JcdHLXw=="],
236+
230237
"cjs-module-lexer": ["[email protected]", "", {}, "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q=="],
231238

232239
"cliui": ["[email protected]", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ=="],
@@ -235,6 +242,8 @@
235242

236243
"color-name": ["[email protected]", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],
237244

245+
"csstype": ["[email protected]", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
246+
238247
"debug": ["[email protected]", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
239248

240249
"emoji-regex": ["[email protected]", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],

apps/items-service/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
"@opentelemetry/sdk-node": "^0.207.0",
1616
"@opentelemetry/semantic-conventions": "^1.37.0",
1717
"postgres": "^3.4.4"
18+
},
19+
"devDependencies": {
20+
"bun-types": "^1.3.1"
1821
}
1922
}

apps/items-service/src/controllers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
*/
55

66
import { trace, SpanStatusCode } from "@opentelemetry/api";
7-
import { ItemsRepository } from "./database";
8-
import type { CreateItemDto, HealthResponse, ItemsListResponse } from "./models";
9-
import { json, badRequest, internalServerError, serviceUnavailable } from "./http-utils";
7+
import { ItemsRepository } from "./database.js";
8+
import type { CreateItemDto, HealthResponse, ItemsListResponse } from "./models.js";
9+
import { json, badRequest, internalServerError, serviceUnavailable } from "./http-utils.js";
1010

1111
/**
1212
* Health check controller

apps/items-service/src/database.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
/**
2-
* Database module
3-
* Handles database connection, initialization, and data access
4-
*/
5-
61
import postgres from "postgres";
72
import { trace, SpanStatusCode } from "@opentelemetry/api";
8-
import type { DatabaseConfig } from "./config";
9-
import type { Item, CreateItemDto } from "./models";
3+
import type { DatabaseConfig } from "./config.js";
4+
import type { Item, CreateItemDto } from "./models.js";
105

116
let sql: ReturnType<typeof postgres> | null = null;
127
/**
@@ -73,7 +68,7 @@ export async function initSchema(): Promise<void> {
7368
* Repository for items data access
7469
*/
7570
export class ItemsRepository {
76-
private db: ReturnType<typeof postgres>;
71+
private readonly db: ReturnType<typeof postgres>;
7772

7873
constructor() {
7974
this.db = getDatabase();

apps/items-service/src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
*/
1616

1717
// Initialize OpenTelemetry first, before any other imports
18-
import { initTelemetry } from "./telemetry";
18+
import { initTelemetry } from "./telemetry.js";
1919
initTelemetry();
2020

2121
// Import application modules
22-
import { loadConfig } from "./config";
23-
import { initDatabase, initSchema, ItemsRepository } from "./database";
24-
import { HealthController, ItemsController } from "./controllers";
25-
import { Router } from "./router";
22+
import { loadConfig } from "./config.js";
23+
import { initDatabase, initSchema, ItemsRepository } from "./database.js";
24+
import { HealthController, ItemsController } from "./controllers.js";
25+
import { Router } from "./router.js";
2626

2727
/**
2828
* Bootstrap and start the application

apps/items-service/src/router.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
*/
55

66
import { trace, SpanStatusCode } from "@opentelemetry/api";
7-
import { HealthController, ItemsController } from "./controllers";
8-
import { getSwaggerHtml, getRootPageHtml } from "./html";
9-
import { openapi } from "./openapi";
10-
import { json, notFound, html } from "./http-utils";
11-
import type { ServerConfig } from "./config";
7+
import { HealthController, ItemsController } from "./controllers.js";
8+
import { getSwaggerHtml, getRootPageHtml } from "./html.js";
9+
import { openapi } from "./openapi.js";
10+
import { json, notFound, html } from "./http-utils.js";
11+
import type { ServerConfig } from "./config.js";
1212

1313
/**
1414
* Route handler type

apps/items-service/tsconfig.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2022",
4+
"module": "ES2022",
5+
"lib": ["ES2022"],
6+
"moduleResolution": "bundler",
7+
"allowImportingTsExtensions": true,
8+
"noEmit": true,
9+
"strict": true,
10+
"skipLibCheck": true,
11+
"esModuleInterop": true,
12+
"allowSyntheticDefaultImports": true,
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
"types": ["bun-types"]
16+
},
17+
"include": ["src/**/*"],
18+
"exclude": ["node_modules"]
19+
}
20+

0 commit comments

Comments
 (0)