@seayoo-web/scripts 1.3.7 → 1.3.9
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-C3gyPvsT.js → git-CpSzshHm.js} +13 -4
- package/dist/index.js +3 -3
- package/dist/node.js +1 -1
- package/package.json +1 -1
|
@@ -51,7 +51,7 @@ async function getProjects(returnAll) {
|
|
|
51
51
|
const rootPkgPath = path.join(root, WorkspaceFile);
|
|
52
52
|
if (await fs.pathExists(rootPkgPath)) {
|
|
53
53
|
const content = await fs.readFile(rootPkgPath, "utf8");
|
|
54
|
-
const dirs = (content.match(/- "(
|
|
54
|
+
const dirs = /packages:\n(?:\s+-\s".+"\/\*)+/.test(content) ? (content.match(/- "(?:.+)\/\*"/g) || []).map((t) => t.slice(3, -3)) : (content.match(/- (?:.+)\/\*/g) || []).map((t) => t.slice(2, -2));
|
|
55
55
|
const names = await Promise.all(dirs.map(getProjectName));
|
|
56
56
|
const projects = dirs.map((id, index) => ({ id, name: names[index] })).filter((project) => !project.name.includes("disabled"));
|
|
57
57
|
return returnAll === true ? projects : projects.filter((project) => project.id !== InternalDir && project.id !== TemplateDir);
|
|
@@ -80,9 +80,18 @@ async function addProjectToWorkspace(project) {
|
|
|
80
80
|
const rootWorkspacePath = path.join(root, WorkspaceFile);
|
|
81
81
|
if (await fs.pathExists(rootWorkspacePath)) {
|
|
82
82
|
let content = await fs.readFile(rootWorkspacePath, "utf8");
|
|
83
|
-
if (
|
|
84
|
-
content
|
|
85
|
-
|
|
83
|
+
if (/packages:\n(?:\s+-\s".+"\/*)+/.test(content)) {
|
|
84
|
+
if (!content.includes(`- "${project}/*"`)) {
|
|
85
|
+
content = content.replace(/(packages:\n(?:\s{2,}-\s.+\n?)+)/, `$1
|
|
86
|
+
- "${project}/*"
|
|
87
|
+
`).replace(/\n{2,}/g, "\n");
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
if (!content.includes(`- ${project}/*`)) {
|
|
91
|
+
content = content.replace(/(packages:\n(?:\s{2,}-\s.+\n?)+)/, `$1
|
|
92
|
+
- ${project}/*
|
|
93
|
+
`).replace(/\n{2,}/g, "\n");
|
|
94
|
+
}
|
|
86
95
|
}
|
|
87
96
|
await fs.writeFile(rootWorkspacePath, content);
|
|
88
97
|
}
|
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-
|
|
10
|
+
import { g as getNowTime, a as getCommitInfo, c as createPageDeployTag } from "./git-CpSzshHm.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";
|
|
@@ -164,13 +164,13 @@ function definePageBuildConfig(option) {
|
|
|
164
164
|
"core-js/es/array/flat",
|
|
165
165
|
"core-js/es/array/flat-map",
|
|
166
166
|
"core-js/es/promise/all-settled",
|
|
167
|
-
"core-js/es/symbol"
|
|
167
|
+
"core-js/es/symbol/iterator"
|
|
168
168
|
],
|
|
169
169
|
additionalModernPolyfills: [
|
|
170
170
|
"core-js/es/array/flat",
|
|
171
171
|
"core-js/es/array/flat-map",
|
|
172
172
|
"core-js/es/promise/all-settled",
|
|
173
|
-
"core-js/es/symbol"
|
|
173
|
+
"core-js/es/symbol/iterator"
|
|
174
174
|
]
|
|
175
175
|
}),
|
|
176
176
|
htmlInjectPlugin({
|
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 getProjects, h as getTemplates, i as checkGitStatusBeforeDestory, j as createBackupTag, r as removeProjectFromWorkspace, s as submitAllDeletionChanges, k as getRepos } from "./git-
|
|
8
|
+
import { b as getMonorepoRoot, d as addProjectToWorkspace, e as copyTemplate, f as getProjects, h as getTemplates, i as checkGitStatusBeforeDestory, j as createBackupTag, r as removeProjectFromWorkspace, s as submitAllDeletionChanges, k as getRepos } from "./git-CpSzshHm.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];
|