feat: 增加代码连接技术

This commit is contained in:
ningmengchongshui 2024-06-11 22:14:33 +08:00
parent ce73f7da60
commit 3ea075091a
5 changed files with 38 additions and 13 deletions

View File

@ -37,6 +37,13 @@ npm install pnpm -g
pnpm install
```
- 连接代码
```sh
npm link
npm link yunzai
```
- 启动
```sh

View File

@ -1,7 +1,7 @@
import Koa from 'koa'
import KoaStatic from 'koa-static'
import Router from 'koa-router'
import { Component } from '#miao/utils'
import { Component } from 'yunzai/utils'
import { readdirSync } from 'fs'
import { join } from 'path'
import './tailwindcss.js'

View File

@ -1,6 +1,6 @@
import { type ComponentCreateOpsionType } from '#miao/utils'
import { type ComponentCreateOpsionType } from 'yunzai/utils'
export type RouterType = {
url: string
element: React.ReactNode
options: ComponentCreateOpsionType
options?: ComponentCreateOpsionType
}[]

View File

@ -1,5 +1,5 @@
{
"name": "miao-yunzai",
"name": "yunzai",
"version": "4.0.0-rc.0",
"author": "Yoimiya-Kokomi, Le-niao",
"description": "QQ Group Bot",
@ -78,13 +78,27 @@
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
"exports": {
"./config": {
"import": "./src/config/index.js"
},
"./db": {
"import": "./src/db/index.js"
},
"./mys": {
"import": "./src/mys/index.js"
},
"./utils": {
"import": "./src/utils/index.js"
},
"./core": {
"import": "./src/core/index.js"
},
"./image/types": {
"import": "./image/types.js"
}
},
"imports": {
"#image/*": "./image/*",
"#yunzai/config": "./src/config/index.js",
"#yunzai/core": "./src/core/index.js",
"#yunzai/db": "./src/db/index.js",
"#yunzai/mys": "./src/mys/index.js",
"#yunzai/utils": "./src/utils/index.js",
"#miao": "./plugins/miao-plugin/components/index.js",
"#miao.models": "./plugins/miao-plugin/models/index.js"
}

View File

@ -34,8 +34,12 @@
//
"paths": {
//
"#image/*": ["./image/*"],
"#yunzai/*": ["./src/*"],
"yunzai/image/types": ["./image/types.js"],
"yunzai/config": ["./src/config/index.js"],
"yunzai/db": ["./src/db/index.js"],
"yunzai/mys": ["./src/mys/index.js"],
"yunzai/utils": ["./src/utils/index.js"],
"yunzai/core": ["./src/core/index.js"],
//
"#miao": ["./plugins/miao-plugin/components/index.js"],
"#miao.models": ["./plugins/miao-plugin/models/index.js"]
@ -46,5 +50,5 @@
"transpileOnly": true,
"experimentalSpecifierResolution": "node"
},
"include": ["src", "image", "plugins", "plugins/system-plugin"]
"include": ["src", "image", "plugins"]
}