From 3ea075091aebca5fbd79c01d63d6718cd2fa4b7d Mon Sep 17 00:00:00 2001 From: ningmengchongshui <916415899@qq.com> Date: Tue, 11 Jun 2024 22:14:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=8A=80=E6=9C=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +++++++ image/main.ts | 2 +- image/types.ts | 4 ++-- package.json | 28 +++++++++++++++++++++------- tsconfig.json | 10 +++++++--- 5 files changed, 38 insertions(+), 13 deletions(-) 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"] }