Skip to content

Commit

Permalink
feat: 初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
babanbang committed Aug 17, 2024
0 parents commit fbfb3ac
Show file tree
Hide file tree
Showing 10 changed files with 978 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release and Publish # 发布和发布的工作流程名称
on:
push:
branches:
- main # 仅当推送到 main 分支时触发
permissions:
contents: write # 设置内容的权限为写
pull-requests: write # 设置拉取请求的权限为写
jobs:
release-please:
# 设置工作流程运行环境为 Ubuntu
runs-on: ubuntu-latest
steps:
# 使用 release-please-action@v3 动作
- uses: google-github-actions/release-please-action@v3
id: release
with:
# 设置发布类型为 Node.js
release-type: node
# 设置包名
package-name: karin-plugin-mystool-genshin
# 设置发起PR的默认分支
default-branch: main
# 检出代码
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
# 设置 Node.js 环境
- uses: actions/setup-node@v4
with:
# 设置 Node.js 版本
node-version: 20
# 设置 npm 注册表 URL
registry-url: "https://registry.npmjs.org"
if: ${{ steps.release.outputs.release_created }}
# 添加node-karin并安装依赖
- run: npm install --save-dev node-karin karin-plugin-mystool && npm install
if: ${{ steps.release.outputs.release_created }}
# 编译
- run: npm run build
if: ${{ steps.release.outputs.release_created }}
# 安装jq工具 删除开发依赖
- run: sudo apt-get install jq && jq 'del(.devDependencies)' package.json > package.json.tmp && mv package.json.tmp package.json
if: ${{ steps.release.outputs.release_created }}
# 发布带npm
- run: npm run pub
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules/
/lib/
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

109 changes: 109 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<p align="center">
<img src="/resources/images/other/摸.png" height="60">
<img src="/resources/images/other/鱼.gif" height="60">
<br>
<a href="https://github.com/babanbang/karin-plugin-MysTool/commits/main" style="text-decoration: none;">
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/babanbang/karin-plugin-MysTool?color=%23114514&style=flat-square">
</a>
<a href="https://github.com/babanbang/karin-plugin-MysTool/stargazers" style="text-decoration: none;">
<img alt="GitHub repo stars" src="https://img.shields.io/github/stars/babanbang/karin-plugin-MysTool?color=%23aa4499&style=flat-square">
</a>
<a href="https://github.com/babanbang/karin-plugin-MysTool/forks" style="text-decoration: none;">
<img alt="GitHub forks" src="https://img.shields.io/github/forks/babanbang/karin-plugin-MysTool?color=%23456789&style=flat-square">
</a>
<br>
<a href="https://github.com/babanbang/karin-plugin-MysTool" style="text-decoration: none;">
<img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/babanbang/karin-plugin-MysTool?style=flat-square">
</a>
<a href="https://github.com/babanbang/karin-plugin-MysTool/issues" style="text-decoration: none;">
<img alt="GitHub issues" src="https://img.shields.io/github/issues/babanbang/karin-plugin-MysTool?style=flat-square">
</a>
<a href="https://github.com/babanbang/karin-plugin-MysTool/graphs/contributors" style="text-decoration: none;">
<img alt="GitHub contributors" src="https://img.shields.io/github/contributors/babanbang/karin-plugin-MysTool?color=%23c0c0c0&style=flat-square">
</a>
</p>

<h1 align="center">karin-plugin-MysTool</h1>
<p align="center">米游社、原神、星穹铁道、绝区零</p>

---

#### 安装使用(开发中...)
```bash
# 在karin根目录执行
pnpm add karin-plugin-mystool -w
```

#### 附加功能:[原神](../../../Genshin)[崩坏:星穹铁道](../../../StarRail)[绝区零](../../../ZZZero)
> [!WARNING]
>请自行选择安装、不安装则无法使用对应功能
---
### 待完成功能
- [x] 可选安装`原神``崩坏:星穹铁道``绝区零`相关功能

<img src="/resources/images/other/help.jpg">

<details><summary><b>米游社、UID相关</b></summary>

- [x] 绑定、删除、查看游戏UID
- [x] 绑定、删除、查看cookie、stoken
- [x] **扫码登录(推荐)**
- [ ] 账号密码登录
</details>

<details><summary><b>原神相关</b></summary>

- [x] 前瞻兑换码
- [x] 探索查询
- [x] 角色列表查询
- [ ] 深渊查询
- [x] 幻想真镜剧诗查询
- [ ] 七圣召唤查询
- [x] 体力查询
- [x] 游戏背包素材查询
- [x] 旅行者札记查询
- [x] 角色养成计算查询
- [x] 角色面板更新、查询
- [x] 祈愿记录更新、查询、导出
</details>

<details><summary><b>崩坏:星穹铁道相关</b></summary>

- [x] 前瞻兑换码
- [x] 探索查询
- [x] 角色列表查询
- [ ] 混沌回忆查询
- [x] 模拟宇宙、寰宇蝗灾、黄金与机械、差分宇宙查询
- [ ] 体力查询
- [x] 开拓月历查询
- [ ] 角色养成计算查询
- [x] 角色面板更新、查询
- [x] 祈愿记录更新、查询、导出(支持使用链接更新)
</details>

<details><summary><b>绝区零相关</b></summary>

- [x] 前瞻兑换码
- [x] 电量查询
- [x] 角色列表查询
- [ ] 式舆防卫战查询
- [x] 角色面板更新、查询
- [x] 祈愿记录更新、查询、导出
</details>

<details><summary><b>其他</b></summary>

- [x] 使用[wkhtmltoimage](https://wkhtmltopdf.org/)截图(由于坤术原因部分图片不支持使用,暂时没有安装教程、windows直接下载exe即可、ubuntu使用apt安装),建议优先使用[karin-puppeteer](https://github.com/KarinJS/karin-puppeteer)
- [x] 1034、10035、签到(额外安装[插件](../../../MysSign)提供功能)
</details>

---
## 致谢
* QQ群 825716431

|Nickname|Contribution|
|:------:|------------|
|[Miao-Yunzai](https://gitee.com/yoimiya-kokomi/Miao-Yunzai)|喵喵!|
|[miao-plugin](https://gitee.com/yoimiya-kokomi/miao-plugin)|喵喵!|
|[simple-qrbtf](https://github.com/StringKe/simple-qrbtf)|二维码生成|
32 changes: 32 additions & 0 deletions config/lables.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 当前版本
version: 4.7
# 成就
achievement: 1226
# 角色数
avatar: 81
# 等级
level: 60
# 奇馈宝箱
magic_chest: 251
# 华丽宝箱
luxurious_chest: 268
# 珍贵宝箱
precious_chest: 704
# 精致宝箱
exquisite_chest: 2321
# 普通宝箱
common_chest: 2998
# 传送点
way_point: 455
# 秘境
domain: 58
# 风神瞳
anemoculus: 66
# 岩神瞳
geoculus: 131
# 雷神瞳
electroculus: 181
# 草神瞳
dendroculus: 271
# 水神瞳
hydroculus: 271
3 changes: 3 additions & 0 deletions config/panel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 面板服务选择:0:自动,1Mgg, 2Hutao,3Enka。
# 如设置三位数字则为分服务器设置,按顺序分别为 国服/B服/外服,例如113代表国服B服Mgg,国外Enka。
serv: 0
14 changes: 14 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import neostandard from 'neostandard'

const data = neostandard({
ignores: ['node_modules', 'temp', 'logs', 'data'],
globals: ['logger', 'NodeJS'],
ts: true,
})

/** 关闭驼峰命名 */
data.forEach((val, index) => {
if (val?.rules?.['camelcase']) data[index].rules['camelcase'] = ['off']
})

export default data
52 changes: 52 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "karin-plugin-mystool-genshin",
"version": "0.0.0",
"author": "babanbang",
"type": "module",
"description": "karin plugin MysTool Genshin Impact",
"homepage": "https://github.com/babanbang/Genshin",
"bugs": {
"url": "https://github.com/babanbang/Genshin/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/babanbang/Genshin.git"
},
"main": "lib/index.js",
"scripts": {
"build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json",
"pub": "npm publish --access public"
},
"devDependencies": {
"@types/express": "^4.17.21",
"@types/lodash": "^4.17.7",
"@types/node": "^20.14.11",
"@types/node-schedule": "^2.1.7",
"@types/ws": "^8.5.11",
"eslint": "^9.7.0",
"neostandard": "^0.11.1",
"tsc-alias": "^1.8.10",
"typescript": "^5.5.3"
},
"karin": {
"apps": [
"lib/apps"
],
"outDir": "lib",
"rootDir": "src"
},
"files": [
"/lib/**/*.js",
"/lib/**/*.d.ts",
"/config/*.yaml",
"/config/*.js",
"resources",
"LICENSE",
"package.json",
"README.md"
],
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
}
}
10 changes: 10 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Cfg, MysUtil, Data, GameNames, GamePathType, GameList } from 'karin-plugin-mystool'
import { logger } from 'node-karin'

MysUtil.initGame(GameList.Gs)
/** 初始化配置 */
Cfg.initCfg(GamePathType.gs)

const pkg = Cfg.package(GamePathType.gs)
const name = Data.getGamePath(GamePathType.gs)
logger.info(`${logger.violet(`[插件:${pkg.version}]`)} ${logger.green(name)}${GameNames.gs}初始化完成~`)
34 changes: 34 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"compilerOptions": {
"module": "ESNext",
"target": "ESNext",
"esModuleInterop": true,
"moduleResolution": "Bundler",
"outDir": "./lib",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
],
},
"types": [
"@types/node"
],
"rootDir": "./src",
"declaration": true,
"noImplicitAny": true,
"strict": true
},
"tsc-alias": {
"resolveFullPaths": true,
"resolveFullExtension": ".js"
},
"include": [
"src/**/*",
],
"exclude": [
"node_modules",
]
}

0 comments on commit fbfb3ac

Please sign in to comment.