@weapp-vite/web 1.3.10 → 1.3.11
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/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as clearStorage, $t as getSystemInfoSync, A as hideTabBar, At as navigateBack, B as saveFile, Bt as checkSession, C as chooseVideo, Ct as setStorageSync, D as getImageInfo, Dt as getEnterOptionsSync, E as getClipboardData, Et as uploadFile, F as openVideoEditor, Ft as registerComponent, G as setClipboardData, Gt as getBatteryInfoSync, H as saveImageToPhotosAlbum, Ht as getAppAuthorizeSetting, I as previewImage, It as registerPage, J as showModal, Jt as getLocation, K as showActionSheet, Kt as getDeviceInfo, L as previewMedia, Lt as switchTab, M as openCustomerServiceChat, Mt as reLaunch, N as openDocument, Nt as redirectTo, O as getVideoInfo, Ot as getLaunchOptionsSync, P as openLocation, Pt as registerApp, Q as updateShareMenu, Qt as getSystemInfo, R as requestPayment, Rt as setupRpx, S as chooseMessageFile, St as setStorage, T as compressVideo, Tt as stopPullDownRefresh, U as saveVideoToPhotosAlbum, Ut as getAppBaseInfo, V as saveFileToDisk, Vt as getAccountInfoSync, W as scanCode, Wt as getBatteryInfo, X as showTabBar, Xt as getNetworkType, Y as showShareMenu, Yt as getMenuButtonBoundingClientRect, Z as showToast, Zt as getSetting, _ as chooseAddress, _n as setRuntimeWarningOptions, _t as pageScrollTo, a as createRewardedVideoAd, an as offNetworkStatusChange, at as createWorker, b as chooseLocation, bn as injectStyle, bt as removeStorageSync, c as getLogManager, cn as onWindowResize, ct as getFileSystemManager, d as reportAnalytics, dn as vibrateShort, dt as getStorageInfoSync, en as getSystemSetting, et as clearStorageSync, f as setBackgroundColor, fn as setNavigationBarMetrics, ft as getStorageSync, g as showNavigationBarLoading, gn as setRuntimeExecutionMode, gt as nextTick, h as setNavigationBarTitle, hn as getRuntimeExecutionMode, ht as navigateToMiniProgram, i as createInterstitialAd, in as login, it as createVideoContext, j as makePhoneCall, jt as navigateTo, k as hideLoading, kt as initializePageRoutes, l as getUpdateManager, ln as openAppAuthorizeSetting, lt as getStorage, m as setNavigationBarColor, mn as createRenderContext, mt as loadSubPackage, n as renderTemplate, nn as getUserProfile, nt as createSelectorQuery, o as getExtConfig, on as offWindowResize, ot as downloadFile, p as setBackgroundTextStyle, pn as defineComponent, pt as hideKeyboard, q as showLoading, qt as getFuzzyLocation, r as canIUse, rn as getWindowInfo, rt as createVKSession, s as getExtConfigSync, sn as onNetworkStatusChange, st as exitMiniProgram, t as createTemplate, tn as getUserInfo, tt as createCanvasContext, u as hideNavigationBarLoading, un as openSetting, ut as getStorageInfo, v as chooseFile, vn as ensureButtonDefined, vt as preloadSubpackage, w as compressImage, wt as startPullDownRefresh, x as chooseMedia, xn as removeStyle, xt as request, y as chooseImage, yn as setButtonFormConfig, yt as removeStorage, z as requestSubscribeMessage, zt as authorize } from "./runtime-
|
|
2
|
-
import { n as transformWxssToCss, t as weappWebPlugin } from "./plugin-
|
|
1
|
+
import { $ as clearStorage, $t as getSystemInfoSync, A as hideTabBar, At as navigateBack, B as saveFile, Bt as checkSession, C as chooseVideo, Ct as setStorageSync, D as getImageInfo, Dt as getEnterOptionsSync, E as getClipboardData, Et as uploadFile, F as openVideoEditor, Ft as registerComponent, G as setClipboardData, Gt as getBatteryInfoSync, H as saveImageToPhotosAlbum, Ht as getAppAuthorizeSetting, I as previewImage, It as registerPage, J as showModal, Jt as getLocation, K as showActionSheet, Kt as getDeviceInfo, L as previewMedia, Lt as switchTab, M as openCustomerServiceChat, Mt as reLaunch, N as openDocument, Nt as redirectTo, O as getVideoInfo, Ot as getLaunchOptionsSync, P as openLocation, Pt as registerApp, Q as updateShareMenu, Qt as getSystemInfo, R as requestPayment, Rt as setupRpx, S as chooseMessageFile, St as setStorage, T as compressVideo, Tt as stopPullDownRefresh, U as saveVideoToPhotosAlbum, Ut as getAppBaseInfo, V as saveFileToDisk, Vt as getAccountInfoSync, W as scanCode, Wt as getBatteryInfo, X as showTabBar, Xt as getNetworkType, Y as showShareMenu, Yt as getMenuButtonBoundingClientRect, Z as showToast, Zt as getSetting, _ as chooseAddress, _n as setRuntimeWarningOptions, _t as pageScrollTo, a as createRewardedVideoAd, an as offNetworkStatusChange, at as createWorker, b as chooseLocation, bn as injectStyle, bt as removeStorageSync, c as getLogManager, cn as onWindowResize, ct as getFileSystemManager, d as reportAnalytics, dn as vibrateShort, dt as getStorageInfoSync, en as getSystemSetting, et as clearStorageSync, f as setBackgroundColor, fn as setNavigationBarMetrics, ft as getStorageSync, g as showNavigationBarLoading, gn as setRuntimeExecutionMode, gt as nextTick, h as setNavigationBarTitle, hn as getRuntimeExecutionMode, ht as navigateToMiniProgram, i as createInterstitialAd, in as login, it as createVideoContext, j as makePhoneCall, jt as navigateTo, k as hideLoading, kt as initializePageRoutes, l as getUpdateManager, ln as openAppAuthorizeSetting, lt as getStorage, m as setNavigationBarColor, mn as createRenderContext, mt as loadSubPackage, n as renderTemplate, nn as getUserProfile, nt as createSelectorQuery, o as getExtConfig, on as offWindowResize, ot as downloadFile, p as setBackgroundTextStyle, pn as defineComponent, pt as hideKeyboard, q as showLoading, qt as getFuzzyLocation, r as canIUse, rn as getWindowInfo, rt as createVKSession, s as getExtConfigSync, sn as onNetworkStatusChange, st as exitMiniProgram, t as createTemplate, tn as getUserInfo, tt as createCanvasContext, u as hideNavigationBarLoading, un as openSetting, ut as getStorageInfo, v as chooseFile, vn as ensureButtonDefined, vt as preloadSubpackage, w as compressImage, wt as startPullDownRefresh, x as chooseMedia, xn as removeStyle, xt as request, y as chooseImage, yn as setButtonFormConfig, yt as removeStorage, z as requestSubscribeMessage, zt as authorize } from "./runtime-BEbX1tRN.mjs";
|
|
2
|
+
import { n as transformWxssToCss, t as weappWebPlugin } from "./plugin-BARxSPO8.mjs";
|
|
3
3
|
export { authorize, canIUse, checkSession, chooseAddress, chooseFile, chooseImage, chooseLocation, chooseMedia, chooseMessageFile, chooseVideo, clearStorage, clearStorageSync, compressImage, compressVideo, createCanvasContext, createInterstitialAd, createRenderContext, createRewardedVideoAd, createSelectorQuery, createTemplate, createVKSession, createVideoContext, createWorker, defineComponent, downloadFile, ensureButtonDefined, exitMiniProgram, getAccountInfoSync, getAppAuthorizeSetting, getAppBaseInfo, getBatteryInfo, getBatteryInfoSync, getClipboardData, getDeviceInfo, getEnterOptionsSync, getExtConfig, getExtConfigSync, getFileSystemManager, getFuzzyLocation, getImageInfo, getLaunchOptionsSync, getLocation, getLogManager, getMenuButtonBoundingClientRect, getNetworkType, getRuntimeExecutionMode, getSetting, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getSystemSetting, getUpdateManager, getUserInfo, getUserProfile, getVideoInfo, getWindowInfo, hideKeyboard, hideLoading, hideNavigationBarLoading, hideTabBar, initializePageRoutes, injectStyle, loadSubPackage, login, makePhoneCall, navigateBack, navigateTo, navigateToMiniProgram, nextTick, offNetworkStatusChange, offWindowResize, onNetworkStatusChange, onWindowResize, openAppAuthorizeSetting, openCustomerServiceChat, openDocument, openLocation, openSetting, openVideoEditor, pageScrollTo, preloadSubpackage, previewImage, previewMedia, reLaunch, redirectTo, registerApp, registerComponent, registerPage, removeStorage, removeStorageSync, removeStyle, renderTemplate, reportAnalytics, request, requestPayment, requestSubscribeMessage, saveFile, saveFileToDisk, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, setBackgroundColor, setBackgroundTextStyle, setButtonFormConfig, setClipboardData, setNavigationBarColor, setNavigationBarMetrics, setNavigationBarTitle, setRuntimeExecutionMode, setRuntimeWarningOptions, setStorage, setStorageSync, setupRpx, showActionSheet, showLoading, showModal, showNavigationBarLoading, showShareMenu, showTabBar, showToast, startPullDownRefresh, stopPullDownRefresh, switchTab, transformWxssToCss, updateShareMenu, uploadFile, vibrateShort, weappWebPlugin };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { t as slugify } from "./slugify-B4l45KNs.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { dirname, extname, join, normalize, posix, relative, resolve } from "pathe";
|
|
4
|
-
import { readFileSync } from "node:fs";
|
|
4
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import { parseDocument } from "htmlparser2";
|
|
6
|
-
import
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
7
|
import { parse } from "@babel/parser";
|
|
8
8
|
import _babelTraverse from "@babel/traverse";
|
|
9
9
|
import * as t from "@babel/types";
|
|
10
10
|
import MagicString from "magic-string";
|
|
11
|
+
import { fs } from "@weapp-core/shared";
|
|
11
12
|
import { bundleRequire } from "rolldown-require";
|
|
12
13
|
//#region src/css/wxss.ts
|
|
13
14
|
const RPX_RE = /(-?(?:\d+(?:\.\d+)?|\.\d+))rpx/gi;
|
|
@@ -945,6 +946,16 @@ function appendInlineQuery(id) {
|
|
|
945
946
|
function relativeModuleId(root, absPath) {
|
|
946
947
|
return `/${normalizePath(relative(root, absPath))}`;
|
|
947
948
|
}
|
|
949
|
+
function toViteFsImport(absPath) {
|
|
950
|
+
const normalized = normalizePath(absPath);
|
|
951
|
+
return normalized.startsWith("/") ? `/@fs${normalized}` : `/@fs/${normalized}`;
|
|
952
|
+
}
|
|
953
|
+
function resolveRuntimePolyfillPath() {
|
|
954
|
+
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
955
|
+
const candidates = [resolve(currentDir, "./runtime/index.mjs"), resolve(currentDir, "../runtime/polyfill.ts")];
|
|
956
|
+
for (const candidate of candidates) if (existsSync(candidate)) return candidate;
|
|
957
|
+
throw new Error("[@weapp-vite/web] Failed to resolve runtime polyfill path.");
|
|
958
|
+
}
|
|
948
959
|
function resolveImportBase(raw, importer, srcRoot) {
|
|
949
960
|
if (!raw) return;
|
|
950
961
|
if (raw.startsWith(".")) return resolve(dirname(importer), raw);
|
|
@@ -952,10 +963,10 @@ function resolveImportBase(raw, importer, srcRoot) {
|
|
|
952
963
|
return resolve(srcRoot, raw);
|
|
953
964
|
}
|
|
954
965
|
function resolveFileWithExtensionsSync(basePath, extensions) {
|
|
955
|
-
if (extname(basePath) &&
|
|
966
|
+
if (extname(basePath) && existsSync(basePath)) return basePath;
|
|
956
967
|
for (const ext of extensions) {
|
|
957
968
|
const candidate = `${basePath}${ext}`;
|
|
958
|
-
if (
|
|
969
|
+
if (existsSync(candidate)) return candidate;
|
|
959
970
|
}
|
|
960
971
|
}
|
|
961
972
|
function resolveTemplatePathSync(raw, importer, srcRoot) {
|
|
@@ -974,7 +985,7 @@ function resolveWxsPathSync(raw, importer, srcRoot) {
|
|
|
974
985
|
//#endregion
|
|
975
986
|
//#region src/plugin/entry.ts
|
|
976
987
|
function generateEntryModule(result, root, wxssOptions, pluginOptions) {
|
|
977
|
-
const importLines = [`import { initializePageRoutes } from '
|
|
988
|
+
const importLines = [`import { initializePageRoutes } from '${toViteFsImport(resolveRuntimePolyfillPath())}'`];
|
|
978
989
|
const bodyLines = [];
|
|
979
990
|
for (const page of result.pages) importLines.push(`import '${relativeModuleId(root, page.script)}'`);
|
|
980
991
|
for (const component of result.components) importLines.push(`import '${relativeModuleId(root, component.script)}'`);
|
|
@@ -1045,6 +1056,7 @@ function transformScriptModule({ code, cleanId, meta, enableHmr }) {
|
|
|
1045
1056
|
const s = new MagicString(code);
|
|
1046
1057
|
let transformed = false;
|
|
1047
1058
|
const imports = [];
|
|
1059
|
+
const runtimePolyfillId = toViteFsImport(resolveRuntimePolyfillPath());
|
|
1048
1060
|
const templateIdent = meta.templatePath ? "__weapp_template__" : void 0;
|
|
1049
1061
|
const styleIdent = meta.stylePath ? "__weapp_style__" : void 0;
|
|
1050
1062
|
if (meta.templatePath && templateIdent) imports.push(`import ${templateIdent} from '${toRelativeImport(cleanId, meta.templatePath)}'`);
|
|
@@ -1059,7 +1071,7 @@ function transformScriptModule({ code, cleanId, meta, enableHmr }) {
|
|
|
1059
1071
|
}
|
|
1060
1072
|
} });
|
|
1061
1073
|
if (!transformed) return null;
|
|
1062
|
-
if (registerImports.size > 0) imports.unshift(`import { ${Array.from(registerImports).join(", ")} } from '
|
|
1074
|
+
if (registerImports.size > 0) imports.unshift(`import { ${Array.from(registerImports).join(", ")} } from '${runtimePolyfillId}'`);
|
|
1063
1075
|
const prefix = `${imports.join("\n")}\n`;
|
|
1064
1076
|
s.prepend(prefix);
|
|
1065
1077
|
if (enableHmr) s.append(`\nif (import.meta.hot) { import.meta.hot.accept() }\n`);
|
package/dist/plugin.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as weappWebPlugin } from "./plugin-
|
|
1
|
+
import { t as weappWebPlugin } from "./plugin-BARxSPO8.mjs";
|
|
2
2
|
export { weappWebPlugin };
|
package/dist/runtime/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as clearStorage, $t as getSystemInfoSync, A as hideTabBar, At as navigateBack, B as saveFile, Bt as checkSession, C as chooseVideo, Ct as setStorageSync, D as getImageInfo, Dt as getEnterOptionsSync, E as getClipboardData, Et as uploadFile, F as openVideoEditor, Ft as registerComponent, G as setClipboardData, Gt as getBatteryInfoSync, H as saveImageToPhotosAlbum, Ht as getAppAuthorizeSetting, I as previewImage, It as registerPage, J as showModal, Jt as getLocation, K as showActionSheet, Kt as getDeviceInfo, L as previewMedia, Lt as switchTab, M as openCustomerServiceChat, Mt as reLaunch, N as openDocument, Nt as redirectTo, O as getVideoInfo, Ot as getLaunchOptionsSync, P as openLocation, Pt as registerApp, Q as updateShareMenu, Qt as getSystemInfo, R as requestPayment, Rt as setupRpx, S as chooseMessageFile, St as setStorage, T as compressVideo, Tt as stopPullDownRefresh, U as saveVideoToPhotosAlbum, Ut as getAppBaseInfo, V as saveFileToDisk, Vt as getAccountInfoSync, W as scanCode, Wt as getBatteryInfo, X as showTabBar, Xt as getNetworkType, Y as showShareMenu, Yt as getMenuButtonBoundingClientRect, Z as showToast, Zt as getSetting, _ as chooseAddress, _n as setRuntimeWarningOptions, _t as pageScrollTo, a as createRewardedVideoAd, an as offNetworkStatusChange, at as createWorker, b as chooseLocation, bn as injectStyle, bt as removeStorageSync, c as getLogManager, cn as onWindowResize, ct as getFileSystemManager, d as reportAnalytics, dn as vibrateShort, dt as getStorageInfoSync, en as getSystemSetting, et as clearStorageSync, f as setBackgroundColor, fn as setNavigationBarMetrics, ft as getStorageSync, g as showNavigationBarLoading, gn as setRuntimeExecutionMode, gt as nextTick, h as setNavigationBarTitle, hn as getRuntimeExecutionMode, ht as navigateToMiniProgram, i as createInterstitialAd, in as login, it as createVideoContext, j as makePhoneCall, jt as navigateTo, k as hideLoading, kt as initializePageRoutes, l as getUpdateManager, ln as openAppAuthorizeSetting, lt as getStorage, m as setNavigationBarColor, mn as createRenderContext, mt as loadSubPackage, n as renderTemplate, nn as getUserProfile, nt as createSelectorQuery, o as getExtConfig, on as offWindowResize, ot as downloadFile, p as setBackgroundTextStyle, pn as defineComponent, pt as hideKeyboard, q as showLoading, qt as getFuzzyLocation, r as canIUse, rn as getWindowInfo, rt as createVKSession, s as getExtConfigSync, sn as onNetworkStatusChange, st as exitMiniProgram, t as createTemplate, tn as getUserInfo, tt as createCanvasContext, u as hideNavigationBarLoading, un as openSetting, ut as getStorageInfo, v as chooseFile, vn as ensureButtonDefined, vt as preloadSubpackage, w as compressImage, wt as startPullDownRefresh, x as chooseMedia, xn as removeStyle, xt as request, y as chooseImage, yn as setButtonFormConfig, yt as removeStorage, z as requestSubscribeMessage, zt as authorize } from "../runtime-
|
|
1
|
+
import { $ as clearStorage, $t as getSystemInfoSync, A as hideTabBar, At as navigateBack, B as saveFile, Bt as checkSession, C as chooseVideo, Ct as setStorageSync, D as getImageInfo, Dt as getEnterOptionsSync, E as getClipboardData, Et as uploadFile, F as openVideoEditor, Ft as registerComponent, G as setClipboardData, Gt as getBatteryInfoSync, H as saveImageToPhotosAlbum, Ht as getAppAuthorizeSetting, I as previewImage, It as registerPage, J as showModal, Jt as getLocation, K as showActionSheet, Kt as getDeviceInfo, L as previewMedia, Lt as switchTab, M as openCustomerServiceChat, Mt as reLaunch, N as openDocument, Nt as redirectTo, O as getVideoInfo, Ot as getLaunchOptionsSync, P as openLocation, Pt as registerApp, Q as updateShareMenu, Qt as getSystemInfo, R as requestPayment, Rt as setupRpx, S as chooseMessageFile, St as setStorage, T as compressVideo, Tt as stopPullDownRefresh, U as saveVideoToPhotosAlbum, Ut as getAppBaseInfo, V as saveFileToDisk, Vt as getAccountInfoSync, W as scanCode, Wt as getBatteryInfo, X as showTabBar, Xt as getNetworkType, Y as showShareMenu, Yt as getMenuButtonBoundingClientRect, Z as showToast, Zt as getSetting, _ as chooseAddress, _n as setRuntimeWarningOptions, _t as pageScrollTo, a as createRewardedVideoAd, an as offNetworkStatusChange, at as createWorker, b as chooseLocation, bn as injectStyle, bt as removeStorageSync, c as getLogManager, cn as onWindowResize, ct as getFileSystemManager, d as reportAnalytics, dn as vibrateShort, dt as getStorageInfoSync, en as getSystemSetting, et as clearStorageSync, f as setBackgroundColor, fn as setNavigationBarMetrics, ft as getStorageSync, g as showNavigationBarLoading, gn as setRuntimeExecutionMode, gt as nextTick, h as setNavigationBarTitle, hn as getRuntimeExecutionMode, ht as navigateToMiniProgram, i as createInterstitialAd, in as login, it as createVideoContext, j as makePhoneCall, jt as navigateTo, k as hideLoading, kt as initializePageRoutes, l as getUpdateManager, ln as openAppAuthorizeSetting, lt as getStorage, m as setNavigationBarColor, mn as createRenderContext, mt as loadSubPackage, n as renderTemplate, nn as getUserProfile, nt as createSelectorQuery, o as getExtConfig, on as offWindowResize, ot as downloadFile, p as setBackgroundTextStyle, pn as defineComponent, pt as hideKeyboard, q as showLoading, qt as getFuzzyLocation, r as canIUse, rn as getWindowInfo, rt as createVKSession, s as getExtConfigSync, sn as onNetworkStatusChange, st as exitMiniProgram, t as createTemplate, tn as getUserInfo, tt as createCanvasContext, u as hideNavigationBarLoading, un as openSetting, ut as getStorageInfo, v as chooseFile, vn as ensureButtonDefined, vt as preloadSubpackage, w as compressImage, wt as startPullDownRefresh, x as chooseMedia, xn as removeStyle, xt as request, y as chooseImage, yn as setButtonFormConfig, yt as removeStorage, z as requestSubscribeMessage, zt as authorize } from "../runtime-BEbX1tRN.mjs";
|
|
2
2
|
export { authorize, canIUse, checkSession, chooseAddress, chooseFile, chooseImage, chooseLocation, chooseMedia, chooseMessageFile, chooseVideo, clearStorage, clearStorageSync, compressImage, compressVideo, createCanvasContext, createInterstitialAd, createRenderContext, createRewardedVideoAd, createSelectorQuery, createTemplate, createVKSession, createVideoContext, createWorker, defineComponent, downloadFile, ensureButtonDefined, exitMiniProgram, getAccountInfoSync, getAppAuthorizeSetting, getAppBaseInfo, getBatteryInfo, getBatteryInfoSync, getClipboardData, getDeviceInfo, getEnterOptionsSync, getExtConfig, getExtConfigSync, getFileSystemManager, getFuzzyLocation, getImageInfo, getLaunchOptionsSync, getLocation, getLogManager, getMenuButtonBoundingClientRect, getNetworkType, getRuntimeExecutionMode, getSetting, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getSystemSetting, getUpdateManager, getUserInfo, getUserProfile, getVideoInfo, getWindowInfo, hideKeyboard, hideLoading, hideNavigationBarLoading, hideTabBar, initializePageRoutes, injectStyle, loadSubPackage, login, makePhoneCall, navigateBack, navigateTo, navigateToMiniProgram, nextTick, offNetworkStatusChange, offWindowResize, onNetworkStatusChange, onWindowResize, openAppAuthorizeSetting, openCustomerServiceChat, openDocument, openLocation, openSetting, openVideoEditor, pageScrollTo, preloadSubpackage, previewImage, previewMedia, reLaunch, redirectTo, registerApp, registerComponent, registerPage, removeStorage, removeStorageSync, removeStyle, renderTemplate, reportAnalytics, request, requestPayment, requestSubscribeMessage, saveFile, saveFileToDisk, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, setBackgroundColor, setBackgroundTextStyle, setButtonFormConfig, setClipboardData, setNavigationBarColor, setNavigationBarMetrics, setNavigationBarTitle, setRuntimeExecutionMode, setRuntimeWarningOptions, setStorage, setStorageSync, setupRpx, showActionSheet, showLoading, showModal, showNavigationBarLoading, showShareMenu, showTabBar, showToast, startPullDownRefresh, stopPullDownRefresh, switchTab, updateShareMenu, uploadFile, vibrateShort };
|
|
@@ -3995,8 +3995,11 @@ function createFileSystemManagerBridge(callWxAsyncSuccess, callWxAsyncFailure) {
|
|
|
3995
3995
|
const WEB_STORAGE_PREFIX = "__weapp_vite_web_storage__:";
|
|
3996
3996
|
const WEB_STORAGE_LIMIT_SIZE_KB = 10240;
|
|
3997
3997
|
const memoryStorage = /* @__PURE__ */ new Map();
|
|
3998
|
+
function isRuntimeStorageLike(value) {
|
|
3999
|
+
return !!value && typeof value === "object" && typeof value.getItem === "function" && typeof value.setItem === "function" && typeof value.removeItem === "function" && typeof value.key === "function";
|
|
4000
|
+
}
|
|
3998
4001
|
function getRuntimeStorage() {
|
|
3999
|
-
if (typeof localStorage === "undefined") return;
|
|
4002
|
+
if (typeof localStorage === "undefined" || !isRuntimeStorageLike(localStorage)) return;
|
|
4000
4003
|
return localStorage;
|
|
4001
4004
|
}
|
|
4002
4005
|
function storageKeyWithPrefix(key) {
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-vite/web",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.11",
|
|
5
5
|
"description": "Experimental web runtime for weapp-vite templates",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/weapp-vite/weapp-vite.git",
|
|
11
|
-
"directory": "packages/web"
|
|
11
|
+
"directory": "packages-runtime/web"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://github.com/weapp-vite/weapp-vite/issues"
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"@babel/traverse": "^7.29.0",
|
|
53
53
|
"@babel/types": "^7.29.0",
|
|
54
54
|
"domhandler": "^6.0.1",
|
|
55
|
-
"fs-extra": "^11.3.4",
|
|
56
55
|
"htmlparser2": "^12.0.0",
|
|
57
56
|
"lit": "^3.3.1",
|
|
58
57
|
"magic-string": "^0.30.21",
|
|
59
58
|
"pathe": "^2.0.3",
|
|
59
|
+
"@weapp-core/shared": "^3.0.3",
|
|
60
60
|
"rolldown-require": "2.0.12"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|