replace bun with pnpm and added dockerfile for web
This commit is contained in:
@@ -34,7 +34,7 @@ class Fetcher {
|
||||
post<Response extends unknown>(
|
||||
path: string,
|
||||
data: Record<string, any> = {},
|
||||
options: FetchRequestInit = {}
|
||||
options: RequestInit = {}
|
||||
): Promise<Response | null> {
|
||||
const url = `${this.url}${path}`
|
||||
this.logger(`Mixan request: ${url}`, JSON.stringify(data, null, 2))
|
||||
@@ -49,9 +49,7 @@ class Fetcher {
|
||||
...options,
|
||||
})
|
||||
.then(async (res) => {
|
||||
const response = await res.json<
|
||||
MixanErrorResponse | Response
|
||||
>()
|
||||
const response = await res.json() as (MixanErrorResponse | Response)
|
||||
|
||||
if(!response) {
|
||||
return null
|
||||
@@ -78,7 +76,7 @@ class Fetcher {
|
||||
|
||||
class Batcher<T extends any> {
|
||||
queue: T[] = []
|
||||
timer?: Timer
|
||||
timer?: NodeJS.Timeout
|
||||
callback: (queue: T[]) => void
|
||||
maxBatchSize: number
|
||||
batchInterval: number
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/uuid": "^9.0.5",
|
||||
"bun-types": "latest",
|
||||
"tsup": "^7.2.0",
|
||||
"typescript": "^5.0.0"
|
||||
}
|
||||
|
||||
@@ -17,9 +17,5 @@
|
||||
"outDir": "dist",
|
||||
"allowImportingTsExtensions": false,
|
||||
"noEmit": false,
|
||||
|
||||
"types": [
|
||||
"bun-types" // add Bun global
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,13 +3,11 @@
|
||||
To install dependencies:
|
||||
|
||||
```bash
|
||||
bun install
|
||||
pnpm install
|
||||
```
|
||||
|
||||
To run:
|
||||
|
||||
```bash
|
||||
bun run index.ts
|
||||
pnpm run index.ts
|
||||
```
|
||||
|
||||
This project was created using `bun init` in bun v1.0.4. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
"type": "module",
|
||||
"module": "index.ts",
|
||||
"devDependencies": {
|
||||
"bun-types": "latest",
|
||||
"tsup": "^7.2.0",
|
||||
"typescript": "^5.0.0"
|
||||
}
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
"jsx": "react-jsx",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"allowJs": true,
|
||||
"types": [
|
||||
"bun-types" // add Bun global
|
||||
]
|
||||
"allowJs": true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user