nuxt-gin-tools 0.0.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/LICENSE +21 -0
- package/README.md +19 -0
- package/index.d.ts +2 -0
- package/index.js +44 -0
- package/package.json +27 -0
- package/src/builder.d.ts +2 -0
- package/src/builder.js +27 -0
- package/src/develop.d.ts +2 -0
- package/src/develop.js +42 -0
- package/src/generate.d.ts +11 -0
- package/src/generate.js +121 -0
- package/src/go-gin-server.json +5 -0
- package/src/pack.d.ts +5 -0
- package/src/pack.js +82 -0
- package/src/postinstall.d.ts +2 -0
- package/src/postinstall.js +23 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 AlbertGao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# nuxt-gin-tools
|
|
2
|
+
|
|
3
|
+
This project is used as a dependency for [nuxt-gin-starter](https://github.com/RapboyGao/nuxt3-gin-starter.git)
|
|
4
|
+
|
|
5
|
+
## Command: nuxt-gin dev
|
|
6
|
+
|
|
7
|
+
- Starting the develop server.
|
|
8
|
+
|
|
9
|
+
## Command: nuxt-gin build
|
|
10
|
+
|
|
11
|
+
- Build script
|
|
12
|
+
|
|
13
|
+
## Command: nuxt-gin gen
|
|
14
|
+
|
|
15
|
+
- Generate API based on openapi.yaml
|
|
16
|
+
|
|
17
|
+
## Command: nuxt-gin install
|
|
18
|
+
|
|
19
|
+
- Postinstall script.
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
// index.ts - 入口文件,用于处理命令行参数并调用相应的功能模块
|
|
8
|
+
// 导入构建和打包功能
|
|
9
|
+
const pack_1 = __importDefault(require("./src/pack"));
|
|
10
|
+
// 导入开发模式功能
|
|
11
|
+
const develop_1 = __importDefault(require("./src/develop"));
|
|
12
|
+
// 导入API生成功能
|
|
13
|
+
const generate_1 = __importDefault(require("./src/generate"));
|
|
14
|
+
// 导入安装后处理功能
|
|
15
|
+
const postinstall_1 = __importDefault(require("./src/postinstall"));
|
|
16
|
+
// 获取命令行参数(去除前两个默认参数)
|
|
17
|
+
const args = process.argv.slice(2);
|
|
18
|
+
// 检查是否提供了命令
|
|
19
|
+
if (args.length === 0) {
|
|
20
|
+
console.error("未提供命令。请指定要运行的命令。");
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
// 根据第一个参数执行对应的命令
|
|
24
|
+
switch (args[0]) {
|
|
25
|
+
case "dev":
|
|
26
|
+
// 启动开发模式
|
|
27
|
+
(0, develop_1.default)();
|
|
28
|
+
break;
|
|
29
|
+
case "build":
|
|
30
|
+
// 执行构建和打包操作
|
|
31
|
+
(0, pack_1.default)();
|
|
32
|
+
break;
|
|
33
|
+
case "gen":
|
|
34
|
+
// 生成API代码(注:此处命令可能拼写错误,应为generate)
|
|
35
|
+
(0, generate_1.default)();
|
|
36
|
+
break;
|
|
37
|
+
case "install":
|
|
38
|
+
// 执行安装后的初始化操作
|
|
39
|
+
(0, postinstall_1.default)();
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
console.error(`未知命令: ${args[0]}`);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nuxt-gin-tools",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"bin": {
|
|
6
|
+
"nuxt-gin": "index.js"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "ts-node build.ts",
|
|
13
|
+
"publish": "npm publish --access public"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"7zip-min": "^2.1.0",
|
|
17
|
+
"chalk": "^5.4.1",
|
|
18
|
+
"concurrently": "^9.2.0",
|
|
19
|
+
"fs-extra": "^11.3.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/fs-extra": "^11.0.4",
|
|
23
|
+
"@types/node": "^24.0.14",
|
|
24
|
+
"ts-node": "^10.9.2",
|
|
25
|
+
"typescript": "^5.8.3"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/src/builder.d.ts
ADDED
package/src/builder.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.build = build;
|
|
7
|
+
const concurrently_1 = __importDefault(require("concurrently"));
|
|
8
|
+
const fs_extra_1 = require("fs-extra");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const cwd = process.cwd();
|
|
11
|
+
function build() {
|
|
12
|
+
(0, fs_extra_1.ensureDirSync)((0, path_1.join)(cwd, "vue/.output"));
|
|
13
|
+
(0, fs_extra_1.ensureFileSync)((0, path_1.join)(cwd, "tmp/production.exe"));
|
|
14
|
+
return (0, concurrently_1.default)([
|
|
15
|
+
{
|
|
16
|
+
command: "go build -o ./tmp/production.exe .",
|
|
17
|
+
name: "go",
|
|
18
|
+
prefixColor: "green",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
command: "nuxt generate",
|
|
22
|
+
name: "nuxt",
|
|
23
|
+
prefixColor: "blue",
|
|
24
|
+
},
|
|
25
|
+
]).result;
|
|
26
|
+
}
|
|
27
|
+
exports.default = build;
|
package/src/develop.d.ts
ADDED
package/src/develop.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.develop = develop;
|
|
7
|
+
const concurrently_1 = __importDefault(require("concurrently"));
|
|
8
|
+
const fs_extra_1 = require("fs-extra");
|
|
9
|
+
const os_1 = __importDefault(require("os"));
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
const cwd = process.cwd();
|
|
12
|
+
const serverConfig = (0, fs_extra_1.readJSONSync)((0, path_1.join)(cwd, "server.config.json"));
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @returns {string} 返回air命令的路径
|
|
16
|
+
* 根据操作系统不同,返回不同的路径
|
|
17
|
+
* 如果是macOS,返回~/go/bin/air
|
|
18
|
+
* 如果是其他操作系统,返回air
|
|
19
|
+
*/
|
|
20
|
+
function getAirCommand() {
|
|
21
|
+
if (os_1.default.platform() === "darwin") {
|
|
22
|
+
return "~/go/bin/air";
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return "air";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function develop() {
|
|
29
|
+
(0, concurrently_1.default)([
|
|
30
|
+
{
|
|
31
|
+
command: getAirCommand(),
|
|
32
|
+
name: "go",
|
|
33
|
+
prefixColor: "green",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
command: `nuxt dev --port=${serverConfig.nuxtPort}`,
|
|
37
|
+
name: "nuxt",
|
|
38
|
+
prefixColor: "blue",
|
|
39
|
+
},
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
exports.default = develop;
|
package/src/generate.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 警告:本文件是API生成框架的一部分,请勿手动修改!
|
|
4
|
+
* 任何修改可能会被自动化流程覆盖。
|
|
5
|
+
* 如需调整生成逻辑,请修改相关配置文件或脚本。
|
|
6
|
+
*/
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.apiGenerate = apiGenerate;
|
|
21
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
22
|
+
const concurrently_1 = __importDefault(require("concurrently")); // 用于并发执行命令的工具
|
|
23
|
+
const fs_extra_1 = __importDefault(require("fs-extra")); // 文件系统操作工具,提供更便捷的API
|
|
24
|
+
const path_1 = __importDefault(require("path")); // 处理和转换文件路径的工具
|
|
25
|
+
const cwd = process.cwd(); // 获取当前工作目录
|
|
26
|
+
/**
|
|
27
|
+
* 要执行的命令列表
|
|
28
|
+
* 包含OpenAPI代码生成命令:
|
|
29
|
+
* 1. 生成Go Gin服务器代码
|
|
30
|
+
* 2. 生成TypeScript Axios客户端代码
|
|
31
|
+
*/
|
|
32
|
+
let commands = [
|
|
33
|
+
{
|
|
34
|
+
command: "openapi-generator-cli generate -i openapi.yaml -g go-gin-server -c node_modules/nuxt3-gin-tools/src/go-gin-server.json -o .",
|
|
35
|
+
name: "go",
|
|
36
|
+
prefixColor: "green",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
command: "openapi-generator-cli generate -i openapi.yaml -g typescript-axios -o vue/composables/api ",
|
|
40
|
+
name: "vue",
|
|
41
|
+
prefixColor: "blue",
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
/**
|
|
45
|
+
* 执行完成后需要删除的路径列表
|
|
46
|
+
*/
|
|
47
|
+
const pathsToDelete = ["api"];
|
|
48
|
+
/**
|
|
49
|
+
* 设置Vue API客户端的基础URL
|
|
50
|
+
* 修改TypeScript axios生成的base.ts文件,将BASE_PATH设置为相对路径
|
|
51
|
+
* @returns {Promise<string>} 返回原始文件内容的Promise
|
|
52
|
+
*/
|
|
53
|
+
function setVueBaseUrl() {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
try {
|
|
56
|
+
// 构建Vue API运行时配置文件的完整路径
|
|
57
|
+
const VUE_API_RUNTIME_PATH = path_1.default.join(cwd, "vue/composables/api/base.ts");
|
|
58
|
+
// 读取原始文件内容
|
|
59
|
+
const originalContent = yield fs_extra_1.default.readFile(VUE_API_RUNTIME_PATH, "utf-8");
|
|
60
|
+
// 使用正则表达式替换BASE_PATH常量,移除协议和域名部分,使其成为相对路径
|
|
61
|
+
// 匹配类似 "export const BASE_PATH = "https://example.com"" 这样的行
|
|
62
|
+
const updatedContent = originalContent.replace(/export\s+const\s+BASE_PATH = "https?:\/\/[^/]+/, `export const BASE_PATH = "`);
|
|
63
|
+
// 将修改后的内容写回文件
|
|
64
|
+
yield fs_extra_1.default.outputFile(VUE_API_RUNTIME_PATH, updatedContent, "utf-8");
|
|
65
|
+
console.log("成功更新Vue API基础URL为相对路径");
|
|
66
|
+
return originalContent;
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
console.error("更新Vue API基础URL失败:", error);
|
|
70
|
+
throw error; // 将错误继续抛出,以便上层处理
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 删除指定的路径
|
|
76
|
+
* 用于清理生成过程中产生的临时或不需要的文件和目录
|
|
77
|
+
*/
|
|
78
|
+
function removePaths() {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
try {
|
|
81
|
+
// 遍历要删除的路径列表
|
|
82
|
+
for (const path of pathsToDelete) {
|
|
83
|
+
// 构建完整路径
|
|
84
|
+
const fullPath = path_1.default.join(cwd, path);
|
|
85
|
+
// 删除路径(文件或目录)
|
|
86
|
+
yield fs_extra_1.default.remove(fullPath);
|
|
87
|
+
console.log(`成功删除路径: ${fullPath}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
console.error("删除路径失败:", error);
|
|
92
|
+
throw error; // 将错误继续抛出
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* 主函数
|
|
98
|
+
* 协调执行所有任务:生成代码、删除路径、配置Vue API
|
|
99
|
+
*/
|
|
100
|
+
function apiGenerate() {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
try {
|
|
103
|
+
// 输出开始信息
|
|
104
|
+
console.log(chalk_1.default.bgGreen("开始生成API代码..."));
|
|
105
|
+
// 并发执行命令列表中的所有命令,等待所有命令完成
|
|
106
|
+
yield (0, concurrently_1.default)(commands).result;
|
|
107
|
+
// 按顺序执行清理和配置任务
|
|
108
|
+
yield removePaths();
|
|
109
|
+
yield setVueBaseUrl();
|
|
110
|
+
console.log(chalk_1.default.bgGreen("API代码生成和配置完成!"));
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
// 捕获并处理任何阶段发生的错误
|
|
114
|
+
console.error(chalk_1.default.red("执行过程中发生错误:"), error);
|
|
115
|
+
// 以错误码1退出进程,表示执行失败
|
|
116
|
+
process.exit(1);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
// 执行主函数
|
|
121
|
+
exports.default = apiGenerate;
|
package/src/pack.d.ts
ADDED
package/src/pack.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.buildAndPack = buildAndPack;
|
|
16
|
+
const _7zip_min_1 = __importDefault(require("7zip-min"));
|
|
17
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
18
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
19
|
+
const path_1 = __importDefault(require("path"));
|
|
20
|
+
const builder_1 = __importDefault(require("./builder"));
|
|
21
|
+
const cwd = process.cwd();
|
|
22
|
+
/**
|
|
23
|
+
* @param {...string} names 路径名称
|
|
24
|
+
* @returns 相对于Workspace位置的路径名称
|
|
25
|
+
*/
|
|
26
|
+
function p(...names) {
|
|
27
|
+
return path_1.default.join(cwd, ...names);
|
|
28
|
+
}
|
|
29
|
+
/** 打包文件夹相对于Workspace位置 */
|
|
30
|
+
const DIST_PACKAGE = "dist/package";
|
|
31
|
+
/** 需要打包的文件相对位置列表 */
|
|
32
|
+
const FILE_LIST = ["vue/.output", "tmp/production.exe", "ecosystem.config.js", "server.config.json"];
|
|
33
|
+
/** package.json 文件夹相对于Workspace位置 */
|
|
34
|
+
const PACKAGE_JSON = DIST_PACKAGE + "/package.json";
|
|
35
|
+
/** 打包package.7z位置 */
|
|
36
|
+
const _7Z_PATH = DIST_PACKAGE + "/../package.7z";
|
|
37
|
+
/** package.json 内容 */
|
|
38
|
+
const PACKAGE_JSON_CONTENT = {
|
|
39
|
+
private: true,
|
|
40
|
+
scripts: {
|
|
41
|
+
start: "./tmp/production.exe",
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* 把FILE_LIST中的文件拷贝到DIST_PACKAGE的对应位置
|
|
46
|
+
*/
|
|
47
|
+
function copyFiles() {
|
|
48
|
+
for (const path of FILE_LIST) {
|
|
49
|
+
fs_extra_1.default.copySync(p(path), p(DIST_PACKAGE, path));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function writeScriptFiles() {
|
|
53
|
+
fs_extra_1.default.outputFileSync(p(DIST_PACKAGE, "start.bat"), `powershell -ExecutionPolicy ByPass -File ./start.ps1`);
|
|
54
|
+
fs_extra_1.default.outputFileSync(p(DIST_PACKAGE, "start.ps1"), `./tmp/production.exe`);
|
|
55
|
+
fs_extra_1.default.outputFileSync(p(DIST_PACKAGE, "start.sh"), `./tmp/production.exe`);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 打包文件为7z格式
|
|
59
|
+
*/
|
|
60
|
+
function pack() {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
fs_extra_1.default.removeSync(p(DIST_PACKAGE));
|
|
63
|
+
fs_extra_1.default.removeSync(p(_7Z_PATH));
|
|
64
|
+
copyFiles();
|
|
65
|
+
writeScriptFiles();
|
|
66
|
+
fs_extra_1.default.outputJSONSync(p(PACKAGE_JSON), PACKAGE_JSON_CONTENT, { spaces: 2 });
|
|
67
|
+
_7zip_min_1.default.pack(p(DIST_PACKAGE), p(_7Z_PATH), () => {
|
|
68
|
+
fs_extra_1.default.removeSync(p(DIST_PACKAGE));
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 先generate,让后打包
|
|
74
|
+
*/
|
|
75
|
+
function buildAndPack() {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
yield (0, builder_1.default)();
|
|
78
|
+
yield pack();
|
|
79
|
+
console.log(chalk_1.default.bgGreen("打包完成!", _7Z_PATH));
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
exports.default = buildAndPack;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.postInstall = postInstall;
|
|
7
|
+
const concurrently_1 = __importDefault(require("concurrently"));
|
|
8
|
+
function postInstall() {
|
|
9
|
+
// 执行并发命令
|
|
10
|
+
return (0, concurrently_1.default)([
|
|
11
|
+
{
|
|
12
|
+
command: "go mod download && go mod tidy",
|
|
13
|
+
name: "go",
|
|
14
|
+
prefixColor: "green",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
command: "nuxt prepare",
|
|
18
|
+
name: "nuxt",
|
|
19
|
+
prefixColor: "blue",
|
|
20
|
+
},
|
|
21
|
+
]).result;
|
|
22
|
+
}
|
|
23
|
+
exports.default = postInstall;
|