@seayoo-web/scripts 2.3.0 → 2.4.1
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-w5-27jZ7.js → git-ByQTrD0l.js} +2 -2
- package/dist/index.js +14 -4
- package/dist/node.js +1 -1
- package/package.json +1 -1
- package/types/src/env.d.ts +1 -1
- package/types/src/vite.page.d.ts +9 -5
|
@@ -209,9 +209,9 @@ async function getCommitLogs(branchOrCommit, sinceCommit, codePath) {
|
|
|
209
209
|
"git log",
|
|
210
210
|
sinceCommit ? `${sinceCommit}..${branchOrCommit || "HEAD"}` : branchOrCommit || "",
|
|
211
211
|
/** spell-checker:disable-next-line */
|
|
212
|
-
`--oneline --pretty=format:"[%cd]
|
|
212
|
+
`--oneline --pretty=format:"[%cd] %s" --date=short -n 60`,
|
|
213
213
|
`-- ${codePath}`
|
|
214
|
-
].filter((f) => !!f).join(" ");
|
|
214
|
+
].filter((f) => !!f && !f.includes("Merge branch")).join(" ");
|
|
215
215
|
const result = await execCmd(cmd);
|
|
216
216
|
return result ? result.split("\n") : [];
|
|
217
217
|
}
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import vueDevTools from "vite-plugin-vue-devtools";
|
|
|
8
8
|
import { existsSync, readFileSync } from "fs";
|
|
9
9
|
import { loadEnv } from "vite";
|
|
10
10
|
import "colors";
|
|
11
|
-
import { g as getNowTime, a as getCommitInfo, c as createPageDeployTag } from "./git-
|
|
11
|
+
import { g as getNowTime, a as getCommitInfo, c as createPageDeployTag } from "./git-ByQTrD0l.js";
|
|
12
12
|
import skipFormatting from "@vue/eslint-config-prettier/skip-formatting";
|
|
13
13
|
import { vueTsConfigs, defineConfigWithVueTs } from "@vue/eslint-config-typescript";
|
|
14
14
|
import { flatConfigs } from "eslint-plugin-import";
|
|
@@ -56,7 +56,7 @@ function defineLibBuildConfig(option) {
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
const EnvPrefix = "SY_";
|
|
59
|
-
function getBuildEnv(command, mode, onlyBuild) {
|
|
59
|
+
function getBuildEnv(command, mode, onlyBuild, requireSentryToken, ignoreSentryToken) {
|
|
60
60
|
const envs = loadEnv(mode, process.cwd(), EnvPrefix);
|
|
61
61
|
const envConfig = {
|
|
62
62
|
command,
|
|
@@ -109,7 +109,15 @@ function getBuildEnv(command, mode, onlyBuild) {
|
|
|
109
109
|
}
|
|
110
110
|
envConfig.sentryAuthToken = envs[s];
|
|
111
111
|
if (!envConfig.sentryAuthToken) {
|
|
112
|
-
|
|
112
|
+
if (requireSentryToken) {
|
|
113
|
+
console.error(`缺少 ${s.red} 设置,请在 .env.local 配置`.red);
|
|
114
|
+
process.exit(1);
|
|
115
|
+
} else if (!ignoreSentryToken) {
|
|
116
|
+
console.warn(`尚未设置 ${s.red},推送 sourcemap 到 sentry 的功能将无效`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (ignoreSentryToken) {
|
|
120
|
+
envConfig.sentryAuthToken = "";
|
|
113
121
|
}
|
|
114
122
|
}
|
|
115
123
|
return envConfig;
|
|
@@ -136,6 +144,8 @@ function definePageBuildConfig(option) {
|
|
|
136
144
|
const {
|
|
137
145
|
notVuePage,
|
|
138
146
|
noPolyfill,
|
|
147
|
+
requireSentryToken,
|
|
148
|
+
ignoreSentryToken,
|
|
139
149
|
manualChunks,
|
|
140
150
|
badPackages = [],
|
|
141
151
|
plugins = [],
|
|
@@ -150,7 +160,7 @@ function definePageBuildConfig(option) {
|
|
|
150
160
|
return async function({ command, mode }) {
|
|
151
161
|
var _a, _b, _c;
|
|
152
162
|
const justBuild = mode === "build";
|
|
153
|
-
const envs = getBuildEnv(command, mode, justBuild);
|
|
163
|
+
const envs = getBuildEnv(command, mode, justBuild, requireSentryToken, ignoreSentryToken);
|
|
154
164
|
const gitInfo = justBuild ? null : await getCommitInfo(command, mode, envs.page, envs.deployTo || "");
|
|
155
165
|
const isProductMode = mode === "production" || mode === "prod";
|
|
156
166
|
const trunkMap = {
|
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 { b as getMonorepoRoot, d as addProjectToWorkspace, e as copyTemplate, f as copyGlobalFiles, h as getProjects, i as getTemplates, j as checkGitStatusBeforeDestroy, k as createBackupTag, r as removeProjectFromWorkspace, s as submitAllDeletionChanges, l as getRepos } from "./git-
|
|
8
|
+
import { b as getMonorepoRoot, d as addProjectToWorkspace, e as copyTemplate, f as copyGlobalFiles, h as getProjects, i as getTemplates, j as checkGitStatusBeforeDestroy, k as createBackupTag, r as removeProjectFromWorkspace, s as submitAllDeletionChanges, l as getRepos } from "./git-ByQTrD0l.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/env.d.ts
CHANGED
|
@@ -25,6 +25,6 @@ interface IBuildEnvs {
|
|
|
25
25
|
/**
|
|
26
26
|
* 获取构建环境配置
|
|
27
27
|
*/
|
|
28
|
-
export declare function getBuildEnv(command: "serve" | "build", mode: string, onlyBuild?: boolean): IBuildEnvs;
|
|
28
|
+
export declare function getBuildEnv(command: "serve" | "build", mode: string, onlyBuild?: boolean, requireSentryToken?: boolean, ignoreSentryToken?: boolean): IBuildEnvs;
|
|
29
29
|
export declare function transformEnvs(envs: Record<string, unknown>): Record<string, string>;
|
|
30
30
|
export {};
|
package/types/src/vite.page.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { UserConfig, UserConfigFnPromise } from "vite";
|
|
|
2
2
|
interface ExternalConfig {
|
|
3
3
|
/** 是否不使用 vue */
|
|
4
4
|
notVuePage?: boolean;
|
|
5
|
-
/**
|
|
5
|
+
/** 是否不加载 polyfill */
|
|
6
6
|
noPolyfill?: boolean;
|
|
7
7
|
/** sentry 配置 */
|
|
8
8
|
sentry?: {
|
|
@@ -10,9 +10,15 @@ interface ExternalConfig {
|
|
|
10
10
|
url?: string;
|
|
11
11
|
org?: string;
|
|
12
12
|
};
|
|
13
|
+
/** 是否强制要求提供 sentryToken */
|
|
14
|
+
requireSentryToken?: boolean;
|
|
15
|
+
/** 是否忽略 sentryToken 设置 */
|
|
16
|
+
ignoreSentryToken?: boolean;
|
|
13
17
|
/** finder 配置 */
|
|
14
18
|
finder?: {
|
|
15
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* 是否部署完毕后打开目标文件(index.html)也可以指定不同的目标文件
|
|
21
|
+
*/
|
|
16
22
|
preview?: boolean | string | string[];
|
|
17
23
|
/**
|
|
18
24
|
* 忽略部署的文件,如果是目录则需要以 / 结尾,支持 * 占位符模糊匹配。
|
|
@@ -21,8 +27,6 @@ interface ExternalConfig {
|
|
|
21
27
|
*/
|
|
22
28
|
ignoreFiles?: string[];
|
|
23
29
|
};
|
|
24
|
-
/** 仅仅编译 */
|
|
25
|
-
onlyBuild?: boolean;
|
|
26
30
|
/**
|
|
27
31
|
* 手工指定 trunk 合并策略,Record<key, chunk>,即 id.include(key) 则打到 trunk 中
|
|
28
32
|
*
|
|
@@ -36,7 +40,7 @@ interface ExternalConfig {
|
|
|
36
40
|
/**
|
|
37
41
|
* 指定哪些不够友好的包,这些包的 iife 或修改全局 windows 变量的行为导致默认 tree-shaking 策略失效
|
|
38
42
|
*
|
|
39
|
-
* 从而这些包被误打入最终的产物中,无谓增加了包的体积。默认 `thinkingdata` 和 `@esotericsoftware`
|
|
43
|
+
* 从而这些包被误打入最终的产物中,无谓增加了包的体积。默认 `thinkingdata` 和 `@esotericsoftware/spine`
|
|
40
44
|
*/
|
|
41
45
|
badPackages?: string[];
|
|
42
46
|
}
|