Skip to content

Commit

Permalink
fix(client): display errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Jan 29, 2024
1 parent 1d27d5d commit feb2a45
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -12,8 +12,8 @@
"packageManager": "yarn@4.0.2",
"license": "MIT",
"scripts": {
"client": "yakumo client",
"build": "tsc -b packages/client && yakumo build",
"client": "yakumo --import tsx client",
"build": "yakumo --import tsx build",
"bump": "yakumo version",
"dep": "yakumo upgrade",
"pub": "yakumo publish",
Expand Down Expand Up @@ -51,9 +51,9 @@
"shx": "^0.3.4",
"typescript": "^5.3.2",
"yakumo": "^1.0.0-beta.2",
"yakumo-esbuild": "^1.0.0-beta.1",
"yakumo-mocha": "^1.0.0-beta.1",
"yakumo-tsc": "^1.0.0-beta.0",
"yakumo-esbuild": "^1.0.0-beta.2",
"yakumo-mocha": "^1.0.0-beta.2",
"yakumo-tsc": "^1.0.0-beta.1",
"yml-register": "^1.1.0"
}
}
10 changes: 10 additions & 0 deletions packages/client/client/context.ts
Expand Up @@ -150,12 +150,22 @@ export function useMenu<K extends keyof ActionContext>(id: K) {
export const routeCache = reactive<Record<keyof any, string>>({})

export class Context extends cordis.Context {
// workaround injection check
// eslint-disable-next-line @typescript-eslint/naming-convention
__v_isRef = undefined

app: App
extension?: LoadResult
internal = new Internal()

constructor() {
super()
this.on('internal/error', (error) => {
console.error(error)
})
this.on('internal/warning', (error) => {
console.warn(error)
})
this.app = createApp(defineComponent({
setup() {
return () => [
Expand Down
5 changes: 3 additions & 2 deletions packages/client/package.json
@@ -1,13 +1,14 @@
{
"name": "@koishijs/client",
"description": "Koishi Console Client",
"version": "5.26.0",
"version": "5.27.1",
"main": "client/index.ts",
"exports": {
".": "./client/index.ts",
"./bin": "./lib/bin.js",
"./lib": "./lib/index.js",
"./yakumo": "./lib/yakumo.js",
"./lib/yakumo": "./lib/yakumo.js",
"./lib/yakumo.js": "./lib/yakumo.js",
"./package.json": "./package.json"
},
"files": [
Expand Down

0 comments on commit feb2a45

Please sign in to comment.