@seayoo-web/scripts 1.3.11 → 1.3.13
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-BHXCYFmD.js → git-BrZHpO_Q.js} +16 -5
- package/dist/index.js +1 -1
- package/dist/node.js +3 -1
- package/package.json +1 -1
- package/types/src/utils.d.ts +4 -0
|
@@ -75,6 +75,16 @@ async function copyTemplate(templateName, targetDir) {
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
+
async function copyGlobalFiles(targetDir) {
|
|
79
|
+
const root = await getMonorepoRoot();
|
|
80
|
+
const globalFiles = await fs.readdir(path.join(root, TemplateDir));
|
|
81
|
+
for (const item of globalFiles) {
|
|
82
|
+
const f = path.join(root, TemplateDir, item);
|
|
83
|
+
if (fs.statSync(f).isFile()) {
|
|
84
|
+
await fs.copy(f, path.join(targetDir, item));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
78
88
|
async function addProjectToWorkspace(project) {
|
|
79
89
|
const root = await getMonorepoRoot();
|
|
80
90
|
const rootWorkspacePath = path.join(root, WorkspaceFile);
|
|
@@ -248,12 +258,13 @@ export {
|
|
|
248
258
|
createPageDeployTag as c,
|
|
249
259
|
addProjectToWorkspace as d,
|
|
250
260
|
copyTemplate as e,
|
|
251
|
-
|
|
261
|
+
copyGlobalFiles as f,
|
|
252
262
|
getNowTime as g,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
263
|
+
getProjects as h,
|
|
264
|
+
getTemplates as i,
|
|
265
|
+
checkGitStatusBeforeDestory as j,
|
|
266
|
+
createBackupTag as k,
|
|
267
|
+
getRepos as l,
|
|
257
268
|
removeProjectFromWorkspace as r,
|
|
258
269
|
submitAllDeletionChanges as s
|
|
259
270
|
};
|
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-BrZHpO_Q.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";
|
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
|
|
8
|
+
import { b as getMonorepoRoot, d as addProjectToWorkspace, e as copyTemplate, f as copyGlobalFiles, h as getProjects, i as getTemplates, j as checkGitStatusBeforeDestory, k as createBackupTag, r as removeProjectFromWorkspace, s as submitAllDeletionChanges, l as getRepos } from "./git-BrZHpO_Q.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];
|
|
@@ -159,6 +159,8 @@ async function createRepo() {
|
|
|
159
159
|
await copyTemplate(answers.template, targetDir);
|
|
160
160
|
spinner.text = "更新 package.json...";
|
|
161
161
|
await updatePackageFiles(targetDir, answers);
|
|
162
|
+
spinner.text = "复制全局文件...";
|
|
163
|
+
await copyGlobalFiles(targetDir);
|
|
162
164
|
spinner.succeed("仓库创建成功!".green);
|
|
163
165
|
console.log("\n接下来你可以:");
|
|
164
166
|
console.log(`cd ${answers.project}/${answers.repoName}`.cyan);
|
package/package.json
CHANGED
package/types/src/utils.d.ts
CHANGED
|
@@ -31,6 +31,10 @@ export declare function getProjectName(project: string): Promise<string>;
|
|
|
31
31
|
* 复制模板到目标目录
|
|
32
32
|
*/
|
|
33
33
|
export declare function copyTemplate(templateName: string, targetDir: string): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* 复制全局文件
|
|
36
|
+
*/
|
|
37
|
+
export declare function copyGlobalFiles(targetDir: string): Promise<void>;
|
|
34
38
|
/**
|
|
35
39
|
* 更新 workspace.yaml
|
|
36
40
|
*/
|