weapp-vite 7.5.0 → 7.6.0
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/README.md +8 -2
- package/THIRD_PARTY_NOTICES.md +60 -0
- package/dist/action-B3YZMA-h.mjs +255 -0
- package/dist/action-BELcDNNv.mjs +139 -0
- package/dist/action-BOk3vGI7.mjs +1110 -0
- package/dist/action-DlC6JYpt.mjs +95 -0
- package/dist/action-zEDY7oh_.mjs +247 -0
- package/dist/{analyze-ZJUvEdaY.mjs → analyze-DN79YOAH.mjs} +1 -65
- package/dist/artifacts-BOyC9Fy-.mjs +106 -0
- package/dist/assets-C5_YYXNk.mjs +637 -0
- package/dist/auto-routes.mjs +2 -2
- package/dist/{budget-BD7VqLCl.d.mts → budget-CTLOHwgI.d.mts} +1 -2
- package/dist/budget-EOeEycc_.mjs +65 -0
- package/dist/builtProject-C29udgXY.mjs +541 -0
- package/dist/{chunkStrategy-DRA5WpB-.mjs → chunkStrategy-DY_LZIIe.mjs} +15 -3
- package/dist/{package-7swhyLmf.mjs → classifier-DBJY__kg.mjs} +4 -7
- package/dist/cli-acceptance.mjs +1 -1
- package/dist/cli.mjs +110 -4506
- package/dist/{config-V0L-IAJf.d.mts → config-Bf6DWhyb.d.mts} +136 -49
- package/dist/config.d.mts +2 -2
- package/dist/{createCompilerContextInstance-DJH_P_nZ.mjs → createCompilerContextInstance-aYwi8wQt.mjs} +15235 -9523
- package/dist/{createContext-BqYzHhY9.mjs → createContext-tApLtII-.mjs} +6 -3
- package/dist/dashboard/analyze.d.mts +1 -1
- package/dist/dashboard/analyze.mjs +3 -1
- package/dist/dashboard/vite.d.mts +1 -1
- package/dist/dashboard.d.mts +2 -2
- package/dist/dashboard.mjs +1749 -1
- package/dist/dashboardTransport-C_Y6jMp-.mjs +16 -0
- package/dist/{dashboardViteBridge-Dy3nAD4m.mjs → dashboardViteBridge-DCGR43aM.mjs} +8 -5
- package/dist/{dev-fR5GiJRO.mjs → dev-C2fgr_Xd.mjs} +5 -1
- package/dist/devProvider-D-hTfsEO.mjs +3027 -0
- package/dist/docs/README.md +8 -2
- package/dist/docs/mcp.md +10 -0
- package/dist/docs/troubleshooting.md +8 -0
- package/dist/docs/vue-sfc.md +25 -2
- package/dist/doctor-worker.mjs +3 -2
- package/dist/doctor.d.mts +2 -2
- package/dist/doctor.mjs +15 -13
- package/dist/engine-C66J0HLz.mjs +54 -0
- package/dist/{file-sC3jD7Fh.mjs → file-CcIOmqhC.mjs} +47 -19
- package/dist/file-DtcteQ4G.mjs +1 -0
- package/dist/forwardConsole-B0Reo8Lf.mjs +511 -0
- package/dist/getInstance-BAIaU2y9.mjs +1 -0
- package/dist/{getInstance-DiGSzBNI.mjs → getInstance-Dt9IQDKr.mjs} +1 -1
- package/dist/history-BIiRCzbq.mjs +784 -0
- package/dist/i18n.d.mts +1 -1
- package/dist/{index-C9HjUX5c.d.mts → index-D5rgBzYZ.d.mts} +1 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/json.d.mts +1 -1
- package/dist/lib-DjccSI1B.mjs +143 -0
- package/dist/{lifecycle-BROTlwSL.mjs → lifecycle-C36WSbQS.mjs} +120 -27
- package/dist/{loadConfig-C3BQhz7F.mjs → loadConfig-BWIsDXR4.mjs} +1 -1
- package/dist/loadConfig-D-BpBgsk.mjs +1 -0
- package/dist/logBuildAppFinish-ChjwATMv.mjs +57 -0
- package/dist/mcp-CYgX9HpO.mjs +86 -0
- package/dist/mcp.d.mts +1 -1
- package/dist/mcpClient-DVLvFLZv.mjs +287 -0
- package/dist/{processCleanup-B6KA30Zc.mjs → metadata-hwF7QRcS.mjs} +1 -19
- package/dist/nodeEnv-BmH8UZPR.mjs +7 -0
- package/dist/openIde-CroqOgk5.mjs +648 -0
- package/dist/options-jqFwfD1G.mjs +34 -0
- package/dist/package-Cmakyy3J.mjs +4 -0
- package/dist/path-CYYIQGS7.mjs +44 -0
- package/dist/processCleanup-BQn2kTcK.mjs +19 -0
- package/dist/{protocol-vg8HGJ4n.mjs → protocol-Cg6Jdlvb.mjs} +42 -39
- package/dist/reader-sh_POQ9-.mjs +93 -0
- package/dist/realpathScope-Tf9mz-fh.mjs +23 -0
- package/dist/report-hyonPGbZ.mjs +107 -0
- package/dist/{path-doV773b7.mjs → resolvedId-CiDl7SC1.mjs} +3 -46
- package/dist/runtime-CLUhQsdA.mjs +43 -0
- package/dist/{runtime-Ee2HY6gR.d.mts → runtime-DpVf714f.d.mts} +1 -1
- package/dist/runtime.d.mts +1 -1
- package/dist/schematics-kO26eQRT.mjs +91 -0
- package/dist/{session-PskhD-nZ.mjs → session-D3zsdzIy.mjs} +71 -9
- package/dist/test.mjs +10 -8
- package/dist/{types-CgZn5X6j.d.mts → types-D-kfuyVa.d.mts} +1 -2
- package/dist/types-D0FFexRF.d.mts +39 -0
- package/dist/types.d.mts +2 -2
- package/dist/{upload-D4msblBf.mjs → upload-DozK8UdN.mjs} +109 -5
- package/dist/upload-worker.mjs +1 -1
- package/dist/{utils-CJSCgEj6.mjs → utils-Dy51PYAC.mjs} +56 -116
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +51 -12
- package/dist/wxs-BT8btflA.mjs +112 -0
- package/dist/wxs-Z4VQDeJ_.mjs +1 -0
- package/package.json +52 -46
- package/dist/dashboard-DvqF3Key.mjs +0 -1842
- package/dist/devProvider-BGBkw28J.mjs +0 -1050
- package/dist/file-DRb4eWqw.mjs +0 -1
- package/dist/getInstance-SiE6WZRh.mjs +0 -1
- package/dist/loadConfig-VGtBF4qm.mjs +0 -1
- package/dist/mcp-D3Yh24Cj.mjs +0 -529
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import path from "pathe";
|
|
3
|
+
import { fs } from "@weapp-core/shared/fs";
|
|
4
|
+
import os from "node:os";
|
|
5
|
+
import { clearTimeout, setTimeout } from "node:timers";
|
|
6
|
+
//#region src/cli/mcpClient/shared.ts
|
|
7
|
+
const CODEX_BLOCK_PREFIX = "# >>> weapp-vite mcp ";
|
|
8
|
+
const CODEX_BLOCK_SUFFIX = " >>>";
|
|
9
|
+
const CODEX_BLOCK_END_PREFIX = "# <<< weapp-vite mcp ";
|
|
10
|
+
const CODEX_BLOCK_END_SUFFIX = " <<<";
|
|
11
|
+
const DEFAULT_HTTP_TIMEOUT_MS = 1500;
|
|
12
|
+
const WORKSPACE_FOLDER_TOKEN = "${workspaceFolder}";
|
|
13
|
+
const REG_CodexUrl = /^\s*url\s*=\s*"([^"]+)"/m;
|
|
14
|
+
const REG_CodexCommand = /^\s*command\s*=\s*"([^"]+)"/m;
|
|
15
|
+
const REG_CodexArgs = /^\s*args\s*=\s*\[([^\]]*)\]/m;
|
|
16
|
+
const REG_FirstTomlString = /"([^"]+)"/;
|
|
17
|
+
function resolveTargetWorkspaceRoot(target) {
|
|
18
|
+
if (target.client === "cursor") return path.dirname(path.dirname(target.configPath));
|
|
19
|
+
if (target.client === "claude-code") return path.dirname(target.configPath);
|
|
20
|
+
return process.cwd();
|
|
21
|
+
}
|
|
22
|
+
function escapeRegExp(value) {
|
|
23
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
24
|
+
}
|
|
25
|
+
function renderTomlString(value) {
|
|
26
|
+
return JSON.stringify(value);
|
|
27
|
+
}
|
|
28
|
+
function sanitizeServerNameSegment(value) {
|
|
29
|
+
return value.trim().toLowerCase().replace(/[^a-z0-9-]+/g, "-").replace(/-{2,}/g, "-").replace(/^-|-$/g, "");
|
|
30
|
+
}
|
|
31
|
+
function resolveServerName(workspaceRoot) {
|
|
32
|
+
return `weapp-vite-${sanitizeServerNameSegment(path.basename(workspaceRoot)) || "project"}`;
|
|
33
|
+
}
|
|
34
|
+
function resolveNodeBinCommand() {
|
|
35
|
+
return process.execPath || "node";
|
|
36
|
+
}
|
|
37
|
+
function resolveProjectCliBin(workspaceRoot) {
|
|
38
|
+
return path.join(workspaceRoot, "node_modules", "weapp-vite", "bin", "weapp-vite.js");
|
|
39
|
+
}
|
|
40
|
+
function renderCommandArgs(args) {
|
|
41
|
+
return args.map(renderTomlString).join(", ");
|
|
42
|
+
}
|
|
43
|
+
function renderCodexBlock(serverName, entry) {
|
|
44
|
+
const startMarker = `${CODEX_BLOCK_PREFIX}${serverName}${CODEX_BLOCK_SUFFIX}`;
|
|
45
|
+
const endMarker = `${CODEX_BLOCK_END_PREFIX}${serverName}${CODEX_BLOCK_END_SUFFIX}`;
|
|
46
|
+
if (entry.url) return `${startMarker}
|
|
47
|
+
[mcp_servers.${serverName}]
|
|
48
|
+
url = ${renderTomlString(entry.url)}
|
|
49
|
+
${endMarker}
|
|
50
|
+
`;
|
|
51
|
+
return `${startMarker}
|
|
52
|
+
[mcp_servers.${serverName}]
|
|
53
|
+
command = ${renderTomlString(entry.command ?? resolveNodeBinCommand())}
|
|
54
|
+
args = [${renderCommandArgs(entry.args ?? [])}]
|
|
55
|
+
${endMarker}
|
|
56
|
+
`;
|
|
57
|
+
}
|
|
58
|
+
function renderJsonPreview(serverName, entry) {
|
|
59
|
+
return `${JSON.stringify({ mcpServers: { [serverName]: entry } }, null, 2)}
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
function resolveCommandEntry(client, workspaceRoot) {
|
|
63
|
+
const binPath = resolveProjectCliBin(workspaceRoot);
|
|
64
|
+
if (client === "cursor") return {
|
|
65
|
+
command: "node",
|
|
66
|
+
args: [
|
|
67
|
+
`${WORKSPACE_FOLDER_TOKEN}/node_modules/weapp-vite/bin/weapp-vite.js`,
|
|
68
|
+
"mcp",
|
|
69
|
+
"--workspace-root",
|
|
70
|
+
WORKSPACE_FOLDER_TOKEN
|
|
71
|
+
]
|
|
72
|
+
};
|
|
73
|
+
return {
|
|
74
|
+
command: resolveNodeBinCommand(),
|
|
75
|
+
args: [
|
|
76
|
+
binPath,
|
|
77
|
+
"mcp",
|
|
78
|
+
"--workspace-root",
|
|
79
|
+
workspaceRoot
|
|
80
|
+
]
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function resolveHttpEntry(client, url) {
|
|
84
|
+
if (client === "claude-code") return {
|
|
85
|
+
type: "http",
|
|
86
|
+
url
|
|
87
|
+
};
|
|
88
|
+
return { url };
|
|
89
|
+
}
|
|
90
|
+
function resolveConfigEntry(client, transport, workspaceRoot, url) {
|
|
91
|
+
return transport === "http" ? resolveHttpEntry(client, url ?? "") : resolveCommandEntry(client, workspaceRoot);
|
|
92
|
+
}
|
|
93
|
+
function resolveCodexBlockPattern(serverName) {
|
|
94
|
+
const startMarker = `${CODEX_BLOCK_PREFIX}${serverName}${CODEX_BLOCK_SUFFIX}`;
|
|
95
|
+
const endMarker = `${CODEX_BLOCK_END_PREFIX}${serverName}${CODEX_BLOCK_END_SUFFIX}`;
|
|
96
|
+
return new RegExp(`${escapeRegExp(startMarker)}[\\s\\S]*?${escapeRegExp(endMarker)}\\n?`, "g");
|
|
97
|
+
}
|
|
98
|
+
function upsertCodexManagedBlock(content, serverName, block) {
|
|
99
|
+
const withoutExisting = content.trimEnd().replace(resolveCodexBlockPattern(serverName), "").trimEnd();
|
|
100
|
+
if (!withoutExisting) return block;
|
|
101
|
+
return `${withoutExisting}\n\n${block}`;
|
|
102
|
+
}
|
|
103
|
+
function parseJsonConfig(content, configPath) {
|
|
104
|
+
if (!content.trim()) return {};
|
|
105
|
+
try {
|
|
106
|
+
return JSON.parse(content);
|
|
107
|
+
} catch (error) {
|
|
108
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
109
|
+
throw new Error(`无法解析 MCP 配置文件 ${configPath}:${message}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function resolveTarget(client, workspaceRoot) {
|
|
113
|
+
const serverName = resolveServerName(workspaceRoot);
|
|
114
|
+
if (client === "codex") return {
|
|
115
|
+
client,
|
|
116
|
+
configPath: path.join(os.homedir(), ".codex", "config.toml"),
|
|
117
|
+
displayName: "Codex",
|
|
118
|
+
serverName
|
|
119
|
+
};
|
|
120
|
+
if (client === "claude-code") return {
|
|
121
|
+
client,
|
|
122
|
+
configPath: path.join(workspaceRoot, ".mcp.json"),
|
|
123
|
+
displayName: "Claude Code",
|
|
124
|
+
serverName
|
|
125
|
+
};
|
|
126
|
+
return {
|
|
127
|
+
client,
|
|
128
|
+
configPath: path.join(workspaceRoot, ".cursor", "mcp.json"),
|
|
129
|
+
displayName: "Cursor",
|
|
130
|
+
serverName
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/cli/mcpClient/inspect.ts
|
|
135
|
+
async function probeHttpEndpoint(url) {
|
|
136
|
+
const controller = new AbortController();
|
|
137
|
+
const timer = setTimeout(() => {
|
|
138
|
+
controller.abort();
|
|
139
|
+
}, DEFAULT_HTTP_TIMEOUT_MS);
|
|
140
|
+
try {
|
|
141
|
+
return (await fetch(url, {
|
|
142
|
+
method: "GET",
|
|
143
|
+
signal: controller.signal
|
|
144
|
+
})).status > 0;
|
|
145
|
+
} catch {
|
|
146
|
+
return false;
|
|
147
|
+
} finally {
|
|
148
|
+
clearTimeout(timer);
|
|
149
|
+
controller.abort();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
async function inspectJsonConfig(target) {
|
|
153
|
+
if (!await fs.pathExists(target.configPath)) return {
|
|
154
|
+
configExists: false,
|
|
155
|
+
configPath: target.configPath,
|
|
156
|
+
displayName: target.displayName,
|
|
157
|
+
issues: [`未找到配置文件:${target.configPath}`],
|
|
158
|
+
serverName: target.serverName
|
|
159
|
+
};
|
|
160
|
+
const entry = parseJsonConfig(await fs.readFile(target.configPath, "utf8"), target.configPath).mcpServers?.[target.serverName];
|
|
161
|
+
if (!entry) return {
|
|
162
|
+
configExists: true,
|
|
163
|
+
configPath: target.configPath,
|
|
164
|
+
displayName: target.displayName,
|
|
165
|
+
issues: [`配置文件中未找到服务器 ${target.serverName}`],
|
|
166
|
+
serverName: target.serverName
|
|
167
|
+
};
|
|
168
|
+
const transport = entry.url ? "http" : "command";
|
|
169
|
+
const issues = [];
|
|
170
|
+
let httpReachable;
|
|
171
|
+
if (transport === "command") {
|
|
172
|
+
const normalizedBin = (entry.args?.[0])?.replaceAll(WORKSPACE_FOLDER_TOKEN, resolveTargetWorkspaceRoot(target));
|
|
173
|
+
if (!normalizedBin || !await fs.pathExists(normalizedBin)) issues.push(`未找到本地 CLI 入口:${normalizedBin ?? "缺少 args[0]"}`);
|
|
174
|
+
} else if (entry.url) {
|
|
175
|
+
httpReachable = await probeHttpEndpoint(entry.url);
|
|
176
|
+
if (!httpReachable) issues.push(`HTTP MCP 地址不可达:${entry.url}`);
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
configExists: true,
|
|
180
|
+
configPath: target.configPath,
|
|
181
|
+
displayName: target.displayName,
|
|
182
|
+
httpReachable,
|
|
183
|
+
issues,
|
|
184
|
+
serverName: target.serverName,
|
|
185
|
+
transport
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
async function inspectCodexConfig(target) {
|
|
189
|
+
if (!await fs.pathExists(target.configPath)) return {
|
|
190
|
+
configExists: false,
|
|
191
|
+
configPath: target.configPath,
|
|
192
|
+
displayName: target.displayName,
|
|
193
|
+
issues: [`未找到配置文件:${target.configPath}`],
|
|
194
|
+
serverName: target.serverName
|
|
195
|
+
};
|
|
196
|
+
const blockMatch = (await fs.readFile(target.configPath, "utf8")).match(resolveCodexBlockPattern(target.serverName));
|
|
197
|
+
if (!blockMatch?.[0]) return {
|
|
198
|
+
configExists: true,
|
|
199
|
+
configPath: target.configPath,
|
|
200
|
+
displayName: target.displayName,
|
|
201
|
+
issues: [`未找到 weapp-vite 生成的 Codex 配置区块:${target.serverName}`],
|
|
202
|
+
serverName: target.serverName
|
|
203
|
+
};
|
|
204
|
+
const block = blockMatch[0];
|
|
205
|
+
const issues = [];
|
|
206
|
+
const urlMatch = block.match(REG_CodexUrl);
|
|
207
|
+
const commandMatch = block.match(REG_CodexCommand);
|
|
208
|
+
const argsMatch = block.match(REG_CodexArgs);
|
|
209
|
+
if (urlMatch?.[1]) {
|
|
210
|
+
const reachable = await probeHttpEndpoint(urlMatch[1]);
|
|
211
|
+
if (!reachable) issues.push(`HTTP MCP 地址不可达:${urlMatch[1]}`);
|
|
212
|
+
return {
|
|
213
|
+
configExists: true,
|
|
214
|
+
configPath: target.configPath,
|
|
215
|
+
displayName: target.displayName,
|
|
216
|
+
httpReachable: reachable,
|
|
217
|
+
issues,
|
|
218
|
+
serverName: target.serverName,
|
|
219
|
+
transport: "http"
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
const binPath = (argsMatch?.[1]?.match(REG_FirstTomlString))?.[1];
|
|
223
|
+
if (!commandMatch?.[1]) issues.push("Codex 配置区块缺少 command 字段");
|
|
224
|
+
if (!binPath || !await fs.pathExists(binPath)) issues.push(`未找到本地 CLI 入口:${binPath ?? "缺少 args[0]"}`);
|
|
225
|
+
return {
|
|
226
|
+
configExists: true,
|
|
227
|
+
configPath: target.configPath,
|
|
228
|
+
displayName: target.displayName,
|
|
229
|
+
issues,
|
|
230
|
+
serverName: target.serverName,
|
|
231
|
+
transport: "command"
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
async function inspectMcpClientConfig(options) {
|
|
235
|
+
const target = resolveTarget(options.client, path.resolve(options.workspaceRoot));
|
|
236
|
+
if (target.client === "codex") return await inspectCodexConfig(target);
|
|
237
|
+
return await inspectJsonConfig(target);
|
|
238
|
+
}
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region src/cli/mcpClient/plan.ts
|
|
241
|
+
function resolveSupportedMcpClient(input) {
|
|
242
|
+
if (input === "codex" || input === "claude-code" || input === "cursor") return input;
|
|
243
|
+
throw new Error(`不支持的 MCP 客户端:${input}。当前仅支持 codex、claude-code、cursor。`);
|
|
244
|
+
}
|
|
245
|
+
function buildMcpClientConfigPlan(options) {
|
|
246
|
+
const workspaceRoot = path.resolve(options.workspaceRoot);
|
|
247
|
+
const target = resolveTarget(options.client, workspaceRoot);
|
|
248
|
+
const entry = resolveConfigEntry(options.client, options.transport, workspaceRoot, options.url);
|
|
249
|
+
if (options.transport === "http" && !entry.url) throw new Error("HTTP 模式缺少 MCP 服务地址,请使用 --url 指定或在当前项目中检测到可用地址。");
|
|
250
|
+
return {
|
|
251
|
+
entry,
|
|
252
|
+
preview: target.client === "codex" ? renderCodexBlock(target.serverName, entry) : renderJsonPreview(target.serverName, entry),
|
|
253
|
+
target,
|
|
254
|
+
transport: options.transport
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function formatMcpQuickStart(options) {
|
|
258
|
+
const suffix = options.transport === "http" && options.httpUrl ? ` --transport http --url ${options.httpUrl}` : "";
|
|
259
|
+
return [
|
|
260
|
+
"在 AI 工具中接入 weapp-vite MCP:",
|
|
261
|
+
` - Codex: wv mcp init codex${suffix}`,
|
|
262
|
+
` - Claude Code: wv mcp init claude-code${suffix}`,
|
|
263
|
+
` - Cursor: wv mcp init cursor${suffix}`
|
|
264
|
+
];
|
|
265
|
+
}
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region src/cli/mcpClient/index.ts
|
|
268
|
+
async function writeMcpClientConfig(plan) {
|
|
269
|
+
await fs.ensureDir(path.dirname(plan.target.configPath));
|
|
270
|
+
const existing = await fs.readFile(plan.target.configPath, "utf8").catch(() => "");
|
|
271
|
+
if (plan.target.client === "codex") {
|
|
272
|
+
const nextContent = upsertCodexManagedBlock(existing, plan.target.serverName, plan.preview);
|
|
273
|
+
await fs.writeFile(plan.target.configPath, nextContent, "utf8");
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
const parsed = parseJsonConfig(existing, plan.target.configPath);
|
|
277
|
+
const nextConfig = {
|
|
278
|
+
...parsed,
|
|
279
|
+
mcpServers: {
|
|
280
|
+
...parsed.mcpServers ?? {},
|
|
281
|
+
[plan.target.serverName]: plan.entry
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
await fs.writeFile(plan.target.configPath, `${JSON.stringify(nextConfig, null, 2)}\n`, "utf8");
|
|
285
|
+
}
|
|
286
|
+
//#endregion
|
|
287
|
+
export { inspectMcpClientConfig as a, resolveSupportedMcpClient as i, buildMcpClientConfigPlan as n, formatMcpQuickStart as r, writeMcpClientConfig as t };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import process from "node:process";
|
|
2
1
|
import path from "pathe";
|
|
3
2
|
//#region src/analyze/subpackages/metadata.ts
|
|
4
3
|
const defaultTotalBudgetBytes = 20971520;
|
|
@@ -57,21 +56,4 @@ function createAnalyzeMetadata(configService, now = /* @__PURE__ */ new Date())
|
|
|
57
56
|
};
|
|
58
57
|
}
|
|
59
58
|
//#endregion
|
|
60
|
-
|
|
61
|
-
function isSassEmbeddedChild(handle) {
|
|
62
|
-
if (!handle || typeof handle !== "object") return false;
|
|
63
|
-
const child = handle;
|
|
64
|
-
const spawnfile = typeof child.spawnfile === "string" ? child.spawnfile : "";
|
|
65
|
-
const spawnargs = Array.isArray(child.spawnargs) ? child.spawnargs : [];
|
|
66
|
-
return Boolean("kill" in handle && "spawnfile" in handle && (spawnfile.includes("sass-embedded") || spawnfile.includes("dart-sass") && spawnargs.includes("--embedded")));
|
|
67
|
-
}
|
|
68
|
-
function terminateStaleSassEmbeddedProcess() {
|
|
69
|
-
const getHandles = process._getActiveHandles;
|
|
70
|
-
const handles = typeof getHandles === "function" ? getHandles() : void 0;
|
|
71
|
-
if (!Array.isArray(handles)) return;
|
|
72
|
-
for (const handle of handles) if (isSassEmbeddedChild(handle)) try {
|
|
73
|
-
handle.kill();
|
|
74
|
-
} catch {}
|
|
75
|
-
}
|
|
76
|
-
//#endregion
|
|
77
|
-
export { resolveAnalyzeHistoryMetadata as i, createAnalyzeMetadata as n, resolveAnalyzeBudgets as r, terminateStaleSassEmbeddedProcess as t };
|
|
59
|
+
export { resolveAnalyzeBudgets as n, resolveAnalyzeHistoryMetadata as r, createAnalyzeMetadata as t };
|