@seayoo-web/scripts 2.0.0 → 2.0.2

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.
@@ -208,6 +208,7 @@ async function getCommitLogs(branchOrCommit, sinceCommit, codePath) {
208
208
  const cmd = [
209
209
  "git log",
210
210
  sinceCommit ? `${sinceCommit}..${branchOrCommit || "HEAD"}` : branchOrCommit || "",
211
+ /** spell-checker:disable-next-line */
211
212
  `--oneline --pretty=format:"[%cd][%h] %s" --date=short -n 60`,
212
213
  `-- ${codePath}`
213
214
  ].filter((f) => !!f).join(" ");
@@ -241,7 +242,7 @@ async function createBackupTag(action, info) {
241
242
  const tagName = `${BackupTagPrefix}${action}_${info.replace(/\//g, "-")}`;
242
243
  const gitUser = await execCmd(`git config user.email`).catch(() => "");
243
244
  const user = (gitUser || "unknown").replace(/@.+/g, "");
244
- await execCmd(`git tag -f ${tagName} -m "${getNowTime()} destroyed by ${user}`);
245
+ await execCmd(`git tag -f ${tagName} -m "${getNowTime()} destroyed by ${user}"`);
245
246
  try {
246
247
  await execCmd(`git push origin -f ${tagName}`, true);
247
248
  } catch (e) {
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import vueDevTools from "vite-plugin-vue-devtools";
7
7
  import { existsSync, readFileSync } from "fs";
8
8
  import { loadEnv } from "vite";
9
9
  import "colors";
10
- import { g as getNowTime, a as getCommitInfo, c as createPageDeployTag } from "./git-DwEYyCAp.js";
10
+ import { g as getNowTime, a as getCommitInfo, c as createPageDeployTag } from "./git-w5-27jZ7.js";
11
11
  import skipFormatting from "@vue/eslint-config-prettier/skip-formatting";
12
12
  import { vueTsConfigs, defineConfigWithVueTs } from "@vue/eslint-config-typescript";
13
13
  import { flatConfigs } from "eslint-plugin-import";
@@ -72,18 +72,20 @@ function getBuildEnv(command, mode) {
72
72
  const s = `${EnvPrefix}SENTRY_AUTH_TOKEN`;
73
73
  const u = `${EnvPrefix}DEPLOY_USER`;
74
74
  const k = `${EnvPrefix}DEPLOY_KEY`;
75
- const execDir = process.cwd().replace(/\\/g, "/").split("/").slice(-2).join("/");
75
+ const paths = process.cwd().replace(/\\/g, "/").split("/");
76
+ const execDirWithPackage = paths.slice(-2).join("/");
77
+ const execDir = paths.slice(-1)[0];
76
78
  const packageFile = join(process.cwd(), "./package.json");
77
79
  if (!existsSync(packageFile)) {
78
80
  console.error("执行代码有误,没有找到 package.json".red);
79
81
  process.exit(1);
80
82
  }
81
83
  const packageJson = JSON.parse(readFileSync(packageFile, { encoding: "utf-8" }).toString());
82
- if (!packageJson || !packageJson.name || packageJson.name !== `@${execDir}`) {
83
- console.error(`工程 package.json/name 属性设置错误,应该跟目录保持一致(@${execDir}),请先调整`.red);
84
+ if (!packageJson || !packageJson.name || !(packageJson.name + "").endsWith(`/${execDir}`)) {
85
+ console.error(`工程 package.json/name 属性设置错误,应该跟目录名保持一致,请先调整`.red);
84
86
  process.exit(1);
85
87
  }
86
- envConfig.page = execDir;
88
+ envConfig.page = execDirWithPackage;
87
89
  if (envConfig.command === "build") {
88
90
  if (process.env.NODE_ENV !== "production") {
89
91
  console.error("部署时需要设置 NODE_ENV 为 production,请检查环境变量设置".red);
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-DwEYyCAp.js";
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-w5-27jZ7.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/scripts",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "scripts for seayoo web repos",
5
5
  "type": "module",
6
6
  "source": "index.ts",
@@ -33,9 +33,9 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@sentry/vite-plugin": "^3.2.2",
37
- "@vitejs/plugin-legacy": "^6.0.2",
38
- "@vitejs/plugin-vue": "^5.2.2",
36
+ "@sentry/vite-plugin": "^3.3.1",
37
+ "@vitejs/plugin-legacy": "^6.1.0",
38
+ "@vitejs/plugin-vue": "^5.2.3",
39
39
  "@vue/eslint-config-prettier": "^10.2.0",
40
40
  "@vue/eslint-config-typescript": "^14.5.0",
41
41
  "colors": "^1.4.0",
@@ -43,21 +43,21 @@
43
43
  "eslint-plugin-import": "^2.31.0",
44
44
  "eslint-plugin-vue": "^9.33.0",
45
45
  "fs-extra": "^11.3.0",
46
- "inquirer": "^12.5.0",
46
+ "inquirer": "^12.5.2",
47
47
  "jiti": "^2.4.2",
48
48
  "ora": "^8.2.0",
49
49
  "postcss-html": "^1.8.0",
50
50
  "terser": "^5.39.0",
51
51
  "vite-plugin-stylelint": "^6.0.0",
52
- "vite-plugin-vue-devtools": "^7.7.2",
52
+ "vite-plugin-vue-devtools": "^7.7.5",
53
53
  "@seayoo-web/finder": "^2.0.13"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/fs-extra": "^11.0.4",
57
- "@types/node": "^22.13.10",
58
- "@typescript-eslint/utils": "^8.26.1",
59
- "eslint": "^9.22.0",
60
- "stylelint": "^16.16.0",
57
+ "@types/node": "^22.14.1",
58
+ "@typescript-eslint/utils": "^8.30.1",
59
+ "eslint": "^9.25.0",
60
+ "stylelint": "^16.18.0",
61
61
  "stylelint-config-recess-order": "^6.0.0",
62
62
  "stylelint-config-standard": "^37.0.0",
63
63
  "@seayoo-web/tsconfig": "^1.0.3"
@@ -1,4 +1,4 @@
1
- import { type UserConfig } from "vite";
1
+ import type { UserConfig } from "vite";
2
2
  /**
3
3
  * 导出一个动态的配置工厂函数
4
4
  */