weapp-vite 6.15.7 → 6.15.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-routes.mjs +1 -1
- package/dist/cli.mjs +10 -10
- package/dist/{config-BMHiO7EZ.d.mts → config-BDvKS_M_.d.mts} +8 -0
- package/dist/config.d.mts +1 -1
- package/dist/{createContext-6sJTdwPY.mjs → createContext-BOcTbMN3.mjs} +392 -143
- package/dist/{file-BSU5Tzfv.mjs → file-BSDfToRq.mjs} +1 -1
- package/dist/file-cvdXNNJc.mjs +2 -0
- package/dist/getInstance-Bl0vmTQo.mjs +2 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/json.d.mts +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +15 -14
- package/dist/file-DwCpnySU.mjs +0 -2
- package/dist/getInstance-DgGsdrOF.mjs +0 -2
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getCompilerContext, u as getRouteRuntimeGlobalKeys } from "./createContext-
|
|
1
|
+
import { i as getCompilerContext, u as getRouteRuntimeGlobalKeys } from "./createContext-BOcTbMN3.mjs";
|
|
2
2
|
//#region src/auto-routes.ts
|
|
3
3
|
const ROUTE_RUNTIME_OVERRIDE_KEY = Symbol.for("weapp-vite.route-runtime");
|
|
4
4
|
function createGetter(resolver) {
|
package/dist/cli.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { S as isPathInside, _ as DEFAULT_MP_PLATFORM, b as resolveMiniPlatform, c as createSharedBuildConfig, d as resolveWeappConfigFile, f as checkRuntime, g as createCjsConfigLoadError, h as parseCommentJson, l as SHARED_CHUNK_VIRTUAL_PREFIX, m as loadViteConfigFile, n as syncProjectSupportFiles, p as getProjectConfigFileName, r as syncManagedTsconfigBootstrapFiles, s as formatBytes, t as createCompilerContext, v as getDefaultIdeProjectRoot, x as shouldPassPlatformArgToIdeOpen, y as normalizeMiniPlatform } from "./createContext-
|
|
1
|
+
import { S as isPathInside, _ as DEFAULT_MP_PLATFORM, b as resolveMiniPlatform, c as createSharedBuildConfig, d as resolveWeappConfigFile, f as checkRuntime, g as createCjsConfigLoadError, h as parseCommentJson, l as SHARED_CHUNK_VIRTUAL_PREFIX, m as loadViteConfigFile, n as syncProjectSupportFiles, p as getProjectConfigFileName, r as syncManagedTsconfigBootstrapFiles, s as formatBytes, t as createCompilerContext, v as getDefaultIdeProjectRoot, x as shouldPassPlatformArgToIdeOpen, y as normalizeMiniPlatform } from "./createContext-BOcTbMN3.mjs";
|
|
2
2
|
import { r as logger_default, t as colors } from "./logger-CgxdNjvb.mjs";
|
|
3
|
-
import { h as VERSION } from "./file-
|
|
3
|
+
import { h as VERSION } from "./file-BSDfToRq.mjs";
|
|
4
4
|
import { a as resolveWeappMcpConfig, o as startWeappViteMcpServer } from "./mcp-DRlj32v4.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import path, { posix } from "pathe";
|
|
7
7
|
import { defu } from "@weapp-core/shared";
|
|
8
8
|
import { fs } from "@weapp-core/shared/fs";
|
|
9
|
+
import fs$1 from "node:fs";
|
|
9
10
|
import process from "node:process";
|
|
10
|
-
import fs$
|
|
11
|
+
import fs$2 from "node:fs/promises";
|
|
11
12
|
import { build, createServer } from "vite";
|
|
12
13
|
import os from "node:os";
|
|
13
14
|
import { execFile } from "node:child_process";
|
|
14
15
|
import { Buffer } from "node:buffer";
|
|
15
|
-
import fs$2 from "node:fs";
|
|
16
16
|
import { cac } from "cac";
|
|
17
17
|
import { resolveCommand } from "package-manager-detector/commands";
|
|
18
18
|
import { promisify } from "node:util";
|
|
@@ -352,7 +352,7 @@ function createDashboardRuntimeEvent(input) {
|
|
|
352
352
|
}
|
|
353
353
|
function readDashboardManifest(packageJsonPath) {
|
|
354
354
|
try {
|
|
355
|
-
return parseCommentJson(fs$
|
|
355
|
+
return parseCommentJson(fs$1.readFileSync(packageJsonPath, "utf8"));
|
|
356
356
|
} catch {
|
|
357
357
|
return;
|
|
358
358
|
}
|
|
@@ -360,7 +360,7 @@ function readDashboardManifest(packageJsonPath) {
|
|
|
360
360
|
function resolveDashboardDistRoot(packageRoot, manifest) {
|
|
361
361
|
const distDir = manifest?.weappViteDashboard?.distDir ?? "dist";
|
|
362
362
|
const distRoot = path.resolve(packageRoot, distDir);
|
|
363
|
-
if (!fs$
|
|
363
|
+
if (!fs$1.existsSync(distRoot)) return;
|
|
364
364
|
return { root: distRoot };
|
|
365
365
|
}
|
|
366
366
|
function resolveDashboardRoot(options) {
|
|
@@ -2124,7 +2124,7 @@ function registerPrepareCommand(cli) {
|
|
|
2124
2124
|
}
|
|
2125
2125
|
//#endregion
|
|
2126
2126
|
//#region package.json
|
|
2127
|
-
var version = "6.15.
|
|
2127
|
+
var version = "6.15.10";
|
|
2128
2128
|
//#endregion
|
|
2129
2129
|
//#region src/cli/devHotkeys/format.ts
|
|
2130
2130
|
const FULLWIDTH_ASCII_START = 65281;
|
|
@@ -2274,7 +2274,7 @@ function formatResolvedScreenshotPath(cwd, fallbackPath, result) {
|
|
|
2274
2274
|
*/
|
|
2275
2275
|
async function runScreenshotAction(options) {
|
|
2276
2276
|
const outputPath = resolveDevScreenshotOutputPath(options.cwd);
|
|
2277
|
-
await fs$
|
|
2277
|
+
await fs$2.mkdir(path.dirname(outputPath), { recursive: true });
|
|
2278
2278
|
logger_default.info(`[dev action] 正在截图当前页面,输出到 ${colors.cyan(formatLogPath(options.cwd, outputPath))}`);
|
|
2279
2279
|
const result = await takeScreenshot({
|
|
2280
2280
|
fullPage: true,
|
|
@@ -2490,7 +2490,7 @@ function hasAnalyzeData(result) {
|
|
|
2490
2490
|
return result.packages.length > 0 || result.modules.length > 0;
|
|
2491
2491
|
}
|
|
2492
2492
|
async function collectOutputFiles(root) {
|
|
2493
|
-
const entries = await fs$
|
|
2493
|
+
const entries = await fs$2.readdir(root, { withFileTypes: true });
|
|
2494
2494
|
const files = [];
|
|
2495
2495
|
for (const entry of entries) {
|
|
2496
2496
|
const absolutePath = path.join(root, entry.name);
|
|
@@ -2538,7 +2538,7 @@ async function analyzeUiFallback(ctx) {
|
|
|
2538
2538
|
for (const absoluteFile of absoluteFiles) {
|
|
2539
2539
|
const relativeFile = path.relative(distRoot, absoluteFile).replace(REG_DIST_POSIX_SEP, "/");
|
|
2540
2540
|
const packageInfo = classifyPackage(relativeFile);
|
|
2541
|
-
const stat = await fs$
|
|
2541
|
+
const stat = await fs$2.stat(absoluteFile);
|
|
2542
2542
|
ensurePackage(packageInfo.id, packageInfo.type).files.push({
|
|
2543
2543
|
file: relativeFile,
|
|
2544
2544
|
type: relativeFile.endsWith(".js") ? "chunk" : "asset",
|
|
@@ -13,6 +13,7 @@ import { PluginOptions } from "vite-tsconfig-paths";
|
|
|
13
13
|
import { WrapPluginOptions } from "vite-plugin-performance";
|
|
14
14
|
import PQueue from "p-queue";
|
|
15
15
|
import { ComputedDefinitions as ComputedDefinitions$1, MethodDefinitions as MethodDefinitions$1, PageLayoutMeta, Ref, WevuDefaults } from "wevu";
|
|
16
|
+
import { MiniProgramNetworkDefaults } from "@wevu/web-apis";
|
|
16
17
|
import { App, App as App$1, Component, Component as Component$1, GenerateType, Page, Page as Page$1, Plugin, Sitemap, Sitemap as Sitemap$1, Theme, Theme as Theme$1 } from "@weapp-core/schematics";
|
|
17
18
|
import { WeappWebPluginOptions } from "@weapp-vite/web/plugin";
|
|
18
19
|
import { CompilerOptions } from "typescript";
|
|
@@ -431,6 +432,12 @@ interface WeappInjectWebRuntimeGlobalsConfig {
|
|
|
431
432
|
targets?: WeappInjectWebRuntimeGlobalsTarget[];
|
|
432
433
|
dependencies?: (string | RegExp)[];
|
|
433
434
|
prelude?: boolean;
|
|
435
|
+
/**
|
|
436
|
+
* @description Web Runtime 网络兼容层的宿主默认参数。
|
|
437
|
+
* @description 会透传给 `fetch` / `XMLHttpRequest` / `WebSocket` 对应的小程序底层能力。
|
|
438
|
+
* @description 显式调用时传入的 `miniProgram` / `miniprogram` 参数优先级更高。
|
|
439
|
+
*/
|
|
440
|
+
networkDefaults?: MiniProgramNetworkDefaults;
|
|
434
441
|
}
|
|
435
442
|
/**
|
|
436
443
|
* @description 已废弃,请迁移到 `WeappInjectWebRuntimeGlobalsConfig`
|
|
@@ -1335,6 +1342,7 @@ interface RuntimeState {
|
|
|
1335
1342
|
matcher?: (input: string) => boolean;
|
|
1336
1343
|
matcherKey: string;
|
|
1337
1344
|
version: number;
|
|
1345
|
+
pendingEntriesByImporter: Map<string, Set<string>>;
|
|
1338
1346
|
};
|
|
1339
1347
|
build: {
|
|
1340
1348
|
queue: PQueue;
|
package/dist/config.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Bn as resolveWeappViteHostMeta, Fn as WeappViteHostMeta, In as WeappViteRuntime, Ln as applyWeappViteHostMeta, Pn as WEAPP_VITE_HOST_NAME, Rn as createWeappViteHostMeta, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, l as defineConfig, m as Theme, n as UserConfigExport, nt as WeappViteConfig, o as UserConfigFnObject, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, y as defineThemeJson, zn as isWeappViteHost } from "./config-
|
|
1
|
+
import { Bn as resolveWeappViteHostMeta, Fn as WeappViteHostMeta, In as WeappViteRuntime, Ln as applyWeappViteHostMeta, Pn as WEAPP_VITE_HOST_NAME, Rn as createWeappViteHostMeta, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, l as defineConfig, m as Theme, n as UserConfigExport, nt as WeappViteConfig, o as UserConfigFnObject, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, y as defineThemeJson, zn as isWeappViteHost } from "./config-BDvKS_M_.mjs";
|
|
2
2
|
export { App, Component, Page, Sitemap, Theme, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnNoEnv, UserConfigFnNoEnvPlain, UserConfigFnObject, UserConfigFnObjectPlain, UserConfigFnPromise, WEAPP_VITE_HOST_NAME, WeappViteConfig, WeappViteHostMeta, WeappViteRuntime, applyWeappViteHostMeta, createWeappViteHostMeta, defineAppJson, defineComponentJson, defineConfig, definePageJson, defineSitemapJson, defineThemeJson, isWeappViteHost, resolveWeappViteHostMeta };
|