@seayoo-web/scripts 1.2.3 → 1.2.5
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/dist/{git-rC0NCMws.js → git-BbsLu9cn.js} +11 -4
- package/dist/index.js +1 -1
- package/dist/node.js +1 -1
- package/package.json +1 -1
- package/types/src/vite.lab.d.ts +2 -0
|
@@ -109,11 +109,18 @@ async function execCmd(cmd, ignoreWarning = false) {
|
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
async function getCommitInfo(command, mode, page, deployTo) {
|
|
112
|
-
if (command !== "build"
|
|
112
|
+
if (command !== "build") {
|
|
113
|
+
return { hash: await getCommitHash(), logs: [] };
|
|
114
|
+
}
|
|
115
|
+
if (mode === "preview" || mode === "prev") {
|
|
116
|
+
if (!deployTo.includes("preview")) {
|
|
117
|
+
console.error(`预览部署的目标路径必须包含 preview 字样!`.red);
|
|
118
|
+
process.exit(1);
|
|
119
|
+
}
|
|
113
120
|
return { hash: await getCommitHash(), logs: [] };
|
|
114
121
|
}
|
|
115
122
|
if (await hasUncommittedChanges()) {
|
|
116
|
-
console.error(
|
|
123
|
+
console.error(`正式部署前需要提交所有代码!`.red);
|
|
117
124
|
process.exit(1);
|
|
118
125
|
}
|
|
119
126
|
if (await getCurrentBranchName() !== MainBranchName) {
|
|
@@ -139,12 +146,12 @@ async function createPageDeployTag(page, deployTo, finderUser) {
|
|
|
139
146
|
const tagName = converToDeployTagName(deployTo);
|
|
140
147
|
const gitUser = await execCmd(`git config user.email`).catch(() => "");
|
|
141
148
|
await execCmd(
|
|
142
|
-
[`git tag -f ${tagName} -m "${getNowTime()} deployed by ${gitUser || finderUser}`, page ? `from ${page}` : ""].filter((c) => !!c).join(" ")
|
|
149
|
+
[`git tag -f ${tagName} -m "${getNowTime()} deployed by ${gitUser || finderUser}`, page ? `from ${page}` : "", '"'].filter((c) => !!c).join(" ")
|
|
143
150
|
);
|
|
144
151
|
try {
|
|
145
152
|
await execCmd(`git push origin -f ${tagName}`, true);
|
|
146
153
|
} catch (e) {
|
|
147
|
-
await execCmd(`git push origin --tags`, true);
|
|
154
|
+
await execCmd(`git push origin -f --tags`, true);
|
|
148
155
|
}
|
|
149
156
|
}
|
|
150
157
|
async function getCommitHash() {
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import vue from "@vitejs/plugin-vue";
|
|
|
7
7
|
import vueDevTools from "vite-plugin-vue-devtools";
|
|
8
8
|
import { existsSync, readFileSync } from "fs";
|
|
9
9
|
import "colors";
|
|
10
|
-
import { g as getNowTime, a as getCommitInfo, c as createPageDeployTag } from "./git-
|
|
10
|
+
import { g as getNowTime, a as getCommitInfo, c as createPageDeployTag } from "./git-BbsLu9cn.js";
|
|
11
11
|
import skipFormatting from "@vue/eslint-config-prettier/skip-formatting";
|
|
12
12
|
import { vueTsConfigs } from "@vue/eslint-config-typescript";
|
|
13
13
|
import { defineConfigWithVueTs } from "@vue/eslint-config-typescript";
|
package/dist/node.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Command } from "commander";
|
|
|
5
5
|
import fs from "fs-extra";
|
|
6
6
|
import inquirer from "inquirer";
|
|
7
7
|
import ora from "ora";
|
|
8
|
-
import { r as root, b as addProjectToWorkspace, d as copyTemplate, e as getProjects, f as getTemplates, h as checkGitStatusBeforeDestory, i as createBackupTag, j as removeProjectFromWorkspace, s as submitAllDeletionChanges, k as getRepos } from "./git-
|
|
8
|
+
import { r as root, b as addProjectToWorkspace, d as copyTemplate, e as getProjects, f as getTemplates, h as checkGitStatusBeforeDestory, i as createBackupTag, j as removeProjectFromWorkspace, s as submitAllDeletionChanges, k as getRepos } from "./git-BbsLu9cn.js";
|
|
9
9
|
const commitRE = /^(?:revert: )?(?:feat|fix|docs|style|refactor|test|build|chore|debug|tweak|improve)(?:\(.+\))?: .{1,100}/;
|
|
10
10
|
function checkCommit() {
|
|
11
11
|
const msgPath = process.argv[2];
|
package/package.json
CHANGED
package/types/src/vite.lab.d.ts
CHANGED