weapp-vite 6.16.31 → 6.16.33

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.
@@ -1,4 +1,4 @@
1
- import { g as getRouteRuntimeGlobalKeys, i as getCompilerContext } from "./createContext-DvtQaPg3.mjs";
1
+ import { g as getRouteRuntimeGlobalKeys, i as getCompilerContext } from "./createContext-DxZoDRL0.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 { C as createCjsConfigLoadError, E as isPathInside, S as parseCommentJson, T as shouldPassPlatformArgToIdeOpen, _ as createBuildScopeConfigFromCli, b as getProjectConfigFileName, f as resolveWeappViteTarget, h as resolveHmrProfileJsonPath, m as SHARED_CHUNK_VIRTUAL_PREFIX, n as syncProjectSupportFiles, p as createSharedBuildConfig, r as syncManagedTsconfigBootstrapFiles, s as formatBytes, t as createCompilerContext, v as resolveWeappConfigFile, w as getDefaultIdeProjectRoot, x as loadViteConfigFile, y as checkRuntime } from "./createContext-DvtQaPg3.mjs";
1
+ import { C as createCjsConfigLoadError, E as isPathInside, S as parseCommentJson, T as shouldPassPlatformArgToIdeOpen, _ as createBuildScopeConfigFromCli, b as getProjectConfigFileName, f as resolveWeappViteTarget, h as resolveHmrProfileJsonPath, m as SHARED_CHUNK_VIRTUAL_PREFIX, n as syncProjectSupportFiles, p as createSharedBuildConfig, r as syncManagedTsconfigBootstrapFiles, s as formatBytes, t as createCompilerContext, v as resolveWeappConfigFile, w as getDefaultIdeProjectRoot, x as loadViteConfigFile, y as checkRuntime } from "./createContext-DxZoDRL0.mjs";
2
2
  import { r as logger_default, t as colors } from "./logger-mt4mSTqV.mjs";
3
- import { h as VERSION } from "./file-ULixDCLO.mjs";
3
+ import { h as VERSION } from "./file-D5ALdQXr.mjs";
4
4
  import { o as resolveWeappMcpConfig, s as startWeappViteMcpServer } from "./mcp-qmDOTH07.mjs";
5
5
  import { createRequire } from "node:module";
6
6
  import path, { posix } from "pathe";
@@ -3708,7 +3708,7 @@ function resolveRunnableHotkeyDefinition(input) {
3708
3708
  }
3709
3709
  //#endregion
3710
3710
  //#region package.json
3711
- var version = "6.16.31";
3711
+ var version = "6.16.33";
3712
3712
  //#endregion
3713
3713
  //#region src/cli/devHotkeys/format.ts
3714
3714
  const FULLWIDTH_ASCII_START = 65281;
@@ -1,6 +1,6 @@
1
1
  import { n as applyWeappViteHostMeta } from "./pluginHost--CaeyWpA.mjs";
2
2
  import { n as configureLogger, r as logger_default } from "./logger-mt4mSTqV.mjs";
3
- import { _ as jsExtensions, a as findJsonEntry, b as vueExtensions, c as isJsOrTs, d as touch, g as configExtensions, i as findJsEntry, l as isTemplate, n as changeFileExtension, o as findTemplateEntry, p as inlineAutoRoutesImports, r as findCssEntry, s as findVueEntry, t as extractConfigFromVue, v as supportedCssLangs, y as templateExtensions } from "./file-ULixDCLO.mjs";
3
+ import { _ as jsExtensions, a as findJsonEntry, b as vueExtensions, c as isJsOrTs, d as touch, g as configExtensions, i as findJsEntry, l as isTemplate, n as changeFileExtension, o as findTemplateEntry, p as inlineAutoRoutesImports, r as findCssEntry, s as findVueEntry, t as extractConfigFromVue, v as supportedCssLangs, y as templateExtensions } from "./file-D5ALdQXr.mjs";
4
4
  import { createRequire, isBuiltin } from "node:module";
5
5
  import path, { posix } from "pathe";
6
6
  import path$1, { normalize, relative, win32 } from "node:path";
@@ -14,7 +14,7 @@ import fs$1, { existsSync, readFileSync } from "node:fs";
14
14
  import { parse } from "vue/compiler-sfc";
15
15
  import { BABEL_TS_MODULE_PARSER_OPTIONS, generate, getVisitorKeys, parse as parse$2, parseJsLike, traverse } from "@weapp-vite/ast/babel";
16
16
  import pm from "picomatch";
17
- import { VUE_COMPONENT_TAG_RE, WE_VU_MODULE_ID, WE_VU_RUNTIME_APIS, buildClassStyleComputedCode, collectVueTemplateTags, compileJsxFile, compileVueFile, createJsonMerger, createPageEntryMatcher, createPageEntryMatcher as createPageEntryMatcher$1, getClassStyleWxsSource, getMiniProgramTemplatePlatform, getSfcCheckMtime, injectWevuPageFeaturesInJsWithResolver, invalidateFileCache, isAutoImportCandidateTag, isBuiltinComponent, pathExists, readAndParseSfc, readFile as readFile$1, resolveClassStyleWxsLocation, stripJsonMacroCallsFromCode } from "wevu/compiler";
17
+ import { VUE_COMPONENT_TAG_RE, WE_VU_INTERNAL_REACTIVITY_MODULE_ID, WE_VU_INTERNAL_RUNTIME_MODULE_ID, WE_VU_INTERNAL_TEMPLATE_MODULE_ID, WE_VU_RUNTIME_APIS, buildClassStyleComputedCode, collectVueTemplateTags, compileJsxFile, compileVueFile, createJsonMerger, createPageEntryMatcher, createPageEntryMatcher as createPageEntryMatcher$1, getClassStyleWxsSource, getMiniProgramTemplatePlatform, getSfcCheckMtime, injectWevuPageFeaturesInJsWithResolver, invalidateFileCache, isAutoImportCandidateTag, isBuiltinComponent, pathExists, readAndParseSfc, readFile as readFile$1, resolveClassStyleWxsLocation, stripJsonMacroCallsFromCode } from "wevu/compiler";
18
18
  import process from "node:process";
19
19
  import { parse as parse$1, stringify } from "comment-json";
20
20
  import fs$2, { appendFile, copyFile, mkdir, readFile, readdir, rm } from "node:fs/promises";
@@ -35,7 +35,7 @@ import { spawn } from "node:child_process";
35
35
  import * as t from "@weapp-vite/ast/babelTypes";
36
36
  import { objectHash } from "@weapp-core/shared/node";
37
37
  import PQueue from "p-queue";
38
- import { APP_PRELUDE_CHUNK_MARKER, APP_PRELUDE_GUARD_KEY, APP_PRELUDE_REQUIRE_MARKER, REQUEST_GLOBAL_ACTUALS_KEY, REQUEST_GLOBAL_BUNDLE_HOST_REF, REQUEST_GLOBAL_BUNDLE_MARKER, REQUEST_GLOBAL_CHUNK_HOST_REF, REQUEST_GLOBAL_CHUNK_MODULE_REF, REQUEST_GLOBAL_EXPOSE_HELPER, REQUEST_GLOBAL_INSTALLER_HOST_REF, REQUEST_GLOBAL_LAZY_CONSTRUCTOR_HELPER, REQUEST_GLOBAL_LAZY_FUNCTION_HELPER, REQUEST_GLOBAL_LOCAL_BINDINGS_MARKER, REQUEST_GLOBAL_MARK_PLACEHOLDER_HELPER, REQUEST_GLOBAL_PASSIVE_BINDINGS_MARKER, REQUEST_GLOBAL_PASSIVE_BINDINGS_MARKER as REQUEST_GLOBAL_PASSIVE_BINDINGS_MARKER$1, REQUEST_GLOBAL_PLACEHOLDER_KEY, REQUEST_GLOBAL_PRELUDE_GUARD_KEY, REQUEST_GLOBAL_PRELUDE_MARKER, REQUEST_GLOBAL_SYNTHETIC_EXPORT_NAME, REQUEST_GLOBAL_USABLE_CONSTRUCTOR_HELPER, WEAPP_VITE_IMPORT_META_ENV_KEY, WEAPP_VITE_INJECTED_API_IDENTIFIER, WEVU_APP_SHELL_COMPONENT_BASE, WEVU_APP_SHELL_TAG_NAME, WEVU_EXPRESSION_ERROR_IDENTIFIER, WEVU_INTERNAL_KEY_IDENTIFIER, WEVU_LAYOUT_BIND_PREFIX, WEVU_PAGE_LAYOUT_CURRENT_NAME_IDENTIFIER, WEVU_PAGE_LAYOUT_CURRENT_PROPS_IDENTIFIER, WEVU_PAGE_LAYOUT_NAME_KEY, WEVU_PAGE_LAYOUT_NEXT_NAME_IDENTIFIER, WEVU_PAGE_LAYOUT_NEXT_PROPS_IDENTIFIER, WEVU_PAGE_LAYOUT_NONE, WEVU_PAGE_LAYOUT_PROPS_KEY, WEVU_PAGE_LAYOUT_SETTER_KEY, WEVU_SCOPED_SLOT_CREATOR_KEY, WEVU_SLOT_FALLBACK_VIRTUAL_HOST_BASE, WEVU_SLOT_FALLBACK_VIRTUAL_HOST_GLOBAL_PATH, WEVU_SLOT_FALLBACK_VIRTUAL_HOST_TAG_NAME, WEVU_SLOT_OWNER_ID_ATTR, WEVU_SLOT_OWNER_ID_PROP, WEVU_SLOT_PROPS_ATTR, WEVU_SLOT_SCOPE_ATTR, WEVU_SLOT_SCOPE_KEY } from "@weapp-core/constants";
38
+ import { APP_PRELUDE_CHUNK_MARKER, APP_PRELUDE_GUARD_KEY, APP_PRELUDE_REQUIRE_MARKER, REQUEST_GLOBAL_ACTUALS_KEY, REQUEST_GLOBAL_BUNDLE_HOST_REF, REQUEST_GLOBAL_BUNDLE_MARKER, REQUEST_GLOBAL_CHUNK_HOST_REF, REQUEST_GLOBAL_CHUNK_MODULE_REF, REQUEST_GLOBAL_EXPOSE_HELPER, REQUEST_GLOBAL_INSTALLER_HOST_REF, REQUEST_GLOBAL_LAZY_CONSTRUCTOR_HELPER, REQUEST_GLOBAL_LAZY_FUNCTION_HELPER, REQUEST_GLOBAL_LOCAL_BINDINGS_MARKER, REQUEST_GLOBAL_MARK_PLACEHOLDER_HELPER, REQUEST_GLOBAL_PASSIVE_BINDINGS_MARKER, REQUEST_GLOBAL_PASSIVE_BINDINGS_MARKER as REQUEST_GLOBAL_PASSIVE_BINDINGS_MARKER$1, REQUEST_GLOBAL_PLACEHOLDER_KEY, REQUEST_GLOBAL_PRELUDE_GUARD_KEY, REQUEST_GLOBAL_PRELUDE_MARKER, REQUEST_GLOBAL_SYNTHETIC_EXPORT_NAME, REQUEST_GLOBAL_USABLE_CONSTRUCTOR_HELPER, WEAPP_VITE_IMPORT_META_ENV_KEY, WEAPP_VITE_INJECTED_API_IDENTIFIER, WEVU_APP_SHELL_COMPONENT_BASE, WEVU_APP_SHELL_TAG_NAME, WEVU_EXPRESSION_ERROR_IDENTIFIER, WEVU_INTERNAL_KEY_IDENTIFIER, WEVU_LAYOUT_BIND_PREFIX, WEVU_PAGE_LAYOUT_CURRENT_NAME_IDENTIFIER, WEVU_PAGE_LAYOUT_CURRENT_PROPS_IDENTIFIER, WEVU_PAGE_LAYOUT_NAME_KEY, WEVU_PAGE_LAYOUT_NEXT_NAME_IDENTIFIER, WEVU_PAGE_LAYOUT_NEXT_PROPS_IDENTIFIER, WEVU_PAGE_LAYOUT_NONE, WEVU_PAGE_LAYOUT_PROPS_KEY, WEVU_PAGE_LAYOUT_SETTER_KEY, WEVU_SCOPED_SLOT_CREATOR_KEY, WEVU_SLOT_FALLBACK_VIRTUAL_HOST_BASE, WEVU_SLOT_FALLBACK_VIRTUAL_HOST_GLOBAL_PATH, WEVU_SLOT_FALLBACK_VIRTUAL_HOST_TAG_NAME, WEVU_SLOT_NAMES_PROP, WEVU_SLOT_OWNER_ID_ATTR, WEVU_SLOT_OWNER_ID_PROP, WEVU_SLOT_PROPS_ATTR, WEVU_SLOT_SCOPE_ATTR, WEVU_SLOT_SCOPE_KEY } from "@weapp-core/constants";
39
39
  import { Buffer } from "node:buffer";
40
40
  import { detect } from "package-manager-detector/detect";
41
41
  import tsconfigPaths from "vite-tsconfig-paths";
@@ -11698,6 +11698,27 @@ const PACKAGE_ALIASES = [
11698
11698
  devDistEntry: "dist/dev/compiler.mjs",
11699
11699
  fallbackWorkspacePackagePath: WEVU_WORKSPACE_PACKAGE_PATH
11700
11700
  },
11701
+ {
11702
+ find: "wevu/internal-runtime",
11703
+ packageName: "wevu",
11704
+ distEntry: "dist/internal-runtime.mjs",
11705
+ devDistEntry: "dist/dev/internal-runtime.mjs",
11706
+ fallbackWorkspacePackagePath: WEVU_WORKSPACE_PACKAGE_PATH
11707
+ },
11708
+ {
11709
+ find: "wevu/internal-reactivity",
11710
+ packageName: "wevu",
11711
+ distEntry: "dist/internal-reactivity.mjs",
11712
+ devDistEntry: "dist/dev/internal-reactivity.mjs",
11713
+ fallbackWorkspacePackagePath: WEVU_WORKSPACE_PACKAGE_PATH
11714
+ },
11715
+ {
11716
+ find: "wevu/internal-template",
11717
+ packageName: "wevu",
11718
+ distEntry: "dist/internal-template.mjs",
11719
+ devDistEntry: "dist/dev/internal-template.mjs",
11720
+ fallbackWorkspacePackagePath: WEVU_WORKSPACE_PACKAGE_PATH
11721
+ },
11701
11722
  {
11702
11723
  find: "wevu/jsx-runtime",
11703
11724
  packageName: "wevu",
@@ -21298,12 +21319,12 @@ function buildInlineExpressionMapCode(inlineExpressions) {
21298
21319
  function buildScopedSlotComponentModule(options) {
21299
21320
  const computedCode = options?.computedCode;
21300
21321
  const inlineMapCode = options?.inlineMapCode;
21301
- const lines = [
21302
- `import { ${computedCode ? `${WE_VU_RUNTIME_APIS.createWevuScopedSlotComponent} as _createWevuScopedSlotComponent, normalizeClass as __wevuNormalizeClass, normalizeStyle as __wevuNormalizeStyle, unref as __wevuUnref` : `${WE_VU_RUNTIME_APIS.createWevuScopedSlotComponent} as _createWevuScopedSlotComponent`} } from '${WE_VU_MODULE_ID}';`,
21303
- "const globalObject = typeof globalThis !== 'undefined' ? globalThis : undefined;",
21304
- `const createWevuScopedSlotComponent = globalObject?.${WEVU_SCOPED_SLOT_CREATOR_KEY}`,
21305
- " ?? _createWevuScopedSlotComponent;"
21306
- ];
21322
+ const lines = [`import { ${WE_VU_RUNTIME_APIS.createWevuScopedSlotComponent} as _createWevuScopedSlotComponent } from '${WE_VU_INTERNAL_RUNTIME_MODULE_ID}';`];
21323
+ if (computedCode) {
21324
+ lines.push(`import { normalizeClass as __wevuNormalizeClass, normalizeStyle as __wevuNormalizeStyle } from '${WE_VU_INTERNAL_TEMPLATE_MODULE_ID}';`);
21325
+ lines.push(`import { unref as __wevuUnref } from '${WE_VU_INTERNAL_REACTIVITY_MODULE_ID}';`);
21326
+ }
21327
+ lines.push("const globalObject = typeof globalThis !== 'undefined' ? globalThis : undefined;", `const createWevuScopedSlotComponent = globalObject?.${WEVU_SCOPED_SLOT_CREATOR_KEY}`, " ?? _createWevuScopedSlotComponent;");
21307
21328
  if (computedCode) lines.push(`const __wevuComputed = ${computedCode};`);
21308
21329
  if (inlineMapCode) lines.push(`const __wevuInlineMap = ${inlineMapCode};`);
21309
21330
  const overrideParts = [];
@@ -21889,6 +21910,16 @@ function createPickArrayExpression(keys) {
21889
21910
  }))
21890
21911
  };
21891
21912
  }
21913
+ function mergeStableKeys(keys, stableKeys) {
21914
+ const merged = [];
21915
+ const seen = /* @__PURE__ */ new Set();
21916
+ for (const key of [...keys, ...stableKeys]) {
21917
+ if (seen.has(key)) continue;
21918
+ seen.add(key);
21919
+ merged.push(key);
21920
+ }
21921
+ return merged;
21922
+ }
21892
21923
  function mergePickArrayExpression(arrayExpression, keys) {
21893
21924
  const existing = /* @__PURE__ */ new Set();
21894
21925
  for (const element of arrayExpression.elements) if (element && element.type === "StringLiteral") existing.add(element.value);
@@ -22110,11 +22141,16 @@ function collectSetDataPickKeysFromTemplate(template, options) {
22110
22141
  * 在 wevu 组件脚本中注入 setData.pick。
22111
22142
  */
22112
22143
  function injectSetDataPickInJs(source, pickKeys) {
22113
- if (!pickKeys.length) return {
22144
+ const mergedPickKeys = mergeStableKeys(pickKeys, [
22145
+ WEVU_SLOT_NAMES_PROP,
22146
+ WEVU_SLOT_OWNER_ID_PROP,
22147
+ WEVU_SLOT_SCOPE_KEY
22148
+ ]);
22149
+ if (!mergedPickKeys.length) return {
22114
22150
  code: source,
22115
22151
  transformed: false
22116
22152
  };
22117
- return transformTargetWevuOptionsInJs(source, (optionsObject) => injectPickIntoOptionsObject(optionsObject, pickKeys));
22153
+ return transformTargetWevuOptionsInJs(source, (optionsObject) => injectPickIntoOptionsObject(optionsObject, mergedPickKeys));
22118
22154
  }
22119
22155
  /**
22120
22156
  * 在含有 scoped slot outlet 的 wevu 组件脚本中注入宿主内部属性。
@@ -24665,7 +24701,7 @@ async function loadAppEntry(ctx, scanState) {
24665
24701
  const vueAppPath = await findVueEntry(appBasename);
24666
24702
  let configFromVue;
24667
24703
  if (!appConfigFile && vueAppPath) {
24668
- const { extractConfigFromVue } = await import("./file-DJGJe9rY.mjs");
24704
+ const { extractConfigFromVue } = await import("./file-CAsLsVdT.mjs");
24669
24705
  configFromVue = await extractConfigFromVue(vueAppPath);
24670
24706
  if (configFromVue) appConfigFile = vueAppPath;
24671
24707
  }
@@ -0,0 +1,2 @@
1
+ import { t as extractConfigFromVue } from "./file-D5ALdQXr.mjs";
2
+ export { extractConfigFromVue };
@@ -84,7 +84,7 @@ function resolveAutoRoutesMacroImportPath() {
84
84
  }
85
85
  async function resolveAutoRoutesInlineSnapshot() {
86
86
  try {
87
- const { getCompilerContext } = await import("./getInstance-CSoROi2f.mjs");
87
+ const { getCompilerContext } = await import("./getInstance-NP3CPo-d.mjs");
88
88
  const compilerContext = getCompilerContext();
89
89
  const service = compilerContext.autoRoutesService;
90
90
  const reference = service?.getReference?.();
@@ -0,0 +1,2 @@
1
+ import { i as getCompilerContext } from "./createContext-DxZoDRL0.mjs";
2
+ export { getCompilerContext };
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as defineThemeJson, i as defineSitemapJson, n as defineComponentJson, r as definePageJson, t as defineAppJson } from "./json-BL8Dhhk6.mjs";
2
2
  import { a as resolveWeappViteHostMeta, i as isWeappViteHost, n as applyWeappViteHostMeta, r as createWeappViteHostMeta, t as WEAPP_VITE_HOST_NAME } from "./pluginHost--CaeyWpA.mjs";
3
3
  import { t as defineConfig } from "./config-DRGcCi3h.mjs";
4
- import { c as WEB_PLATFORM_ALIASES, d as isWebPlatform, f as resolveWeappViteTarget, l as getSupportedWeappVitePlatforms, t as createCompilerContext, u as getSupportedWeappViteTargetDescriptors } from "./createContext-DvtQaPg3.mjs";
4
+ import { c as WEB_PLATFORM_ALIASES, d as isWebPlatform, f as resolveWeappViteTarget, l as getSupportedWeappVitePlatforms, t as createCompilerContext, u as getSupportedWeappViteTargetDescriptors } from "./createContext-DxZoDRL0.mjs";
5
5
  import { i as createWevuComponent, n as defineProps, r as setPageLayout, t as defineEmits } from "./runtime-C3z9pDQB.mjs";
6
6
  export { WEAPP_VITE_HOST_NAME, WEB_PLATFORM_ALIASES, applyWeappViteHostMeta, createCompilerContext, createWeappViteHostMeta, createWevuComponent, defineAppJson, defineComponentJson, defineConfig, defineEmits, definePageJson, defineProps, defineSitemapJson, defineThemeJson, getSupportedWeappVitePlatforms, getSupportedWeappViteTargetDescriptors, isWeappViteHost, isWebPlatform, resolveWeappViteHostMeta, resolveWeappViteTarget, setPageLayout };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weapp-vite",
3
3
  "type": "module",
4
- "version": "6.16.31",
4
+ "version": "6.16.33",
5
5
  "description": "weapp-vite 一个现代化的小程序打包工具",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -113,7 +113,7 @@
113
113
  "rolldown-plugin-dts": "0.25.2",
114
114
  "semver": "^7.8.1",
115
115
  "typescript": "^6.0.3",
116
- "vite": "8.0.14",
116
+ "vite": "8.0.16",
117
117
  "vite-tsconfig-paths": "^6.1.1",
118
118
  "vue": "^3.5.35",
119
119
  "vue-tsc": "^3.3.3",
@@ -122,7 +122,7 @@
122
122
  "@weapp-core/logger": "3.1.1",
123
123
  "@weapp-core/schematics": "6.0.4",
124
124
  "@weapp-core/shared": "3.0.4",
125
- "@weapp-vite/ast": "6.16.31",
125
+ "@weapp-vite/ast": "6.16.33",
126
126
  "@weapp-vite/mcp": "1.3.6",
127
127
  "@weapp-vite/miniprogram-automator": "1.1.3",
128
128
  "@weapp-vite/volar": "2.1.0",
@@ -132,7 +132,7 @@
132
132
  "rolldown-require": "2.0.18",
133
133
  "vite-plugin-performance": "2.0.1",
134
134
  "weapp-ide-cli": "5.3.2",
135
- "wevu": "6.16.31"
135
+ "wevu": "6.16.33"
136
136
  },
137
137
  "publishConfig": {
138
138
  "access": "public",
@@ -1,2 +0,0 @@
1
- import { t as extractConfigFromVue } from "./file-ULixDCLO.mjs";
2
- export { extractConfigFromVue };
@@ -1,2 +0,0 @@
1
- import { i as getCompilerContext } from "./createContext-DvtQaPg3.mjs";
2
- export { getCompilerContext };