weapp-vite 6.14.2 → 6.14.3
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 +54 -47
- package/dist/{config-BHVrIbhx.d.mts → config-BMpfbpQb.d.mts} +3 -1
- package/dist/config.d.mts +1 -1
- package/dist/{createContext-utz68GiW.mjs → createContext-BWIKo9nG.mjs} +93 -40
- package/dist/{file-PUFdKeUd.mjs → file-B1jggPxp.mjs} +1 -1
- package/dist/file-CLt_iCyi.mjs +2 -0
- package/dist/getInstance-CoI8eyed.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 +7 -7
- package/dist/file-nOZc956t.mjs +0 -2
- package/dist/getInstance-eoGdnbzn.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-BWIKo9nG.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,6 +1,6 @@
|
|
|
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-BWIKo9nG.mjs";
|
|
2
2
|
import { r as logger_default, t as colors } from "./logger-CgxdNjvb.mjs";
|
|
3
|
-
import { m as VERSION } from "./file-
|
|
3
|
+
import { m as VERSION } from "./file-B1jggPxp.mjs";
|
|
4
4
|
import { a as resolveWeappMcpConfig, o as startWeappViteMcpServer } from "./mcp-DRlj32v4.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { defu, fs } from "@weapp-core/shared";
|
|
@@ -960,21 +960,6 @@ async function openWechatIdeByAutomator(projectPath) {
|
|
|
960
960
|
})).disconnect();
|
|
961
961
|
}
|
|
962
962
|
/**
|
|
963
|
-
* @description 若当前项目已在微信开发者工具中打开且自动化可连通,则直接复用现有会话,避免重复拉起 IDE。
|
|
964
|
-
*/
|
|
965
|
-
async function tryReuseOpenedWechatIde(projectPath) {
|
|
966
|
-
try {
|
|
967
|
-
(await connectOpenedAutomator({
|
|
968
|
-
projectPath,
|
|
969
|
-
timeout: 3e3
|
|
970
|
-
})).disconnect();
|
|
971
|
-
logger_default.info("目标项目已在微信开发者工具中打开,跳过重复打开。");
|
|
972
|
-
return true;
|
|
973
|
-
} catch {
|
|
974
|
-
return false;
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
/**
|
|
978
963
|
* @description 执行 IDE 打开流程,并在登录失效时允许按键重试。
|
|
979
964
|
*/
|
|
980
965
|
async function runWechatIdeOpenWithRetry(argv) {
|
|
@@ -990,7 +975,7 @@ async function runWechatIdeOpenWithRetry(argv) {
|
|
|
990
975
|
logger_default.error("检测到微信开发者工具登录状态失效,请先登录后重试。");
|
|
991
976
|
logger_default.warn(formatWechatIdeLoginRequiredError(error));
|
|
992
977
|
logger_default.info(formatRetryHotkeyPrompt());
|
|
993
|
-
if (
|
|
978
|
+
if (await waitForRetryKeypress() !== "retry") {
|
|
994
979
|
logger_default.warn("已取消重试。完成登录后请重新执行当前命令。");
|
|
995
980
|
retrying = false;
|
|
996
981
|
continue;
|
|
@@ -1033,20 +1018,6 @@ function resolveIdeProjectPath(mpDistRoot) {
|
|
|
1033
1018
|
function resolveIdeProjectRoot(mpDistRoot, cwd) {
|
|
1034
1019
|
return resolveIdeProjectPath(mpDistRoot) ?? cwd;
|
|
1035
1020
|
}
|
|
1036
|
-
async function openIde(platform, projectPath, options = {}) {
|
|
1037
|
-
if (platform === "weapp" && projectPath && options.trustProject !== false) try {
|
|
1038
|
-
if (await tryReuseOpenedWechatIde(projectPath)) return;
|
|
1039
|
-
await openWechatIdeByAutomator(projectPath);
|
|
1040
|
-
return;
|
|
1041
|
-
} catch (error) {
|
|
1042
|
-
logger_default.warn("通过 automator 启动微信开发者工具并自动信任项目失败,回退到普通 open 流程。");
|
|
1043
|
-
logger_default.error(error);
|
|
1044
|
-
}
|
|
1045
|
-
const argv = ["open", "-p"];
|
|
1046
|
-
if (projectPath) argv.push(projectPath);
|
|
1047
|
-
if (shouldPassPlatformArgToIdeOpen(platform)) argv.push("--platform", platform);
|
|
1048
|
-
await runWechatIdeOpenWithRetry(argv);
|
|
1049
|
-
}
|
|
1050
1021
|
async function closeIde() {
|
|
1051
1022
|
const config = await getConfig();
|
|
1052
1023
|
const cliPath = config.cliPath?.trim() ? config.cliPath : null;
|
|
@@ -1075,6 +1046,51 @@ async function closeIde() {
|
|
|
1075
1046
|
return false;
|
|
1076
1047
|
}
|
|
1077
1048
|
}
|
|
1049
|
+
function formatReuseOpenedWechatIdePrompt() {
|
|
1050
|
+
return `目标项目已在微信开发者工具中打开,已跳过重复打开。按 ${colors.bold(colors.green("r"))} 关闭当前窗口后重新打开。`;
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* @description 若当前项目已在微信开发者工具中打开且自动化可连通,则直接复用现有会话,避免重复拉起 IDE。
|
|
1054
|
+
*/
|
|
1055
|
+
async function tryReuseOpenedWechatIde(projectPath) {
|
|
1056
|
+
let miniProgram;
|
|
1057
|
+
try {
|
|
1058
|
+
miniProgram = await connectOpenedAutomator({
|
|
1059
|
+
projectPath,
|
|
1060
|
+
timeout: 3e3
|
|
1061
|
+
});
|
|
1062
|
+
} catch {
|
|
1063
|
+
return null;
|
|
1064
|
+
}
|
|
1065
|
+
miniProgram.disconnect();
|
|
1066
|
+
logger_default.info(formatReuseOpenedWechatIdePrompt());
|
|
1067
|
+
if (await waitForRetryKeypress() !== "retry") return {
|
|
1068
|
+
reopened: false,
|
|
1069
|
+
reused: true
|
|
1070
|
+
};
|
|
1071
|
+
logger_default.info(colors.bold(colors.green("正在关闭当前已打开项目,并重新拉起微信开发者工具...")));
|
|
1072
|
+
if (!await closeIde()) logger_default.warn("关闭当前微信开发者工具失败,仍继续尝试重新打开目标项目。");
|
|
1073
|
+
await openWechatIdeByAutomator(projectPath);
|
|
1074
|
+
return {
|
|
1075
|
+
reopened: true,
|
|
1076
|
+
reused: false
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
async function openIde(platform, projectPath, options = {}) {
|
|
1080
|
+
if (platform === "weapp" && projectPath && options.trustProject !== false) try {
|
|
1081
|
+
const reuseResult = await tryReuseOpenedWechatIde(projectPath);
|
|
1082
|
+
if (reuseResult?.reused || reuseResult?.reopened) return;
|
|
1083
|
+
await openWechatIdeByAutomator(projectPath);
|
|
1084
|
+
return;
|
|
1085
|
+
} catch (error) {
|
|
1086
|
+
logger_default.warn("通过 automator 启动微信开发者工具并自动信任项目失败,回退到普通 open 流程。");
|
|
1087
|
+
logger_default.error(error);
|
|
1088
|
+
}
|
|
1089
|
+
const argv = ["open", "-p"];
|
|
1090
|
+
if (projectPath) argv.push(projectPath);
|
|
1091
|
+
if (platform && shouldPassPlatformArgToIdeOpen(platform)) argv.push("--platform", platform);
|
|
1092
|
+
await runWechatIdeOpenWithRetry(argv);
|
|
1093
|
+
}
|
|
1078
1094
|
/**
|
|
1079
1095
|
* @description 解析 IDE 相关命令所需的平台、项目目录与配置上下文。
|
|
1080
1096
|
*/
|
|
@@ -1959,7 +1975,7 @@ async function handleDoctor(clientName, options) {
|
|
|
1959
1975
|
logger_default.success("MCP 客户端配置检查通过。");
|
|
1960
1976
|
}
|
|
1961
1977
|
async function handleServer(options) {
|
|
1962
|
-
const resolvedTransport = options.transport === "http" ? "streamable-http" : options.transport;
|
|
1978
|
+
const resolvedTransport = options.transport === "http" ? "streamable-http" : options.transport === "command" ? void 0 : options.transport;
|
|
1963
1979
|
await startWeappViteMcpServer({
|
|
1964
1980
|
endpoint: options.endpoint,
|
|
1965
1981
|
host: options.host,
|
|
@@ -2052,7 +2068,7 @@ function registerPrepareCommand(cli) {
|
|
|
2052
2068
|
}
|
|
2053
2069
|
//#endregion
|
|
2054
2070
|
//#region package.json
|
|
2055
|
-
var version = "6.14.
|
|
2071
|
+
var version = "6.14.3";
|
|
2056
2072
|
//#endregion
|
|
2057
2073
|
//#region src/cli/devHotkeys.ts
|
|
2058
2074
|
const DEV_SCREENSHOT_DIR = ".weapp-vite/dev-screenshots";
|
|
@@ -2347,7 +2363,7 @@ function startDevHotkeys(options) {
|
|
|
2347
2363
|
const handleInputOnce = (input, source) => {
|
|
2348
2364
|
const normalizedInput = normalizeInputChar(input);
|
|
2349
2365
|
const now = Date.now();
|
|
2350
|
-
for (const [token, timestamp] of recentInputs) if (now - timestamp > HOTKEY_DEDUP_WINDOW_MS) recentInputs.delete(token);
|
|
2366
|
+
for (const [token, timestamp] of recentInputs) if (now - Number(timestamp.split(":")[1] ?? 0) > HOTKEY_DEDUP_WINDOW_MS) recentInputs.delete(token);
|
|
2351
2367
|
const dedupKey = normalizedInput;
|
|
2352
2368
|
const recentEntry = recentInputs.get(dedupKey);
|
|
2353
2369
|
if (recentEntry !== void 0) {
|
|
@@ -2503,21 +2519,12 @@ function registerServeCommand(cli) {
|
|
|
2503
2519
|
}
|
|
2504
2520
|
};
|
|
2505
2521
|
if (targets.runMini) {
|
|
2506
|
-
const buildWatch = typeof inlineConfig?.build?.watch === "object" && inlineConfig.build.watch ? inlineConfig.build.watch : {};
|
|
2507
|
-
const buildChokidar = "chokidar" in buildWatch ? buildWatch.chokidar : void 0;
|
|
2508
2522
|
const existingServer = inlineConfig?.server ?? {};
|
|
2509
2523
|
inlineConfig = {
|
|
2510
2524
|
...inlineConfig,
|
|
2511
2525
|
build: {
|
|
2512
2526
|
...inlineConfig?.build ?? {},
|
|
2513
|
-
watch: {
|
|
2514
|
-
...buildWatch,
|
|
2515
|
-
chokidar: {
|
|
2516
|
-
...buildChokidar ?? {},
|
|
2517
|
-
usePolling: true,
|
|
2518
|
-
interval: 100
|
|
2519
|
-
}
|
|
2520
|
-
}
|
|
2527
|
+
watch: typeof inlineConfig?.build?.watch === "object" && inlineConfig.build.watch ? { ...inlineConfig.build.watch } : {}
|
|
2521
2528
|
},
|
|
2522
2529
|
server: {
|
|
2523
2530
|
...existingServer,
|
|
@@ -2547,9 +2554,9 @@ function registerServeCommand(cli) {
|
|
|
2547
2554
|
let analyzeRunId = 0;
|
|
2548
2555
|
const devHotkeysSession = targets.runMini ? startDevHotkeys({
|
|
2549
2556
|
cwd: configService.cwd,
|
|
2550
|
-
mcpConfig: configService.weappViteConfig?.
|
|
2557
|
+
mcpConfig: configService.weappViteConfig?.mcp,
|
|
2551
2558
|
platform: configService.platform,
|
|
2552
|
-
projectPath: resolveIdeProjectRoot(configService.mpDistRoot, configService.cwd),
|
|
2559
|
+
projectPath: resolveIdeProjectRoot(configService.mpDistRoot, configService.cwd) ?? configService.cwd,
|
|
2553
2560
|
silentStartupHint: true
|
|
2554
2561
|
}) : void 0;
|
|
2555
2562
|
try {
|
|
@@ -1399,7 +1399,9 @@ interface WxmlService {
|
|
|
1399
1399
|
getAllDeps: () => Set<string>;
|
|
1400
1400
|
getAggregatedComponents: (filepathOrBaseName: string) => ComponentsMap | undefined;
|
|
1401
1401
|
getAggregatedAutoImportComponents: (filepathOrBaseName: string) => ComponentsMap | undefined;
|
|
1402
|
-
clearAll: (
|
|
1402
|
+
clearAll: (options?: {
|
|
1403
|
+
clearEmittedCode?: boolean;
|
|
1404
|
+
}) => void;
|
|
1403
1405
|
analyze: (wxml: string) => ScanWxmlResult;
|
|
1404
1406
|
scan: (filepath: string) => Promise<ScanWxmlResult | undefined>;
|
|
1405
1407
|
setWxmlComponentsMap: (absPath: string, components: ComponentsMap) => void;
|
package/dist/config.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { An as createWeappViteHostMeta, Dn as WeappViteHostMeta, En as WEAPP_VITE_HOST_NAME, Mn as resolveWeappViteHostMeta, On as WeappViteRuntime, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, jn as isWeappViteHost, kn as applyWeappViteHostMeta, 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 } from "./config-
|
|
1
|
+
import { An as createWeappViteHostMeta, Dn as WeappViteHostMeta, En as WEAPP_VITE_HOST_NAME, Mn as resolveWeappViteHostMeta, On as WeappViteRuntime, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, jn as isWeappViteHost, kn as applyWeappViteHostMeta, 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 } from "./config-BMpfbpQb.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 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as applyWeappViteHostMeta } from "./pluginHost-BzPJL4F-.mjs";
|
|
2
2
|
import { n as configureLogger, r as logger_default } from "./logger-CgxdNjvb.mjs";
|
|
3
|
-
import { _ as supportedCssLangs, a as findJsonEntry, c as inlineAutoRoutesImports, g as jsExtensions, h as configExtensions, i as findJsEntry, l as isJsOrTs, n as extractConfigFromVue, o as findTemplateEntry, p as touch, r as findCssEntry, s as findVueEntry, t as changeFileExtension, u as isTemplate, v as templateExtensions, y as vueExtensions } from "./file-
|
|
3
|
+
import { _ as supportedCssLangs, a as findJsonEntry, c as inlineAutoRoutesImports, g as jsExtensions, h as configExtensions, i as findJsEntry, l as isJsOrTs, n as extractConfigFromVue, o as findTemplateEntry, p as touch, r as findCssEntry, s as findVueEntry, t as changeFileExtension, u as isTemplate, v as templateExtensions, y as vueExtensions } from "./file-B1jggPxp.mjs";
|
|
4
4
|
import { createRequire, isBuiltin } from "node:module";
|
|
5
5
|
import { addExtension, defu, fs, get, isEmptyObject, isObject, objectHash, removeExtension, removeExtensionDeep, set } from "@weapp-core/shared";
|
|
6
6
|
import { LRUCache } from "lru-cache";
|
|
@@ -266,10 +266,13 @@ function getAutoImportConfig(configService) {
|
|
|
266
266
|
if (!weappConfig) return;
|
|
267
267
|
const userConfigured = weappConfig.autoImportComponents ?? weappConfig.enhance?.autoImportComponents;
|
|
268
268
|
const enabledDefaults = createEnabledAutoImportComponents(configService);
|
|
269
|
+
const hasMergeableSubPackageAutoImportConfig = Boolean(Object.values(weappConfig.subPackages ?? {}).some((subConfig) => {
|
|
270
|
+
const scoped = subConfig?.autoImportComponents;
|
|
271
|
+
return scoped !== void 0 && scoped !== false;
|
|
272
|
+
}));
|
|
269
273
|
if (userConfigured === false) return;
|
|
270
274
|
const normalizedConfig = userConfigured === true ? enabledDefaults : userConfigured ? mergeAutoImportComponents(enabledDefaults, cloneAutoImportComponents(userConfigured), true) : void 0;
|
|
271
|
-
const
|
|
272
|
-
const baseConfig = cloneAutoImportComponents(normalizedConfig ?? fallbackConfig);
|
|
275
|
+
const baseConfig = cloneAutoImportComponents(normalizedConfig ?? (normalizedConfig === void 0 && !hasMergeableSubPackageAutoImportConfig ? enabledDefaults : void 0));
|
|
273
276
|
const subPackageConfigs = weappConfig.subPackages;
|
|
274
277
|
const currentRoot = configService.currentSubPackageRoot;
|
|
275
278
|
if (currentRoot) {
|
|
@@ -788,6 +791,7 @@ function shouldNormalizeNpmImportByPlatform(importee, options) {
|
|
|
788
791
|
function normalizeNpmImportPathByPlatform(importee, options) {
|
|
789
792
|
const trimmed = importee.trim();
|
|
790
793
|
if (!shouldNormalizeNpmImportByPlatform(trimmed, options)) return importee;
|
|
794
|
+
if (!options.platform) return importee;
|
|
791
795
|
const normalized = trimmed.replace(NPM_PROTOCOL_RE$1, "");
|
|
792
796
|
return normalizePlatformNpmImportPath(options.platform, normalized, { alipayNpmMode: options.alipayNpmMode });
|
|
793
797
|
}
|
|
@@ -4790,8 +4794,8 @@ async function resolveImplicitConfigFile(configRoot) {
|
|
|
4790
4794
|
}
|
|
4791
4795
|
}
|
|
4792
4796
|
}
|
|
4793
|
-
async function loadViteConfigFile(configEnv, configFile, configRoot, configFileDependencies, configFileExport, configLoader
|
|
4794
|
-
return loadConfigFromFile(configEnv, configFile ?? await resolveImplicitConfigFile(configRoot), configRoot,
|
|
4797
|
+
async function loadViteConfigFile(configEnv, configFile, configRoot, configFileDependencies, configFileExport, configLoader) {
|
|
4798
|
+
return loadConfigFromFile(configEnv, configFile ?? await resolveImplicitConfigFile(configRoot), configRoot, void 0, void 0, configLoader ?? "bundle");
|
|
4795
4799
|
}
|
|
4796
4800
|
//#endregion
|
|
4797
4801
|
//#region src/utils/projectConfig.ts
|
|
@@ -5237,7 +5241,7 @@ function createRegistryHelpers(state) {
|
|
|
5237
5241
|
const htmlSettings = getHtmlCustomDataSettings(state.ctx);
|
|
5238
5242
|
if (typedSettings.enabled || htmlSettings.enabled) {
|
|
5239
5243
|
const astEngine = resolveAstEngine(state.ctx.configService.weappViteConfig);
|
|
5240
|
-
let metadataSource = json;
|
|
5244
|
+
let metadataSource = json ?? void 0;
|
|
5241
5245
|
try {
|
|
5242
5246
|
if (!metadataSource && JSON_LIKE_FILE_RE.test(resolvedJsonPath)) metadataSource = await fs.readJson(resolvedJsonPath);
|
|
5243
5247
|
} catch {}
|
|
@@ -5262,8 +5266,7 @@ function createRegistryHelpers(state) {
|
|
|
5262
5266
|
state.scheduleVueComponentsWrite(vueSettings.enabled || removed || removedNames.length > 0);
|
|
5263
5267
|
}
|
|
5264
5268
|
function ensureMatcher() {
|
|
5265
|
-
const
|
|
5266
|
-
const globs = getAutoImportConfig(configService)?.globs;
|
|
5269
|
+
const globs = getAutoImportConfig(requireConfigService(state.ctx, "过滤组件前必须初始化 configService。"))?.globs;
|
|
5267
5270
|
if (!globs || globs.length === 0) {
|
|
5268
5271
|
state.autoImportState.matcher = void 0;
|
|
5269
5272
|
state.autoImportState.matcherKey = "";
|
|
@@ -5271,11 +5274,7 @@ function createRegistryHelpers(state) {
|
|
|
5271
5274
|
}
|
|
5272
5275
|
const nextKey = globs.join("\0");
|
|
5273
5276
|
if (!state.autoImportState.matcher || state.autoImportState.matcherKey !== nextKey) {
|
|
5274
|
-
state.autoImportState.matcher = picomatch(globs, {
|
|
5275
|
-
cwd: configService.cwd,
|
|
5276
|
-
windows: true,
|
|
5277
|
-
posixSlashes: true
|
|
5278
|
-
});
|
|
5277
|
+
state.autoImportState.matcher = picomatch(globs, { windows: true });
|
|
5279
5278
|
state.autoImportState.matcherKey = nextKey;
|
|
5280
5279
|
}
|
|
5281
5280
|
return state.autoImportState.matcher;
|
|
@@ -5440,7 +5439,7 @@ function createResolverHelpers(state) {
|
|
|
5440
5439
|
const allComponents = /* @__PURE__ */ new Map();
|
|
5441
5440
|
for (const resolver of resolvers) {
|
|
5442
5441
|
if (getSupportFilesStrategy(resolver) !== "full") continue;
|
|
5443
|
-
for (const [name, from] of Object.entries(resolver?.components ?? {})) allComponents.set(name, from);
|
|
5442
|
+
for (const [name, from] of Object.entries(resolver?.components ?? {})) if (typeof from === "string") allComponents.set(name, from);
|
|
5444
5443
|
}
|
|
5445
5444
|
return Object.fromEntries(allComponents);
|
|
5446
5445
|
}
|
|
@@ -5471,8 +5470,9 @@ function createResolverHelpers(state) {
|
|
|
5471
5470
|
}
|
|
5472
5471
|
for (const step of getCompiledResolvers(resolvers)) {
|
|
5473
5472
|
if (step.kind === "static") {
|
|
5473
|
+
const components = step.components ?? {};
|
|
5474
5474
|
for (const candidate of toComponentCandidates(componentName)) {
|
|
5475
|
-
const from =
|
|
5475
|
+
const from = components[candidate];
|
|
5476
5476
|
if (from) {
|
|
5477
5477
|
const value = {
|
|
5478
5478
|
name: componentName,
|
|
@@ -5484,6 +5484,7 @@ function createResolverHelpers(state) {
|
|
|
5484
5484
|
}
|
|
5485
5485
|
continue;
|
|
5486
5486
|
}
|
|
5487
|
+
if (!step.resolver) continue;
|
|
5487
5488
|
const value = resolveWithResolver(step.resolver, componentName, importerBaseName ?? "");
|
|
5488
5489
|
if (value) {
|
|
5489
5490
|
resolveCache.set(cacheKey, value);
|
|
@@ -5923,7 +5924,7 @@ async function discoverPagesRoots(root) {
|
|
|
5923
5924
|
const classified = classifyPagesRootEntry(current, entry);
|
|
5924
5925
|
if (!classified) continue;
|
|
5925
5926
|
if ("pageRoot" in classified) {
|
|
5926
|
-
pagesRoots.add(classified.pageRoot);
|
|
5927
|
+
if (classified.pageRoot) pagesRoots.add(classified.pageRoot);
|
|
5927
5928
|
continue;
|
|
5928
5929
|
}
|
|
5929
5930
|
queue.push(classified.nextPath);
|
|
@@ -6045,7 +6046,7 @@ async function collectCandidates(absoluteSrcRoot, include, subPackageRoots, sear
|
|
|
6045
6046
|
for (const entryPath of files) {
|
|
6046
6047
|
const resolvedEntryPath = resolveCandidateEntryPath(absoluteSrcRoot, entryPath);
|
|
6047
6048
|
if (!shouldCollectCandidateEntry(matcher, resolvedEntryPath)) continue;
|
|
6048
|
-
applyCandidateEntryToMap(candidates, entryPath, resolvedEntryPath);
|
|
6049
|
+
if (resolvedEntryPath) applyCandidateEntryToMap(candidates, entryPath, resolvedEntryPath);
|
|
6049
6050
|
}
|
|
6050
6051
|
}
|
|
6051
6052
|
return candidates;
|
|
@@ -7620,7 +7621,9 @@ function normalizeScriptModuleExtension(scriptModuleExtension) {
|
|
|
7620
7621
|
}
|
|
7621
7622
|
function getDefaultScriptModuleTagByExtension(scriptModuleExtension) {
|
|
7622
7623
|
if (!scriptModuleExtension) return "wxs";
|
|
7623
|
-
|
|
7624
|
+
const normalizedExtension = normalizeScriptModuleExtension(scriptModuleExtension);
|
|
7625
|
+
if (!normalizedExtension || !(normalizedExtension in DEFAULT_SCRIPT_MODULE_TAG_BY_EXTENSION)) return "wxs";
|
|
7626
|
+
return DEFAULT_SCRIPT_MODULE_TAG_BY_EXTENSION[normalizedExtension];
|
|
7624
7627
|
}
|
|
7625
7628
|
function resolveScriptModuleTagName(options) {
|
|
7626
7629
|
if (options?.scriptModuleTag) return options.scriptModuleTag;
|
|
@@ -7637,6 +7640,7 @@ function isScriptModuleTagName(tagName) {
|
|
|
7637
7640
|
}
|
|
7638
7641
|
function getScriptModuleImportAttrs(tagName) {
|
|
7639
7642
|
if (!tagName) return;
|
|
7643
|
+
if (!(tagName in SCRIPT_MODULE_IMPORT_ATTRS)) return;
|
|
7640
7644
|
return SCRIPT_MODULE_IMPORT_ATTRS[tagName];
|
|
7641
7645
|
}
|
|
7642
7646
|
function isScriptModuleImportAttr(tagName, attrName) {
|
|
@@ -7659,14 +7663,12 @@ const TEMPLATE_IMPORT_ATTRS = Object.freeze({
|
|
|
7659
7663
|
import: ["src"],
|
|
7660
7664
|
include: ["src"]
|
|
7661
7665
|
});
|
|
7662
|
-
function getTemplateImportTagNames() {
|
|
7663
|
-
return [...TEMPLATE_IMPORT_TAG_NAMES];
|
|
7664
|
-
}
|
|
7665
7666
|
function isTemplateImportTag(tagName) {
|
|
7666
|
-
return typeof tagName === "string" &&
|
|
7667
|
+
return typeof tagName === "string" && TEMPLATE_IMPORT_TAG_NAMES.includes(tagName);
|
|
7667
7668
|
}
|
|
7668
7669
|
function getTemplateImportAttrs(tagName) {
|
|
7669
7670
|
if (!tagName) return;
|
|
7671
|
+
if (!(tagName in TEMPLATE_IMPORT_ATTRS)) return;
|
|
7670
7672
|
return TEMPLATE_IMPORT_ATTRS[tagName];
|
|
7671
7673
|
}
|
|
7672
7674
|
function isTemplateImportAttr(tagName, attrName) {
|
|
@@ -8218,6 +8220,7 @@ function normalizeRelativeDir(value) {
|
|
|
8218
8220
|
return (normalized.startsWith("./") ? normalized.slice(2) : normalized).replace(EMPTY_VALUE_RE, ".");
|
|
8219
8221
|
}
|
|
8220
8222
|
function resolvePlatformProjectRoot(configService) {
|
|
8223
|
+
if (!configService) return "dist";
|
|
8221
8224
|
return normalizeRelativeDir(resolveProjectConfigRoot(configService.projectConfig, configService.platform) ?? "dist");
|
|
8222
8225
|
}
|
|
8223
8226
|
function getPackNpmRelationList(ctx) {
|
|
@@ -8334,7 +8337,7 @@ function createNpmService(ctx) {
|
|
|
8334
8337
|
const [mainRelation, ...subRelations] = getPackNpmRelationList(ctx);
|
|
8335
8338
|
const packageJsonPath = path.resolve(ctx.configService.cwd, mainRelation.packageJsonPath);
|
|
8336
8339
|
if (await fs.pathExists(packageJsonPath)) {
|
|
8337
|
-
const pkgJson = await fs.readJson(packageJsonPath);
|
|
8340
|
+
const pkgJson = await fs.readJson(packageJsonPath) ?? {};
|
|
8338
8341
|
const npmDistDirName = resolveNpmDistDirName(ctx.configService);
|
|
8339
8342
|
const outDir = path.resolve(ctx.configService.cwd, mainRelation.miniprogramNpmDistDir, npmDistDirName);
|
|
8340
8343
|
const cachedSourceOutDir = resolveNpmSourceCacheOutDir(ctx.configService.cwd, npmDistDirName);
|
|
@@ -9688,10 +9691,13 @@ function resolvePollingWatchConfig(configService) {
|
|
|
9688
9691
|
const buildWatch = configService.inlineConfig?.build?.watch;
|
|
9689
9692
|
const chokidar = buildWatch && typeof buildWatch === "object" && "chokidar" in buildWatch ? buildWatch.chokidar : void 0;
|
|
9690
9693
|
const serverWatch = configService.inlineConfig?.server?.watch;
|
|
9694
|
+
const usePollingCandidate = chokidar?.usePolling ?? serverWatch?.usePolling;
|
|
9695
|
+
const intervalCandidate = chokidar?.interval ?? serverWatch?.interval;
|
|
9696
|
+
const binaryIntervalCandidate = chokidar?.binaryInterval ?? serverWatch?.binaryInterval;
|
|
9691
9697
|
return {
|
|
9692
|
-
usePolling:
|
|
9693
|
-
interval:
|
|
9694
|
-
binaryInterval:
|
|
9698
|
+
usePolling: typeof usePollingCandidate === "boolean" ? usePollingCandidate : void 0,
|
|
9699
|
+
interval: typeof intervalCandidate === "number" ? intervalCandidate : void 0,
|
|
9700
|
+
binaryInterval: typeof binaryIntervalCandidate === "number" ? binaryIntervalCandidate : void 0
|
|
9695
9701
|
};
|
|
9696
9702
|
}
|
|
9697
9703
|
function createSidecarWatchOptions(configService, input) {
|
|
@@ -10885,6 +10891,7 @@ function createLoadConfig(options) {
|
|
|
10885
10891
|
cwd,
|
|
10886
10892
|
isDev,
|
|
10887
10893
|
mode,
|
|
10894
|
+
emitDefaultAutoImportOutputs: opts.emitDefaultAutoImportOutputs ?? true,
|
|
10888
10895
|
chunksConfigured,
|
|
10889
10896
|
projectConfig,
|
|
10890
10897
|
projectConfigPath: projectConfigPathResolved,
|
|
@@ -11151,7 +11158,7 @@ function createAutoImportPlugin(state) {
|
|
|
11151
11158
|
if (fileWatcherStarted || !configService?.isDev || !globs?.length) return;
|
|
11152
11159
|
const watchTargets = registerAutoImportWatchTargets(state, globs, void 0, { includeSrcRoot: false });
|
|
11153
11160
|
if (!watchTargets?.size) return;
|
|
11154
|
-
const watcher = chokidar.watch(
|
|
11161
|
+
const watcher = chokidar.watch(Array.from(watchTargets, (target) => String(target)), createSidecarWatchOptions(configService, {
|
|
11155
11162
|
ignoreInitial: true,
|
|
11156
11163
|
persistent: true,
|
|
11157
11164
|
awaitWriteFinish: {
|
|
@@ -12680,6 +12687,31 @@ const IDENTIFIER_CHAR_RE = /[\w$]/;
|
|
|
12680
12687
|
function escapeRegExp(source) {
|
|
12681
12688
|
return source.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
12682
12689
|
}
|
|
12690
|
+
function isInsideMustache(code, start, end) {
|
|
12691
|
+
const open = code.lastIndexOf("{{", start);
|
|
12692
|
+
if (open < 0) return false;
|
|
12693
|
+
return code.indexOf("}}", open + 2) >= end;
|
|
12694
|
+
}
|
|
12695
|
+
function getMustacheOuterQuote(code, start) {
|
|
12696
|
+
const open = code.lastIndexOf("{{", start);
|
|
12697
|
+
if (open <= 0) return null;
|
|
12698
|
+
for (let index = open - 1; index >= 0; index--) {
|
|
12699
|
+
const char = code[index];
|
|
12700
|
+
if (char === "\"" || char === "'") return char;
|
|
12701
|
+
if (char === "<" || char === ">" || char === "\n" || char === "\r") break;
|
|
12702
|
+
}
|
|
12703
|
+
return null;
|
|
12704
|
+
}
|
|
12705
|
+
function toQuotedLiteral(value, quote) {
|
|
12706
|
+
try {
|
|
12707
|
+
const parsed = JSON.parse(value);
|
|
12708
|
+
if (typeof parsed !== "string") return value;
|
|
12709
|
+
const escaped = parsed.replace(/\\/g, "\\\\").replace(/\r/g, "\\r").replace(/\n/g, "\\n").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
12710
|
+
return quote === "'" ? `'${escaped.replace(/'/g, "\\'")}'` : `"${escaped.replace(/"/g, "\\\"")}"`;
|
|
12711
|
+
} catch {
|
|
12712
|
+
return value;
|
|
12713
|
+
}
|
|
12714
|
+
}
|
|
12683
12715
|
function replaceDefineImportMetaEnv(code, defineImportMetaEnv) {
|
|
12684
12716
|
if (!defineImportMetaEnv || Object.keys(defineImportMetaEnv).length === 0) return code;
|
|
12685
12717
|
const entries = Object.entries(defineImportMetaEnv).sort(([leftKey], [rightKey]) => rightKey.length - leftKey.length);
|
|
@@ -12698,7 +12730,7 @@ function replaceDefineImportMetaEnv(code, defineImportMetaEnv) {
|
|
|
12698
12730
|
replacementRanges.push({
|
|
12699
12731
|
start,
|
|
12700
12732
|
end,
|
|
12701
|
-
value: String(value)
|
|
12733
|
+
value: isInsideMustache(code, start, end) ? toQuotedLiteral(String(value), getMustacheOuterQuote(code, start) === "'" ? "\"" : "'") : String(value)
|
|
12702
12734
|
});
|
|
12703
12735
|
}
|
|
12704
12736
|
}
|
|
@@ -13157,6 +13189,7 @@ async function resolveUsingComponentReference(ctx, configService, reExportResolu
|
|
|
13157
13189
|
};
|
|
13158
13190
|
}
|
|
13159
13191
|
async function resolveUsingComponentPath(ctx, configService, reExportResolutionCache, importSource, importerFilename, info) {
|
|
13192
|
+
if (!info) return;
|
|
13160
13193
|
return (await resolveUsingComponentReference(ctx, configService, reExportResolutionCache, importSource, importerFilename, info)).from;
|
|
13161
13194
|
}
|
|
13162
13195
|
function createUsingComponentPathResolver(ctx, configService, reExportResolutionCache) {
|
|
@@ -13209,6 +13242,7 @@ async function applyScriptSetupUsingComponents(options) {
|
|
|
13209
13242
|
const usingComponents = json && typeof json.usingComponents === "object" && json.usingComponents && !Array.isArray(json.usingComponents) ? json.usingComponents : {};
|
|
13210
13243
|
for (const { localName, importSource, importedName, kind } of imports) {
|
|
13211
13244
|
let { from } = await resolveUsingComponentReference(pluginCtx, configService, reExportResolutionCache, importSource, vueEntryPath, {
|
|
13245
|
+
localName,
|
|
13212
13246
|
kind,
|
|
13213
13247
|
importedName,
|
|
13214
13248
|
fallbackRelativeImporterDir: true
|
|
@@ -14232,7 +14266,9 @@ function resolveRequestGlobalsInstallerName(code) {
|
|
|
14232
14266
|
const isInstallerFunctionNode = (node) => {
|
|
14233
14267
|
if (!node) return false;
|
|
14234
14268
|
const functionCode = generate(node).code;
|
|
14235
|
-
return
|
|
14269
|
+
return FULL_REQUEST_GLOBAL_TARGETS.every((target) => {
|
|
14270
|
+
return functionCode.includes(target);
|
|
14271
|
+
});
|
|
14236
14272
|
};
|
|
14237
14273
|
traverse(ast, {
|
|
14238
14274
|
FunctionDeclaration(path) {
|
|
@@ -29096,7 +29132,9 @@ function replaceImportMetaAccessInSfc(source, options) {
|
|
|
29096
29132
|
ignoreEmpty: false
|
|
29097
29133
|
});
|
|
29098
29134
|
if (errors.length > 0) return source;
|
|
29099
|
-
const blocks = [descriptor.script, descriptor.scriptSetup].filter((block) =>
|
|
29135
|
+
const blocks = [descriptor.script, descriptor.scriptSetup].filter((block) => {
|
|
29136
|
+
return Boolean(block && !block.src);
|
|
29137
|
+
});
|
|
29100
29138
|
if (blocks.length === 0) return source;
|
|
29101
29139
|
const ms = new MagicString(source);
|
|
29102
29140
|
let mutated = false;
|
|
@@ -31421,7 +31459,11 @@ function scanWxml(wxml, options) {
|
|
|
31421
31459
|
const LEADING_DOT_SLASH_RE$1 = /^\.\//;
|
|
31422
31460
|
function resolveVueBundlePlatformOptions(options) {
|
|
31423
31461
|
return {
|
|
31424
|
-
normalizeUsingComponents: resolveVueTransformJsonPlatformOptions({
|
|
31462
|
+
normalizeUsingComponents: resolveVueTransformJsonPlatformOptions({
|
|
31463
|
+
platform: options.platform,
|
|
31464
|
+
weappViteConfig: {},
|
|
31465
|
+
packageJson: {}
|
|
31466
|
+
}).normalizeUsingComponents,
|
|
31425
31467
|
normalizeTemplate: shouldNormalizeVueTemplateForPlatform(options.platform),
|
|
31426
31468
|
emitGenericPlaceholder: shouldEmitGenericPlaceholderAsset(options.platform),
|
|
31427
31469
|
scriptModuleTag: resolveScriptModuleTagByPlatform(options.platform, options.scriptModuleExtension)
|
|
@@ -32739,7 +32781,9 @@ function createVueTransformPlugin(ctx) {
|
|
|
32739
32781
|
ctx,
|
|
32740
32782
|
configService: ctx.configService,
|
|
32741
32783
|
scanService: ctx.scanService,
|
|
32742
|
-
collectFallbackPageEntryIds,
|
|
32784
|
+
collectFallbackPageEntryIds: async (configService, scanService) => {
|
|
32785
|
+
return Array.from(await collectFallbackPageEntryIds(configService, scanService));
|
|
32786
|
+
},
|
|
32743
32787
|
findFirstResolvedVueLikeEntry,
|
|
32744
32788
|
pathExists: fs.pathExists,
|
|
32745
32789
|
readFile: fs.readFile
|
|
@@ -32754,9 +32798,11 @@ function createVueTransformPlugin(ctx) {
|
|
|
32754
32798
|
pluginCtx: this,
|
|
32755
32799
|
configService: ctx.configService,
|
|
32756
32800
|
styleBlocksCache,
|
|
32757
|
-
loadScopedSlotModule
|
|
32801
|
+
loadScopedSlotModule: (id) => {
|
|
32802
|
+
return loadScopedSlotModule(id, scopedSlotModules)?.code ?? null;
|
|
32803
|
+
},
|
|
32758
32804
|
scopedSlotModules,
|
|
32759
|
-
parseWeappVueStyleRequest,
|
|
32805
|
+
parseWeappVueStyleRequest: (id) => parseWeappVueStyleRequest(id) ?? null,
|
|
32760
32806
|
readAndParseSfc,
|
|
32761
32807
|
createReadAndParseSfcOptions
|
|
32762
32808
|
});
|
|
@@ -32938,7 +32984,7 @@ async function transformWxsFile(state, wxsPath) {
|
|
|
32938
32984
|
}));
|
|
32939
32985
|
}
|
|
32940
32986
|
if (code === void 0) return;
|
|
32941
|
-
const outputFileName = resolveRelativeOutputFileNameWithExtension(configService, isRaw ? wxsPath : removeExtension(wxsPath), scriptModuleExtension);
|
|
32987
|
+
const outputFileName = resolveRelativeOutputFileNameWithExtension(configService, isRaw ? wxsPath : removeExtension(wxsPath), scriptModuleExtension ?? "wxs");
|
|
32942
32988
|
state.wxsMap.set(wxsPath, { emittedFile: {
|
|
32943
32989
|
type: "asset",
|
|
32944
32990
|
fileName: outputFileName,
|
|
@@ -34251,12 +34297,15 @@ function createScanService(ctx) {
|
|
|
34251
34297
|
ctx.runtimeState.autoRoutes.loadingAppConfig = false;
|
|
34252
34298
|
}
|
|
34253
34299
|
const routes = autoRoutesService.getReference();
|
|
34254
|
-
config.pages = mergeAutoRoutePages(config.pages, routes.pages);
|
|
34300
|
+
config.pages = mergeAutoRoutePages(config.pages, routes.pages) ?? [];
|
|
34255
34301
|
const mergedSubPackages = mergeAutoRouteSubPackages(config.subPackages ?? config.subpackages, routes.subPackages.map((subPackage) => ({
|
|
34256
34302
|
root: subPackage.root,
|
|
34257
34303
|
pages: [...subPackage.pages]
|
|
34258
34304
|
})));
|
|
34259
|
-
if (mergedSubPackages) config.subPackages = mergedSubPackages
|
|
34305
|
+
if (mergedSubPackages) config.subPackages = mergedSubPackages.map((subPackage) => ({
|
|
34306
|
+
...subPackage,
|
|
34307
|
+
pages: Array.isArray(subPackage.pages) ? subPackage.pages : []
|
|
34308
|
+
}));
|
|
34260
34309
|
return config;
|
|
34261
34310
|
}
|
|
34262
34311
|
async function loadAppEntry() {
|
|
@@ -34270,7 +34319,7 @@ function createScanService(ctx) {
|
|
|
34270
34319
|
const vueAppPath = await findVueEntry(appBasename);
|
|
34271
34320
|
let configFromVue;
|
|
34272
34321
|
if (!appConfigFile && vueAppPath) {
|
|
34273
|
-
const { extractConfigFromVue } = await import("./file-
|
|
34322
|
+
const { extractConfigFromVue } = await import("./file-CLt_iCyi.mjs");
|
|
34274
34323
|
configFromVue = await extractConfigFromVue(vueAppPath);
|
|
34275
34324
|
if (configFromVue) appConfigFile = vueAppPath;
|
|
34276
34325
|
}
|
|
@@ -35145,6 +35194,7 @@ async function collectAutoImportTemplateTags(ctx) {
|
|
|
35145
35194
|
}));
|
|
35146
35195
|
}
|
|
35147
35196
|
async function syncProjectSupportFiles(ctx) {
|
|
35197
|
+
const configService = requireConfigService(ctx, "同步 support files 前必须初始化 configService。");
|
|
35148
35198
|
const managedTsconfigChanged = await hasManagedTsconfigChanges(ctx);
|
|
35149
35199
|
await syncManagedTsconfigFiles(ctx);
|
|
35150
35200
|
if (ctx.autoRoutesService?.isEnabled()) await ctx.autoRoutesService.ensureFresh();
|
|
@@ -35155,8 +35205,11 @@ async function syncProjectSupportFiles(ctx) {
|
|
|
35155
35205
|
const globs = autoImportConfig.globs;
|
|
35156
35206
|
if (Array.isArray(globs) && globs.length > 0) {
|
|
35157
35207
|
const files = await findAutoImportCandidates({
|
|
35158
|
-
ctx
|
|
35159
|
-
|
|
35208
|
+
ctx: {
|
|
35209
|
+
...ctx,
|
|
35210
|
+
configService
|
|
35211
|
+
},
|
|
35212
|
+
resolvedConfig: { build: { outDir: configService.outDir } }
|
|
35160
35213
|
}, globs);
|
|
35161
35214
|
await Promise.all(files.map((file) => ctx.autoImportService.registerPotentialComponent(file)));
|
|
35162
35215
|
} else if (!shouldBootstrapAutoImportWithoutGlobs(autoImportConfig)) {}
|
|
@@ -86,7 +86,7 @@ function resolveAutoRoutesMacroImportPath() {
|
|
|
86
86
|
}
|
|
87
87
|
async function resolveAutoRoutesInlineSnapshot() {
|
|
88
88
|
try {
|
|
89
|
-
const { getCompilerContext } = await import("./getInstance-
|
|
89
|
+
const { getCompilerContext } = await import("./getInstance-CoI8eyed.mjs");
|
|
90
90
|
const compilerContext = getCompilerContext();
|
|
91
91
|
const service = compilerContext.autoRoutesService;
|
|
92
92
|
const reference = service?.getReference?.();
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as Ref, An as createWeappViteHostMeta, C as LoadConfigOptions, D as MethodDefinitions, Dn as WeappViteHostMeta, E as InlineConfig, En as WEAPP_VITE_HOST_NAME, F as RolldownPlugin, I as RolldownPluginOption, L as RolldownWatchOptions, M as RolldownBuild, Mn as resolveWeappViteHostMeta, N as RolldownOptions, O as Plugin, On as WeappViteRuntime, P as RolldownOutput, R as RolldownWatcher, S as CompilerContext, T as ConfigEnv, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, j as ResolvedConfig, jn as isWeappViteHost, k as PluginOption, kn as applyWeappViteHostMeta, 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, w as ComputedDefinitions, y as defineThemeJson, z as ViteDevServer } from "./config-
|
|
1
|
+
import { A as Ref, An as createWeappViteHostMeta, C as LoadConfigOptions, D as MethodDefinitions, Dn as WeappViteHostMeta, E as InlineConfig, En as WEAPP_VITE_HOST_NAME, F as RolldownPlugin, I as RolldownPluginOption, L as RolldownWatchOptions, M as RolldownBuild, Mn as resolveWeappViteHostMeta, N as RolldownOptions, O as Plugin, On as WeappViteRuntime, P as RolldownOutput, R as RolldownWatcher, S as CompilerContext, T as ConfigEnv, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, j as ResolvedConfig, jn as isWeappViteHost, k as PluginOption, kn as applyWeappViteHostMeta, 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, w as ComputedDefinitions, y as defineThemeJson, z as ViteDevServer } from "./config-BMpfbpQb.mjs";
|
|
2
2
|
import { a as createWevuComponent, i as WevuComponentOptions, n as defineProps, r as setPageLayout, t as defineEmits } from "./runtime-58wbbRDf.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/createContext.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createCompilerContext } from "./createContext-
|
|
1
|
+
import { t as createCompilerContext } from "./createContext-BWIKo9nG.mjs";
|
|
2
2
|
import { a as defineThemeJson, i as defineSitemapJson, n as defineComponentJson, r as definePageJson, t as defineAppJson } from "./json-wnfVS9jE.mjs";
|
|
3
3
|
import { a as resolveWeappViteHostMeta, i as isWeappViteHost, n as applyWeappViteHostMeta, r as createWeappViteHostMeta, t as WEAPP_VITE_HOST_NAME } from "./pluginHost-BzPJL4F-.mjs";
|
|
4
4
|
import { t as defineConfig } from "./config-B2xtjEug.mjs";
|
package/dist/json.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as definePageJson, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, m as Theme, p as Sitemap, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-
|
|
1
|
+
import { _ as definePageJson, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, m as Theme, p as Sitemap, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-BMpfbpQb.mjs";
|
|
2
2
|
export { App, Component, Page, Sitemap, Theme, defineAppJson, defineComponentJson, definePageJson, defineSitemapJson, defineThemeJson };
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _t as WeappMcpConfig } from "./config-
|
|
1
|
+
import { _t as WeappMcpConfig } from "./config-BMpfbpQb.mjs";
|
|
2
2
|
import { CreateServerOptions, DEFAULT_MCP_ENDPOINT, DEFAULT_MCP_HOST, DEFAULT_MCP_PORT, McpServerHandle, StartMcpServerOptions, createWeappViteMcpServer } from "@weapp-vite/mcp";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
package/dist/types.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { c as Resolver } from "./index-6QUk3Zbc.mjs";
|
|
2
2
|
import { n as AutoRoutesSubPackage, t as AutoRoutes } from "./routes-DiEBrMtj.mjs";
|
|
3
|
-
import { $ as WeappDebugConfig, $t as NpmBuildOptions, A as Ref, At as ChunksConfig, B as BindingErrorLike, Bt as GenerateTemplateEntry, Cn as WeappManagedSharedTsconfigConfig, Ct as WeappVueTemplateConfig, D as MethodDefinitions, Dn as WeappViteHostMeta, Dt as AliasOptions, E as InlineConfig, Et as Alias, F as RolldownPlugin, Ft as GenerateFileType, G as EntryJsonFragment, Gt as GenerateTemplatesConfig, H as BaseEntry, Ht as GenerateTemplateFileSource, I as RolldownPluginOption, It as GenerateFilenamesOptions, J as ScanComponentItem, Jt as JsonMergeContext, K as PageEntry, Kt as JsFormat, L as RolldownWatchOptions, Lt as GenerateOptions, M as RolldownBuild, Mt as CopyOptions, N as RolldownOptions, Nt as GenerateDirsOptions, O as Plugin, On as WeappViteRuntime, Ot as AlipayNpmMode, P as RolldownOutput, Pt as GenerateExtensionsOptions, Q as UserConfig, Qt as MpPlatform, R as RolldownWatcher, Rt as GenerateTemplate, Sn as WeappManagedServerTsconfigConfig, St as WeappVueConfig, T as ConfigEnv, Tn as WeappWebConfig, Tt as WeappWorkerConfig, U as ComponentEntry, Ut as GenerateTemplateInlineSource, V as AppEntry, Vt as GenerateTemplateFactory, W as Entry, Wt as GenerateTemplateScope, X as ProjectConfig, Xt as JsonMergeStage, Y as WxmlDep, Yt as JsonMergeFunction, Z as SubPackageMetaValue, Zt as JsonMergeStrategy, _n as WeappLibFileName, _t as WeappMcpConfig, an as SharedChunkMode, at as EnhanceOptions, b as ChangeEvent, bn as WeappManagedAppTsconfigConfig, bt as WeappRouteRules, cn as SubPackage, ct as MultiPlatformConfig, dn as SubPackageStyleEntry, dt as WeappAutoRoutesInclude, en as NpmMainPackageConfig, et as WeappForwardConsoleConfig, fn as SubPackageStyleScope, ft as WeappAutoRoutesIncludePattern, gn as WeappLibEntryContext, gt as WeappInjectWeapiConfig, hn as WeappLibDtsOptions, ht as WeappInjectRequestGlobalsTarget, in as SharedChunkDynamicImports, it as AutoImportComponentsOption, j as ResolvedConfig, jt as CopyGlobs, k as PluginOption, kt as BuildNpmPackageMeta, ln as SubPackageStyleConfigEntry, lt as ScanWxmlOptions, mn as WeappLibConfig, mt as WeappInjectRequestGlobalsConfig, nn as NpmSubPackageConfig, nt as WeappViteConfig, on as SharedChunkOverride, ot as EnhanceWxmlOptions, pn as WeappLibComponentJson, pt as WeappHmrConfig, q as ComponentsMap, qt as JsonConfig, rn as ResolvedAlias, rt as AutoImportComponents, sn as SharedChunkStrategy, st as HandleWxmlOptions, tn as NpmPluginPackageConfig, tt as WeappForwardConsoleLogLevel, un as SubPackageStyleConfigObject, ut as WeappAutoRoutesConfig, vn as WeappLibInternalDtsOptions, vt as WeappNpmConfig, w as ComputedDefinitions, wn as WeappManagedTypeScriptConfig, wt as WeappWevuConfig, x as WeappVitePluginApi, xn as WeappManagedNodeTsconfigConfig, xt as WeappSubPackageConfig, yn as WeappLibVueTscOptions, yt as WeappRouteRule, z as ViteDevServer, zt as GenerateTemplateContext } from "./config-
|
|
3
|
+
import { $ as WeappDebugConfig, $t as NpmBuildOptions, A as Ref, At as ChunksConfig, B as BindingErrorLike, Bt as GenerateTemplateEntry, Cn as WeappManagedSharedTsconfigConfig, Ct as WeappVueTemplateConfig, D as MethodDefinitions, Dn as WeappViteHostMeta, Dt as AliasOptions, E as InlineConfig, Et as Alias, F as RolldownPlugin, Ft as GenerateFileType, G as EntryJsonFragment, Gt as GenerateTemplatesConfig, H as BaseEntry, Ht as GenerateTemplateFileSource, I as RolldownPluginOption, It as GenerateFilenamesOptions, J as ScanComponentItem, Jt as JsonMergeContext, K as PageEntry, Kt as JsFormat, L as RolldownWatchOptions, Lt as GenerateOptions, M as RolldownBuild, Mt as CopyOptions, N as RolldownOptions, Nt as GenerateDirsOptions, O as Plugin, On as WeappViteRuntime, Ot as AlipayNpmMode, P as RolldownOutput, Pt as GenerateExtensionsOptions, Q as UserConfig, Qt as MpPlatform, R as RolldownWatcher, Rt as GenerateTemplate, Sn as WeappManagedServerTsconfigConfig, St as WeappVueConfig, T as ConfigEnv, Tn as WeappWebConfig, Tt as WeappWorkerConfig, U as ComponentEntry, Ut as GenerateTemplateInlineSource, V as AppEntry, Vt as GenerateTemplateFactory, W as Entry, Wt as GenerateTemplateScope, X as ProjectConfig, Xt as JsonMergeStage, Y as WxmlDep, Yt as JsonMergeFunction, Z as SubPackageMetaValue, Zt as JsonMergeStrategy, _n as WeappLibFileName, _t as WeappMcpConfig, an as SharedChunkMode, at as EnhanceOptions, b as ChangeEvent, bn as WeappManagedAppTsconfigConfig, bt as WeappRouteRules, cn as SubPackage, ct as MultiPlatformConfig, dn as SubPackageStyleEntry, dt as WeappAutoRoutesInclude, en as NpmMainPackageConfig, et as WeappForwardConsoleConfig, fn as SubPackageStyleScope, ft as WeappAutoRoutesIncludePattern, gn as WeappLibEntryContext, gt as WeappInjectWeapiConfig, hn as WeappLibDtsOptions, ht as WeappInjectRequestGlobalsTarget, in as SharedChunkDynamicImports, it as AutoImportComponentsOption, j as ResolvedConfig, jt as CopyGlobs, k as PluginOption, kt as BuildNpmPackageMeta, ln as SubPackageStyleConfigEntry, lt as ScanWxmlOptions, mn as WeappLibConfig, mt as WeappInjectRequestGlobalsConfig, nn as NpmSubPackageConfig, nt as WeappViteConfig, on as SharedChunkOverride, ot as EnhanceWxmlOptions, pn as WeappLibComponentJson, pt as WeappHmrConfig, q as ComponentsMap, qt as JsonConfig, rn as ResolvedAlias, rt as AutoImportComponents, sn as SharedChunkStrategy, st as HandleWxmlOptions, tn as NpmPluginPackageConfig, tt as WeappForwardConsoleLogLevel, un as SubPackageStyleConfigObject, ut as WeappAutoRoutesConfig, vn as WeappLibInternalDtsOptions, vt as WeappNpmConfig, w as ComputedDefinitions, wn as WeappManagedTypeScriptConfig, wt as WeappWevuConfig, x as WeappVitePluginApi, xn as WeappManagedNodeTsconfigConfig, xt as WeappSubPackageConfig, yn as WeappLibVueTscOptions, yt as WeappRouteRule, z as ViteDevServer, zt as GenerateTemplateContext } from "./config-BMpfbpQb.mjs";
|
|
4
4
|
export { Alias, AliasOptions, AlipayNpmMode, AppEntry, AutoImportComponents, AutoImportComponentsOption, AutoRoutes, AutoRoutesSubPackage, BaseEntry, BindingErrorLike, BuildNpmPackageMeta, ChangeEvent, ChunksConfig, ComponentEntry, ComponentsMap, ComputedDefinitions, ConfigEnv, CopyGlobs, CopyOptions, EnhanceOptions, EnhanceWxmlOptions, Entry, EntryJsonFragment, GenerateDirsOptions, GenerateExtensionsOptions, GenerateFileType, GenerateFilenamesOptions, GenerateOptions, GenerateTemplate, GenerateTemplateContext, GenerateTemplateEntry, GenerateTemplateFactory, GenerateTemplateFileSource, GenerateTemplateInlineSource, GenerateTemplateScope, GenerateTemplatesConfig, HandleWxmlOptions, InlineConfig, JsFormat, JsonConfig, JsonMergeContext, JsonMergeFunction, JsonMergeStage, JsonMergeStrategy, MethodDefinitions, MpPlatform, MultiPlatformConfig, NpmBuildOptions, NpmMainPackageConfig, NpmPluginPackageConfig, NpmSubPackageConfig, PageEntry, Plugin, PluginOption, ProjectConfig, Ref, ResolvedAlias, ResolvedConfig, Resolver, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatchOptions, RolldownWatcher, ScanComponentItem, ScanWxmlOptions, SharedChunkDynamicImports, SharedChunkMode, SharedChunkOverride, SharedChunkStrategy, SubPackage, SubPackageMetaValue, SubPackageStyleConfigEntry, SubPackageStyleConfigObject, SubPackageStyleEntry, SubPackageStyleScope, UserConfig, ViteDevServer, WeappAutoRoutesConfig, WeappAutoRoutesInclude, WeappAutoRoutesIncludePattern, WeappDebugConfig, WeappForwardConsoleConfig, WeappForwardConsoleLogLevel, WeappHmrConfig, WeappInjectRequestGlobalsConfig, WeappInjectRequestGlobalsTarget, WeappInjectWeapiConfig, WeappLibComponentJson, WeappLibConfig, WeappLibDtsOptions, WeappLibEntryContext, WeappLibFileName, WeappLibInternalDtsOptions, WeappLibVueTscOptions, WeappManagedAppTsconfigConfig, WeappManagedNodeTsconfigConfig, WeappManagedServerTsconfigConfig, WeappManagedSharedTsconfigConfig, WeappManagedTypeScriptConfig, WeappMcpConfig, WeappNpmConfig, WeappRouteRule, WeappRouteRules, WeappSubPackageConfig, WeappViteConfig, WeappViteHostMeta, WeappVitePluginApi, WeappViteRuntime, WeappVueConfig, WeappVueTemplateConfig, WeappWebConfig, WeappWevuConfig, WeappWorkerConfig, WxmlDep };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.14.
|
|
4
|
+
"version": "6.14.3",
|
|
5
5
|
"description": "weapp-vite 一个现代化的小程序打包工具",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -120,17 +120,17 @@
|
|
|
120
120
|
"@weapp-core/logger": "3.1.1",
|
|
121
121
|
"@weapp-core/schematics": "6.0.4",
|
|
122
122
|
"@weapp-core/shared": "3.0.3",
|
|
123
|
-
"@weapp-vite/ast": "6.14.
|
|
124
|
-
"@weapp-vite/mcp": "1.2.
|
|
123
|
+
"@weapp-vite/ast": "6.14.3",
|
|
124
|
+
"@weapp-vite/mcp": "1.2.1",
|
|
125
125
|
"@weapp-vite/miniprogram-automator": "1.0.2",
|
|
126
126
|
"@weapp-vite/volar": "2.0.8",
|
|
127
|
-
"@weapp-vite/web": "1.3.
|
|
127
|
+
"@weapp-vite/web": "1.3.12",
|
|
128
128
|
"@wevu/api": "0.2.3",
|
|
129
|
-
"@wevu/web-apis": "1.2.
|
|
129
|
+
"@wevu/web-apis": "1.2.2",
|
|
130
130
|
"rolldown-require": "2.0.12",
|
|
131
131
|
"vite-plugin-performance": "2.0.1",
|
|
132
132
|
"weapp-ide-cli": "5.2.2",
|
|
133
|
-
"wevu": "6.14.
|
|
133
|
+
"wevu": "6.14.3"
|
|
134
134
|
},
|
|
135
135
|
"publishConfig": {
|
|
136
136
|
"access": "public",
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"benchmark:auto-import:ci": "node --import tsx scripts/benchmark-auto-import-ci.ts",
|
|
156
156
|
"test:dev": "vitest",
|
|
157
157
|
"test": "vitest run",
|
|
158
|
-
"test:types": "cd test-d/auto-routes-define-app-json && tsd && cd ../config-define-config && tsd",
|
|
158
|
+
"test:types": "cd test-d/auto-routes-define-app-json && tsd && cd ../config-define-config && tsd && cd ../internal-src-types && tsd",
|
|
159
159
|
"lint:src": "eslint src --ext .ts",
|
|
160
160
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
161
161
|
"sync": "cnpm sync weapp-vite"
|
package/dist/file-nOZc956t.mjs
DELETED