weapp-vite 7.1.0 → 7.1.2
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 +3 -3
- package/dist/{createContext-CjNVaqAp.mjs → createContext-BYZnlk4j.mjs} +30 -19
- package/dist/file-BRQqRekU.mjs +2 -0
- package/dist/{file-9RDnJeq9.mjs → file-CLo_LdAz.mjs} +1 -1
- package/dist/getInstance-D82nepOm.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/test.mjs +1 -1
- package/package.json +28 -25
- package/dist/file-BS_wmEe4.mjs +0 -2
- package/dist/getInstance-wlc8j1Bg.mjs +0 -2
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as getCompilerContext, y as getRouteRuntimeGlobalKeys } from "./createContext-
|
|
1
|
+
import { n as getCompilerContext, y as getRouteRuntimeGlobalKeys } from "./createContext-BYZnlk4j.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,5 +1,5 @@
|
|
|
1
|
-
import { A as getDefaultIdeProjectRoot, C as collectPreloadPages, D as loadViteConfigFile, E as suggestPreloadRules, M as isPathInside, O as createCjsConfigLoadError, S as getProjectConfigFileName, T as resolvePreloadPackageIdentifier, _ as SHARED_CHUNK_VIRTUAL_PREFIX, a as createGlassEaselAnalyzeResult, b as resolveWeappConfigFile, f as getBackendForCapability, g as createSharedBuildConfig, h as syncManagedTsconfigBootstrapFiles, j as shouldPassPlatformArgToIdeOpen, k as parseCommentJson, m as syncProjectSupportFiles, o as formatBytes, p as resolveBackendExecution, t as createCompilerContext, v as resolveHmrProfileJsonPath, w as findPreloadRuleKey, x as checkRuntime } from "./createContext-
|
|
2
|
-
import { f as VERSION, i as findJsEntry, o as findTemplateEntry, s as findVueEntry } from "./file-
|
|
1
|
+
import { A as getDefaultIdeProjectRoot, C as collectPreloadPages, D as loadViteConfigFile, E as suggestPreloadRules, M as isPathInside, O as createCjsConfigLoadError, S as getProjectConfigFileName, T as resolvePreloadPackageIdentifier, _ as SHARED_CHUNK_VIRTUAL_PREFIX, a as createGlassEaselAnalyzeResult, b as resolveWeappConfigFile, f as getBackendForCapability, g as createSharedBuildConfig, h as syncManagedTsconfigBootstrapFiles, j as shouldPassPlatformArgToIdeOpen, k as parseCommentJson, m as syncProjectSupportFiles, o as formatBytes, p as resolveBackendExecution, t as createCompilerContext, v as resolveHmrProfileJsonPath, w as findPreloadRuleKey, x as checkRuntime } from "./createContext-BYZnlk4j.mjs";
|
|
2
|
+
import { f as VERSION, i as findJsEntry, o as findTemplateEntry, s as findVueEntry } from "./file-CLo_LdAz.mjs";
|
|
3
3
|
import { r as logger_default, t as colors } from "./logger-mt4mSTqV.mjs";
|
|
4
4
|
import { c as startWeappViteMcpServer, l as detectAiDevelopmentEnvironment, s as resolveWeappMcpConfig } from "./mcp-BG6TliEg.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
@@ -5062,7 +5062,7 @@ function resolveRunnableHotkeyDefinition(input) {
|
|
|
5062
5062
|
}
|
|
5063
5063
|
//#endregion
|
|
5064
5064
|
//#region package.json
|
|
5065
|
-
var version = "7.1.
|
|
5065
|
+
var version = "7.1.2";
|
|
5066
5066
|
//#endregion
|
|
5067
5067
|
//#region src/cli/devHotkeys/format.ts
|
|
5068
5068
|
const FULLWIDTH_ASCII_START = 65281;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as applyWeappViteHostMeta } from "./pluginHost--CaeyWpA.mjs";
|
|
2
|
-
import { E as MINI_PROGRAM_PLATFORM_ADAPTERS, _ as templateExtensions, a as findJsonEntry, b as isNativeTemplateSource, c as isJsOrTs, d as touch, g as supportedCssLangs, h as scriptExtensions, i as findJsEntry, l as isTemplate, m as jsExtensions, n as changeFileExtension, o as findTemplateEntry, p as configExtensions, r as findCssEntry, s as findVueEntry, t as extractConfigFromVue, v as vueExtensions, w as inlineAutoRoutesImports, x as isSourceStyleExtension, y as ALL_NATIVE_STYLE_RESOLVER_EXTENSIONS } from "./file-
|
|
2
|
+
import { E as MINI_PROGRAM_PLATFORM_ADAPTERS, _ as templateExtensions, a as findJsonEntry, b as isNativeTemplateSource, c as isJsOrTs, d as touch, g as supportedCssLangs, h as scriptExtensions, i as findJsEntry, l as isTemplate, m as jsExtensions, n as changeFileExtension, o as findTemplateEntry, p as configExtensions, r as findCssEntry, s as findVueEntry, t as extractConfigFromVue, v as vueExtensions, w as inlineAutoRoutesImports, x as isSourceStyleExtension, y as ALL_NATIVE_STYLE_RESOLVER_EXTENSIONS } from "./file-CLo_LdAz.mjs";
|
|
3
3
|
import { n as configureLogger, r as logger_default } from "./logger-mt4mSTqV.mjs";
|
|
4
4
|
import { createRequire, isBuiltin } from "node:module";
|
|
5
5
|
import { createDebug } from "obug";
|
|
@@ -19520,7 +19520,7 @@ function scanWxml(wxml, options) {
|
|
|
19520
19520
|
return token;
|
|
19521
19521
|
}
|
|
19522
19522
|
//#endregion
|
|
19523
|
-
//#region src/runtime/tsconfigSupport/
|
|
19523
|
+
//#region src/runtime/tsconfigSupport/jsxSources.ts
|
|
19524
19524
|
const WEVU_JSX_IMPORT_SOURCES = /* @__PURE__ */ new Set([
|
|
19525
19525
|
"wevu",
|
|
19526
19526
|
"wevu/alipay",
|
|
@@ -19528,6 +19528,27 @@ const WEVU_JSX_IMPORT_SOURCES = /* @__PURE__ */ new Set([
|
|
|
19528
19528
|
"wevu/tt",
|
|
19529
19529
|
"wevu/weapp"
|
|
19530
19530
|
]);
|
|
19531
|
+
const JSX_RUNTIME_SUFFIX = "/jsx-runtime";
|
|
19532
|
+
function resolveWevuJsxImportSource(platform) {
|
|
19533
|
+
switch (platform) {
|
|
19534
|
+
case void 0:
|
|
19535
|
+
case "weapp": return "wevu/weapp";
|
|
19536
|
+
case "alipay": return "wevu/alipay";
|
|
19537
|
+
case "tt": return "wevu/tt";
|
|
19538
|
+
default: return "wevu";
|
|
19539
|
+
}
|
|
19540
|
+
}
|
|
19541
|
+
function isWevuJsxImportSource(value) {
|
|
19542
|
+
return Boolean(value && WEVU_JSX_IMPORT_SOURCES.has(value));
|
|
19543
|
+
}
|
|
19544
|
+
/**
|
|
19545
|
+
* `compilerOptions.types` 只按类型包目录解析,不能指向 Wevu JSX 子路径。
|
|
19546
|
+
*/
|
|
19547
|
+
function isWevuJsxRuntimeTypePackage(value) {
|
|
19548
|
+
return Boolean(value?.endsWith(JSX_RUNTIME_SUFFIX) && isWevuJsxImportSource(value.slice(0, -12)));
|
|
19549
|
+
}
|
|
19550
|
+
//#endregion
|
|
19551
|
+
//#region src/runtime/tsconfigSupport/shared.ts
|
|
19531
19552
|
const DEFAULT_APP_EXTRA_INCLUDE = [
|
|
19532
19553
|
"../types/**/*.d.ts",
|
|
19533
19554
|
"../env.d.ts",
|
|
@@ -19555,18 +19576,6 @@ const TRAILING_SLASH_PATTERN = /\/+$/;
|
|
|
19555
19576
|
function hasDependency(packageJson, name) {
|
|
19556
19577
|
return Boolean(packageJson?.dependencies?.[name] || packageJson?.devDependencies?.[name] || packageJson?.peerDependencies?.[name]);
|
|
19557
19578
|
}
|
|
19558
|
-
function resolveWevuJsxImportSource(platform) {
|
|
19559
|
-
switch (platform) {
|
|
19560
|
-
case void 0:
|
|
19561
|
-
case "weapp": return "wevu/weapp";
|
|
19562
|
-
case "alipay": return "wevu/alipay";
|
|
19563
|
-
case "tt": return "wevu/tt";
|
|
19564
|
-
default: return "wevu";
|
|
19565
|
-
}
|
|
19566
|
-
}
|
|
19567
|
-
function isWevuJsxImportSource(value) {
|
|
19568
|
-
return Boolean(value && WEVU_JSX_IMPORT_SOURCES.has(value));
|
|
19569
|
-
}
|
|
19570
19579
|
function unique$1(values) {
|
|
19571
19580
|
return [...new Set(values)];
|
|
19572
19581
|
}
|
|
@@ -19645,11 +19654,9 @@ function getAppTypes(ctx, legacyConfig) {
|
|
|
19645
19654
|
const userTypes = getManagedTypeScriptConfig(ctx)?.app?.compilerOptions?.types;
|
|
19646
19655
|
const legacyTypes = legacyConfig?.app?.compilerOptions?.types;
|
|
19647
19656
|
const types = [getPlatformAppTypesPackage(config.platform), "weapp-vite/client"];
|
|
19648
|
-
const jsxImportSource = resolveAppWevuJsxImportSource(ctx, legacyConfig);
|
|
19649
|
-
if (isWevuJsxImportSource(jsxImportSource)) types.push(`${jsxImportSource}/jsx-runtime`);
|
|
19650
19657
|
if (Array.isArray(legacyTypes) && legacyTypes.length > 0) types.push(...legacyTypes);
|
|
19651
19658
|
if (Array.isArray(userTypes) && userTypes.length > 0) types.push(...userTypes);
|
|
19652
|
-
return unique$1(types);
|
|
19659
|
+
return unique$1(types).filter((type) => !isWevuJsxRuntimeTypePackage(type));
|
|
19653
19660
|
}
|
|
19654
19661
|
function getAppPaths(ctx, legacyConfig) {
|
|
19655
19662
|
const configService = requireConfigService(ctx, "生成 app paths 前必须初始化 configService。");
|
|
@@ -33503,7 +33510,11 @@ function createCoreLifecyclePlugin(state) {
|
|
|
33503
33510
|
const REQUIRE_ANALYSIS_FILTER_RE = /\.[jt]s$/;
|
|
33504
33511
|
const URL_SUFFIX_RE = /[?#].*$/;
|
|
33505
33512
|
const REQUIRE_ASYNC_TARGET_MARKER_PREFIX = "__weapp_vite_require_async_target__";
|
|
33506
|
-
const REQUIRE_ASYNC_TARGET_MARKER_RE = new RegExp(
|
|
33513
|
+
const REQUIRE_ASYNC_TARGET_MARKER_RE = new RegExp([
|
|
33514
|
+
`\\brequire\\s*\\.\\s*async\\(\\s*([${String.fromCharCode(39, 34, 96)}])`,
|
|
33515
|
+
REQUIRE_ASYNC_TARGET_MARKER_PREFIX,
|
|
33516
|
+
"([\\w-]+)\\1\\s*\\)"
|
|
33517
|
+
].join(""), "g");
|
|
33507
33518
|
function cleanModuleId(id) {
|
|
33508
33519
|
return id.replace(URL_SUFFIX_RE, "");
|
|
33509
33520
|
}
|
|
@@ -38435,7 +38446,7 @@ async function loadAppEntry(ctx, scanState) {
|
|
|
38435
38446
|
const { path: appEntryPath } = appEntry;
|
|
38436
38447
|
let configFromVue;
|
|
38437
38448
|
if (!appConfigFile && vueAppPath) {
|
|
38438
|
-
const { extractConfigFromVue } = await import("./file-
|
|
38449
|
+
const { extractConfigFromVue } = await import("./file-BRQqRekU.mjs");
|
|
38439
38450
|
configFromVue = await extractConfigFromVue(vueAppPath);
|
|
38440
38451
|
if (configFromVue) appConfigFile = vueAppPath;
|
|
38441
38452
|
}
|
|
@@ -54,7 +54,7 @@ function resolveAutoRoutesMacroImportPath() {
|
|
|
54
54
|
}
|
|
55
55
|
async function resolveAutoRoutesInlineSnapshot() {
|
|
56
56
|
try {
|
|
57
|
-
const { getCompilerContext } = await import("./getInstance-
|
|
57
|
+
const { getCompilerContext } = await import("./getInstance-D82nepOm.mjs");
|
|
58
58
|
const compilerContext = getCompilerContext();
|
|
59
59
|
const service = compilerContext.autoRoutesService;
|
|
60
60
|
const reference = service?.getReference?.();
|
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 getSupportedWeappVitePlatforms, d as resolveWeappViteTarget, l as getSupportedWeappViteTargetDescriptors, s as WEB_PLATFORM_ALIASES, t as createCompilerContext, u as isWebPlatform } from "./createContext-
|
|
4
|
+
import { c as getSupportedWeappVitePlatforms, d as resolveWeappViteTarget, l as getSupportedWeappViteTargetDescriptors, s as WEB_PLATFORM_ALIASES, t as createCompilerContext, u as isWebPlatform } from "./createContext-BYZnlk4j.mjs";
|
|
5
5
|
import { a as resolveLayoutHost, c as createWevuComponent, i as registerLayoutHosts, n as defineProps, o as unregisterLayoutHosts, r as setPageLayout, s as waitForLayoutHost, t as defineEmits } from "./runtime-D6VCNhNY.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, registerLayoutHosts, resolveLayoutHost, resolveWeappViteHostMeta, resolveWeappViteTarget, setPageLayout, unregisterLayoutHosts, waitForLayoutHost };
|
package/dist/test.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.1.
|
|
4
|
+
"version": "7.1.2",
|
|
5
5
|
"description": "weapp-vite 一个现代化的小程序打包工具",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -15,13 +15,16 @@
|
|
|
15
15
|
"url": "https://github.com/weapp-vite/weapp-vite/issues"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
|
+
"weapp-vite",
|
|
18
19
|
"weapp",
|
|
20
|
+
"wechat",
|
|
21
|
+
"mini-program",
|
|
22
|
+
"miniprogram",
|
|
19
23
|
"vite",
|
|
20
24
|
"ts",
|
|
21
25
|
"wxml",
|
|
22
26
|
"wxss",
|
|
23
27
|
"mp",
|
|
24
|
-
"miniprogram",
|
|
25
28
|
"scss"
|
|
26
29
|
],
|
|
27
30
|
"exports": {
|
|
@@ -114,26 +117,26 @@
|
|
|
114
117
|
"registry": "https://registry.npmjs.org"
|
|
115
118
|
},
|
|
116
119
|
"dependencies": {
|
|
117
|
-
"@babel/preset-env": "^8.0.
|
|
120
|
+
"@babel/preset-env": "^8.0.5",
|
|
118
121
|
"@babel/preset-typescript": "^8.0.1",
|
|
119
122
|
"@jridgewell/remapping": "^2.3.5",
|
|
120
123
|
"@vercel/detect-agent": "^1.2.5",
|
|
121
124
|
"@volar/typescript": "^2.4.28",
|
|
122
125
|
"@vue/language-core": "^3.3.11",
|
|
123
|
-
"@weapp-core/constants": "0.2.
|
|
124
|
-
"@weapp-core/init": "6.0.
|
|
125
|
-
"@weapp-core/logger": "3.1.
|
|
126
|
-
"@weapp-core/schematics": "6.2.
|
|
127
|
-
"@weapp-core/shared": "3.2.
|
|
128
|
-
"@weapp-vite/ast": "7.1.
|
|
129
|
-
"@weapp-vite/eslint": "0.2.
|
|
130
|
-
"@weapp-vite/i18n": "0.2.
|
|
131
|
-
"@weapp-vite/mcp": "1.5.
|
|
132
|
-
"@weapp-vite/miniprogram-automator": "1.2.
|
|
133
|
-
"@weapp-vite/volar": "2.1.
|
|
134
|
-
"@weapp-vite/web": "1.5.
|
|
135
|
-
"@wevu/api": "0.3.
|
|
136
|
-
"@wevu/web-apis": "1.2.
|
|
126
|
+
"@weapp-core/constants": "0.2.3",
|
|
127
|
+
"@weapp-core/init": "6.0.19",
|
|
128
|
+
"@weapp-core/logger": "3.1.3",
|
|
129
|
+
"@weapp-core/schematics": "6.2.3",
|
|
130
|
+
"@weapp-core/shared": "3.2.2",
|
|
131
|
+
"@weapp-vite/ast": "7.1.2",
|
|
132
|
+
"@weapp-vite/eslint": "0.2.4",
|
|
133
|
+
"@weapp-vite/i18n": "0.2.3",
|
|
134
|
+
"@weapp-vite/mcp": "1.5.3",
|
|
135
|
+
"@weapp-vite/miniprogram-automator": "1.2.18",
|
|
136
|
+
"@weapp-vite/volar": "2.1.7",
|
|
137
|
+
"@weapp-vite/web": "1.5.2",
|
|
138
|
+
"@wevu/api": "0.3.2",
|
|
139
|
+
"@wevu/web-apis": "1.2.42",
|
|
137
140
|
"cac": "^7.0.0",
|
|
138
141
|
"chokidar": "^5.0.0",
|
|
139
142
|
"comment-json": "^5.0.0",
|
|
@@ -141,9 +144,9 @@
|
|
|
141
144
|
"htmlparser2": "^12.0.0",
|
|
142
145
|
"local-pkg": "^1.2.1",
|
|
143
146
|
"lru-cache": "^11.5.2",
|
|
144
|
-
"magic-string": "^1.
|
|
147
|
+
"magic-string": "^1.3.1",
|
|
145
148
|
"merge": "^2.1.1",
|
|
146
|
-
"obug": "^
|
|
149
|
+
"obug": "^3.0.0",
|
|
147
150
|
"p-queue": "^9.3.3",
|
|
148
151
|
"package-manager-detector": "^1.8.0",
|
|
149
152
|
"pathe": "^2.0.3",
|
|
@@ -152,17 +155,17 @@
|
|
|
152
155
|
"postcss-value-parser": "4.2.0",
|
|
153
156
|
"rolldown": "1.2.8",
|
|
154
157
|
"rolldown-plugin-dts": "0.28.5",
|
|
155
|
-
"rolldown-require": "2.0.
|
|
158
|
+
"rolldown-require": "2.0.29",
|
|
156
159
|
"semver": "^7.8.5",
|
|
157
160
|
"typescript": "^6.0.3",
|
|
158
|
-
"vite": "8.
|
|
159
|
-
"vite-plugin-performance": "2.0.
|
|
161
|
+
"vite": "8.3.0",
|
|
162
|
+
"vite-plugin-performance": "2.0.2",
|
|
160
163
|
"vite-tsconfig-paths": "^6.1.1",
|
|
161
164
|
"vue": "^3.5.42",
|
|
162
165
|
"vue-tsc": "^3.3.11",
|
|
163
|
-
"weapp-ide-cli": "6.1.
|
|
164
|
-
"weapp-tailwindcss": "^5.5.
|
|
165
|
-
"wevu": "7.1.
|
|
166
|
+
"weapp-ide-cli": "6.1.4",
|
|
167
|
+
"weapp-tailwindcss": "^5.5.4",
|
|
168
|
+
"wevu": "7.1.2"
|
|
166
169
|
},
|
|
167
170
|
"optionalDependencies": {
|
|
168
171
|
"@swc/core": "^1.16.2"
|
package/dist/file-BS_wmEe4.mjs
DELETED