@chatbi-v/cli 2.0.2 → 2.0.4
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/bin/chatbi-cli.js +1 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2464 -188
- package/package.json +6 -3
- package/templates/app/package.json.hbs +5 -2
- package/templates/plugin/package.json.hbs +5 -5
- package/templates/plugin/tsconfig.json.hbs +1 -1
- package/dist/bench-ACSHVGHE.mjs +0 -77
- package/dist/build-UB4D3WNI.mjs +0 -11
- package/dist/chunk-4OD6C56P.mjs +0 -89
- package/dist/chunk-7A54IJI5.mjs +0 -6368
- package/dist/chunk-LJFX6MNO.mjs +0 -255
- package/dist/chunk-SBGVKO4C.mjs +0 -2255
- package/dist/chunk-TX5M36S5.mjs +0 -55
- package/dist/chunk-V7IEPMC4.mjs +0 -52
- package/dist/chunk-WCPZB47I.mjs +0 -262
- package/dist/chunk-WIVHOK75.mjs +0 -5292
- package/dist/chunk-Y24V4GQG.mjs +0 -9577
- package/dist/commands/add.js +0 -182
- package/dist/commands/bench.js +0 -100
- package/dist/commands/build.js +0 -290
- package/dist/commands/dev.js +0 -8
- package/dist/commands/discover.js +0 -25
- package/dist/commands/doctor.js +0 -231
- package/dist/commands/fetch.js +0 -41
- package/dist/commands/gl.js +0 -151
- package/dist/commands/init.js +0 -253
- package/dist/commands/install.js +0 -85
- package/dist/commands/ls.js +0 -46
- package/dist/commands/sync.js +0 -78
- package/dist/commands/use.js +0 -31
- package/dist/config.js +0 -70
- package/dist/corekit.js +0 -370
- package/dist/execa-METROS6Z.mjs +0 -17
- package/dist/fetch-7X2UFWIV.mjs +0 -10
- package/dist/index.cjs +0 -27278
- package/dist/index.mjs +0 -2769
- package/dist/init-QFRFYEA5.mjs +0 -12
- package/dist/sandbox.js +0 -522
- package/dist/sync-7HPKGVFY.mjs +0 -11
- package/dist/utils.js +0 -99
package/dist/corekit.js
DELETED
|
@@ -1,370 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @file corekit.ts
|
|
4
|
-
* @description CLI 的核心调度器,负责版本管控、环境编排和工作流调度
|
|
5
|
-
* @author ChatBI Team
|
|
6
|
-
*/
|
|
7
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
-
if (k2 === undefined) k2 = k;
|
|
9
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
-
}
|
|
13
|
-
Object.defineProperty(o, k2, desc);
|
|
14
|
-
}) : (function(o, m, k, k2) {
|
|
15
|
-
if (k2 === undefined) k2 = k;
|
|
16
|
-
o[k2] = m[k];
|
|
17
|
-
}));
|
|
18
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
-
}) : function(o, v) {
|
|
21
|
-
o["default"] = v;
|
|
22
|
-
});
|
|
23
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
-
var ownKeys = function(o) {
|
|
25
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
-
var ar = [];
|
|
27
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
-
return ar;
|
|
29
|
-
};
|
|
30
|
-
return ownKeys(o);
|
|
31
|
-
};
|
|
32
|
-
return function (mod) {
|
|
33
|
-
if (mod && mod.__esModule) return mod;
|
|
34
|
-
var result = {};
|
|
35
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
-
__setModuleDefault(result, mod);
|
|
37
|
-
return result;
|
|
38
|
-
};
|
|
39
|
-
})();
|
|
40
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
-
};
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.CoreKit = void 0;
|
|
45
|
-
const path_1 = __importDefault(require("path"));
|
|
46
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
47
|
-
const picocolors_1 = __importDefault(require("picocolors"));
|
|
48
|
-
const prompts_1 = __importDefault(require("prompts"));
|
|
49
|
-
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
50
|
-
const utils_1 = require("./utils");
|
|
51
|
-
const sandbox_1 = require("./sandbox");
|
|
52
|
-
const config_1 = require("./config");
|
|
53
|
-
/**
|
|
54
|
-
* CoreKit: CLI 的大脑
|
|
55
|
-
* 负责版本管控、环境编排、工作流调度
|
|
56
|
-
*/
|
|
57
|
-
class CoreKit {
|
|
58
|
-
/**
|
|
59
|
-
* 解析项目模式
|
|
60
|
-
*/
|
|
61
|
-
static async detectMode(cwd) {
|
|
62
|
-
const pkgPath = path_1.default.join(cwd, 'package.json');
|
|
63
|
-
if (!fs_extra_1.default.existsSync(pkgPath))
|
|
64
|
-
return 'app';
|
|
65
|
-
const pkg = await fs_extra_1.default.readJson(pkgPath);
|
|
66
|
-
// 1. Monorepo 判定
|
|
67
|
-
if (pkg.workspaces || fs_extra_1.default.existsSync(path_1.default.join(cwd, 'pnpm-workspace.yaml'))) {
|
|
68
|
-
return 'monorepo';
|
|
69
|
-
}
|
|
70
|
-
// 2. 显式标记判定
|
|
71
|
-
if (pkg.chatbi?.type === 'plugin' || pkg.plugin === true)
|
|
72
|
-
return 'plugin';
|
|
73
|
-
if (pkg.chatbi?.type === 'app')
|
|
74
|
-
return 'app';
|
|
75
|
-
// 3. 启发式探测 (是否存在入口文件)
|
|
76
|
-
const pluginEntries = await (0, fast_glob_1.default)(['index.plugin.{ts,js}', 'src/index.plugin.{ts,js}'], { cwd });
|
|
77
|
-
if (pluginEntries.length > 0)
|
|
78
|
-
return 'plugin';
|
|
79
|
-
// 4. 根据关键文件判定
|
|
80
|
-
if (fs_extra_1.default.existsSync(path_1.default.join(cwd, 'index.html'))) {
|
|
81
|
-
return 'app';
|
|
82
|
-
}
|
|
83
|
-
// 5. 如果有 src/index.ts 或 src/index.tsx
|
|
84
|
-
if (fs_extra_1.default.existsSync(path_1.default.join(cwd, 'src/index.ts')) || fs_extra_1.default.existsSync(path_1.default.join(cwd, 'src/index.tsx'))) {
|
|
85
|
-
// 如果有 bin 字段,通常是 Node 命令行工具或库
|
|
86
|
-
if (pkg.bin)
|
|
87
|
-
return 'lib';
|
|
88
|
-
// 如果有 peerDependencies.react,通常是插件
|
|
89
|
-
if (pkg.peerDependencies?.react)
|
|
90
|
-
return 'plugin';
|
|
91
|
-
return 'plugin'; // 默认视为 plugin (即 lib 模式)
|
|
92
|
-
}
|
|
93
|
-
return 'app'; // 默认为 App 模式
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* 获取当前生效的内核版本
|
|
97
|
-
* 优先序:项目配置 > 全局 current 软链 > 最新安装的版本
|
|
98
|
-
*/
|
|
99
|
-
static async resolveVersion(projectRoot) {
|
|
100
|
-
// 1. 尝试从项目配置读取
|
|
101
|
-
if (projectRoot) {
|
|
102
|
-
const config = await config_1.ConfigManager.loadConfig(projectRoot);
|
|
103
|
-
if (config.coreVersion)
|
|
104
|
-
return config.coreVersion;
|
|
105
|
-
}
|
|
106
|
-
// 2. 尝试从 CLI 自身寻找版本信息
|
|
107
|
-
try {
|
|
108
|
-
const cliRoot = await (0, utils_1.getCliRoot)();
|
|
109
|
-
const cliVersionFile = path_1.default.join(cliRoot, '.chatbi-version');
|
|
110
|
-
if (fs_extra_1.default.existsSync(cliVersionFile)) {
|
|
111
|
-
const version = (await fs_extra_1.default.readFile(cliVersionFile, 'utf-8')).trim();
|
|
112
|
-
if (version)
|
|
113
|
-
return version;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
catch (e) { }
|
|
117
|
-
// 3. 尝试读取全局 current 软链
|
|
118
|
-
const currentLinkPath = path_1.default.join(sandbox_1.Sandbox.getVersionRoot(), 'current');
|
|
119
|
-
if (fs_extra_1.default.existsSync(currentLinkPath)) {
|
|
120
|
-
try {
|
|
121
|
-
const realPath = await fs_extra_1.default.realpath(currentLinkPath);
|
|
122
|
-
return path_1.default.basename(realPath);
|
|
123
|
-
}
|
|
124
|
-
catch (e) { }
|
|
125
|
-
}
|
|
126
|
-
// 4. 回退:获取最新安装版本
|
|
127
|
-
const versions = await this.listVersions();
|
|
128
|
-
return versions[0] || 'latest';
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* 列出所有已安装版本
|
|
132
|
-
*/
|
|
133
|
-
static async listVersions() {
|
|
134
|
-
const versionsDir = sandbox_1.Sandbox.getVersionRoot();
|
|
135
|
-
if (!fs_extra_1.default.existsSync(versionsDir))
|
|
136
|
-
return [];
|
|
137
|
-
const dirs = await (0, fast_glob_1.default)('*', {
|
|
138
|
-
cwd: versionsDir,
|
|
139
|
-
onlyDirectories: true,
|
|
140
|
-
deep: 1
|
|
141
|
-
});
|
|
142
|
-
return dirs
|
|
143
|
-
.filter(d => d !== 'current')
|
|
144
|
-
.sort((a, b) => b.localeCompare(a, undefined, { numeric: true, sensitivity: 'base' }));
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* 自动发现项目中的插件
|
|
148
|
-
*/
|
|
149
|
-
static async discoverPlugins(rootDir) {
|
|
150
|
-
const pluginsDir = path_1.default.join(rootDir, 'plugins');
|
|
151
|
-
if (!fs_extra_1.default.existsSync(pluginsDir))
|
|
152
|
-
return [];
|
|
153
|
-
// 使用 glob 查找所有包含 package.json 的子目录
|
|
154
|
-
const pkgFiles = await (0, fast_glob_1.default)('*/package.json', { cwd: pluginsDir, absolute: true });
|
|
155
|
-
const plugins = [];
|
|
156
|
-
for (const pkgPath of pkgFiles) {
|
|
157
|
-
try {
|
|
158
|
-
const pkg = await fs_extra_1.default.readJson(pkgPath);
|
|
159
|
-
const pluginPath = path_1.default.dirname(pkgPath);
|
|
160
|
-
plugins.push({
|
|
161
|
-
name: pkg.name || path_1.default.basename(pluginPath),
|
|
162
|
-
path: pluginPath,
|
|
163
|
-
id: path_1.default.basename(pluginPath)
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
catch (e) { }
|
|
167
|
-
}
|
|
168
|
-
return plugins;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* 启动开发环境 (统一入口)
|
|
172
|
-
*/
|
|
173
|
-
static async startDev(cwd, options = {}) {
|
|
174
|
-
const mode = await this.detectMode(cwd);
|
|
175
|
-
const version = await this.resolveVersion(cwd);
|
|
176
|
-
(0, utils_1.printBox)(`${picocolors_1.default.cyan(picocolors_1.default.bold('🚀 ChatBI Dev Server'))}\n\n` +
|
|
177
|
-
`${picocolors_1.default.gray('Mode: ')} ${picocolors_1.default.yellow(mode)}\n` +
|
|
178
|
-
`${picocolors_1.default.gray('Kernel: ')} ${picocolors_1.default.green(version)}\n` +
|
|
179
|
-
`${picocolors_1.default.gray('Root: ')} ${picocolors_1.default.white(cwd)}`, 'Dev Server');
|
|
180
|
-
const spinner = (0, utils_1.createSpinner)('正在准备沙箱环境...').start();
|
|
181
|
-
try {
|
|
182
|
-
// 1. 准备环境 (Sandbox)
|
|
183
|
-
await sandbox_1.Sandbox.prepare(version);
|
|
184
|
-
spinner.text = picocolors_1.default.cyan('正在注入虚拟上下文...');
|
|
185
|
-
// 2. 注入虚拟上下文 (tsconfig, aliases)
|
|
186
|
-
await sandbox_1.Sandbox.injectContext(cwd, version);
|
|
187
|
-
spinner.succeed(picocolors_1.default.green('环境就绪'));
|
|
188
|
-
// 3. 根据模式启动
|
|
189
|
-
if (mode === 'plugin') {
|
|
190
|
-
await this.startPluginDevServer(cwd, version, options.port);
|
|
191
|
-
}
|
|
192
|
-
else if (mode === 'app') {
|
|
193
|
-
await this.startAppDevServer(cwd, version, options.port);
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
await this.startMonorepoDevServer(cwd, version, options.port);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
catch (e) {
|
|
200
|
-
spinner.fail(picocolors_1.default.red(`启动失败: ${e.message}`));
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* 启动 Monorepo 开发服务器
|
|
205
|
-
*/
|
|
206
|
-
static async startMonorepoDevServer(rootDir, version, customPort) {
|
|
207
|
-
// 扫描 apps 目录下的所有子应用
|
|
208
|
-
const appsDir = path_1.default.join(rootDir, 'apps');
|
|
209
|
-
if (!fs_extra_1.default.existsSync(appsDir)) {
|
|
210
|
-
utils_1.logger.warn('当前 Monorepo 下未找到 apps/ 目录');
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
const pkgFiles = await (0, fast_glob_1.default)('*/package.json', { cwd: appsDir, absolute: true });
|
|
214
|
-
const apps = pkgFiles.map(pkgPath => ({
|
|
215
|
-
name: path_1.default.basename(path_1.default.dirname(pkgPath)),
|
|
216
|
-
path: path_1.default.dirname(pkgPath)
|
|
217
|
-
}));
|
|
218
|
-
if (apps.length === 0) {
|
|
219
|
-
utils_1.logger.warn('当前 Monorepo 下未找到任何应用 (apps/)');
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
// 交互式选择
|
|
223
|
-
const response = await (0, prompts_1.default)({
|
|
224
|
-
type: 'select',
|
|
225
|
-
name: 'appPath',
|
|
226
|
-
message: '请选择要启动的应用:',
|
|
227
|
-
choices: apps.map(app => ({ title: app.name, value: app.path })),
|
|
228
|
-
initial: 0
|
|
229
|
-
});
|
|
230
|
-
if (!response.appPath) {
|
|
231
|
-
utils_1.logger.info('已取消');
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
// 启动选中的应用
|
|
235
|
-
await this.startAppDevServer(response.appPath, version, customPort);
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* 启动插件开发服务器 (Hosted Mode)
|
|
239
|
-
*/
|
|
240
|
-
static async startPluginDevServer(pluginDir, version, customPort) {
|
|
241
|
-
utils_1.logger.info('正在启动托管式 Shell...');
|
|
242
|
-
const shellPort = customPort || 5173;
|
|
243
|
-
// 获取核心包路径
|
|
244
|
-
const sandboxRoot = sandbox_1.Sandbox.getRoot();
|
|
245
|
-
const versionPath = sandbox_1.Sandbox.getVersionPath(version);
|
|
246
|
-
const sandboxNodeModules = path_1.default.join(versionPath, 'node_modules');
|
|
247
|
-
// 确保 Shell 模板就绪
|
|
248
|
-
const shellDir = await sandbox_1.Sandbox.ensureShell(version);
|
|
249
|
-
// 获取 Core Alias
|
|
250
|
-
const coreAlias = sandbox_1.Sandbox.getCoreAlias(version);
|
|
251
|
-
// 确保 tailwindcss 和 autoprefixer 能被找到
|
|
252
|
-
const tailwindPath = path_1.default.join(sandboxNodeModules, 'tailwindcss');
|
|
253
|
-
const autoprefixerPath = path_1.default.join(sandboxNodeModules, 'autoprefixer');
|
|
254
|
-
// 计算插件入口
|
|
255
|
-
let pluginEntry = path_1.default.join(pluginDir, 'src/index.tsx');
|
|
256
|
-
if (!fs_extra_1.default.existsSync(pluginEntry)) {
|
|
257
|
-
pluginEntry = path_1.default.join(pluginDir, 'src/index.ts');
|
|
258
|
-
}
|
|
259
|
-
// 注入环境变量
|
|
260
|
-
const define = {
|
|
261
|
-
'process.env.CHATBI_PLUGIN_PATH': JSON.stringify(pluginDir)
|
|
262
|
-
};
|
|
263
|
-
const { createServer } = await Promise.resolve().then(() => __importStar(require('vite')));
|
|
264
|
-
try {
|
|
265
|
-
const server = await createServer({
|
|
266
|
-
root: shellDir,
|
|
267
|
-
configFile: false,
|
|
268
|
-
css: {
|
|
269
|
-
postcss: {
|
|
270
|
-
plugins: [
|
|
271
|
-
require(tailwindPath)({
|
|
272
|
-
presets: [require(path_1.default.join(sandboxNodeModules, '@chatbi-v/tailwind-config'))],
|
|
273
|
-
darkMode: 'class',
|
|
274
|
-
content: [
|
|
275
|
-
path_1.default.join(shellDir, 'index.html'),
|
|
276
|
-
path_1.default.join(shellDir, 'src/**/*.{ts,tsx}'),
|
|
277
|
-
path_1.default.join(pluginDir, 'src/**/*.{ts,tsx}')
|
|
278
|
-
]
|
|
279
|
-
}),
|
|
280
|
-
require(autoprefixerPath)
|
|
281
|
-
]
|
|
282
|
-
}
|
|
283
|
-
},
|
|
284
|
-
server: {
|
|
285
|
-
port: shellPort,
|
|
286
|
-
host: true,
|
|
287
|
-
fs: {
|
|
288
|
-
allow: [
|
|
289
|
-
sandboxRoot,
|
|
290
|
-
pluginDir,
|
|
291
|
-
path_1.default.resolve(pluginDir, '../../')
|
|
292
|
-
]
|
|
293
|
-
}
|
|
294
|
-
},
|
|
295
|
-
resolve: {
|
|
296
|
-
alias: {
|
|
297
|
-
...coreAlias,
|
|
298
|
-
'react': path_1.default.join(sandboxNodeModules, 'react'),
|
|
299
|
-
'react-dom': path_1.default.join(sandboxNodeModules, 'react-dom'),
|
|
300
|
-
'@': path_1.default.join(shellDir, 'src'),
|
|
301
|
-
// 关键:将虚拟模块指向用户插件
|
|
302
|
-
'virtual:user-plugin': pluginEntry,
|
|
303
|
-
// 防止 glob 报错,提供空的映射
|
|
304
|
-
'@chatbi-plugins': path_1.default.join(shellDir, 'empty'),
|
|
305
|
-
'@chatbi-apps': path_1.default.join(shellDir, 'empty')
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
define,
|
|
309
|
-
});
|
|
310
|
-
await server.listen();
|
|
311
|
-
const localUrl = `http://localhost:${shellPort}/`;
|
|
312
|
-
(0, utils_1.printBox)(`${picocolors_1.default.green(picocolors_1.default.bold('✅ 托管式 Shell 已启动'))}\n\n` +
|
|
313
|
-
`${picocolors_1.default.white('Local: ')} ${picocolors_1.default.cyan(picocolors_1.default.underline(localUrl))}`, 'Shell Success');
|
|
314
|
-
}
|
|
315
|
-
catch (e) {
|
|
316
|
-
utils_1.logger.error('Shell 服务器启动失败', e);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* 启动应用开发服务器 (Integrated Mode)
|
|
321
|
-
*/
|
|
322
|
-
static async startAppDevServer(appDir, version, customPort) {
|
|
323
|
-
utils_1.logger.info('正在启动应用...');
|
|
324
|
-
// 在 App 模式下,我们直接运行 App 目录下的 Vite,
|
|
325
|
-
// 但是我们注入了 Sandbox 的 alias,所以 App 不需要安装 core
|
|
326
|
-
const versionPath = sandbox_1.Sandbox.getVersionPath(version);
|
|
327
|
-
const sandboxNodeModules = path_1.default.join(versionPath, 'node_modules');
|
|
328
|
-
const coreAlias = sandbox_1.Sandbox.getCoreAlias(version);
|
|
329
|
-
const { createServer, loadConfigFromFile } = await Promise.resolve().then(() => __importStar(require('vite')));
|
|
330
|
-
try {
|
|
331
|
-
// 尝试加载用户原有的 Vite 配置
|
|
332
|
-
const configContext = { command: 'serve', mode: 'development' };
|
|
333
|
-
const userConfig = await loadConfigFromFile(configContext, undefined, appDir).catch(() => null);
|
|
334
|
-
const server = await createServer({
|
|
335
|
-
root: appDir,
|
|
336
|
-
// 这里我们允许用户有自己的 vite config,但我们会 merge alias
|
|
337
|
-
// 实际场景中可能需要写一个 Vite 插件来做这件事,这里简单处理
|
|
338
|
-
resolve: {
|
|
339
|
-
alias: {
|
|
340
|
-
...coreAlias,
|
|
341
|
-
// 补充常用的基础依赖映射,防止用户 vite.config.ts 中的插件找不到依赖
|
|
342
|
-
'react': path_1.default.join(sandboxNodeModules, 'react'),
|
|
343
|
-
'react-dom': path_1.default.join(sandboxNodeModules, 'react-dom'),
|
|
344
|
-
'@vitejs/plugin-react': path_1.default.join(sandboxNodeModules, '@vitejs/plugin-react')
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
server: {
|
|
348
|
-
port: customPort || 3000,
|
|
349
|
-
host: true,
|
|
350
|
-
fs: {
|
|
351
|
-
allow: [
|
|
352
|
-
sandbox_1.Sandbox.getRoot(),
|
|
353
|
-
appDir,
|
|
354
|
-
// 允许访问沙箱中的所有依赖
|
|
355
|
-
sandboxNodeModules
|
|
356
|
-
]
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
});
|
|
360
|
-
await server.listen();
|
|
361
|
-
const localUrl = `http://localhost:${server.config.server.port}/`;
|
|
362
|
-
(0, utils_1.printBox)(`${picocolors_1.default.green(picocolors_1.default.bold('✅ 应用已成功启动'))}\n\n` +
|
|
363
|
-
`${picocolors_1.default.white('Local: ')} ${picocolors_1.default.cyan(picocolors_1.default.underline(localUrl))}`, 'App Success');
|
|
364
|
-
}
|
|
365
|
-
catch (e) {
|
|
366
|
-
utils_1.logger.error('应用启动失败', e);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
exports.CoreKit = CoreKit;
|
package/dist/execa-METROS6Z.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
$,
|
|
3
|
-
execa,
|
|
4
|
-
execaCommand,
|
|
5
|
-
execaCommandSync,
|
|
6
|
-
execaNode,
|
|
7
|
-
execaSync
|
|
8
|
-
} from "./chunk-SBGVKO4C.mjs";
|
|
9
|
-
import "./chunk-TX5M36S5.mjs";
|
|
10
|
-
export {
|
|
11
|
-
$,
|
|
12
|
-
execa,
|
|
13
|
-
execaCommand,
|
|
14
|
-
execaCommandSync,
|
|
15
|
-
execaNode,
|
|
16
|
-
execaSync
|
|
17
|
-
};
|