@ruan-cat/vercel-deploy-tool 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/readme.md +32 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruan-cat/vercel-deploy-tool",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "阮喵喵自用的vercel部署工具,用于实现复杂项目的部署。",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -51,7 +51,7 @@
51
51
  "rimraf": "^5.0.7",
52
52
  "shx": "^0.3.4",
53
53
  "vercel": "^34.2.7",
54
- "@ruan-cat/utils": "^1.0.4"
54
+ "@ruan-cat/utils": "^1.0.5"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/lodash-es": "^4.17.12",
package/readme.md CHANGED
@@ -17,11 +17,35 @@ pnpm i -D @ruan-cat/vercel-deploy-tool@latest
17
17
 
18
18
  ## 环境要求
19
19
 
20
- - node >=22.6.0
20
+ - node >=20.15.1
21
21
  - pnpm >=9
22
22
 
23
23
  ## 使用教程
24
24
 
25
+ ### 增加 .gitignore 配置
26
+
27
+ 本工具会在根目录内默认生成一个全空配置的 vercel.null.def.json 文件,这个文件应该被忽略。
28
+
29
+ 后续的使用会不可避免的使用 vercel 的 api,会在你的项目内生成一个或多个.vercel 文件夹,故.vercel 文件夹也应该被忽略。
30
+
31
+ ```bash
32
+ # 忽略vercel本地打包生成的文件
33
+ .vercel
34
+ # 忽略自动生成vercel部署配置文件
35
+ vercel.null.def.json
36
+ ```
37
+
38
+ 如果你使用环境变量文件,推荐你加上 dotenv 推荐的环境变量文件忽略。
39
+
40
+ ```bash
41
+ # dotenv environment variable files
42
+ .env
43
+ .env.development.local
44
+ .env.test.local
45
+ .env.production.local
46
+ .env.local
47
+ ```
48
+
25
49
  ### 获取 vercel 提供的 id
26
50
 
27
51
  用 [`vc link`](https://vercel.com/guides/how-can-i-use-github-actions-with-vercel) 命令获取 vercelOrgId 和 vercelProjectId。
@@ -104,16 +128,16 @@ pnpm i -D tsx
104
128
  ```yaml
105
129
  name: 自写的vercel部署工具
106
130
  env:
107
- # 必须密文提供token
131
+ # 必须密文提供token
108
132
  VERCEL_TOKEN: ${{ secrets.vercel_token }}
109
- # 可以明文提供组织id和项目id
133
+ # 可以明文提供组织id和项目id
110
134
  # VERCEL_ORG_ID: ${{ secrets.vercel_orgId }}
111
135
  # VERCEL_PROJECT_ID: ${{ secrets.vercel_projectId }}
112
136
 
113
137
  on:
114
138
  push:
115
139
  branches:
116
- # 可以自选分支 为了避免过快耗尽vercel额度,建议只在main分支内触发部署
140
+ # 可以自选分支 为了避免过快耗尽vercel额度,建议只在main分支内触发部署
117
141
  - main
118
142
 
119
143
  jobs:
@@ -128,7 +152,7 @@ jobs:
128
152
  with:
129
153
  # 若项目提供了packageManager配置 这里可以不提供该配置
130
154
  # version: 9
131
- # 必须安装 vercel @dotenvx/dotenvx tsx 这三个全局包
155
+ # 必须安装 vercel @dotenvx/dotenvx tsx 这三个全局包
132
156
  run_install: |
133
157
  - recursive: true
134
158
  - args: [--global, "vercel", "@dotenvx/dotenvx", "tsx"]
@@ -136,7 +160,7 @@ jobs:
136
160
  - name: 安装node
137
161
  uses: actions/setup-node@v4
138
162
  with:
139
- node-version: 22.6.0
163
+ node-version: 20.15.1
140
164
  cache: pnpm
141
165
 
142
166
  - name: 检查版本
@@ -149,9 +173,9 @@ jobs:
149
173
  run: pnpm ls -g
150
174
 
151
175
  - name: 运行自写的vercel部署工具
152
- # 读取环境变量
176
+ # 读取环境变量
153
177
  # https://dotenvx.com/docs/cis/github-actions#install-dotenvx
154
- # pnpm run your-command
178
+ # pnpm run your-command
155
179
  run: |
156
180
  curl -sfS https://dotenvx.sh/install.sh | sh
157
181
  pnpm dotenvx run -- pnpm run deploy-vercel