diff --git a/README.md b/README.md index d0c7703..9a4bd51 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,13 @@ npm install pnpm -g pnpm install ``` +- 连接代码 + +```sh +npm link +npm link yunzai +``` + - 启动 ```sh diff --git a/image/main.ts b/image/main.ts index 2b18811..e7b7945 100644 --- a/image/main.ts +++ b/image/main.ts @@ -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' diff --git a/image/types.ts b/image/types.ts index 1a0a629..431c99f 100644 --- a/image/types.ts +++ b/image/types.ts @@ -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 }[] diff --git a/package.json b/package.json index 04167e0..c1edcf3 100644 --- a/package.json +++ b/package.json @@ -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" } diff --git a/tsconfig.json b/tsconfig.json index 8396c24..3e3f4cb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -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"] }