2024-06-09 01:31:31 +08:00
|
|
|
|
# Miao-Yunzai
|
2023-03-04 16:12:48 +08:00
|
|
|
|
|
2024-06-08 20:52:49 +08:00
|
|
|
|
这里是Miao-Yunzai V4 测试仓库,
|
2023-03-07 03:19:41 +08:00
|
|
|
|
|
2024-06-08 20:52:49 +08:00
|
|
|
|
你应该积极使用 V3 ,它仍然是长期支持并维护的版本。
|
2023-03-07 03:19:41 +08:00
|
|
|
|
|
2024-06-08 20:52:49 +08:00
|
|
|
|
哪怕 V4 后续发布,V3仍然接受长期支持并维护。
|
2023-05-28 15:25:23 +08:00
|
|
|
|
|
2024-06-08 20:52:49 +08:00
|
|
|
|
在功能点未完成测试之前,仓库不会发布任何有关新功能信息。
|
2023-03-04 16:12:48 +08:00
|
|
|
|
|
2024-06-08 20:52:49 +08:00
|
|
|
|
> 必要环境 Windows/Linux + Chrome/Chromium/Edge
|
2023-03-04 14:30:13 +08:00
|
|
|
|
|
2024-06-10 00:37:59 +08:00
|
|
|
|
> 必要环境 Node.js>16.14.0 + Redis>5.0.0
|
2023-03-05 06:42:24 +08:00
|
|
|
|
|
2024-06-10 00:37:59 +08:00
|
|
|
|
推荐使用`18.18.2`版本,如果系统不支持,最低要求`16.14.0`,这是新版`puppeteer`的限制
|
2023-03-05 06:42:24 +08:00
|
|
|
|
|
2024-06-09 01:00:07 +08:00
|
|
|
|
## 使用教程
|
2024-06-09 01:00:25 +08:00
|
|
|
|
|
2024-06-09 01:00:07 +08:00
|
|
|
|
- 安装源码
|
2023-03-04 16:12:48 +08:00
|
|
|
|
|
2024-06-09 01:00:07 +08:00
|
|
|
|
```sh
|
|
|
|
|
git clone --depth=1 -b dev https://github.com/yoimiya-kokomi/Miao-Yunzai.git
|
|
|
|
|
```
|
|
|
|
|
|
2024-06-09 23:45:33 +08:00
|
|
|
|
- 进入目录
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
cd Miao-Yunzai
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
- 安装插件(计划移除中...)
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
|
|
|
|
|
git clone --depth=1 https://github.com/yoimiya-kokomi/miao-plugin.git ./plugins/miao-plugin/
|
|
|
|
|
```
|
|
|
|
|
|
2024-06-09 01:00:07 +08:00
|
|
|
|
- 安装依赖
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
npm install pnpm -g
|
|
|
|
|
pnpm install
|
|
|
|
|
```
|
2023-03-05 06:42:24 +08:00
|
|
|
|
|
2024-06-09 01:00:07 +08:00
|
|
|
|
- 启动
|
2023-03-04 14:30:13 +08:00
|
|
|
|
|
2024-06-09 01:00:07 +08:00
|
|
|
|
```sh
|
2024-06-10 00:37:59 +08:00
|
|
|
|
npm run app
|
2024-06-09 01:00:07 +08:00
|
|
|
|
```
|
2023-03-05 06:42:24 +08:00
|
|
|
|
|
2024-06-09 01:00:07 +08:00
|
|
|
|
- 重新登录
|
2023-03-06 08:38:31 +08:00
|
|
|
|
|
2024-06-09 01:00:07 +08:00
|
|
|
|
```sh
|
2024-06-10 00:37:59 +08:00
|
|
|
|
npm run app login
|
2024-06-09 01:00:07 +08:00
|
|
|
|
```
|
2023-03-07 03:19:41 +08:00
|
|
|
|
|
2024-06-10 00:37:59 +08:00
|
|
|
|
- 进程托管
|
2024-06-09 11:57:45 +08:00
|
|
|
|
|
|
|
|
|
```sh
|
2024-06-10 00:37:59 +08:00
|
|
|
|
npm run start
|
2023-04-30 14:32:10 +08:00
|
|
|
|
```
|
2023-05-28 15:25:23 +08:00
|
|
|
|
|
2024-06-10 00:37:59 +08:00
|
|
|
|
- 杀死进程
|
2023-04-30 14:32:10 +08:00
|
|
|
|
|
2024-06-09 11:57:45 +08:00
|
|
|
|
```sh
|
2024-06-10 00:37:59 +08:00
|
|
|
|
npm run kill
|
2024-01-31 04:13:59 +08:00
|
|
|
|
```
|
2024-06-10 09:34:28 +08:00
|
|
|
|
|
2024-06-10 10:06:44 +08:00
|
|
|
|
## 新特性
|
2024-06-10 09:34:28 +08:00
|
|
|
|
|
|
|
|
|
支持TS、TSX环境,提供Miao-Yunzai完全的类型声明及其开发文档。
|
|
|
|
|
|
2024-06-10 10:06:44 +08:00
|
|
|
|
- 消息回调
|
|
|
|
|
|
|
|
|
|
[查看 开发示例](./example/apps.ts)
|
|
|
|
|
|
|
|
|
|
- 图片组件
|
|
|
|
|
|
|
|
|
|
你无需再写原生的html,React将为你进行组件和管理
|
|
|
|
|
|
|
|
|
|
[学习 React.js](https://react.docschina.org/)
|
|
|
|
|
|
|
|
|
|
你无需再写原生从css !
|
|
|
|
|
|
|
|
|
|
tailwindcss将识别plugins目录下的tsx和jsx文件
|
|
|
|
|
|
|
|
|
|
为你自动生成css , 存放在`./publick/output.css`
|
|
|
|
|
|
|
|
|
|
[学习 tailwindcss](https://www.tailwindcss.cn/)
|
|
|
|
|
|
|
|
|
|
> 插件间浏览器都将独立控制且互不影响
|
|
|
|
|
|
|
|
|
|
[查看 开发示例](./example/index.tsx)
|
|
|
|
|
|
2024-06-10 10:27:51 +08:00
|
|
|
|
> 执行尝试生产html
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
npm run css
|
|
|
|
|
npx ts-node ./example/index.ts
|
|
|
|
|
```
|
|
|
|
|
|
2024-06-10 10:06:44 +08:00
|
|
|
|
## 生成开发文档
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
npm run docs
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
浏览器打开文件`docs/index.html`
|
|
|
|
|
|
|
|
|
|
# 开发者需知
|
|
|
|
|
|
2024-06-10 09:34:28 +08:00
|
|
|
|
- 提交
|
|
|
|
|
|
|
|
|
|
```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
|
|
|
|
|
```
|
|
|
|
|
|
2024-06-10 10:27:51 +08:00
|
|
|
|
## 关于lib
|
2024-06-10 09:34:28 +08:00
|
|
|
|
|
2024-06-10 10:27:51 +08:00
|
|
|
|
将在未来逐渐放弃,在版本发布后,开发者需要有意识的对此变化做出调整.
|
2024-06-10 09:34:28 +08:00
|
|
|
|
|
|
|
|
|
```ts
|
|
|
|
|
// 已废弃
|
|
|
|
|
--lib / puppeteer
|
|
|
|
|
// 无扩展性,计划废弃
|
|
|
|
|
--lib / renderer
|
|
|
|
|
// 非机器人框架的核心处理代码
|
|
|
|
|
// 消耗服务器内存,无扩展性,计划废弃
|
|
|
|
|
--lib / tools / web.js / test.js / log.js / ksr.js
|
|
|
|
|
// 计划废弃
|
|
|
|
|
--renderers
|
|
|
|
|
|
|
|
|
|
// 其他内容逐步优化。。。
|
|
|
|
|
```
|