[retry] upgrade to bun 1.0.33 + upgrade deps #5

Merged
qpismont merged 2 commits from bun1.0.33 into main 2024-03-20 20:41:47 +01:00
9 changed files with 33 additions and 26 deletions
Showing only changes of commit 96f8b57564 - Show all commits

View file

@ -10,5 +10,6 @@ steps:
matrix: matrix:
BUN_VERSION: BUN_VERSION:
- 1.0.25 - 1.0.31
- 1.0.26 - 1.0.32
- 1.0.33

View file

@ -3,7 +3,7 @@ when:
steps: steps:
lint: lint:
image: oven/bun:1.0.26-slim image: oven/bun:1.0.33-slim
commands: commands:
- bun install - bun install
- bun run ci - bun run ci

View file

@ -12,8 +12,9 @@ steps:
matrix: matrix:
BUN_VERSION: BUN_VERSION:
- 1.0.25 - 1.0.31
- 1.0.26 - 1.0.32
- 1.0.33
services: services:
nats: nats:

View file

@ -1,5 +1,5 @@
{ {
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", "$schema": "https://biomejs.dev/schemas/1.6.1/schema.json",
"organizeImports": { "organizeImports": {
"enabled": true "enabled": true
}, },

BIN
bun.lockb

Binary file not shown.

View file

@ -12,7 +12,7 @@
"build": "tsc --project tsconfig.build.json" "build": "tsc --project tsconfig.build.json"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "1.5.3", "@biomejs/biome": "1.6.1",
"@types/bun": "latest", "@types/bun": "latest",
"typescript": "^5.0.0" "typescript": "^5.0.0"
}, },

View file

@ -52,6 +52,7 @@ export default class NatsAdaptor implements Adaptor {
} }
async stop(): Promise<void> { async stop(): Promise<void> {
this.sub?.unsubscribe();
await this.nc?.drain(); await this.nc?.drain();
} }
} }

View file

@ -1,4 +1,4 @@
import { z } from "zod"; import type { z } from "zod";
import type Adaptor from "./adaptors/adaptor"; import type Adaptor from "./adaptors/adaptor";
import { RequestError } from "./error"; import { RequestError } from "./error";
import { import {
@ -36,6 +36,7 @@ export default class Service {
async (rawReq) => { async (rawReq) => {
const rawReqJson = JSON.parse(rawReq); const rawReqJson = JSON.parse(rawReq);
const internalRequestJson = InternalRequestSchema.safeParse(rawReqJson); const internalRequestJson = InternalRequestSchema.safeParse(rawReqJson);
if (!internalRequestJson.success) { if (!internalRequestJson.success) {
return JSON.stringify({ return JSON.stringify({
statusCode: 400, statusCode: 400,
@ -51,12 +52,14 @@ export default class Service {
if (internalRequest.data && schema) { if (internalRequest.data && schema) {
const validate = schema.safeParse(internalRequest.data); const validate = schema.safeParse(internalRequest.data);
if (!validate.success) { if (!validate.success) {
return JSON.stringify({ return JSON.stringify({
statusCode: 400, statusCode: 400,
data: validate.error, data: validate.error,
} satisfies InternalResponse); } satisfies InternalResponse);
} }
req.data = validate.data; req.data = validate.data;
} }
@ -75,6 +78,7 @@ export default class Service {
data: err.message, data: err.message,
} satisfies InternalResponse); } satisfies InternalResponse);
} }
return JSON.stringify({ return JSON.stringify({
statusCode: 500, statusCode: 500,
data: "unknow error apend", data: "unknow error apend",