Skip to content

Commit

Permalink
feat: 初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
babanbang committed Aug 18, 2024
0 parents commit 979b610
Show file tree
Hide file tree
Showing 9 changed files with 850 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-myssign
# 设置发起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.

17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<p align="center">
<a href="https://github.com/babanbang/MysSign/commits/main" style="text-decoration: none;">
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/babanbang/MysSign?color=%23114514&style=flat-square">
</a>
<a href="https://github.com/babanbang/MysSign" style="text-decoration: none;">
<img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/babanbang/MysSign?style=flat-square">
</a>
</p>

> [!TIP]
> 请先确保你已经安装了[Karin](https://github.com/KarinJS/Karin)[karin-plugin-MysTool](https://github.com/babanbang/karin-plugin-MysTool)
#### 安装使用(开发中...)
```bash
# 在karin根目录执行
pnpm add karin-plugin-mystool-myssign@latest -w
```
Empty file added config/config.yaml
Empty file.
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-myssign",
"version": "0.0.0",
"author": "babanbang",
"type": "module",
"description": "karin plugin MysTool MysSign",
"homepage": "https://github.com/babanbang/MysSign",
"bugs": {
"url": "https://github.com/babanbang/MysSign/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/babanbang/MysSign.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"
}
}
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Cfg, Data, GamePathType } from 'karin-plugin-mystool'
import { logger } from 'node-karin'

/** 初始化配置 */
Cfg.initCfg(GamePathType.Sign)

const pkg = Cfg.package(GamePathType.Sign)
const name = Data.getGamePath(GamePathType.Sign)
logger.info(`${logger.violet(`[插件:${pkg.version}]`)} ${logger.green(name)}初始化完成~`)
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 979b610

Please sign in to comment.