Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
- 🔥 新增 `auto check` 命令用于检查 `package.json` 依赖版本, 移除 .ncurc.json 文件
- ⚙️ 更新依赖版本

Co-authored-by: biaov <biaov2017@qq.com>
Co-authored-by: biaov2017 <biao2017@qq.com>
Co-authored-by: biaov2018 <biaov2017@qq.com>
  • Loading branch information
3 people committed Apr 25, 2024
1 parent 4813f08 commit 540911d
Show file tree
Hide file tree
Showing 20 changed files with 6,523 additions and 3,330 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish Package to npmjs

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install -g npm
- run: npm ci
- run: npm run build
- run: cd dist
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 0 additions & 4 deletions .ncurc.json

This file was deleted.

37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- [x] [简化打包提交命令](#简化打包提交命令)
- [x] [简化手动更改版本号命令](#简化手动更改版本号命令)
- [x] [生成工作目录结构文件](#生成工作目录结构文件)
- [x] [检查 `package.json` 依赖版本](#检查-packagejson-依赖版本)

## 全局安装

Expand Down Expand Up @@ -99,6 +100,39 @@ auto mkdir -l 10 -n demo
└ └── README.md ----------------------
```

### 检查 package.json 依赖版本

```sh
auto check
```

![img](./assets/check.png)

#### `check.config.json`

- 自动生成初始化 `check.config.json` 文件

```sh
npm check -i
```

- 字段解析:
- `prefix`: 版本前缀,默认为 `^`
- `registry`: 依赖来源,默认为 `https://registry.npmmirror.com/`
- `check`: 是否更新 `package.json` 文件,为 `true` 时等同于 `auto check -u`, `-u` 优先级最高, 默认为 `false`
- `reject`: 拒绝检查的依赖,默认为 `[]`
- `resolve`: 指定版本检查的标签,默认为 `[]`,例如:['mine-auto-cli@beta'],默认标签为 `latest`

```json
{
"prefix": "^",
"registry": "https://registry.npmmirror.com/",
"check": false,
"reject": [],
"resolve": []
}
```

### 技术栈

- `Vite` + `TypeScript` + `Node`
Expand All @@ -111,11 +145,14 @@ auto mkdir -l 10 -n demo
- `commander`: 命令
- `log-symbols`: 图标
- `ora`: 动画效果
- `pacote`: 包信息请求器
- `strip-json-comments`: 移除 json 注释
- `update-notifier`: 检查更新

#### devDependencies

- `@types/node`: `node` 类型
- `@types/pacote`: `pacote` 类型
- `@types/update-notifier`: `update-notifier` 类型
- `prettier`: 格式化工具
- `typescript`: 编程语言
Expand Down
Binary file added assets/check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion bin/mine-auto-cli.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env node
#!/usr/bin/env node
import '../dist/index.js'
Loading

0 comments on commit 540911d

Please sign in to comment.