@ruan-cat/vercel-deploy-tool 0.0.4 → 0.0.6
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.
- package/package.json +5 -1
- package/src/config.ts +2 -3
- package/src/index.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruan-cat/vercel-deploy-tool",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "阮喵喵自用的vercel部署工具,用于实现复杂项目的部署。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -33,9 +33,13 @@
|
|
|
33
33
|
"@dotenvx/dotenvx": "^1.11.5",
|
|
34
34
|
"c12": "^1.11.2",
|
|
35
35
|
"consola": "^3.2.3",
|
|
36
|
+
"cpx": "^1.5.0",
|
|
36
37
|
"execa": "^9.3.1",
|
|
37
38
|
"lodash-es": "^4.17.21",
|
|
39
|
+
"mkdirp": "^3.0.1",
|
|
38
40
|
"pathe": "^1.1.2",
|
|
41
|
+
"rimraf": "^5.0.7",
|
|
42
|
+
"shx": "^0.3.4",
|
|
39
43
|
"vercel": "^34.2.7",
|
|
40
44
|
"@ruan-cat/utils": "^1.0.2"
|
|
41
45
|
},
|
package/src/config.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type Base = {
|
|
|
20
20
|
type: DeployTargetType;
|
|
21
21
|
|
|
22
22
|
/** 目标的工作目录 */
|
|
23
|
-
targetCWD: string
|
|
23
|
+
targetCWD: `./${string}`;
|
|
24
24
|
|
|
25
25
|
/** 生产环境的访问url */
|
|
26
26
|
url: string[];
|
|
@@ -44,15 +44,14 @@ export interface WithUserCommands extends Base {
|
|
|
44
44
|
* 实际部署的构建命令 通常是真实参与部署的命令
|
|
45
45
|
*
|
|
46
46
|
* FIXME: 在具体的execa中,无法使用pnpm的筛选命令。只能指定其工作目录。
|
|
47
|
+
* FIXME: 这个字段无法实现类型声明,缺失类型提示了。
|
|
47
48
|
* TODO: 实现对 targetCWD 的读取,并实现类型声明。
|
|
48
49
|
*
|
|
49
50
|
* pnpm -F @ruan-cat-vercel-monorepo-test/docs-01-star build:docs
|
|
50
51
|
*
|
|
51
52
|
* @example pnpm -C=./packages/docs-01-star build:docs
|
|
52
53
|
* @example pnpm -C=./packages/monorepo-5 build:docs
|
|
53
|
-
*
|
|
54
54
|
*/
|
|
55
|
-
// userCommands: Array<UserCommandsWithPnpmPath<WithUserCommands["outputDirectory"]> | string>;
|
|
56
55
|
userCommands: UserCommandsWithPnpmPath<WithUserCommands["targetCWD"]>[];
|
|
57
56
|
|
|
58
57
|
/**
|
package/src/index.ts
CHANGED
|
@@ -207,19 +207,19 @@ function generateBuildTask(deployTarget: DeployTarget) {
|
|
|
207
207
|
*/
|
|
208
208
|
function generateCopyDistTasks(deployTarget: WithUserCommands) {
|
|
209
209
|
function delDirectoryCmd() {
|
|
210
|
-
return <const>`rimraf ${vercelOutputStatic}`;
|
|
210
|
+
return <const>`pnpm dlx rimraf ${vercelOutputStatic}`;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
function createDirectoryCmd() {
|
|
214
|
-
return <const>`mkdirp ${vercelOutputStatic}`;
|
|
214
|
+
return <const>`pnpm dlx mkdirp ${vercelOutputStatic}`;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
function copyDirectoryFileCmd() {
|
|
218
|
-
return <const>`cpx "${deployTarget.outputDirectory}" ${vercelOutputStatic}`;
|
|
218
|
+
return <const>`pnpm dlx cpx "${deployTarget.outputDirectory}" ${vercelOutputStatic}`;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
function printDirectoryFileCmd() {
|
|
222
|
-
return <const>`shx ls -R ${vercelOutputStatic}`;
|
|
222
|
+
return <const>`pnpm dlx shx ls -R ${vercelOutputStatic}`;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
function cmdPrefix() {
|