[retry] upgrade to bun 1.0.33 + upgrade deps #5
9 changed files with 34 additions and 26 deletions
|
@ -10,5 +10,7 @@ steps:
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
BUN_VERSION:
|
BUN_VERSION:
|
||||||
- 1.0.25
|
- 1.0.30
|
||||||
- 1.0.26
|
- 1.0.31
|
||||||
|
- 1.0.32
|
||||||
|
- 1.0.33
|
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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
BIN
bun.lockb
Binary file not shown.
|
@ -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"
|
||||||
},
|
},
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"lib": ["ESNext"],
|
"lib": ["ESNext"],
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleDetection": "force",
|
"moduleDetection": "force",
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
|
|
||||||
/* Bundler mode */
|
/* Bundler mode */
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
|
|
||||||
/* Linting */
|
/* Linting */
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"forceConsistentCasingInFileNames": true
|
"forceConsistentCasingInFileNames": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue