From 8899018a4ec07abb6474e9fdd351e29d6b87f06f Mon Sep 17 00:00:00 2001 From: ningmengchongshui <916415899@qq.com> Date: Mon, 10 Jun 2024 17:11:16 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=B0=83=E6=95=B4=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.cjs | 1 - README.md | 141 ++++----------------------------------------- deploy.sh | 18 ------ example/apps.ts | 7 --- example/hello.tsx | 12 ---- example/index.tsx | 38 ------------ example/routes.tsx | 17 ------ index.js | 2 +- package.json | 2 - typedoc.json | 4 -- 10 files changed, 12 insertions(+), 230 deletions(-) delete mode 100644 deploy.sh delete mode 100644 example/apps.ts delete mode 100644 example/hello.tsx delete mode 100644 example/index.tsx delete mode 100644 example/routes.tsx delete mode 100644 typedoc.json diff --git a/.eslintrc.cjs b/.eslintrc.cjs index d79b0f3..57cae45 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -17,7 +17,6 @@ module.exports = { segment: true }, rules: { - 'eqeqeq': ['off'], 'prefer-const': ['off'], 'arrow-body-style': 'off' } diff --git a/README.md b/README.md index 0ceb0cc..8b4777e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ 推荐使用`18.18.2`版本,如果系统不支持,最低要求`16.14.0`,这是新版`puppeteer`的限制 +[!点击阅读Miao-Yunzai文档了解更多](https://ningmengchongshui.github.io/Miao-Yunzai-Docs/) + ## 使用教程 - 安装源码 @@ -47,7 +49,7 @@ npm run app - 重新登录 ```sh -npm run app login +npm run login ``` - 进程托管 @@ -62,133 +64,12 @@ npm run start npm run kill ``` -## 新特性 +## 致谢 -支持TS、TSX环境,提供Miao-Yunzai完全的类型声明及其开发文档。 - -- 消息回调 - -[查看 开发示例](./example/apps.ts) - -- 图片组件 - -你无需再写原生的html,React将为你进行组件和管理 - -[学习 React.js](https://react.docschina.org/) - -你无需再写原生从css ! - -tailwindcss将识别plugins目录下的tsx和jsx文件 - -为你自动生成css , 存放在`./public/output.css` - -[学习 tailwindcss](https://www.tailwindcss.cn/) - -- 测试生成HTML - -```sh -npm run css -npx ts-node ./example/index.ts -``` - -> 插件间浏览器都将独立控制 - -[查看 开发示例](./example/index.tsx) - -- 热开发图片 - -```sh -npm run image -``` - -[查看 配置示例](./example/routes.tsx) - -## 生成开发文档 - -```sh -npm run docs -``` - -浏览器打开文件`docs/index.html` - -## 关于lib - -将在未来逐渐放弃,在版本发布后,开发者需要有意识的对此变化做出调整. - -```ts -// 已废弃 ---lib / puppeteer -// 无扩展性,计划废弃 ---lib / renderer -// 非机器人框架的核心处理代码 -// 消耗服务器内存,无扩展性,计划废弃 ---lib / tools / web.js / test.js / log.js / ksr.js -// 计划废弃 ---renderers - -// 其他内容逐步优化。。。 -``` - -# 开发者需知 - -- 提交 - -```ts -/** - * feature:新功能 - * update:更新某功能 - * fix:修补某功能 - * refactor:重构某个功能 - * optimize: 优化构建工具或运行时性能 - * style:仅样式改动 - * docs:仅文档新增/改动 - * chore:构建过程或辅助工具的变动 - */ -``` - -- 注释风格 - -```ts -/** - * 返回false - * @param T 任意字符串 - * @returns false - */ -function getTest(T: string) { - return false -} -``` - -- 命名风格 - -```ts -// 获得test值 -function getTest(T: string) {} -// 设置 -function setTest(T: string) {} -// 删除 -function delTest(T: string) {} -// 获取某数据依据为id -function getDataById(T: string) {} - -// 系统常量 -const ENV_TEST = 'dev' - -// 局域常量 -const MyName = 'yunzai' - -// 可修改变量 -let values = '' - -// 禁止使用 var values = '' - -// 声明数组 -const Arr = [] - -// 不推荐 new - -// 声明对象 -const Obj = {} - -// 不推荐new -``` +| Nickname | Contribution | +| :-----------------------------------------------------------: | -------------------- | +| [Yunzai v3.0](https://gitee.com/le-niao/Yunzai-Bot) | 乐神的Yunzai-Bot V3 | +| [GardenHamster](https://github.com/GardenHamster/GenshinPray) | 模拟抽卡背景素材来源 | +| [西风驿站](https://bbs.mihoyo.com/ys/collection/839181) | 角色攻略图来源 | +| [米游社友人A](https://bbs.mihoyo.com/ys/collection/428421) | 角色突破素材图来源 | +| [icqq](https://github.com/icqqjs/icqq) | ICQQ | diff --git a/deploy.sh b/deploy.sh deleted file mode 100644 index 99fd07d..0000000 --- a/deploy.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env sh - -# 确保脚本抛出遇到的错误 -set -e - -# 生成静态文件 - -npm run docs - -# 进入生成的文件夹 - -cd docs/ - -git init -git add -A -git commit -m 'add' - -git push -f git@github.com:yoimiya-kokomi/Miao-Yunzai.git master:docs diff --git a/example/apps.ts b/example/apps.ts deleted file mode 100644 index 5101381..0000000 --- a/example/apps.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Messages } from '../src/core/index.js' -const message = new Messages({ - priority: 9000 -}) -message.response(/^你好/, async e => { - e.reply('你好') -}) diff --git a/example/hello.tsx b/example/hello.tsx deleted file mode 100644 index fe45cb3..0000000 --- a/example/hello.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' -export type DataType = { - name: string -} -export type PropsType = { - data: DataType -} -export default function App({ data }: PropsType) { - return ( -