Skip to content

Commit

Permalink
refa: move app to console plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed May 20, 2023
1 parent 37b8c38 commit 288ece7
Show file tree
Hide file tree
Showing 24 changed files with 22 additions and 13 deletions.
15 changes: 14 additions & 1 deletion packages/client/client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
{
"extends": "../tsconfig.client",
"compilerOptions": {
"rootDir": ".",
"target": "es2020",
"module": "esnext",
"declaration": true,
"jsx": "preserve",
"noEmit": true,
"composite": true,
"incremental": true,
"skipLibCheck": true,
"esModuleInterop": true,
"moduleResolution": "node",
"strictBindCallApply": true,
"types": [
"@koishijs/client/global",
],
},
"include": [
".",
Expand Down
7 changes: 1 addition & 6 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
"version": "5.8.3",
"main": "client/index.ts",
"files": [
"app",
"client",
"lib",
"bin.js",
"global.d.ts",
"tsconfig.client.json"
"global.d.ts"
],
"bin": {
"koishi-console": "bin.js"
Expand Down Expand Up @@ -50,8 +48,5 @@
"vue": "^3.3.2",
"vue-i18n": "^9.2.2",
"vue-router": "^4.2.0"
},
"yakumo": {
"client": "./build/client"
}
}
2 changes: 1 addition & 1 deletion packages/online/app/assets
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../tsconfig.client",
"extends": "../../../tsconfig.client",
"compilerOptions": {
"rootDir": ".",
},
Expand Down
3 changes: 3 additions & 0 deletions plugins/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,8 @@
"open": "^8.4.2",
"uuid": "^8.3.2",
"ws": "^8.13.0"
},
"yakumo": {
"client": "./scripts/client"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function build(root: string, config: vite.UserConfig = {}, isClient

export default async function () {
// build for console main
const { output } = await build(cwd + '/packages/client/app')
const { output } = await build(cwd + '/plugins/console/app')

await Promise.all([
copyFile(findModulePath('vue') + '/dist/vue.runtime.esm-browser.prod.js', dist + '/vue.js'),
Expand Down
4 changes: 1 addition & 3 deletions plugins/console/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ class NodeConsole extends Console {
ctx.envData.clientCount = this.layer.clients.size
})

this.root = config.root || config.devMode
? resolve(require.resolve('@koishijs/client/package.json'), '../app')
: resolve(__dirname, '../../dist')
this.root = config.root || (resolve(__dirname, config.devMode ? '../../app' : '../../dist'))
}

async start() {
Expand Down

0 comments on commit 288ece7

Please sign in to comment.