weapp-vite 7.5.0 → 7.7.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 +14 -6
- package/THIRD_PARTY_NOTICES.md +60 -0
- package/bin/bootstrap.js +9 -4
- package/bin/bootstrap.test.ts +82 -1
- package/bin/nodeVersionWarning.js +17 -0
- package/bin/nodeVersionWarning.test.ts +30 -0
- package/dist/action-BD56SQh4.mjs +254 -0
- package/dist/action-CPtgEl6p.mjs +94 -0
- package/dist/action-le0bNff_.mjs +1102 -0
- package/dist/action-ytG5oFAw.mjs +138 -0
- package/dist/action-zmJrU8PC.mjs +245 -0
- package/dist/{analyze-ZJUvEdaY.mjs → analyze-DCZo-sJd.mjs} +4 -71
- package/dist/artifacts-TrTX9_jj.mjs +104 -0
- package/dist/assets-XyhpYtGl.mjs +630 -0
- package/dist/auto-import-components/resolvers.d.mts +1 -1
- package/dist/auto-import-components/resolvers.mjs +1 -1
- package/dist/auto-import-presets/wevu-router.d.mts +1 -1
- package/dist/auto-import-presets/wevu-router.mjs +1 -1
- package/dist/auto-import-presets/wevu.d.mts +1 -1
- package/dist/auto-import-presets/wevu.mjs +1 -1
- package/dist/auto-import-presets.d.mts +2 -2
- package/dist/auto-import-presets.mjs +2 -2
- package/dist/auto-routes.d.mts +1 -3
- package/dist/auto-routes.mjs +3 -4
- package/dist/{budget-BD7VqLCl.d.mts → budget-DTPngJU0.d.mts} +1 -10
- package/dist/budget-_Mu-4GKn.mjs +63 -0
- package/dist/builtProject-B145uOt5.mjs +534 -0
- package/dist/{package-7swhyLmf.mjs → classifier-CNTJOYQL.mjs} +5 -9
- package/dist/cli-acceptance.mjs +3 -4
- package/dist/cli.mjs +142 -4569
- package/dist/{config-DRGcCi3h.mjs → config-59ZWhCIf.mjs} +1 -2
- package/dist/{config-V0L-IAJf.d.mts → config-BNx2BODw.d.mts} +145 -150
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +3 -3
- package/dist/{constants-DEZdcsMn.mjs → constants-BOe8mgqL.mjs} +2 -4
- package/dist/{createCompilerContextInstance-DJH_P_nZ.mjs → createCompilerContextInstance-BXSdH2E8.mjs} +19930 -14019
- package/dist/{createContext-BqYzHhY9.mjs → createContext-W0TeXxbo.mjs} +7 -5
- package/dist/dashboard/analyze.d.mts +1 -7
- package/dist/dashboard/analyze.mjs +3 -1
- package/dist/dashboard/vite.d.mts +2 -4
- package/dist/dashboard/vite.mjs +1 -2
- package/dist/dashboard.d.mts +2 -2
- package/dist/dashboard.mjs +1733 -1
- package/dist/dashboardTransport-C9290QgS.mjs +15 -0
- package/dist/{dashboardViteBridge-Dy3nAD4m.mjs → dashboardViteBridge-B7QgQo94.mjs} +11 -11
- package/dist/{dev-fR5GiJRO.mjs → dev-D1QSExwk.mjs} +6 -3
- package/dist/devProvider-Bcvz5nu4.mjs +4966 -0
- package/dist/docs/README.md +14 -6
- package/dist/docs/ai-workflows.md +2 -0
- package/dist/docs/mcp.md +11 -1
- package/dist/docs/troubleshooting.md +16 -0
- package/dist/docs/vue-sfc.md +25 -2
- package/dist/docs/weapp-config.md +29 -0
- package/dist/docs/wevu-authoring.md +2 -0
- package/dist/doctor-worker.mjs +5 -5
- package/dist/doctor.d.mts +2 -8
- package/dist/doctor.mjs +24 -31
- package/dist/engine-Mnnm_ALP.mjs +53 -0
- package/dist/file-5eEfbK60.mjs +1 -0
- package/dist/{file-sC3jD7Fh.mjs → file-D8mp5GmB.mjs} +50 -26
- package/dist/{files-BqxFIPRp.mjs → files-Cy9jURJu.mjs} +1 -2
- package/dist/forwardConsole-D2Q0RIqc.mjs +509 -0
- package/dist/getInstance-BXNVH7sU.mjs +1 -0
- package/dist/{getInstance-DiGSzBNI.mjs → getInstance-DfNlbr-X.mjs} +2 -3
- package/dist/history-dKxzoHmN.mjs +774 -0
- package/dist/i18n.d.mts +1 -3
- package/dist/i18n.mjs +1 -2
- package/dist/{index-C9HjUX5c.d.mts → index-DIZJRrvK.d.mts} +1 -24
- package/dist/{index-CaXAtb9e.d.mts → index-SnaW3cvA.d.mts} +0 -12
- package/dist/index.d.mts +3 -7
- package/dist/index.mjs +6 -6
- package/dist/{json-BL8Dhhk6.mjs → json-Cvon2mw5.mjs} +1 -2
- package/dist/json.d.mts +1 -1
- package/dist/json.mjs +1 -1
- package/dist/lib-CJyMBzoe.mjs +140 -0
- package/dist/{lifecycle-BROTlwSL.mjs → lifecycle-CUo8PMQc.mjs} +123 -33
- package/dist/{loadConfig-C3BQhz7F.mjs → loadConfig-CKIdfW4o.mjs} +2 -3
- package/dist/loadConfig-D4WGJcYp.mjs +1 -0
- package/dist/logBuildAppFinish-DOBoof6S.mjs +54 -0
- package/dist/mcp-D88QvQgG.mjs +84 -0
- package/dist/{mcp-Cj8Maqo6.mjs → mcp-ovJgl1N9.mjs} +2 -4
- package/dist/mcp.d.mts +1 -3
- package/dist/mcp.mjs +1 -1
- package/dist/mcpClient-C8JzVZ46.mjs +283 -0
- package/dist/{processCleanup-B6KA30Zc.mjs → metadata-HlDKtlsu.mjs} +2 -21
- package/dist/nodeEnv-zq1EymWj.mjs +6 -0
- package/dist/openIde-QoYKhuuM.mjs +643 -0
- package/dist/options-Cz8vZ-0w.mjs +33 -0
- package/dist/{chunkStrategy-DRA5WpB-.mjs → package-DR62fAzP.mjs} +32 -31
- package/dist/path-E1OjBJAl.mjs +43 -0
- package/dist/{platform-CnkySBKz.mjs → platform-BiMpsZIb.mjs} +1 -2
- package/dist/{pluginHost--CaeyWpA.mjs → pluginHost-vn8Vty1J.mjs} +1 -2
- package/dist/processCleanup-DzB64WI8.mjs +18 -0
- package/dist/{protocol-vg8HGJ4n.mjs → protocol-HiSJRrSO.mjs} +43 -41
- package/dist/reader-wzPH_W8A.mjs +92 -0
- package/dist/realpathScope-DwlLaCk3.mjs +22 -0
- package/dist/report-PJVyo-UZ.mjs +105 -0
- package/dist/{path-doV773b7.mjs → resolvedId-DaxPh_yV.mjs} +5 -50
- package/dist/{resolvers-Dod-euqX.mjs → resolvers-CKYqmRD_.mjs} +10 -20
- package/dist/resolvers.d.mts +1 -1
- package/dist/resolvers.mjs +1 -1
- package/dist/{routes-C7fCmf92.d.mts → routes-DvAFX29h.d.mts} +0 -2
- package/dist/{runtime-Ee2HY6gR.d.mts → runtime-BL4RjBRa.d.mts} +1 -9
- package/dist/runtime-CKtMVERT.mjs +42 -0
- package/dist/{runtime-D6VCNhNY.mjs → runtime-DDUCb7pP.mjs} +4 -8
- package/dist/runtime.d.mts +1 -1
- package/dist/runtime.mjs +1 -1
- package/dist/schematics-DikfOjMD.mjs +90 -0
- package/dist/{session-PskhD-nZ.mjs → session-COrQJYif.mjs} +81 -21
- package/dist/test.d.mts +1 -3
- package/dist/test.mjs +54 -30
- package/dist/types-BK2EQ3Jm.d.mts +37 -0
- package/dist/{types-CgZn5X6j.d.mts → types-e2BMP9NU.d.mts} +1 -4
- package/dist/types.d.mts +4 -4
- package/dist/{upload-D4msblBf.mjs → upload-Chal5b3w.mjs} +118 -24
- package/dist/upload-worker.mjs +3 -5
- package/dist/{utils-CJSCgEj6.mjs → utils-CTGSZp4j.mjs} +72 -146
- package/dist/vite.d.mts +2 -4
- package/dist/vite.mjs +55 -21
- package/dist/volar.mjs +1 -2
- package/dist/{wevu-BQWUU7br.mjs → wevu-BaihCXO9.mjs} +1 -2
- package/dist/wevu-DTtSOyxB.d.mts +3 -0
- package/dist/{wevu-router-Dg1LnBlg.mjs → wevu-router-BIoxDbnu.mjs} +1 -2
- package/dist/wevu-router-CdWurGQ4.d.mts +3 -0
- package/dist/wxs-7V7MPzeW.mjs +1 -0
- package/dist/wxs-BdHHXltv.mjs +110 -0
- package/package.json +62 -53
- 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
- package/dist/wevu-C4KEC5kO.d.mts +0 -5
- package/dist/wevu-router-Cg2sIkIE.d.mts +0 -5
package/dist/test.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as parseSidecarModuleId, i as parseLogicalEntryId } from "./protocol-
|
|
1
|
+
import { m as captureWatchDependencies, u as CompilerSession } from "./createCompilerContextInstance-BXSdH2E8.mjs";
|
|
2
|
+
import { a as parseSidecarModuleId, i as parseLogicalEntryId } from "./protocol-HiSJRrSO.mjs";
|
|
3
|
+
import { D as createSidecarWatchOptions, E as deduplicateCleanupErrors, T as createFileWatcher } from "./devProvider-Bcvz5nu4.mjs";
|
|
4
|
+
import { n as normalizePath, t as isPathInside } from "./path-E1OjBJAl.mjs";
|
|
3
5
|
import process from "node:process";
|
|
4
6
|
import path from "node:path";
|
|
5
7
|
import fs from "node:fs/promises";
|
|
6
8
|
import { createHash, randomUUID } from "node:crypto";
|
|
7
|
-
|
|
8
|
-
//#region src/testArtifact/inputs.ts
|
|
9
|
+
// src/testArtifact/inputs.ts
|
|
9
10
|
const sessionId = randomUUID();
|
|
10
11
|
const excludedDirectories = /* @__PURE__ */ new Set([
|
|
11
12
|
".git",
|
|
@@ -69,10 +70,34 @@ async function fingerprintPaths(paths, excluded = []) {
|
|
|
69
70
|
for (const file of [...new Set(paths)].sort()) await visit(path.resolve(file));
|
|
70
71
|
return hash.digest("hex");
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
-
//#region src/testArtifact.ts
|
|
73
|
+
// src/testArtifact.ts
|
|
74
74
|
let pendingBuild = Promise.resolve();
|
|
75
75
|
const artifactInputs = /* @__PURE__ */ new WeakMap();
|
|
76
|
+
/** 监听策略属于产物启动快照,后续编译配置变动不能改写已登记策略。 */
|
|
77
|
+
function captureArtifactWatchConfig(config) {
|
|
78
|
+
const inline = config.inlineConfig;
|
|
79
|
+
const buildWatch = inline?.build?.watch;
|
|
80
|
+
const serverWatch = inline?.server?.watch;
|
|
81
|
+
const watchOptions = createSidecarWatchOptions(config, {});
|
|
82
|
+
const buildChokidar = buildWatch && typeof buildWatch === "object" && "chokidar" in buildWatch ? buildWatch.chokidar : void 0;
|
|
83
|
+
return { inlineConfig: {
|
|
84
|
+
...inline,
|
|
85
|
+
build: {
|
|
86
|
+
...inline?.build,
|
|
87
|
+
watch: {
|
|
88
|
+
...buildWatch && typeof buildWatch === "object" ? buildWatch : {},
|
|
89
|
+
chokidar: {
|
|
90
|
+
...buildChokidar,
|
|
91
|
+
...watchOptions
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
server: inline?.server ? {
|
|
96
|
+
...inline.server,
|
|
97
|
+
watch: serverWatch && typeof serverWatch === "object" ? { ...serverWatch } : serverWatch
|
|
98
|
+
} : void 0
|
|
99
|
+
} };
|
|
100
|
+
}
|
|
76
101
|
function enqueueBuild(task) {
|
|
77
102
|
const result = pendingBuild.then(task, task);
|
|
78
103
|
pendingBuild = result.then(() => void 0, () => void 0);
|
|
@@ -124,6 +149,7 @@ async function buildTestArtifact(options = {}) {
|
|
|
124
149
|
preloadAppEntry: false,
|
|
125
150
|
syncSupportFiles: false
|
|
126
151
|
});
|
|
152
|
+
const watchConfig = captureArtifactWatchConfig(ctx.configService);
|
|
127
153
|
for (const file of ctx.configService.configFileDependencies ?? []) dependencies.add(file);
|
|
128
154
|
if (options.projectConfigPath) dependencies.add(path.resolve(cwd, options.projectConfigPath));
|
|
129
155
|
dependencies.add(ctx.configService.absoluteSrcRoot);
|
|
@@ -137,10 +163,12 @@ async function buildTestArtifact(options = {}) {
|
|
|
137
163
|
sourceRootPath: ctx.configService.absoluteSrcRoot
|
|
138
164
|
};
|
|
139
165
|
const paths = [...dependencies, outDir];
|
|
166
|
+
const fingerprint = await fingerprintPaths(paths);
|
|
140
167
|
const stable = (await Promise.all([...discoveredInputs].map(async ([file, fingerprint]) => await fingerprint === await fingerprintPaths([file])))).every(Boolean) && before === await fingerprintPaths(initialInputs, [outDir]);
|
|
141
168
|
artifactInputs.set(artifact, {
|
|
142
169
|
paths,
|
|
143
|
-
fingerprint: stable ?
|
|
170
|
+
fingerprint: stable ? fingerprint : "",
|
|
171
|
+
watchConfig
|
|
144
172
|
});
|
|
145
173
|
return artifact;
|
|
146
174
|
} finally {
|
|
@@ -156,15 +184,20 @@ async function watchTestArtifact(options = {}) {
|
|
|
156
184
|
let dirty = false;
|
|
157
185
|
let forced = false;
|
|
158
186
|
let closing;
|
|
159
|
-
const watchedInputs = () => artifactInputs.get(artifact).paths.
|
|
187
|
+
const watchedInputs = () => [...new Map(artifactInputs.get(artifact).paths.map((file) => [normalizePath(file), file])).values()].filter((file) => !isPathInside(artifact.miniprogramRootPath, file) && (normalizePath(file) === normalizePath(artifact.sourceRootPath) || !isPathInside(artifact.sourceRootPath, file)));
|
|
160
188
|
let watched = watchedInputs();
|
|
161
|
-
const watcher =
|
|
189
|
+
const watcher = createFileWatcher(artifactInputs.get(artifact).watchConfig, watched, {
|
|
162
190
|
ignoreInitial: true,
|
|
163
191
|
ignored(file) {
|
|
164
|
-
if (watched.some((input) =>
|
|
165
|
-
return /[/\\](?:node_modules|\.git|\.weapp-vite)(?:[/\\]|$)/.test(file) ||
|
|
192
|
+
if (watched.some((input) => isPathInside(file, input))) return false;
|
|
193
|
+
return /[/\\](?:node_modules|\.git|\.weapp-vite)(?:[/\\]|$)/.test(file) || isPathInside(artifact.miniprogramRootPath, file);
|
|
166
194
|
}
|
|
167
195
|
});
|
|
196
|
+
const closeResources = async (priorFailures = []) => {
|
|
197
|
+
const results = await Promise.allSettled([watcher.close(), active]);
|
|
198
|
+
const failures = deduplicateCleanupErrors([...priorFailures, ...results.filter((result) => result.status === "rejected").map((result) => result.reason)]);
|
|
199
|
+
if (failures.length) throw failures.length === 1 ? failures[0] : new AggregateError(failures, "Test artifact watcher cleanup failed", { cause: failures[0] });
|
|
200
|
+
};
|
|
168
201
|
const requestRebuild = (force) => {
|
|
169
202
|
if (closed) return Promise.reject(/* @__PURE__ */ new Error("The weapp-vite test artifact watcher has already closed."));
|
|
170
203
|
dirty = true;
|
|
@@ -178,10 +211,8 @@ async function watchTestArtifact(options = {}) {
|
|
|
178
211
|
if (closed) break;
|
|
179
212
|
artifact = await buildTestArtifact(options);
|
|
180
213
|
if (!closed) {
|
|
181
|
-
|
|
182
|
-
await watcher.
|
|
183
|
-
watched = next;
|
|
184
|
-
watcher.add(watched);
|
|
214
|
+
watched = watchedInputs();
|
|
215
|
+
await watcher.updateTargets(watched);
|
|
185
216
|
await options.onRebuilt?.(artifact);
|
|
186
217
|
}
|
|
187
218
|
if (closed) break;
|
|
@@ -201,21 +232,18 @@ async function watchTestArtifact(options = {}) {
|
|
|
201
232
|
});
|
|
202
233
|
}, 20);
|
|
203
234
|
};
|
|
204
|
-
watcher.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
watcher.
|
|
235
|
+
watcher.onChange((changes) => {
|
|
236
|
+
if (changes.some((change) => change.kind === "file")) scheduleRebuild();
|
|
237
|
+
});
|
|
238
|
+
watcher.onError((error) => options.onError?.(error));
|
|
208
239
|
try {
|
|
209
|
-
await
|
|
210
|
-
watcher.once("ready", resolve);
|
|
211
|
-
watcher.once("error", reject);
|
|
212
|
-
});
|
|
240
|
+
await watcher.ready;
|
|
213
241
|
if (!await isTestArtifactCurrent(artifact)) await requestRebuild(false);
|
|
214
242
|
} catch (error) {
|
|
215
243
|
closed = true;
|
|
216
244
|
if (scheduled) clearTimeout(scheduled);
|
|
217
|
-
|
|
218
|
-
await
|
|
245
|
+
closing = closeResources([error]);
|
|
246
|
+
await closing;
|
|
219
247
|
throw error;
|
|
220
248
|
}
|
|
221
249
|
return {
|
|
@@ -226,14 +254,10 @@ async function watchTestArtifact(options = {}) {
|
|
|
226
254
|
if (closing) return closing;
|
|
227
255
|
closed = true;
|
|
228
256
|
if (scheduled) clearTimeout(scheduled);
|
|
229
|
-
closing = (
|
|
230
|
-
await watcher.close();
|
|
231
|
-
await active?.catch(() => void 0);
|
|
232
|
-
})();
|
|
257
|
+
closing = closeResources();
|
|
233
258
|
return closing;
|
|
234
259
|
},
|
|
235
260
|
rebuild: () => requestRebuild(true)
|
|
236
261
|
};
|
|
237
262
|
}
|
|
238
|
-
//#endregion
|
|
239
263
|
export { buildTestArtifact, isTestArtifactCurrent, watchTestArtifact };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
type GlassEaselDiagnosticCode = 'GE001' | 'GE002' | 'GE003' | 'GE004' | 'GE005' | 'GE006';
|
|
2
|
+
type GlassEaselDiagnosticSeverity = 'error' | 'warning';
|
|
3
|
+
interface GlassEaselDiagnostic {
|
|
4
|
+
code: GlassEaselDiagnosticCode;
|
|
5
|
+
severity: GlassEaselDiagnosticSeverity;
|
|
6
|
+
message: string;
|
|
7
|
+
file: string;
|
|
8
|
+
line?: number;
|
|
9
|
+
column?: number;
|
|
10
|
+
normalized?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** 每个 source/output owner 的最近分析事实;日志去重状态不属于当前事实。 */
|
|
13
|
+
interface GlassEaselAnalysisFact {
|
|
14
|
+
kind: 'output' | 'source';
|
|
15
|
+
scope?: string;
|
|
16
|
+
detected: boolean;
|
|
17
|
+
diagnostics: Map<string, GlassEaselDiagnostic>;
|
|
18
|
+
sourceIds: Set<string>;
|
|
19
|
+
}
|
|
20
|
+
interface GlassEaselAnalyzeResult {
|
|
21
|
+
detected: boolean;
|
|
22
|
+
minimumBaseLibrary: '3.8.12';
|
|
23
|
+
migrationGuide: string;
|
|
24
|
+
diagnostics: GlassEaselDiagnostic[];
|
|
25
|
+
summary: {
|
|
26
|
+
errors: number;
|
|
27
|
+
warnings: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
interface GlassEaselTemplateFinding {
|
|
31
|
+
code: Extract<GlassEaselDiagnosticCode, 'GE002' | 'GE003' | 'GE004'>;
|
|
32
|
+
severity: GlassEaselDiagnosticSeverity;
|
|
33
|
+
message: string;
|
|
34
|
+
start: number;
|
|
35
|
+
normalized?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export { GlassEaselAnalyzeResult as n, GlassEaselTemplateFinding as r, GlassEaselAnalysisFact as t };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import "@weapp-vite/i18n/
|
|
2
|
-
import "@weapp-vite/i18n";
|
|
3
|
-
//#region src/i18n/types.d.ts
|
|
1
|
+
import "@weapp-vite/i18n/types";
|
|
4
2
|
interface WeappI18nConfig {
|
|
5
3
|
defaultLocale: string;
|
|
6
4
|
fallbackLocale?: string;
|
|
@@ -8,5 +6,4 @@ interface WeappI18nConfig {
|
|
|
8
6
|
functionName?: string;
|
|
9
7
|
moduleName?: string;
|
|
10
8
|
}
|
|
11
|
-
//#endregion
|
|
12
9
|
export { WeappI18nConfig as t };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as Resolver } from "./index-
|
|
2
|
-
import { n as AutoRoutesSubPackage, t as AutoRoutes } from "./routes-
|
|
3
|
-
import { $ as
|
|
4
|
-
import { t as WeappI18nConfig } from "./types-
|
|
1
|
+
import { f as Resolver } from "./index-SnaW3cvA.mjs";
|
|
2
|
+
import { n as AutoRoutesSubPackage, t as AutoRoutes } from "./routes-DvAFX29h.mjs";
|
|
3
|
+
import { $ as WeappCompilerOutputRequest, $n as NpmPackageFilesConfig, $t as WeappUniAppConfig, A as Ref, An as GenerateDirsOptions, At as WeappAppPreludeConfig, B as BindingErrorLike, Bn as GenerateTemplateInlineSource, Br as WeappViteRuntime, Bt as WeappInjectWeapiConfig, Cn as AliasOptions, Cr as WeappLibVueTscOptions, Ct as AutoImportComponents, D as MethodDefinitions, Dn as CopyGlobs, Dr as WeappManagedSharedTsconfigConfig, Dt as HandleWxmlOptions, E as InlineConfig, En as ChunksConfig, Er as WeappManagedServerTsconfigConfig, Et as EnhanceWxmlOptions, F as RolldownPlugin, Fn as GenerateTemplate, Ft as WeappBuildScopeConfig, G as EntryJsonFragment, Gn as JsonMergeContext, Gt as WeappPreloadNetwork, H as BaseEntry, Hn as GenerateTemplatesConfig, Ht as WeappInjectWebRuntimeGlobalsTarget, I as RolldownPluginOption, In as GenerateTemplateContext, It as WeappBuildScopeObjectConfig, J as ScanComponentItem, Jn as JsonMergeStrategy, Jt as WeappReactConfig, K as PageEntry, Kn as JsonMergeFunction, Kt as WeappPreloadRule, L as RolldownWatchOptions, Ln as GenerateTemplateEntry, Lt as WeappHmrConfig, M as RolldownBuild, Mn as GenerateFileType, Mt as WeappAutoRoutesConfig, N as RolldownOptions, Nn as GenerateFilenamesOptions, Nt as WeappAutoRoutesInclude, O as Plugin, On as CopyOptions, Or as WeappManagedTypeScriptConfig, Ot as MultiPlatformConfig, P as RolldownOutput, Pn as GenerateOptions, Pt as WeappAutoRoutesIncludePattern, Q as WeappCompilerHmrRequest, Qn as NpmMainPackageConfig, Qt as WeappSubPackageConfig, R as RolldownWatcher, Rn as GenerateTemplateFactory, Rt as WeappInjectRequestGlobalsConfig, Sn as Alias, Sr as WeappLibInternalDtsOptions, St as WeappViteConfig, T as ConfigEnv, Tn as BuildNpmPackageMeta, Tr as WeappManagedNodeTsconfigConfig, Tt as EnhanceOptions, U as ComponentEntry, Un as JsFormat, Ut as WeappMcpConfig, V as AppEntry, Vn as GenerateTemplateScope, Vt as WeappInjectWebRuntimeGlobalsConfig, W as Entry, Wn as JsonConfig, Wt as WeappNpmConfig, X as WeappCompilerHmrAsset, Xn as NpmBuildOptions, Xt as WeappRouteRule, Y as WxmlDep, Yn as MpPlatform, Yt as WeappRequestRuntimeConfig, Z as WeappCompilerHmrPreparation, Zn as NpmDependencyPattern, Zt as WeappRouteRules, _n as WxmlTransformNode, _r as WeappLibComponentJson, _t as WeappDebugConfig, an as WxmlRemoveAttrRule, ar as SharedChunkMode, at as WeappCompilerPluginOption, b as ChangeEvent, bn as MultiPlatformProjectConfig, br as WeappLibEntryContext, bt as WeappTailwindcssOptions, cn as WxmlValidationContext, cr as StyleConfigEntry, ct as WeappCompilerSourceClaim, dn as WxmlAttribute, dr as StyleScope, dt as ProjectConfig, en as WeappVueConfig, er as NpmPluginPackageConfig, et as WeappCompilerPlugin, fn as WxmlAttributeValue, fr as SubPackage, ft as SubPackageMetaValue, gn as WxmlTransformContext, gr as SubPackageStyleScope, gt as WeappAnalyzeHistoryConfig, hn as WxmlTransform, hr as SubPackageStyleEntry, ht as WeappAnalyzeConfig, in as WeappWorkerConfig, ir as SharedChunkDynamicImports, it as WeappCompilerPluginFactory, j as ResolvedConfig, jn as GenerateExtensionsOptions, jr as WeappViteHostMeta, jt as WeappAppPreludeMode, k as PluginOption, kn as DeprecatedInlineDynamicImports, kr as WeappWebConfig, kt as ScanWxmlOptions, ln as WxmlValidationDiagnostic, lr as StyleConfigObject, lt as WeappCompilerSourceRequest, mn as WxmlSourceLocation, mr as SubPackageStyleConfigObject, mt as WeappAnalyzeBudgetConfig, nn as WeappWebRuntimeConfig, nr as NpmSubPackageConfig, nt as WeappCompilerPluginContext, on as WxmlRemoveOptions, or as SharedChunkOverride, ot as WeappCompilerPluginPhase, pn as WxmlElementInfo, pr as SubPackageStyleConfigEntry, pt as UserConfig, q as ComponentsMap, qn as JsonMergeStage, qt as WeappReactCompilerConfig, rn as WeappWevuConfig, rr as ResolvedAlias, rt as WeappCompilerPluginController, sn as WxmlValidate, sr as SharedChunkStrategy, st as WeappCompilerResourceKind, tn as WeappVueTemplateConfig, tr as NpmStrategy, tt as WeappCompilerPluginCapabilities, un as WxmlValidationVisitor, ur as StyleEntry, ut as WeappCompilerTransformResult, vn as WxmlTransformResult, vr as WeappLibConfig, vt as WeappForwardConsoleConfig, w as ComputedDefinitions, wn as AlipayNpmMode, wr as WeappManagedAppTsconfigConfig, wt as AutoImportComponentsOption, x as WeappVitePluginApi, xn as MultiPlatformProjectConfigs, xr as WeappLibFileName, xt as WeappUploadConfig, yn as WxmlTransformVisitor, yr as WeappLibDtsOptions, yt as WeappForwardConsoleLogLevel, z as ViteDevServer, zn as GenerateTemplateFileSource, zt as WeappInjectRequestGlobalsTarget } from "./config-BNx2BODw.mjs";
|
|
4
|
+
import { t as WeappI18nConfig } from "./types-e2BMP9NU.mjs";
|
|
5
5
|
export { Alias, AliasOptions, AlipayNpmMode, AppEntry, AutoImportComponents, AutoImportComponentsOption, AutoRoutes, AutoRoutesSubPackage, BaseEntry, BindingErrorLike, BuildNpmPackageMeta, ChangeEvent, ChunksConfig, ComponentEntry, ComponentsMap, type ComputedDefinitions, type ConfigEnv, CopyGlobs, CopyOptions, DeprecatedInlineDynamicImports, EnhanceOptions, EnhanceWxmlOptions, Entry, EntryJsonFragment, GenerateDirsOptions, GenerateExtensionsOptions, GenerateFileType, GenerateFilenamesOptions, GenerateOptions, GenerateTemplate, GenerateTemplateContext, GenerateTemplateEntry, GenerateTemplateFactory, GenerateTemplateFileSource, GenerateTemplateInlineSource, GenerateTemplateScope, GenerateTemplatesConfig, HandleWxmlOptions, type InlineConfig, JsFormat, type JsonConfig, type JsonMergeContext, type JsonMergeFunction, type JsonMergeStage, type JsonMergeStrategy, type MethodDefinitions, MpPlatform, MultiPlatformConfig, MultiPlatformProjectConfig, MultiPlatformProjectConfigs, NpmBuildOptions, NpmDependencyPattern, NpmMainPackageConfig, NpmPackageFilesConfig, NpmPluginPackageConfig, NpmStrategy, NpmSubPackageConfig, PageEntry, type Plugin, type PluginOption, ProjectConfig, type Ref, ResolvedAlias, type ResolvedConfig, type Resolver, type RolldownBuild, type RolldownOptions, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatchOptions, type RolldownWatcher, ScanComponentItem, ScanWxmlOptions, SharedChunkDynamicImports, SharedChunkMode, SharedChunkOverride, SharedChunkStrategy, StyleConfigEntry, StyleConfigObject, StyleEntry, StyleScope, SubPackage, SubPackageMetaValue, SubPackageStyleConfigEntry, SubPackageStyleConfigObject, SubPackageStyleEntry, SubPackageStyleScope, UserConfig, type ViteDevServer, WeappAnalyzeBudgetConfig, WeappAnalyzeConfig, WeappAnalyzeHistoryConfig, WeappAppPreludeConfig, WeappAppPreludeMode, WeappAutoRoutesConfig, WeappAutoRoutesInclude, WeappAutoRoutesIncludePattern, WeappBuildScopeConfig, WeappBuildScopeObjectConfig, type WeappCompilerHmrAsset, type WeappCompilerHmrPreparation, type WeappCompilerHmrRequest, WeappCompilerOutputRequest, WeappCompilerPlugin, WeappCompilerPluginCapabilities, WeappCompilerPluginContext, WeappCompilerPluginController, WeappCompilerPluginFactory, WeappCompilerPluginOption, WeappCompilerPluginPhase, WeappCompilerResourceKind, WeappCompilerSourceClaim, WeappCompilerSourceRequest, WeappCompilerTransformResult, WeappDebugConfig, WeappForwardConsoleConfig, WeappForwardConsoleLogLevel, WeappHmrConfig, type WeappI18nConfig, WeappInjectRequestGlobalsConfig, WeappInjectRequestGlobalsTarget, WeappInjectWeapiConfig, WeappInjectWebRuntimeGlobalsConfig, WeappInjectWebRuntimeGlobalsTarget, WeappLibComponentJson, WeappLibConfig, WeappLibDtsOptions, WeappLibEntryContext, WeappLibFileName, WeappLibInternalDtsOptions, WeappLibVueTscOptions, WeappManagedAppTsconfigConfig, WeappManagedNodeTsconfigConfig, WeappManagedServerTsconfigConfig, WeappManagedSharedTsconfigConfig, WeappManagedTypeScriptConfig, WeappMcpConfig, WeappNpmConfig, WeappPreloadNetwork, WeappPreloadRule, WeappReactCompilerConfig, WeappReactConfig, WeappRequestRuntimeConfig, WeappRouteRule, WeappRouteRules, WeappSubPackageConfig, WeappTailwindcssOptions, WeappUniAppConfig, WeappUploadConfig, WeappViteConfig, type WeappViteHostMeta, WeappVitePluginApi, type WeappViteRuntime, WeappVueConfig, WeappVueTemplateConfig, WeappWebConfig, WeappWebRuntimeConfig, WeappWevuConfig, WeappWorkerConfig, WxmlAttribute, WxmlAttributeValue, WxmlDep, WxmlElementInfo, WxmlRemoveAttrRule, WxmlRemoveOptions, WxmlSourceLocation, WxmlTransform, WxmlTransformContext, WxmlTransformNode, WxmlTransformResult, WxmlTransformVisitor, WxmlValidate, WxmlValidationContext, WxmlValidationDiagnostic, WxmlValidationVisitor };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as resolveMiniPlatform } from "./platform-
|
|
1
|
+
import { m as resolveMiniPlatform } from "./platform-BiMpsZIb.mjs";
|
|
2
2
|
import { r as logger_default } from "./logger-DGn5iEVN.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import process from "node:process";
|
|
@@ -6,17 +6,120 @@ import { pathToFileURL } from "node:url";
|
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { mkdir, readFile, stat } from "node:fs/promises";
|
|
8
8
|
import { getPackageInfo } from "local-pkg";
|
|
9
|
+
import { Buffer } from "node:buffer";
|
|
10
|
+
import { performance } from "node:perf_hooks";
|
|
9
11
|
import { execFile, execFileSync } from "node:child_process";
|
|
10
|
-
|
|
12
|
+
// src/cli/upload/processTreeDiagnostics.ts
|
|
13
|
+
const diagnostics = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
const MARKER_PREFIX = "[weapp-vite:upload-process-tree:v1]";
|
|
15
|
+
const MARKER_RE = /^\[weapp-vite:upload-process-tree:v1\] (script-enter|parent-query-start|parent-query-end|children-query-start|children-query-end) (\d{1,9}) (\d{1,16})$/;
|
|
16
|
+
const ERROR_CODES = /* @__PURE__ */ new Set([
|
|
17
|
+
"ETIMEDOUT",
|
|
18
|
+
"ENOENT",
|
|
19
|
+
"EACCES",
|
|
20
|
+
"EPERM",
|
|
21
|
+
"ENOBUFS",
|
|
22
|
+
"EIO",
|
|
23
|
+
"UNKNOWN"
|
|
24
|
+
]);
|
|
25
|
+
const SIGNALS = /* @__PURE__ */ new Set([
|
|
26
|
+
"SIGTERM",
|
|
27
|
+
"SIGKILL",
|
|
28
|
+
"SIGINT",
|
|
29
|
+
"SIGABRT"
|
|
30
|
+
]);
|
|
31
|
+
/** 标记只写入诊断管道,不进入供清理使用的 PID 输出。 */
|
|
32
|
+
const WINDOWS_PROCESS_TREE_DIAGNOSTIC_SETUP = `\$wvTreeClock = [Diagnostics.Stopwatch]::StartNew(); function Write-WvTreeStage([string]\$stage) { [Console]::Error.WriteLine('${MARKER_PREFIX} ' + $stage + ' ' + $wvTreeClock.ElapsedMilliseconds + ' ' + [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds()) }; `;
|
|
33
|
+
function processTreeStageCommand(stage) {
|
|
34
|
+
return `Write-WvTreeStage '${stage}'; `;
|
|
35
|
+
}
|
|
36
|
+
function readMarkers(stderr, elapsedMs) {
|
|
37
|
+
const text = Buffer.isBuffer(stderr) ? stderr.subarray(0, 8192).toString("utf8") : typeof stderr === "string" ? Buffer.from(stderr.slice(0, 8192)).subarray(0, 8192).toString("utf8") : "";
|
|
38
|
+
const markers = [];
|
|
39
|
+
for (const line of text.split(/\r?\n/)) {
|
|
40
|
+
const match = MARKER_RE.exec(line);
|
|
41
|
+
if (!match) continue;
|
|
42
|
+
const elapsed = Number(match[2]);
|
|
43
|
+
const utc = Number(match[3]);
|
|
44
|
+
if (!Number.isSafeInteger(elapsed) || elapsed > elapsedMs || !Number.isSafeInteger(utc) || markers.length >= 8) return [];
|
|
45
|
+
markers.push({
|
|
46
|
+
stage: match[1],
|
|
47
|
+
elapsedMs: elapsed,
|
|
48
|
+
utcMs: utc
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const expected = markers[1]?.stage === "parent-query-start" ? [
|
|
52
|
+
"script-enter",
|
|
53
|
+
"parent-query-start",
|
|
54
|
+
"parent-query-end",
|
|
55
|
+
"children-query-start",
|
|
56
|
+
"children-query-end"
|
|
57
|
+
] : [
|
|
58
|
+
"script-enter",
|
|
59
|
+
"children-query-start",
|
|
60
|
+
"children-query-end"
|
|
61
|
+
];
|
|
62
|
+
return markers.every((marker, index) => marker.stage === expected[index] && marker.elapsedMs >= (markers[index - 1]?.elapsedMs ?? 0)) ? markers : [];
|
|
63
|
+
}
|
|
64
|
+
function describeQuery(error, elapsedMs, utcStart, utcEnd) {
|
|
65
|
+
const failure = error;
|
|
66
|
+
const markers = readMarkers(failure.stderr, elapsedMs);
|
|
67
|
+
const first = markers[0];
|
|
68
|
+
const last = markers.at(-1);
|
|
69
|
+
const result = {
|
|
70
|
+
elapsedMs,
|
|
71
|
+
stage: last?.stage ?? "before-script-entry-or-unobserved"
|
|
72
|
+
};
|
|
73
|
+
if (typeof failure.code === "string" && ERROR_CODES.has(failure.code)) result.code = failure.code;
|
|
74
|
+
if (typeof failure.signal === "string" && SIGNALS.has(failure.signal)) result.signal = failure.signal;
|
|
75
|
+
if (typeof failure.status === "number" && Number.isSafeInteger(failure.status)) result.status = failure.status;
|
|
76
|
+
const startupMs = first && first.utcMs - utcStart;
|
|
77
|
+
if (first && startupMs !== void 0 && startupMs >= 0 && startupMs <= elapsedMs && Math.abs(utcEnd - utcStart - elapsedMs) <= 5 && markers.every((marker) => Math.abs(marker.utcMs - first.utcMs - (marker.elapsedMs - first.elapsedMs)) <= 5)) {
|
|
78
|
+
result.startupMs = startupMs;
|
|
79
|
+
if (last?.stage === "parent-query-start" || last?.stage === "children-query-start") result.activeQueryMs = Math.max(0, elapsedMs - startupMs - (last.elapsedMs - first.elapsedMs));
|
|
80
|
+
}
|
|
81
|
+
for (const [name, key] of [["parent", "parentQueryMs"], ["children", "childrenQueryMs"]]) {
|
|
82
|
+
const start = markers.find((marker) => marker.stage === `${name}-query-start`);
|
|
83
|
+
const end = markers.find((marker) => marker.stage === `${name}-query-end`);
|
|
84
|
+
if (start && end) result[key] = end.elapsedMs - start.elapsedMs;
|
|
85
|
+
}
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
/** 只附带标量诊断,保持清理失败的原始异常身份与控制流。 */
|
|
89
|
+
function observeWindowsProcessTreeQuery(run) {
|
|
90
|
+
const startedAt = performance.now();
|
|
91
|
+
const utcStart = Date.now();
|
|
92
|
+
try {
|
|
93
|
+
return run();
|
|
94
|
+
} catch (error) {
|
|
95
|
+
if (error && typeof error === "object") {
|
|
96
|
+
const elapsedMs = Math.max(0, Math.round(performance.now() - startedAt));
|
|
97
|
+
diagnostics.set(error, {
|
|
98
|
+
elapsedMs,
|
|
99
|
+
stage: "before-script-entry-or-unobserved"
|
|
100
|
+
});
|
|
101
|
+
try {
|
|
102
|
+
diagnostics.set(error, describeQuery(error, elapsedMs, utcStart, Date.now()));
|
|
103
|
+
} catch {}
|
|
104
|
+
}
|
|
105
|
+
throw error;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/** Windows 查询只展示白名单诊断,不能回显异常中携带的命令或原始 stderr。 */
|
|
109
|
+
function describeUploadProcessTreeError(error) {
|
|
110
|
+
const diagnostic = error && typeof error === "object" ? diagnostics.get(error) : void 0;
|
|
111
|
+
return diagnostic ? `PowerShell 进程归属查询失败 ${JSON.stringify(diagnostic)}` : String(error);
|
|
112
|
+
}
|
|
113
|
+
// src/cli/upload/processTree.ts
|
|
11
114
|
function childPids(pid, lifetime) {
|
|
12
115
|
if (process.platform === "win32") {
|
|
13
116
|
const since = lifetime ? `[DateTimeOffset]::FromUnixTimeMilliseconds(${lifetime.start}).UtcDateTime` : `(Get-CimInstance Win32_Process -Filter 'ProcessId = ${pid}').CreationDate.ToUniversalTime()`;
|
|
14
117
|
const until = lifetime ? `[DateTimeOffset]::FromUnixTimeMilliseconds(${lifetime.end}).UtcDateTime` : "[DateTime]::UtcNow";
|
|
15
|
-
return execFileSync("powershell.exe", [
|
|
118
|
+
return observeWindowsProcessTreeQuery(() => execFileSync("powershell.exe", [
|
|
16
119
|
"-NoProfile",
|
|
17
120
|
"-NonInteractive",
|
|
18
121
|
"-Command",
|
|
19
|
-
`$ErrorActionPreference = 'Stop'; $since = ${since}; $until = ${until}; Get-CimInstance Win32_Process -Filter 'ParentProcessId = ${pid}' | Where-Object {
|
|
122
|
+
`$ErrorActionPreference = 'Stop'; ${WINDOWS_PROCESS_TREE_DIAGNOSTIC_SETUP}${processTreeStageCommand("script-enter")}${lifetime ? "" : processTreeStageCommand("parent-query-start")}$since = ${since}; ${lifetime ? "" : processTreeStageCommand("parent-query-end")}$until = ${until}; ${processTreeStageCommand("children-query-start")}Get-CimInstance Win32_Process -Filter 'ParentProcessId = ${pid}' | Where-Object { $_.CreationDate.ToUniversalTime() -ge $since -and $_.CreationDate.ToUniversalTime() -le $until } | Select-Object -ExpandProperty ProcessId; ${processTreeStageCommand("children-query-end")}`
|
|
20
123
|
], {
|
|
21
124
|
encoding: "utf8",
|
|
22
125
|
windowsHide: true,
|
|
@@ -24,9 +127,9 @@ function childPids(pid, lifetime) {
|
|
|
24
127
|
stdio: [
|
|
25
128
|
"ignore",
|
|
26
129
|
"pipe",
|
|
27
|
-
"
|
|
130
|
+
"pipe"
|
|
28
131
|
]
|
|
29
|
-
}).split(/\s+/).map(Number).filter((value) => Number.isSafeInteger(value) && value > 0);
|
|
132
|
+
})).split(/\s+/).map(Number).filter((value) => Number.isSafeInteger(value) && value > 0);
|
|
30
133
|
}
|
|
31
134
|
const output = execFileSync("ps", [
|
|
32
135
|
"-A",
|
|
@@ -115,8 +218,7 @@ function terminateUploadProcess(pid, options) {
|
|
|
115
218
|
function terminateUploadDescendants(pid) {
|
|
116
219
|
for (const child of childPids(pid)) terminateUploadProcess(child);
|
|
117
220
|
}
|
|
118
|
-
|
|
119
|
-
//#region src/cli/upload/tools.ts
|
|
221
|
+
// src/cli/upload/tools.ts
|
|
120
222
|
function requireUploadEnv(context, name) {
|
|
121
223
|
const value = context.env[name]?.trim();
|
|
122
224
|
if (!value) throw new Error(`上传缺少环境变量 ${name}。请通过环境变量或项目 .env 文件配置凭据。`);
|
|
@@ -179,8 +281,7 @@ async function runUploadCli(context, packageName, binName, args, secrets, captur
|
|
|
179
281
|
child.stdin?.end();
|
|
180
282
|
});
|
|
181
283
|
}
|
|
182
|
-
|
|
183
|
-
//#region src/cli/upload/providers/alipay.ts
|
|
284
|
+
// src/cli/upload/providers/alipay.ts
|
|
184
285
|
/** 校验支付宝身份密钥及上传版本,只在执行阶段加载并调用官方 SDK。 */
|
|
185
286
|
async function prepareAlipayUpload(context, action = "upload") {
|
|
186
287
|
const appId = requireUploadAppId({
|
|
@@ -251,8 +352,7 @@ async function prepareAlipayUpload(context, action = "upload") {
|
|
|
251
352
|
}
|
|
252
353
|
};
|
|
253
354
|
}
|
|
254
|
-
|
|
255
|
-
//#region src/cli/upload/providers/douyin.ts
|
|
355
|
+
// src/cli/upload/providers/douyin.ts
|
|
256
356
|
/** 校验抖音项目与 Token 对应的 AppID,仅在执行阶段调用官方上传或预览 SDK。 */
|
|
257
357
|
async function prepareDouyinUpload(context, action = "upload") {
|
|
258
358
|
const token = requireUploadEnv(context, "TT_UPLOAD_TOKEN");
|
|
@@ -295,8 +395,7 @@ async function prepareDouyinUpload(context, action = "upload") {
|
|
|
295
395
|
}
|
|
296
396
|
};
|
|
297
397
|
}
|
|
298
|
-
|
|
299
|
-
//#region src/cli/upload/providers/jd.ts
|
|
398
|
+
// src/cli/upload/providers/jd.ts
|
|
300
399
|
/** 京东 SDK 不解析 IDE 配置,需要将项目根目录转换为 app.json 所在目录。 */
|
|
301
400
|
async function prepareJdUpload(context, action = "upload") {
|
|
302
401
|
const privateKey = requireUploadEnv(context, "JD_PRIVATE_KEY");
|
|
@@ -348,8 +447,7 @@ async function prepareJdUpload(context, action = "upload") {
|
|
|
348
447
|
}
|
|
349
448
|
};
|
|
350
449
|
}
|
|
351
|
-
|
|
352
|
-
//#region src/cli/upload/providers/swan.ts
|
|
450
|
+
// src/cli/upload/providers/swan.ts
|
|
353
451
|
/** 使用官方百度 CLI 上传或预览普通小程序,JSON 模式会在认证失败时拒绝交互登录。 */
|
|
354
452
|
async function prepareSwanUpload(context, action = "upload") {
|
|
355
453
|
const token = requireUploadEnv(context, "SWAN_UPLOAD_TOKEN");
|
|
@@ -423,8 +521,7 @@ async function prepareSwanUpload(context, action = "upload") {
|
|
|
423
521
|
}
|
|
424
522
|
};
|
|
425
523
|
}
|
|
426
|
-
|
|
427
|
-
//#region src/cli/upload/providers/wechat.ts
|
|
524
|
+
// src/cli/upload/providers/wechat.ts
|
|
428
525
|
/** 校验微信凭据,SDK 自行读取 IDE 项目中的 miniprogramRoot。 */
|
|
429
526
|
async function prepareWechatUpload(context, action = "upload") {
|
|
430
527
|
const appid = requireUploadAppId({
|
|
@@ -487,8 +584,7 @@ async function prepareWechatUpload(context, action = "upload") {
|
|
|
487
584
|
}
|
|
488
585
|
};
|
|
489
586
|
}
|
|
490
|
-
|
|
491
|
-
//#region src/cli/upload/providers/xhs.ts
|
|
587
|
+
// src/cli/upload/providers/xhs.ts
|
|
492
588
|
/** 使用独立的官方 CI 实例上传或预览小红书项目,禁止回退到扫码登录。 */
|
|
493
589
|
async function prepareXhsUpload(context, action = "upload") {
|
|
494
590
|
const token = requireUploadEnv(context, "XHS_UPLOAD_TOKEN");
|
|
@@ -534,8 +630,7 @@ async function prepareXhsUpload(context, action = "upload") {
|
|
|
534
630
|
}
|
|
535
631
|
};
|
|
536
632
|
}
|
|
537
|
-
|
|
538
|
-
//#region src/cli/upload/index.ts
|
|
633
|
+
// src/cli/upload/index.ts
|
|
539
634
|
const providers = {
|
|
540
635
|
weapp: prepareWechatUpload,
|
|
541
636
|
alipay: prepareAlipayUpload,
|
|
@@ -558,5 +653,4 @@ function prepareUpload(platform, context, action = "upload") {
|
|
|
558
653
|
if (!Object.hasOwn(providers, platform)) throw new Error(`不支持上传或预览平台 "${platform}"。`);
|
|
559
654
|
return providers[platform](context, action);
|
|
560
655
|
}
|
|
561
|
-
|
|
562
|
-
export { terminateUploadProcess as a, terminateUploadDescendants as i, resolveUploadPlatforms as n, redactUploadSecrets as r, prepareUpload as t };
|
|
656
|
+
export { terminateUploadProcess as a, terminateUploadDescendants as i, resolveUploadPlatforms as n, describeUploadProcessTreeError as o, redactUploadSecrets as r, prepareUpload as t };
|
package/dist/upload-worker.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as terminateUploadDescendants, r as redactUploadSecrets, t as prepareUpload } from "./upload-
|
|
1
|
+
import { i as terminateUploadDescendants, r as redactUploadSecrets, t as prepareUpload } from "./upload-Chal5b3w.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
|
-
|
|
3
|
+
// src/cli/upload/uploadResult.ts
|
|
4
4
|
function record(value) {
|
|
5
5
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
6
6
|
}
|
|
@@ -86,8 +86,7 @@ function normalizeUploadResult(platform, value, secrets) {
|
|
|
86
86
|
}
|
|
87
87
|
return result;
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
//#region src/cli/upload/worker.ts
|
|
89
|
+
// src/cli/upload/worker.ts
|
|
91
90
|
process.once("disconnect", () => process.exit(1));
|
|
92
91
|
process.once("SIGINT", () => process.exit(1));
|
|
93
92
|
process.once("SIGTERM", () => process.exit(1));
|
|
@@ -157,5 +156,4 @@ try {
|
|
|
157
156
|
const message = error instanceof Error ? error.message : String(error);
|
|
158
157
|
process.stderr.write(`${message}\n`, () => process.exit(1));
|
|
159
158
|
}
|
|
160
|
-
//#endregion
|
|
161
159
|
export {};
|