@weapp-vite/web 1.3.37 → 1.4.0
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/README.md +144 -5
- package/dist/_virtual/_rolldown/runtime.mjs +19 -1
- package/dist/compiler/wxml/attributes.mjs +1 -1
- package/dist/compiler/wxml/attributes.mjs.map +1 -1
- package/dist/compiler/wxml/compile.mjs +6 -3
- package/dist/compiler/wxml/compile.mjs.map +1 -1
- package/dist/compiler/wxml/interpolation.mjs +1 -2
- package/dist/compiler/wxml/interpolation.mjs.map +1 -1
- package/dist/compiler/wxml/navigation.mjs +5 -7
- package/dist/compiler/wxml/navigation.mjs.map +1 -1
- package/dist/compiler/wxml/parser.mjs +5 -5
- package/dist/compiler/wxml/parser.mjs.map +1 -1
- package/dist/compiler/wxml/renderer.mjs +13 -12
- package/dist/compiler/wxml/renderer.mjs.map +1 -1
- package/dist/compiler/wxml/specialNodes.mjs +6 -1
- package/dist/compiler/wxml/specialNodes.mjs.map +1 -1
- package/dist/compiler/wxml/types.d.mts +12 -0
- package/dist/compiler/wxs.mjs +5 -5
- package/dist/compiler/wxs.mjs.map +1 -1
- package/dist/css/wxss.d.mts +1 -0
- package/dist/css/wxss.mjs +110 -9
- package/dist/css/wxss.mjs.map +1 -1
- package/dist/index.d.mts +29 -6
- package/dist/index.mjs +197 -4
- package/dist/index.mjs.map +1 -0
- package/dist/plugin/assets.d.mts +7 -0
- package/dist/plugin/assets.mjs +122 -0
- package/dist/plugin/assets.mjs.map +1 -0
- package/dist/plugin/constants.mjs +10 -1
- package/dist/plugin/constants.mjs.map +1 -1
- package/dist/plugin/dependencyScan.mjs +41 -0
- package/dist/plugin/dependencyScan.mjs.map +1 -0
- package/dist/plugin/entry.mjs +55 -6
- package/dist/plugin/entry.mjs.map +1 -1
- package/dist/plugin/files.mjs +1 -1
- package/dist/plugin/files.mjs.map +1 -1
- package/dist/plugin/index.d.mts +37 -3
- package/dist/plugin/index.mjs +240 -73
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/layout.mjs +24 -0
- package/dist/plugin/layout.mjs.map +1 -0
- package/dist/plugin/path.mjs +4 -1
- package/dist/plugin/path.mjs.map +1 -1
- package/dist/plugin/register.mjs +45 -33
- package/dist/plugin/register.mjs.map +1 -1
- package/dist/plugin/scan.mjs +206 -94
- package/dist/plugin/scan.mjs.map +1 -1
- package/dist/plugin/scanSfc.mjs +65 -0
- package/dist/plugin/scanSfc.mjs.map +1 -0
- package/dist/plugin/state.mjs +3 -2
- package/dist/plugin/state.mjs.map +1 -1
- package/dist/plugin/styleModule.mjs +52 -0
- package/dist/plugin/styleModule.mjs.map +1 -0
- package/dist/plugin/types.d.mts +37 -1
- package/dist/plugin/vueSfc.mjs +149 -0
- package/dist/plugin/vueSfc.mjs.map +1 -0
- package/dist/runtime/appShell/container.mjs +25 -0
- package/dist/runtime/appShell/container.mjs.map +1 -0
- package/dist/runtime/appShell/tabBar/index.mjs +192 -0
- package/dist/runtime/appShell/tabBar/index.mjs.map +1 -0
- package/dist/runtime/appShell/tabBar/style.mjs +127 -0
- package/dist/runtime/appShell/tabBar/style.mjs.map +1 -0
- package/dist/runtime/button/helpers.mjs +1 -58
- package/dist/runtime/button/helpers.mjs.map +1 -1
- package/dist/runtime/button/index.d.mts +4 -5
- package/dist/runtime/button/index.mjs +6 -28
- package/dist/runtime/button/index.mjs.map +1 -1
- package/dist/runtime/button/style.mjs +53 -28
- package/dist/runtime/button/style.mjs.map +1 -1
- package/dist/runtime/component/behavior.mjs +26 -2
- package/dist/runtime/component/behavior.mjs.map +1 -1
- package/dist/runtime/component/element.mjs +107 -31
- package/dist/runtime/component/element.mjs.map +1 -1
- package/dist/runtime/component/observers.mjs +36 -0
- package/dist/runtime/component/observers.mjs.map +1 -0
- package/dist/runtime/component/publicInstance.mjs +48 -0
- package/dist/runtime/component/publicInstance.mjs.map +1 -0
- package/dist/runtime/component/relations.mjs +35 -0
- package/dist/runtime/component/relations.mjs.map +1 -0
- package/dist/runtime/component/slots.mjs +24 -0
- package/dist/runtime/component/slots.mjs.map +1 -0
- package/dist/runtime/component/state.mjs +13 -3
- package/dist/runtime/component/state.mjs.map +1 -1
- package/dist/runtime/component/types.d.mts +29 -4
- package/dist/runtime/component/virtualHost.mjs +83 -0
- package/dist/runtime/component/virtualHost.mjs.map +1 -0
- package/dist/runtime/host/index.d.mts +13 -0
- package/dist/runtime/host/index.mjs +47 -0
- package/dist/runtime/host/index.mjs.map +1 -0
- package/dist/runtime/host/types.d.mts +28 -0
- package/dist/runtime/hostGlobals.d.mts +9 -0
- package/dist/runtime/hostGlobals.mjs +39 -0
- package/dist/runtime/hostGlobals.mjs.map +1 -0
- package/dist/runtime/index.d.mts +21 -3
- package/dist/runtime/index.mjs +26 -4
- package/dist/runtime/index.mjs.map +1 -0
- package/dist/runtime/legacyTemplate/dom.mjs +3 -3
- package/dist/runtime/legacyTemplate/dom.mjs.map +1 -1
- package/dist/runtime/legacyTemplate/expression.mjs +9 -9
- package/dist/runtime/legacyTemplate/expression.mjs.map +1 -1
- package/dist/runtime/legacyTemplate/index.mjs +6 -6
- package/dist/runtime/legacyTemplate/index.mjs.map +1 -1
- package/dist/runtime/nativeComponents/canvas/index.mjs +53 -0
- package/dist/runtime/nativeComponents/canvas/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/checkbox.mjs +137 -0
- package/dist/runtime/nativeComponents/checkbox.mjs.map +1 -0
- package/dist/runtime/nativeComponents/cover/index.mjs +23 -0
- package/dist/runtime/nativeComponents/cover/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/form.d.mts +7 -0
- package/dist/runtime/nativeComponents/form.mjs +50 -0
- package/dist/runtime/nativeComponents/form.mjs.map +1 -0
- package/dist/runtime/nativeComponents/formControl.mjs +61 -0
- package/dist/runtime/nativeComponents/formControl.mjs.map +1 -0
- package/dist/runtime/nativeComponents/helpers.mjs +25 -0
- package/dist/runtime/nativeComponents/helpers.mjs.map +1 -0
- package/dist/runtime/nativeComponents/icon/helpers.mjs +42 -0
- package/dist/runtime/nativeComponents/icon/helpers.mjs.map +1 -0
- package/dist/runtime/nativeComponents/icon/index.mjs +45 -0
- package/dist/runtime/nativeComponents/icon/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/icon/style.mjs +176 -0
- package/dist/runtime/nativeComponents/icon/style.mjs.map +1 -0
- package/dist/runtime/nativeComponents/image.d.mts +8 -0
- package/dist/runtime/nativeComponents/image.mjs +121 -0
- package/dist/runtime/nativeComponents/image.mjs.map +1 -0
- package/dist/runtime/nativeComponents/index.d.mts +11 -0
- package/dist/runtime/nativeComponents/index.mjs +83 -0
- package/dist/runtime/nativeComponents/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/input.d.mts +8 -0
- package/dist/runtime/nativeComponents/input.mjs +131 -0
- package/dist/runtime/nativeComponents/input.mjs.map +1 -0
- package/dist/runtime/nativeComponents/label.mjs +36 -0
- package/dist/runtime/nativeComponents/label.mjs.map +1 -0
- package/dist/runtime/nativeComponents/mediaRegistry.mjs +47 -0
- package/dist/runtime/nativeComponents/mediaRegistry.mjs.map +1 -0
- package/dist/runtime/nativeComponents/movable/helpers.mjs +23 -0
- package/dist/runtime/nativeComponents/movable/helpers.mjs.map +1 -0
- package/dist/runtime/nativeComponents/movable/index.mjs +117 -0
- package/dist/runtime/nativeComponents/movable/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/navigator.mjs +200 -0
- package/dist/runtime/nativeComponents/navigator.mjs.map +1 -0
- package/dist/runtime/nativeComponents/picker/editors.mjs +74 -0
- package/dist/runtime/nativeComponents/picker/editors.mjs.map +1 -0
- package/dist/runtime/nativeComponents/picker/helpers.mjs +57 -0
- package/dist/runtime/nativeComponents/picker/helpers.mjs.map +1 -0
- package/dist/runtime/nativeComponents/picker/index.mjs +210 -0
- package/dist/runtime/nativeComponents/picker/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/picker/style.mjs +71 -0
- package/dist/runtime/nativeComponents/picker/style.mjs.map +1 -0
- package/dist/runtime/nativeComponents/pickerView/column.mjs +134 -0
- package/dist/runtime/nativeComponents/pickerView/column.mjs.map +1 -0
- package/dist/runtime/nativeComponents/pickerView/helpers.mjs +17 -0
- package/dist/runtime/nativeComponents/pickerView/helpers.mjs.map +1 -0
- package/dist/runtime/nativeComponents/pickerView/index.mjs +128 -0
- package/dist/runtime/nativeComponents/pickerView/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/pickerView/style.mjs +58 -0
- package/dist/runtime/nativeComponents/pickerView/style.mjs.map +1 -0
- package/dist/runtime/nativeComponents/primitives.mjs +16 -0
- package/dist/runtime/nativeComponents/primitives.mjs.map +1 -0
- package/dist/runtime/nativeComponents/progress/helpers.mjs +29 -0
- package/dist/runtime/nativeComponents/progress/helpers.mjs.map +1 -0
- package/dist/runtime/nativeComponents/progress/index.mjs +130 -0
- package/dist/runtime/nativeComponents/progress/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/progress/style.mjs +40 -0
- package/dist/runtime/nativeComponents/progress/style.mjs.map +1 -0
- package/dist/runtime/nativeComponents/radio.mjs +147 -0
- package/dist/runtime/nativeComponents/radio.mjs.map +1 -0
- package/dist/runtime/nativeComponents/richText/helpers.mjs +230 -0
- package/dist/runtime/nativeComponents/richText/helpers.mjs.map +1 -0
- package/dist/runtime/nativeComponents/richText/index.mjs +74 -0
- package/dist/runtime/nativeComponents/richText/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/scrollView.d.mts +15 -0
- package/dist/runtime/nativeComponents/scrollView.mjs +79 -0
- package/dist/runtime/nativeComponents/scrollView.mjs.map +1 -0
- package/dist/runtime/nativeComponents/slider/helpers.mjs +28 -0
- package/dist/runtime/nativeComponents/slider/helpers.mjs.map +1 -0
- package/dist/runtime/nativeComponents/slider/index.mjs +120 -0
- package/dist/runtime/nativeComponents/slider/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/slider/style.mjs +60 -0
- package/dist/runtime/nativeComponents/slider/style.mjs.map +1 -0
- package/dist/runtime/nativeComponents/style.mjs +41 -0
- package/dist/runtime/nativeComponents/style.mjs.map +1 -0
- package/dist/runtime/nativeComponents/swiper/helpers.mjs +52 -0
- package/dist/runtime/nativeComponents/swiper/helpers.mjs.map +1 -0
- package/dist/runtime/nativeComponents/swiper/index.mjs +235 -0
- package/dist/runtime/nativeComponents/swiper/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/swiper/item.mjs +14 -0
- package/dist/runtime/nativeComponents/swiper/item.mjs.map +1 -0
- package/dist/runtime/nativeComponents/swiper/style.mjs +20 -0
- package/dist/runtime/nativeComponents/swiper/style.mjs.map +1 -0
- package/dist/runtime/nativeComponents/switch.d.mts +7 -0
- package/dist/runtime/nativeComponents/switch.mjs +132 -0
- package/dist/runtime/nativeComponents/switch.mjs.map +1 -0
- package/dist/runtime/nativeComponents/textarea.d.mts +9 -0
- package/dist/runtime/nativeComponents/textarea.mjs +144 -0
- package/dist/runtime/nativeComponents/textarea.mjs.map +1 -0
- package/dist/runtime/nativeComponents/video/helpers.d.mts +12 -0
- package/dist/runtime/nativeComponents/video/helpers.mjs +21 -0
- package/dist/runtime/nativeComponents/video/helpers.mjs.map +1 -0
- package/dist/runtime/nativeComponents/video/index.mjs +124 -0
- package/dist/runtime/nativeComponents/video/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/video/style.mjs +14 -0
- package/dist/runtime/nativeComponents/video/style.mjs.map +1 -0
- package/dist/runtime/navigationBar/index.mjs +1 -3
- package/dist/runtime/navigationBar/index.mjs.map +1 -1
- package/dist/runtime/pageLayout.d.mts +9 -0
- package/dist/runtime/pageLayout.mjs +16 -0
- package/dist/runtime/pageLayout.mjs.map +1 -0
- package/dist/runtime/polyfill/animation.mjs +120 -0
- package/dist/runtime/polyfill/animation.mjs.map +1 -0
- package/dist/runtime/polyfill/appState.mjs +1 -1
- package/dist/runtime/polyfill/appState.mjs.map +1 -1
- package/dist/runtime/polyfill/async.d.mts +7 -0
- package/dist/runtime/polyfill/async.mjs.map +1 -1
- package/dist/runtime/polyfill/canvasContext.mjs +41 -0
- package/dist/runtime/polyfill/canvasContext.mjs.map +1 -1
- package/dist/runtime/polyfill/device.mjs +1 -1
- package/dist/runtime/polyfill/device.mjs.map +1 -1
- package/dist/runtime/polyfill/deviceAuthSystemApi.mjs +8 -2
- package/dist/runtime/polyfill/deviceAuthSystemApi.mjs.map +1 -1
- package/dist/runtime/polyfill/eventBus.mjs +56 -0
- package/dist/runtime/polyfill/eventBus.mjs.map +1 -0
- package/dist/runtime/polyfill/fileSystemManager.mjs +5 -2
- package/dist/runtime/polyfill/fileSystemManager.mjs.map +1 -1
- package/dist/runtime/polyfill/files.mjs +10 -10
- package/dist/runtime/polyfill/files.mjs.map +1 -1
- package/dist/runtime/polyfill/font.mjs +32 -0
- package/dist/runtime/polyfill/font.mjs.map +1 -0
- package/dist/runtime/polyfill/index.d.mts +2 -2
- package/dist/runtime/polyfill/index.mjs +49 -45
- package/dist/runtime/polyfill/index.mjs.map +1 -1
- package/dist/runtime/polyfill/interaction.mjs +7 -6
- package/dist/runtime/polyfill/interaction.mjs.map +1 -1
- package/dist/runtime/polyfill/interactionApi.mjs +3 -2
- package/dist/runtime/polyfill/interactionApi.mjs.map +1 -1
- package/dist/runtime/polyfill/intersectionObserver.mjs +106 -0
- package/dist/runtime/polyfill/intersectionObserver.mjs.map +1 -0
- package/dist/runtime/polyfill/locale.mjs +14 -0
- package/dist/runtime/polyfill/locale.mjs.map +1 -0
- package/dist/runtime/polyfill/locationApi.mjs +7 -4
- package/dist/runtime/polyfill/locationApi.mjs.map +1 -1
- package/dist/runtime/polyfill/mediaActions.mjs +2 -2
- package/dist/runtime/polyfill/mediaActions.mjs.map +1 -1
- package/dist/runtime/polyfill/mediaApi/file.mjs +1 -1
- package/dist/runtime/polyfill/mediaApi/info.mjs +6 -4
- package/dist/runtime/polyfill/mediaApi/info.mjs.map +1 -1
- package/dist/runtime/polyfill/menuApi.mjs +38 -4
- package/dist/runtime/polyfill/menuApi.mjs.map +1 -1
- package/dist/runtime/polyfill/navigationBarRuntime.mjs +6 -1
- package/dist/runtime/polyfill/navigationBarRuntime.mjs.map +1 -1
- package/dist/runtime/polyfill/network/request.mjs +2 -2
- package/dist/runtime/polyfill/network/request.mjs.map +1 -1
- package/dist/runtime/polyfill/platformApi.mjs +1 -1
- package/dist/runtime/polyfill/routeRuntime/appLifecycle.mjs +88 -0
- package/dist/runtime/polyfill/routeRuntime/appLifecycle.mjs.map +1 -0
- package/dist/runtime/polyfill/routeRuntime/dom.mjs +44 -15
- package/dist/runtime/polyfill/routeRuntime/dom.mjs.map +1 -1
- package/dist/runtime/polyfill/routeRuntime/history.d.mts +30 -0
- package/dist/runtime/polyfill/routeRuntime/history.mjs +148 -0
- package/dist/runtime/polyfill/routeRuntime/history.mjs.map +1 -0
- package/dist/runtime/polyfill/routeRuntime/lifecycle.mjs +39 -8
- package/dist/runtime/polyfill/routeRuntime/lifecycle.mjs.map +1 -1
- package/dist/runtime/polyfill/routeRuntime/options.d.mts +11 -1
- package/dist/runtime/polyfill/routeRuntime/options.mjs +0 -1
- package/dist/runtime/polyfill/routeRuntime/options.mjs.map +1 -1
- package/dist/runtime/polyfill/routeRuntime/result.mjs +12 -0
- package/dist/runtime/polyfill/routeRuntime/result.mjs.map +1 -0
- package/dist/runtime/polyfill/routeRuntime/scroll.mjs +39 -0
- package/dist/runtime/polyfill/routeRuntime/scroll.mjs.map +1 -0
- package/dist/runtime/polyfill/routeRuntime/stack.mjs +122 -0
- package/dist/runtime/polyfill/routeRuntime/stack.mjs.map +1 -0
- package/dist/runtime/polyfill/routeRuntime.d.mts +26 -17
- package/dist/runtime/polyfill/routeRuntime.mjs +121 -96
- package/dist/runtime/polyfill/routeRuntime.mjs.map +1 -1
- package/dist/runtime/polyfill/runtimeDataApi.mjs +8 -3
- package/dist/runtime/polyfill/runtimeDataApi.mjs.map +1 -1
- package/dist/runtime/polyfill/runtimeOps.mjs +10 -6
- package/dist/runtime/polyfill/runtimeOps.mjs.map +1 -1
- package/dist/runtime/polyfill/selectorQuery.mjs +70 -14
- package/dist/runtime/polyfill/selectorQuery.mjs.map +1 -1
- package/dist/runtime/polyfill/storage.mjs +5 -2
- package/dist/runtime/polyfill/storage.mjs.map +1 -1
- package/dist/runtime/polyfill/system.mjs +30 -3
- package/dist/runtime/polyfill/system.mjs.map +1 -1
- package/dist/runtime/polyfill/types/locationRuntime.d.mts +1 -4
- package/dist/runtime/polyfill/types/platformRuntime.d.mts +9 -0
- package/dist/runtime/polyfill/types/systemAuth.d.mts +20 -9
- package/dist/runtime/polyfill/types/tabBarRuntime.d.mts +25 -0
- package/dist/runtime/polyfill/ui.mjs +2 -6
- package/dist/runtime/polyfill/ui.mjs.map +1 -1
- package/dist/runtime/polyfill/uiMediaApi.d.mts +11 -10
- package/dist/runtime/polyfill/uiMediaApi.mjs +26 -2
- package/dist/runtime/polyfill/uiMediaApi.mjs.map +1 -1
- package/dist/runtime/polyfill/videoContext.mjs +4 -0
- package/dist/runtime/polyfill/videoContext.mjs.map +1 -1
- package/dist/runtime/polyfill/vkSession.mjs +4 -14
- package/dist/runtime/polyfill/vkSession.mjs.map +1 -1
- package/dist/runtime/polyfill.d.mts +2 -2
- package/dist/runtime/renderContext.mjs +1 -1
- package/dist/runtime/renderContext.mjs.map +1 -1
- package/dist/runtime/rpx.mjs +17 -8
- package/dist/runtime/rpx.mjs.map +1 -1
- package/dist/runtime/seo/index.d.mts +31 -0
- package/dist/runtime/seo/index.mjs +94 -0
- package/dist/runtime/seo/index.mjs.map +1 -0
- package/dist/runtime/viewport/index.d.mts +12 -0
- package/dist/runtime/viewport/index.mjs +44 -0
- package/dist/runtime/viewport/index.mjs.map +1 -0
- package/dist/runtime/viewport/style.mjs +62 -0
- package/dist/runtime/viewport/style.mjs.map +1 -0
- package/dist/runtime/viewport/types.d.mts +14 -0
- package/dist/runtime/wevu.d.mts +20 -0
- package/dist/runtime/wevu.mjs +73 -0
- package/dist/runtime/wevu.mjs.map +1 -0
- package/dist/shared/nativeComponents.mjs +401 -0
- package/dist/shared/nativeComponents.mjs.map +1 -0
- package/dist/shared/tabBar.d.mts +19 -0
- package/dist/shared/tabBar.mjs +37 -0
- package/dist/shared/tabBar.mjs.map +1 -0
- package/dist/shared/wxml.mjs +3 -20
- package/dist/shared/wxml.mjs.map +1 -1
- package/package.json +13 -5
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,211 @@
|
|
|
1
|
+
import { __exportAll, __reExport } from "./_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { transformWxssToCss } from "./css/wxss.mjs";
|
|
2
3
|
import { weappWebPlugin } from "./plugin/index.mjs";
|
|
4
|
+
import { setRuntimeWarningOptions } from "./runtime/warning.mjs";
|
|
5
|
+
import { installWebHostGlobals } from "./runtime/hostGlobals.mjs";
|
|
3
6
|
import { injectStyle, removeStyle } from "./runtime/style.mjs";
|
|
4
7
|
import { ensureButtonDefined, setButtonFormConfig } from "./runtime/button/index.mjs";
|
|
5
|
-
import { setRuntimeWarningOptions } from "./runtime/warning.mjs";
|
|
6
8
|
import { getRuntimeExecutionMode, setRuntimeExecutionMode } from "./runtime/execution.mjs";
|
|
7
9
|
import { createRenderContext } from "./runtime/renderContext.mjs";
|
|
8
10
|
import { defineComponent } from "./runtime/component/index.mjs";
|
|
11
|
+
import { getRuntimeClipboard, getRuntimeDialogs, getRuntimeFetch, getRuntimeStorage, getWebRuntimeHost, openRuntimeUrl, resetWebRuntimeHost, setWebRuntimeHost } from "./runtime/host/index.mjs";
|
|
12
|
+
import { resolveImageModeStyle } from "./runtime/nativeComponents/image.mjs";
|
|
13
|
+
import { createInputEventDetail } from "./runtime/nativeComponents/input.mjs";
|
|
9
14
|
import { setNavigationBarMetrics } from "./runtime/navigationBar/index.mjs";
|
|
10
|
-
import {
|
|
15
|
+
import { getWebViewportWidth, resolveWebViewportConfig, setupWebViewport } from "./runtime/viewport/index.mjs";
|
|
11
16
|
import { setupRpx } from "./runtime/rpx.mjs";
|
|
17
|
+
import { configureWebSeo, resetWebDocumentHead, setupWebResourceHints, syncWebDocumentHead, updateWebDocumentTitle } from "./runtime/seo/index.mjs";
|
|
18
|
+
import { disposeWebRouting, getWebRoutingConfig, resolveWebRoutingConfig } from "./runtime/polyfill/routeRuntime/history.mjs";
|
|
12
19
|
import { getEnterOptionsSync, getLaunchOptionsSync, initializePageRoutes, navigateBack, navigateTo, reLaunch, redirectTo, registerApp, registerComponent, registerPage, switchTab } from "./runtime/polyfill/routeRuntime.mjs";
|
|
13
20
|
import { clearStorage, clearStorageSync, createCanvasContext, createSelectorQuery, createVKSession, createVideoContext, createWorker, downloadFile, exitMiniProgram, getFileSystemManager, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, hideKeyboard, loadSubPackage, navigateToMiniProgram, nextTick, pageScrollTo, preloadSubpackage, removeStorage, removeStorageSync, request, setStorage, setStorageSync, startPullDownRefresh, stopPullDownRefresh, uploadFile } from "./runtime/polyfill/runtimeDataApi.mjs";
|
|
14
|
-
import {
|
|
21
|
+
import { createScrollEventDetail } from "./runtime/nativeComponents/scrollView.mjs";
|
|
22
|
+
import { createSwitchEventDetail } from "./runtime/nativeComponents/switch.mjs";
|
|
23
|
+
import { createTextareaLineChangeDetail } from "./runtime/nativeComponents/textarea.mjs";
|
|
24
|
+
import { createVideoProgressDetail, createVideoTimeUpdateDetail, resolveVideoObjectFit } from "./runtime/nativeComponents/video/helpers.mjs";
|
|
25
|
+
import { ensureNativeComponentsDefined } from "./runtime/nativeComponents/index.mjs";
|
|
26
|
+
import { setPageLayout } from "./runtime/pageLayout.mjs";
|
|
27
|
+
import { authorize, checkSession, getAccountInfoSync, getAppAuthorizeSetting, getAppBaseInfo, getBatteryInfo, getBatteryInfoSync, getDeviceInfo, getFuzzyLocation, getLocation, getMenuButtonBoundingClientRect, getNetworkType, getSetting, getSystemInfo, getSystemInfoSync, getSystemSetting, getUserInfo, getUserProfile, getWindowInfo, login, offNetworkStatusChange, offWindowResize, onNetworkStatusChange, onWindowResize, openAppAuthorizeSetting, openSetting, vibrateShort } from "./runtime/polyfill/deviceAuthSystemApi.mjs";
|
|
28
|
+
import { chooseAddress, chooseFile, chooseImage, chooseLocation, chooseMedia, chooseMessageFile, chooseVideo, compressImage, compressVideo, getClipboardData, getImageInfo, getVideoInfo, hideLoading, hideTabBar, hideTabBarRedDot, makePhoneCall, openCustomerServiceChat, openDocument, openLocation, openVideoEditor, previewImage, previewMedia, removeTabBarBadge, requestPayment, requestSubscribeMessage, saveFile, saveFileToDisk, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, setClipboardData, setTabBarBadge, setTabBarItem, setTabBarStyle, showActionSheet, showLoading, showModal, showShareMenu, showTabBar, showTabBarRedDot, showToast, updateShareMenu } from "./runtime/polyfill/uiMediaApi.mjs";
|
|
15
29
|
import { canIUse, createInterstitialAd, createRewardedVideoAd, getExtConfig, getExtConfigSync, getLogManager, getUpdateManager, hideNavigationBarLoading, reportAnalytics, setBackgroundColor, setBackgroundTextStyle, setNavigationBarColor, setNavigationBarTitle, showNavigationBarLoading } from "./runtime/polyfill/index.mjs";
|
|
16
30
|
import { createTemplate, renderTemplate } from "./runtime/legacyTemplate/index.mjs";
|
|
31
|
+
import { installWebModuleRegistration, registerWebWevuApp, registerWebWevuComponent } from "./runtime/wevu.mjs";
|
|
32
|
+
|
|
33
|
+
export * from "wevu/internal-runtime"
|
|
34
|
+
|
|
35
|
+
//#region src/index.ts
|
|
36
|
+
var src_exports = /* @__PURE__ */ __exportAll({
|
|
37
|
+
authorize: () => authorize,
|
|
38
|
+
canIUse: () => canIUse,
|
|
39
|
+
checkSession: () => checkSession,
|
|
40
|
+
chooseAddress: () => chooseAddress,
|
|
41
|
+
chooseFile: () => chooseFile,
|
|
42
|
+
chooseImage: () => chooseImage,
|
|
43
|
+
chooseLocation: () => chooseLocation,
|
|
44
|
+
chooseMedia: () => chooseMedia,
|
|
45
|
+
chooseMessageFile: () => chooseMessageFile,
|
|
46
|
+
chooseVideo: () => chooseVideo,
|
|
47
|
+
clearStorage: () => clearStorage,
|
|
48
|
+
clearStorageSync: () => clearStorageSync,
|
|
49
|
+
compressImage: () => compressImage,
|
|
50
|
+
compressVideo: () => compressVideo,
|
|
51
|
+
configureWebSeo: () => configureWebSeo,
|
|
52
|
+
createCanvasContext: () => createCanvasContext,
|
|
53
|
+
createInputEventDetail: () => createInputEventDetail,
|
|
54
|
+
createInterstitialAd: () => createInterstitialAd,
|
|
55
|
+
createRenderContext: () => createRenderContext,
|
|
56
|
+
createRewardedVideoAd: () => createRewardedVideoAd,
|
|
57
|
+
createScrollEventDetail: () => createScrollEventDetail,
|
|
58
|
+
createSelectorQuery: () => createSelectorQuery,
|
|
59
|
+
createSwitchEventDetail: () => createSwitchEventDetail,
|
|
60
|
+
createTemplate: () => createTemplate,
|
|
61
|
+
createTextareaLineChangeDetail: () => createTextareaLineChangeDetail,
|
|
62
|
+
createVKSession: () => createVKSession,
|
|
63
|
+
createVideoContext: () => createVideoContext,
|
|
64
|
+
createVideoProgressDetail: () => createVideoProgressDetail,
|
|
65
|
+
createVideoTimeUpdateDetail: () => createVideoTimeUpdateDetail,
|
|
66
|
+
createWorker: () => createWorker,
|
|
67
|
+
defineComponent: () => defineComponent,
|
|
68
|
+
disposeWebRouting: () => disposeWebRouting,
|
|
69
|
+
downloadFile: () => downloadFile,
|
|
70
|
+
ensureButtonDefined: () => ensureButtonDefined,
|
|
71
|
+
ensureNativeComponentsDefined: () => ensureNativeComponentsDefined,
|
|
72
|
+
exitMiniProgram: () => exitMiniProgram,
|
|
73
|
+
getAccountInfoSync: () => getAccountInfoSync,
|
|
74
|
+
getAppAuthorizeSetting: () => getAppAuthorizeSetting,
|
|
75
|
+
getAppBaseInfo: () => getAppBaseInfo,
|
|
76
|
+
getBatteryInfo: () => getBatteryInfo,
|
|
77
|
+
getBatteryInfoSync: () => getBatteryInfoSync,
|
|
78
|
+
getClipboardData: () => getClipboardData,
|
|
79
|
+
getDeviceInfo: () => getDeviceInfo,
|
|
80
|
+
getEnterOptionsSync: () => getEnterOptionsSync,
|
|
81
|
+
getExtConfig: () => getExtConfig,
|
|
82
|
+
getExtConfigSync: () => getExtConfigSync,
|
|
83
|
+
getFileSystemManager: () => getFileSystemManager,
|
|
84
|
+
getFuzzyLocation: () => getFuzzyLocation,
|
|
85
|
+
getImageInfo: () => getImageInfo,
|
|
86
|
+
getLaunchOptionsSync: () => getLaunchOptionsSync,
|
|
87
|
+
getLocation: () => getLocation,
|
|
88
|
+
getLogManager: () => getLogManager,
|
|
89
|
+
getMenuButtonBoundingClientRect: () => getMenuButtonBoundingClientRect,
|
|
90
|
+
getNetworkType: () => getNetworkType,
|
|
91
|
+
getRuntimeClipboard: () => getRuntimeClipboard,
|
|
92
|
+
getRuntimeDialogs: () => getRuntimeDialogs,
|
|
93
|
+
getRuntimeExecutionMode: () => getRuntimeExecutionMode,
|
|
94
|
+
getRuntimeFetch: () => getRuntimeFetch,
|
|
95
|
+
getRuntimeStorage: () => getRuntimeStorage,
|
|
96
|
+
getSetting: () => getSetting,
|
|
97
|
+
getStorage: () => getStorage,
|
|
98
|
+
getStorageInfo: () => getStorageInfo,
|
|
99
|
+
getStorageInfoSync: () => getStorageInfoSync,
|
|
100
|
+
getStorageSync: () => getStorageSync,
|
|
101
|
+
getSystemInfo: () => getSystemInfo,
|
|
102
|
+
getSystemInfoSync: () => getSystemInfoSync,
|
|
103
|
+
getSystemSetting: () => getSystemSetting,
|
|
104
|
+
getUpdateManager: () => getUpdateManager,
|
|
105
|
+
getUserInfo: () => getUserInfo,
|
|
106
|
+
getUserProfile: () => getUserProfile,
|
|
107
|
+
getVideoInfo: () => getVideoInfo,
|
|
108
|
+
getWebRoutingConfig: () => getWebRoutingConfig,
|
|
109
|
+
getWebRuntimeHost: () => getWebRuntimeHost,
|
|
110
|
+
getWebViewportWidth: () => getWebViewportWidth,
|
|
111
|
+
getWindowInfo: () => getWindowInfo,
|
|
112
|
+
hideKeyboard: () => hideKeyboard,
|
|
113
|
+
hideLoading: () => hideLoading,
|
|
114
|
+
hideNavigationBarLoading: () => hideNavigationBarLoading,
|
|
115
|
+
hideTabBar: () => hideTabBar,
|
|
116
|
+
hideTabBarRedDot: () => hideTabBarRedDot,
|
|
117
|
+
initializePageRoutes: () => initializePageRoutes,
|
|
118
|
+
injectStyle: () => injectStyle,
|
|
119
|
+
installWebHostGlobals: () => installWebHostGlobals,
|
|
120
|
+
installWebModuleRegistration: () => installWebModuleRegistration,
|
|
121
|
+
loadSubPackage: () => loadSubPackage,
|
|
122
|
+
login: () => login,
|
|
123
|
+
makePhoneCall: () => makePhoneCall,
|
|
124
|
+
navigateBack: () => navigateBack,
|
|
125
|
+
navigateTo: () => navigateTo,
|
|
126
|
+
navigateToMiniProgram: () => navigateToMiniProgram,
|
|
127
|
+
nextTick: () => nextTick,
|
|
128
|
+
offNetworkStatusChange: () => offNetworkStatusChange,
|
|
129
|
+
offWindowResize: () => offWindowResize,
|
|
130
|
+
onNetworkStatusChange: () => onNetworkStatusChange,
|
|
131
|
+
onWindowResize: () => onWindowResize,
|
|
132
|
+
openAppAuthorizeSetting: () => openAppAuthorizeSetting,
|
|
133
|
+
openCustomerServiceChat: () => openCustomerServiceChat,
|
|
134
|
+
openDocument: () => openDocument,
|
|
135
|
+
openLocation: () => openLocation,
|
|
136
|
+
openRuntimeUrl: () => openRuntimeUrl,
|
|
137
|
+
openSetting: () => openSetting,
|
|
138
|
+
openVideoEditor: () => openVideoEditor,
|
|
139
|
+
pageScrollTo: () => pageScrollTo,
|
|
140
|
+
preloadSubpackage: () => preloadSubpackage,
|
|
141
|
+
previewImage: () => previewImage,
|
|
142
|
+
previewMedia: () => previewMedia,
|
|
143
|
+
reLaunch: () => reLaunch,
|
|
144
|
+
redirectTo: () => redirectTo,
|
|
145
|
+
registerApp: () => registerApp,
|
|
146
|
+
registerComponent: () => registerComponent,
|
|
147
|
+
registerPage: () => registerPage,
|
|
148
|
+
registerWebWevuApp: () => registerWebWevuApp,
|
|
149
|
+
registerWebWevuComponent: () => registerWebWevuComponent,
|
|
150
|
+
removeStorage: () => removeStorage,
|
|
151
|
+
removeStorageSync: () => removeStorageSync,
|
|
152
|
+
removeStyle: () => removeStyle,
|
|
153
|
+
removeTabBarBadge: () => removeTabBarBadge,
|
|
154
|
+
renderTemplate: () => renderTemplate,
|
|
155
|
+
reportAnalytics: () => reportAnalytics,
|
|
156
|
+
request: () => request,
|
|
157
|
+
requestPayment: () => requestPayment,
|
|
158
|
+
requestSubscribeMessage: () => requestSubscribeMessage,
|
|
159
|
+
resetWebDocumentHead: () => resetWebDocumentHead,
|
|
160
|
+
resetWebRuntimeHost: () => resetWebRuntimeHost,
|
|
161
|
+
resolveImageModeStyle: () => resolveImageModeStyle,
|
|
162
|
+
resolveVideoObjectFit: () => resolveVideoObjectFit,
|
|
163
|
+
resolveWebRoutingConfig: () => resolveWebRoutingConfig,
|
|
164
|
+
resolveWebViewportConfig: () => resolveWebViewportConfig,
|
|
165
|
+
saveFile: () => saveFile,
|
|
166
|
+
saveFileToDisk: () => saveFileToDisk,
|
|
167
|
+
saveImageToPhotosAlbum: () => saveImageToPhotosAlbum,
|
|
168
|
+
saveVideoToPhotosAlbum: () => saveVideoToPhotosAlbum,
|
|
169
|
+
scanCode: () => scanCode,
|
|
170
|
+
setBackgroundColor: () => setBackgroundColor,
|
|
171
|
+
setBackgroundTextStyle: () => setBackgroundTextStyle,
|
|
172
|
+
setButtonFormConfig: () => setButtonFormConfig,
|
|
173
|
+
setClipboardData: () => setClipboardData,
|
|
174
|
+
setNavigationBarColor: () => setNavigationBarColor,
|
|
175
|
+
setNavigationBarMetrics: () => setNavigationBarMetrics,
|
|
176
|
+
setNavigationBarTitle: () => setNavigationBarTitle,
|
|
177
|
+
setPageLayout: () => setPageLayout,
|
|
178
|
+
setRuntimeExecutionMode: () => setRuntimeExecutionMode,
|
|
179
|
+
setRuntimeWarningOptions: () => setRuntimeWarningOptions,
|
|
180
|
+
setStorage: () => setStorage,
|
|
181
|
+
setStorageSync: () => setStorageSync,
|
|
182
|
+
setTabBarBadge: () => setTabBarBadge,
|
|
183
|
+
setTabBarItem: () => setTabBarItem,
|
|
184
|
+
setTabBarStyle: () => setTabBarStyle,
|
|
185
|
+
setWebRuntimeHost: () => setWebRuntimeHost,
|
|
186
|
+
setupRpx: () => setupRpx,
|
|
187
|
+
setupWebResourceHints: () => setupWebResourceHints,
|
|
188
|
+
setupWebViewport: () => setupWebViewport,
|
|
189
|
+
showActionSheet: () => showActionSheet,
|
|
190
|
+
showLoading: () => showLoading,
|
|
191
|
+
showModal: () => showModal,
|
|
192
|
+
showNavigationBarLoading: () => showNavigationBarLoading,
|
|
193
|
+
showShareMenu: () => showShareMenu,
|
|
194
|
+
showTabBar: () => showTabBar,
|
|
195
|
+
showTabBarRedDot: () => showTabBarRedDot,
|
|
196
|
+
showToast: () => showToast,
|
|
197
|
+
startPullDownRefresh: () => startPullDownRefresh,
|
|
198
|
+
stopPullDownRefresh: () => stopPullDownRefresh,
|
|
199
|
+
switchTab: () => switchTab,
|
|
200
|
+
syncWebDocumentHead: () => syncWebDocumentHead,
|
|
201
|
+
transformWxssToCss: () => transformWxssToCss,
|
|
202
|
+
updateShareMenu: () => updateShareMenu,
|
|
203
|
+
updateWebDocumentTitle: () => updateWebDocumentTitle,
|
|
204
|
+
uploadFile: () => uploadFile,
|
|
205
|
+
vibrateShort: () => vibrateShort,
|
|
206
|
+
weappWebPlugin: () => weappWebPlugin
|
|
207
|
+
});
|
|
17
208
|
|
|
18
|
-
|
|
209
|
+
//#endregion
|
|
210
|
+
export { authorize, canIUse, checkSession, chooseAddress, chooseFile, chooseImage, chooseLocation, chooseMedia, chooseMessageFile, chooseVideo, clearStorage, clearStorageSync, compressImage, compressVideo, configureWebSeo, createCanvasContext, createInputEventDetail, createInterstitialAd, createRenderContext, createRewardedVideoAd, createScrollEventDetail, createSelectorQuery, createSwitchEventDetail, createTemplate, createTextareaLineChangeDetail, createVKSession, createVideoContext, createVideoProgressDetail, createVideoTimeUpdateDetail, createWorker, defineComponent, disposeWebRouting, downloadFile, ensureButtonDefined, ensureNativeComponentsDefined, exitMiniProgram, getAccountInfoSync, getAppAuthorizeSetting, getAppBaseInfo, getBatteryInfo, getBatteryInfoSync, getClipboardData, getDeviceInfo, getEnterOptionsSync, getExtConfig, getExtConfigSync, getFileSystemManager, getFuzzyLocation, getImageInfo, getLaunchOptionsSync, getLocation, getLogManager, getMenuButtonBoundingClientRect, getNetworkType, getRuntimeClipboard, getRuntimeDialogs, getRuntimeExecutionMode, getRuntimeFetch, getRuntimeStorage, getSetting, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getSystemSetting, getUpdateManager, getUserInfo, getUserProfile, getVideoInfo, getWebRoutingConfig, getWebRuntimeHost, getWebViewportWidth, getWindowInfo, hideKeyboard, hideLoading, hideNavigationBarLoading, hideTabBar, hideTabBarRedDot, initializePageRoutes, injectStyle, installWebHostGlobals, installWebModuleRegistration, loadSubPackage, login, makePhoneCall, navigateBack, navigateTo, navigateToMiniProgram, nextTick, offNetworkStatusChange, offWindowResize, onNetworkStatusChange, onWindowResize, openAppAuthorizeSetting, openCustomerServiceChat, openDocument, openLocation, openRuntimeUrl, openSetting, openVideoEditor, pageScrollTo, preloadSubpackage, previewImage, previewMedia, reLaunch, redirectTo, registerApp, registerComponent, registerPage, registerWebWevuApp, registerWebWevuComponent, removeStorage, removeStorageSync, removeStyle, removeTabBarBadge, renderTemplate, reportAnalytics, request, requestPayment, requestSubscribeMessage, resetWebDocumentHead, resetWebRuntimeHost, resolveImageModeStyle, resolveVideoObjectFit, resolveWebRoutingConfig, resolveWebViewportConfig, saveFile, saveFileToDisk, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, setBackgroundColor, setBackgroundTextStyle, setButtonFormConfig, setClipboardData, setNavigationBarColor, setNavigationBarMetrics, setNavigationBarTitle, setPageLayout, setRuntimeExecutionMode, setRuntimeWarningOptions, setStorage, setStorageSync, setTabBarBadge, setTabBarItem, setTabBarStyle, setWebRuntimeHost, setupRpx, setupWebResourceHints, setupWebViewport, showActionSheet, showLoading, showModal, showNavigationBarLoading, showShareMenu, showTabBar, showTabBarRedDot, showToast, startPullDownRefresh, stopPullDownRefresh, switchTab, syncWebDocumentHead, transformWxssToCss, updateShareMenu, updateWebDocumentTitle, uploadFile, vibrateShort, weappWebPlugin };
|
|
211
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export { transformWxssToCss } from './css/wxss'\nexport { weappWebPlugin } from './plugin'\nexport type { WeappWebPluginOptions } from './plugin'\nexport * from './runtime/index'\n"],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
//#region src/plugin/assets.d.ts
|
|
3
|
+
type WebAssetNext = (error?: unknown) => void;
|
|
4
|
+
declare function createWebAssetMiddleware(srcRoot: string): (request: IncomingMessage, response: ServerResponse, next: WebAssetNext) => void;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { createWebAssetMiddleware };
|
|
7
|
+
//# sourceMappingURL=assets.d.mts.map
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { normalizePath } from "./path.mjs";
|
|
2
|
+
import { readFile, readdir, stat } from "node:fs/promises";
|
|
3
|
+
import { extname, relative, resolve } from "pathe";
|
|
4
|
+
import { createReadStream } from "node:fs";
|
|
5
|
+
|
|
6
|
+
//#region src/plugin/assets.ts
|
|
7
|
+
const WEB_ASSET_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
8
|
+
".aac",
|
|
9
|
+
".avif",
|
|
10
|
+
".br",
|
|
11
|
+
".cer",
|
|
12
|
+
".cert",
|
|
13
|
+
".gif",
|
|
14
|
+
".jpeg",
|
|
15
|
+
".jpg",
|
|
16
|
+
".m4a",
|
|
17
|
+
".mp3",
|
|
18
|
+
".mp4",
|
|
19
|
+
".ogg",
|
|
20
|
+
".otf",
|
|
21
|
+
".png",
|
|
22
|
+
".silk",
|
|
23
|
+
".svg",
|
|
24
|
+
".ttf",
|
|
25
|
+
".wasm",
|
|
26
|
+
".wav",
|
|
27
|
+
".webm",
|
|
28
|
+
".webp",
|
|
29
|
+
".woff",
|
|
30
|
+
".woff2"
|
|
31
|
+
]);
|
|
32
|
+
const WEB_ASSET_CONTENT_TYPES = {
|
|
33
|
+
".aac": "audio/aac",
|
|
34
|
+
".avif": "image/avif",
|
|
35
|
+
".gif": "image/gif",
|
|
36
|
+
".jpeg": "image/jpeg",
|
|
37
|
+
".jpg": "image/jpeg",
|
|
38
|
+
".m4a": "audio/mp4",
|
|
39
|
+
".mp3": "audio/mpeg",
|
|
40
|
+
".mp4": "video/mp4",
|
|
41
|
+
".ogg": "audio/ogg",
|
|
42
|
+
".otf": "font/otf",
|
|
43
|
+
".png": "image/png",
|
|
44
|
+
".svg": "image/svg+xml",
|
|
45
|
+
".ttf": "font/ttf",
|
|
46
|
+
".wasm": "application/wasm",
|
|
47
|
+
".wav": "audio/wav",
|
|
48
|
+
".webm": "video/webm",
|
|
49
|
+
".webp": "image/webp",
|
|
50
|
+
".woff": "font/woff",
|
|
51
|
+
".woff2": "font/woff2"
|
|
52
|
+
};
|
|
53
|
+
function isWebAssetFile(filename) {
|
|
54
|
+
return WEB_ASSET_EXTENSIONS.has(extname(filename).toLowerCase());
|
|
55
|
+
}
|
|
56
|
+
function isInsideRoot(root, filename) {
|
|
57
|
+
const relativePath = normalizePath(relative(root, filename));
|
|
58
|
+
return relativePath !== ".." && !relativePath.startsWith("../") && !relativePath.startsWith("/");
|
|
59
|
+
}
|
|
60
|
+
function resolveWebAssetRequest(srcRoot, requestUrl) {
|
|
61
|
+
if (!requestUrl) return;
|
|
62
|
+
let pathname;
|
|
63
|
+
try {
|
|
64
|
+
if (decodeURIComponent(requestUrl.split(/[?#]/, 1)[0]).split("/").includes("..")) return;
|
|
65
|
+
pathname = decodeURIComponent(new URL(requestUrl, "http://weapp-vite.local").pathname);
|
|
66
|
+
} catch {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const relativePath = pathname.replace(/^\/+/, "");
|
|
70
|
+
if (!relativePath || !isWebAssetFile(relativePath)) return;
|
|
71
|
+
const filename = resolve(srcRoot, relativePath);
|
|
72
|
+
return isInsideRoot(srcRoot, filename) ? filename : void 0;
|
|
73
|
+
}
|
|
74
|
+
async function collectWebAssetFiles(directory) {
|
|
75
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
76
|
+
const files = [];
|
|
77
|
+
for (const entry of entries) {
|
|
78
|
+
const filename = resolve(directory, entry.name);
|
|
79
|
+
if (entry.isDirectory()) files.push(...await collectWebAssetFiles(filename));
|
|
80
|
+
else if (entry.isFile() && isWebAssetFile(filename)) files.push(filename);
|
|
81
|
+
}
|
|
82
|
+
return files;
|
|
83
|
+
}
|
|
84
|
+
async function emitWebAssets(context, srcRoot) {
|
|
85
|
+
if (!context.emitFile) return;
|
|
86
|
+
const files = await collectWebAssetFiles(srcRoot);
|
|
87
|
+
for (const filename of files) {
|
|
88
|
+
const fileName = normalizePath(relative(srcRoot, filename));
|
|
89
|
+
context.addWatchFile?.(filename);
|
|
90
|
+
context.emitFile({
|
|
91
|
+
type: "asset",
|
|
92
|
+
fileName,
|
|
93
|
+
source: await readFile(filename)
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function createWebAssetMiddleware(srcRoot) {
|
|
98
|
+
return (request, response, next) => {
|
|
99
|
+
const filename = resolveWebAssetRequest(srcRoot, request.url);
|
|
100
|
+
if (!filename) {
|
|
101
|
+
next();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
stat(filename).then((fileStat) => {
|
|
105
|
+
if (!fileStat.isFile()) {
|
|
106
|
+
next();
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const extension = extname(filename).toLowerCase();
|
|
110
|
+
response.statusCode = 200;
|
|
111
|
+
response.setHeader("Content-Length", String(fileStat.size));
|
|
112
|
+
response.setHeader("Content-Type", WEB_ASSET_CONTENT_TYPES[extension] ?? "application/octet-stream");
|
|
113
|
+
const stream = createReadStream(filename);
|
|
114
|
+
stream.on("error", next);
|
|
115
|
+
stream.pipe(response);
|
|
116
|
+
}).catch(() => next());
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
//#endregion
|
|
121
|
+
export { createWebAssetMiddleware, emitWebAssets, resolveWebAssetRequest };
|
|
122
|
+
//# sourceMappingURL=assets.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.mjs","names":[],"sources":["../../src/plugin/assets.ts"],"sourcesContent":["import type { IncomingMessage, ServerResponse } from 'node:http'\nimport { createReadStream } from 'node:fs'\nimport { readdir, readFile, stat } from 'node:fs/promises'\nimport { extname, relative, resolve } from 'pathe'\nimport { normalizePath } from './path'\n\nconst WEB_ASSET_EXTENSIONS = new Set([\n '.aac',\n '.avif',\n '.br',\n '.cer',\n '.cert',\n '.gif',\n '.jpeg',\n '.jpg',\n '.m4a',\n '.mp3',\n '.mp4',\n '.ogg',\n '.otf',\n '.png',\n '.silk',\n '.svg',\n '.ttf',\n '.wasm',\n '.wav',\n '.webm',\n '.webp',\n '.woff',\n '.woff2',\n])\n\nconst WEB_ASSET_CONTENT_TYPES: Record<string, string> = {\n '.aac': 'audio/aac',\n '.avif': 'image/avif',\n '.gif': 'image/gif',\n '.jpeg': 'image/jpeg',\n '.jpg': 'image/jpeg',\n '.m4a': 'audio/mp4',\n '.mp3': 'audio/mpeg',\n '.mp4': 'video/mp4',\n '.ogg': 'audio/ogg',\n '.otf': 'font/otf',\n '.png': 'image/png',\n '.svg': 'image/svg+xml',\n '.ttf': 'font/ttf',\n '.wasm': 'application/wasm',\n '.wav': 'audio/wav',\n '.webm': 'video/webm',\n '.webp': 'image/webp',\n '.woff': 'font/woff',\n '.woff2': 'font/woff2',\n}\n\ninterface WebAssetPluginContext {\n addWatchFile?: (id: string) => void\n emitFile?: (asset: { type: 'asset', fileName: string, source: Uint8Array }) => void\n}\n\ntype WebAssetNext = (error?: unknown) => void\n\nfunction isWebAssetFile(filename: string) {\n return WEB_ASSET_EXTENSIONS.has(extname(filename).toLowerCase())\n}\n\nfunction isInsideRoot(root: string, filename: string) {\n const relativePath = normalizePath(relative(root, filename))\n return relativePath !== '..'\n && !relativePath.startsWith('../')\n && !relativePath.startsWith('/')\n}\n\nexport function resolveWebAssetRequest(srcRoot: string, requestUrl?: string) {\n if (!requestUrl) {\n return undefined\n }\n let pathname: string\n try {\n const rawPath = decodeURIComponent(requestUrl.split(/[?#]/, 1)[0]!)\n if (rawPath.split('/').includes('..')) {\n return undefined\n }\n pathname = decodeURIComponent(new URL(requestUrl, 'http://weapp-vite.local').pathname)\n }\n catch {\n return undefined\n }\n const relativePath = pathname.replace(/^\\/+/, '')\n if (!relativePath || !isWebAssetFile(relativePath)) {\n return undefined\n }\n const filename = resolve(srcRoot, relativePath)\n return isInsideRoot(srcRoot, filename) ? filename : undefined\n}\n\nasync function collectWebAssetFiles(directory: string): Promise<string[]> {\n const entries = await readdir(directory, { withFileTypes: true })\n const files: string[] = []\n for (const entry of entries) {\n const filename = resolve(directory, entry.name)\n if (entry.isDirectory()) {\n files.push(...await collectWebAssetFiles(filename))\n }\n else if (entry.isFile() && isWebAssetFile(filename)) {\n files.push(filename)\n }\n }\n return files\n}\n\nexport async function emitWebAssets(context: WebAssetPluginContext, srcRoot: string) {\n if (!context.emitFile) {\n return\n }\n const files = await collectWebAssetFiles(srcRoot)\n for (const filename of files) {\n const fileName = normalizePath(relative(srcRoot, filename))\n context.addWatchFile?.(filename)\n context.emitFile({\n type: 'asset',\n fileName,\n source: await readFile(filename),\n })\n }\n}\n\nexport function createWebAssetMiddleware(srcRoot: string) {\n return (request: IncomingMessage, response: ServerResponse, next: WebAssetNext) => {\n const filename = resolveWebAssetRequest(srcRoot, request.url)\n if (!filename) {\n next()\n return\n }\n void stat(filename).then((fileStat) => {\n if (!fileStat.isFile()) {\n next()\n return\n }\n const extension = extname(filename).toLowerCase()\n response.statusCode = 200\n response.setHeader('Content-Length', String(fileStat.size))\n response.setHeader('Content-Type', WEB_ASSET_CONTENT_TYPES[extension] ?? 'application/octet-stream')\n const stream = createReadStream(filename)\n stream.on('error', next)\n stream.pipe(response)\n }).catch(() => next())\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//#region src/plugin/constants.ts
|
|
2
2
|
const SCRIPT_EXTS = [
|
|
3
|
+
".vue",
|
|
3
4
|
".ts",
|
|
4
5
|
".tsx",
|
|
5
6
|
".js",
|
|
@@ -37,7 +38,15 @@ const WXS_RESOLVE_EXTS = [
|
|
|
37
38
|
".js"
|
|
38
39
|
];
|
|
39
40
|
const ENTRY_ID = "\0@weapp-vite/web/entry";
|
|
41
|
+
const AUTO_ROUTES_ID = "weapp-vite/auto-routes";
|
|
42
|
+
const RESOLVED_AUTO_ROUTES_ID = "\0@weapp-vite/web/auto-routes";
|
|
43
|
+
const TEMPLATE_QUERY = "weapp-web-template";
|
|
44
|
+
const STYLE_QUERY = "weapp-web-style";
|
|
45
|
+
const SFC_TEMPLATE_QUERY = "weapp-web-sfc-template";
|
|
46
|
+
const SFC_STYLE_QUERY = "weapp-web-sfc-style";
|
|
47
|
+
const WEB_COMPONENT_PREFIX = "/@weapp-vite/web/component/";
|
|
48
|
+
const WEB_COMPONENT_QUERY = "weapp-web-component";
|
|
40
49
|
|
|
41
50
|
//#endregion
|
|
42
|
-
export { ENTRY_ID, SCRIPT_EXTS, STYLE_EXTS, TEMPLATE_EXTS, TRANSFORM_STYLE_EXTS, WXS_EXTS, WXS_RESOLVE_EXTS };
|
|
51
|
+
export { AUTO_ROUTES_ID, ENTRY_ID, RESOLVED_AUTO_ROUTES_ID, SCRIPT_EXTS, SFC_STYLE_QUERY, SFC_TEMPLATE_QUERY, STYLE_EXTS, STYLE_QUERY, TEMPLATE_EXTS, TEMPLATE_QUERY, TRANSFORM_STYLE_EXTS, WEB_COMPONENT_PREFIX, WEB_COMPONENT_QUERY, WXS_EXTS, WXS_RESOLVE_EXTS };
|
|
43
52
|
//# sourceMappingURL=constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","names":[],"sources":["../../src/plugin/constants.ts"],"sourcesContent":["export const SCRIPT_EXTS = ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs']\nexport const STYLE_EXTS = ['.wxss', '.scss', '.less', '.css']\nexport const TRANSFORM_STYLE_EXTS = ['.wxss']\nexport const TEMPLATE_EXTS = ['.wxml', '.axml', '.swan', '.ttml', '.qml', '.ksml', '.xhsml', '.html']\nexport const WXS_EXTS = ['.wxs', '.wxs.ts', '.wxs.js']\nexport const WXS_RESOLVE_EXTS = ['.wxs', '.wxs.ts', '.wxs.js', '.ts', '.js']\n\nexport const ENTRY_ID = '\\0@weapp-vite/web/entry'\n"],"mappings":";AAAA,MAAa,cAAc;CAAC;CAAO;CAAQ;CAAO;CAAQ;CAAQ;AAAM;
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":[],"sources":["../../src/plugin/constants.ts"],"sourcesContent":["export const SCRIPT_EXTS = ['.vue', '.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs']\nexport const STYLE_EXTS = ['.wxss', '.scss', '.less', '.css']\nexport const TRANSFORM_STYLE_EXTS = ['.wxss']\nexport const TEMPLATE_EXTS = ['.wxml', '.axml', '.swan', '.ttml', '.qml', '.ksml', '.xhsml', '.html']\nexport const WXS_EXTS = ['.wxs', '.wxs.ts', '.wxs.js']\nexport const WXS_RESOLVE_EXTS = ['.wxs', '.wxs.ts', '.wxs.js', '.ts', '.js']\n\nexport const ENTRY_ID = '\\0@weapp-vite/web/entry'\nexport const AUTO_ROUTES_ID = 'weapp-vite/auto-routes'\nexport const RESOLVED_AUTO_ROUTES_ID = '\\0@weapp-vite/web/auto-routes'\nexport const TEMPLATE_QUERY = 'weapp-web-template'\nexport const STYLE_QUERY = 'weapp-web-style'\nexport const SFC_TEMPLATE_QUERY = 'weapp-web-sfc-template'\nexport const SFC_STYLE_QUERY = 'weapp-web-sfc-style'\nexport const WEB_COMPONENT_PREFIX = '/@weapp-vite/web/component/'\nexport const WEB_COMPONENT_QUERY = 'weapp-web-component'\n"],"mappings":";AAAA,MAAa,cAAc;CAAC;CAAQ;CAAO;CAAQ;CAAO;CAAQ;CAAQ;AAAM;AAChF,MAAa,aAAa;CAAC;CAAS;CAAS;CAAS;AAAM;AAC5D,MAAa,uBAAuB,CAAC,OAAO;AAC5C,MAAa,gBAAgB;CAAC;CAAS;CAAS;CAAS;CAAS;CAAQ;CAAS;CAAU;AAAO;AACpG,MAAa,WAAW;CAAC;CAAQ;CAAW;AAAS;AACrD,MAAa,mBAAmB;CAAC;CAAQ;CAAW;CAAW;CAAO;AAAK;AAE3E,MAAa,WAAW;AACxB,MAAa,iBAAiB;AAC9B,MAAa,0BAA0B;AACvC,MAAa,iBAAiB;AAC9B,MAAa,cAAc;AAC3B,MAAa,qBAAqB;AAClC,MAAa,kBAAkB;AAC/B,MAAa,uBAAuB;AACpC,MAAa,sBAAsB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { extname } from "pathe";
|
|
2
|
+
import { build } from "esbuild";
|
|
3
|
+
|
|
4
|
+
//#region src/plugin/dependencyScan.ts
|
|
5
|
+
const SCRIPT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
6
|
+
".cjs",
|
|
7
|
+
".js",
|
|
8
|
+
".jsx",
|
|
9
|
+
".mjs",
|
|
10
|
+
".ts",
|
|
11
|
+
".tsx"
|
|
12
|
+
]);
|
|
13
|
+
function isBareModuleId(id) {
|
|
14
|
+
return Boolean(id) && !id.startsWith(".") && !id.startsWith("/") && !id.startsWith("#");
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 收集外部原生组件脚本递归依赖的裸模块,交由 Vite 预构建处理。
|
|
18
|
+
*/
|
|
19
|
+
async function collectExternalComponentOptimizeDeps(components) {
|
|
20
|
+
const entryPoints = Array.from(new Set(components.filter((component) => component.importId && SCRIPT_EXTENSIONS.has(extname(component.script))).map((component) => component.script)));
|
|
21
|
+
if (entryPoints.length === 0) return [];
|
|
22
|
+
const result = await build({
|
|
23
|
+
entryPoints,
|
|
24
|
+
bundle: true,
|
|
25
|
+
format: "esm",
|
|
26
|
+
logLevel: "silent",
|
|
27
|
+
metafile: true,
|
|
28
|
+
outdir: "weapp-web-dependency-scan",
|
|
29
|
+
packages: "external",
|
|
30
|
+
platform: "browser",
|
|
31
|
+
write: false
|
|
32
|
+
});
|
|
33
|
+
const componentImportIds = new Set(components.map((component) => component.importId));
|
|
34
|
+
const dependencies = /* @__PURE__ */ new Set();
|
|
35
|
+
for (const input of Object.values(result.metafile.inputs)) for (const dependency of input.imports) if (dependency.external && isBareModuleId(dependency.path) && !componentImportIds.has(dependency.path)) dependencies.add(dependency.path);
|
|
36
|
+
return Array.from(dependencies).sort();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { collectExternalComponentOptimizeDeps };
|
|
41
|
+
//# sourceMappingURL=dependencyScan.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencyScan.mjs","names":[],"sources":["../../src/plugin/dependencyScan.ts"],"sourcesContent":["import type { ComponentEntry } from './types'\nimport { build } from 'esbuild'\nimport { extname } from 'pathe'\n\nconst SCRIPT_EXTENSIONS = new Set(['.cjs', '.js', '.jsx', '.mjs', '.ts', '.tsx'])\n\nfunction isBareModuleId(id: string) {\n return Boolean(id)\n && !id.startsWith('.')\n && !id.startsWith('/')\n && !id.startsWith('#')\n}\n\n/**\n * 收集外部原生组件脚本递归依赖的裸模块,交由 Vite 预构建处理。\n */\nexport async function collectExternalComponentOptimizeDeps(components: ComponentEntry[]) {\n const entryPoints = Array.from(new Set(\n components\n .filter(component => component.importId && SCRIPT_EXTENSIONS.has(extname(component.script)))\n .map(component => component.script),\n ))\n if (entryPoints.length === 0) {\n return []\n }\n\n const result = await build({\n entryPoints,\n bundle: true,\n format: 'esm',\n logLevel: 'silent',\n metafile: true,\n outdir: 'weapp-web-dependency-scan',\n packages: 'external',\n platform: 'browser',\n write: false,\n })\n const componentImportIds = new Set(components.map(component => component.importId))\n const dependencies = new Set<string>()\n for (const input of Object.values(result.metafile.inputs)) {\n for (const dependency of input.imports) {\n if (dependency.external\n && isBareModuleId(dependency.path)\n && !componentImportIds.has(dependency.path)) {\n dependencies.add(dependency.path)\n }\n }\n }\n return Array.from(dependencies).sort()\n}\n"],"mappings":";;;;AAIA,MAAM,oCAAoB,IAAI,IAAI;CAAC;CAAQ;CAAO;CAAQ;CAAQ;CAAO;AAAM,CAAC;AAEhF,SAAS,eAAe,IAAY;CAClC,OAAO,QAAQ,EAAE,KACZ,CAAC,GAAG,WAAW,GAAG,KAClB,CAAC,GAAG,WAAW,GAAG,KAClB,CAAC,GAAG,WAAW,GAAG;AACzB;;;;AAKA,eAAsB,qCAAqC,YAA8B;CACvF,MAAM,cAAc,MAAM,KAAK,IAAI,IACjC,WACG,QAAO,cAAa,UAAU,YAAY,kBAAkB,IAAI,QAAQ,UAAU,MAAM,CAAC,CAAC,CAAC,CAC3F,KAAI,cAAa,UAAU,MAAM,CACtC,CAAC;CACD,IAAI,YAAY,WAAW,GACzB,OAAO,CAAC;CAGV,MAAM,SAAS,MAAM,MAAM;EACzB;EACA,QAAQ;EACR,QAAQ;EACR,UAAU;EACV,UAAU;EACV,QAAQ;EACR,UAAU;EACV,UAAU;EACV,OAAO;CACT,CAAC;CACD,MAAM,qBAAqB,IAAI,IAAI,WAAW,KAAI,cAAa,UAAU,QAAQ,CAAC;CAClF,MAAM,+BAAe,IAAI,IAAY;CACrC,KAAK,MAAM,SAAS,OAAO,OAAO,OAAO,SAAS,MAAM,GACtD,KAAK,MAAM,cAAc,MAAM,SAC7B,IAAI,WAAW,YACV,eAAe,WAAW,IAAI,KAC9B,CAAC,mBAAmB,IAAI,WAAW,IAAI,GAC1C,aAAa,IAAI,WAAW,IAAI;CAItC,OAAO,MAAM,KAAK,YAAY,CAAC,CAAC,KAAK;AACvC"}
|
package/dist/plugin/entry.mjs
CHANGED
|
@@ -1,23 +1,72 @@
|
|
|
1
|
+
import { WEB_COMPONENT_PREFIX } from "./constants.mjs";
|
|
1
2
|
import { relativeModuleId, resolveRuntimePolyfillPath, toViteFsImport } from "./path.mjs";
|
|
2
3
|
|
|
3
4
|
//#region src/plugin/entry.ts
|
|
5
|
+
function generateAutoRoutesModule(result) {
|
|
6
|
+
const pages = result.pages.map((page) => page.id);
|
|
7
|
+
const subPackageMap = /* @__PURE__ */ new Map();
|
|
8
|
+
for (const id of pages) {
|
|
9
|
+
const pagesSegment = id.indexOf("/pages/");
|
|
10
|
+
if (pagesSegment <= 0) continue;
|
|
11
|
+
const root = id.slice(0, pagesSegment);
|
|
12
|
+
const route = id.slice(pagesSegment + 1);
|
|
13
|
+
const routes = subPackageMap.get(root) ?? [];
|
|
14
|
+
routes.push(route);
|
|
15
|
+
subPackageMap.set(root, routes);
|
|
16
|
+
}
|
|
17
|
+
const mainPages = pages.filter((id) => !id.includes("/pages/"));
|
|
18
|
+
const subPackages = [...subPackageMap].map(([root, routes]) => ({
|
|
19
|
+
root,
|
|
20
|
+
pages: routes
|
|
21
|
+
}));
|
|
22
|
+
return [
|
|
23
|
+
`const routes = ${JSON.stringify({
|
|
24
|
+
pages: mainPages,
|
|
25
|
+
entries: pages,
|
|
26
|
+
subPackages
|
|
27
|
+
})}`,
|
|
28
|
+
`const call = (name, options) => globalThis.wx?.[name]?.(options)`,
|
|
29
|
+
`export const pages = routes.pages`,
|
|
30
|
+
`export const entries = routes.entries`,
|
|
31
|
+
`export const subPackages = routes.subPackages`,
|
|
32
|
+
`export const miniProgramRouter = {`,
|
|
33
|
+
` switchTab: options => call('switchTab', options),`,
|
|
34
|
+
` reLaunch: options => call('reLaunch', options),`,
|
|
35
|
+
` redirectTo: options => call('redirectTo', options),`,
|
|
36
|
+
` navigateTo: options => call('navigateTo', options),`,
|
|
37
|
+
` navigateBack: options => call('navigateBack', options),`,
|
|
38
|
+
`}`,
|
|
39
|
+
`export const wxRouter = miniProgramRouter`,
|
|
40
|
+
`export { routes }`,
|
|
41
|
+
`export default routes`
|
|
42
|
+
].join("\n");
|
|
43
|
+
}
|
|
4
44
|
function generateEntryModule(result, root, wxssOptions, pluginOptions) {
|
|
5
45
|
const importLines = [`import { initializePageRoutes } from '${pluginOptions?.__runtimeProvider?.moduleId ?? toViteFsImport(resolveRuntimePolyfillPath())}'`];
|
|
6
46
|
const bodyLines = [];
|
|
7
|
-
for (const page of result.pages) importLines.push(`import '${relativeModuleId(root, page.script)}'`);
|
|
8
|
-
for (const component of result.components) importLines.push(`import '${relativeModuleId(root, component.script)}'`);
|
|
9
47
|
if (result.app) importLines.push(`import '${relativeModuleId(root, result.app)}'`);
|
|
48
|
+
for (const page of result.pages) importLines.push(`import '${relativeModuleId(root, page.script)}'`);
|
|
49
|
+
for (const component of result.components) {
|
|
50
|
+
const componentImportId = component.importId ? `${WEB_COMPONENT_PREFIX}${encodeURIComponent(component.importId)}` : relativeModuleId(root, component.script);
|
|
51
|
+
importLines.push(`import '${componentImportId}'`);
|
|
52
|
+
}
|
|
53
|
+
for (const layout of result.layouts) importLines.push(`import '${relativeModuleId(root, layout.script)}'`);
|
|
10
54
|
const pageOrder = result.pages.map((page) => page.id);
|
|
11
|
-
const rpxConfig = wxssOptions?.designWidth ? {
|
|
12
|
-
designWidth: wxssOptions
|
|
13
|
-
varName: wxssOptions
|
|
55
|
+
const rpxConfig = wxssOptions?.pxPerRpx === void 0 || typeof wxssOptions.designWidth === "number" && Number.isFinite(wxssOptions.designWidth) ? {
|
|
56
|
+
designWidth: wxssOptions?.designWidth ?? 750,
|
|
57
|
+
varName: wxssOptions?.rpxVar
|
|
14
58
|
} : void 0;
|
|
15
59
|
const initOptions = {};
|
|
60
|
+
if (result.tabBar) initOptions.tabBar = result.tabBar;
|
|
16
61
|
if (rpxConfig) initOptions.rpx = rpxConfig;
|
|
17
62
|
if (pluginOptions?.form?.preventDefault !== void 0) initOptions.form = { preventDefault: pluginOptions.form.preventDefault };
|
|
18
63
|
const runtimeOptions = {};
|
|
19
64
|
if (pluginOptions?.runtime?.executionMode) runtimeOptions.executionMode = pluginOptions.runtime.executionMode;
|
|
20
65
|
if (pluginOptions?.runtime?.warnings) runtimeOptions.warnings = pluginOptions.runtime.warnings;
|
|
66
|
+
if (pluginOptions?.runtime?.viewport) runtimeOptions.viewport = pluginOptions.runtime.viewport;
|
|
67
|
+
if (pluginOptions?.runtime?.routing) runtimeOptions.routing = pluginOptions.runtime.routing;
|
|
68
|
+
if (pluginOptions?.runtime?.seo) runtimeOptions.seo = pluginOptions.runtime.seo;
|
|
69
|
+
if (pluginOptions?.runtime?.resourceHints) runtimeOptions.resourceHints = pluginOptions.runtime.resourceHints;
|
|
21
70
|
if (Object.keys(runtimeOptions).length > 0) initOptions.runtime = runtimeOptions;
|
|
22
71
|
const initOptionsCode = Object.keys(initOptions).length > 0 ? `, ${JSON.stringify(initOptions)}` : "";
|
|
23
72
|
bodyLines.push(`initializePageRoutes(${JSON.stringify(pageOrder)}${initOptionsCode})`);
|
|
@@ -25,5 +74,5 @@ function generateEntryModule(result, root, wxssOptions, pluginOptions) {
|
|
|
25
74
|
}
|
|
26
75
|
|
|
27
76
|
//#endregion
|
|
28
|
-
export { generateEntryModule };
|
|
77
|
+
export { generateAutoRoutesModule, generateEntryModule };
|
|
29
78
|
//# sourceMappingURL=entry.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.mjs","names":[],"sources":["../../src/plugin/entry.ts"],"sourcesContent":["import type { WxssTransformOptions } from '../css/wxss'\n\nimport type { ScanResult, WeappWebPluginOptions } from './types'\nimport { relativeModuleId, resolveRuntimePolyfillPath, toViteFsImport } from './path'\n\nexport function generateEntryModule(\n result: ScanResult,\n root: string,\n wxssOptions?: WxssTransformOptions,\n pluginOptions?: WeappWebPluginOptions,\n) {\n const runtimePolyfillId = pluginOptions?.__runtimeProvider?.moduleId\n ?? toViteFsImport(resolveRuntimePolyfillPath())\n const importLines: string[] = [`import { initializePageRoutes } from '${runtimePolyfillId}'`]\n const bodyLines: string[] = []\n\n for (const page of result.pages) {\n importLines.push(`import '${relativeModuleId(root, page.script)}'`)\n }\n for (const component of result.components) {\n
|
|
1
|
+
{"version":3,"file":"entry.mjs","names":[],"sources":["../../src/plugin/entry.ts"],"sourcesContent":["import type { WxssTransformOptions } from '../css/wxss'\n\nimport type { ScanResult, WeappWebPluginOptions } from './types'\nimport { WEB_COMPONENT_PREFIX } from './constants'\nimport { relativeModuleId, resolveRuntimePolyfillPath, toViteFsImport } from './path'\n\nexport function generateAutoRoutesModule(result: ScanResult) {\n const pages = result.pages.map(page => page.id)\n const subPackageMap = new Map<string, string[]>()\n for (const id of pages) {\n const pagesSegment = id.indexOf('/pages/')\n if (pagesSegment <= 0) {\n continue\n }\n const root = id.slice(0, pagesSegment)\n const route = id.slice(pagesSegment + 1)\n const routes = subPackageMap.get(root) ?? []\n routes.push(route)\n subPackageMap.set(root, routes)\n }\n const mainPages = pages.filter(id => !id.includes('/pages/'))\n const subPackages = [...subPackageMap].map(([root, routes]) => ({ root, pages: routes }))\n const snapshot = JSON.stringify({ pages: mainPages, entries: pages, subPackages })\n return [\n `const routes = ${snapshot}`,\n `const call = (name, options) => globalThis.wx?.[name]?.(options)`,\n `export const pages = routes.pages`,\n `export const entries = routes.entries`,\n `export const subPackages = routes.subPackages`,\n `export const miniProgramRouter = {`,\n ` switchTab: options => call('switchTab', options),`,\n ` reLaunch: options => call('reLaunch', options),`,\n ` redirectTo: options => call('redirectTo', options),`,\n ` navigateTo: options => call('navigateTo', options),`,\n ` navigateBack: options => call('navigateBack', options),`,\n `}`,\n `export const wxRouter = miniProgramRouter`,\n `export { routes }`,\n `export default routes`,\n ].join('\\n')\n}\n\nexport function generateEntryModule(\n result: ScanResult,\n root: string,\n wxssOptions?: WxssTransformOptions,\n pluginOptions?: WeappWebPluginOptions,\n) {\n const runtimePolyfillId = pluginOptions?.__runtimeProvider?.moduleId\n ?? toViteFsImport(resolveRuntimePolyfillPath())\n const importLines: string[] = [`import { initializePageRoutes } from '${runtimePolyfillId}'`]\n const bodyLines: string[] = []\n\n if (result.app) {\n importLines.push(`import '${relativeModuleId(root, result.app)}'`)\n }\n for (const page of result.pages) {\n importLines.push(`import '${relativeModuleId(root, page.script)}'`)\n }\n for (const component of result.components) {\n const componentImportId = component.importId\n ? `${WEB_COMPONENT_PREFIX}${encodeURIComponent(component.importId)}`\n : relativeModuleId(root, component.script)\n importLines.push(`import '${componentImportId}'`)\n }\n for (const layout of result.layouts) {\n importLines.push(`import '${relativeModuleId(root, layout.script)}'`)\n }\n\n const pageOrder = result.pages.map(page => page.id)\n const useRuntimeRpx = wxssOptions?.pxPerRpx === undefined\n || (typeof wxssOptions.designWidth === 'number' && Number.isFinite(wxssOptions.designWidth))\n const rpxConfig = useRuntimeRpx\n ? { designWidth: wxssOptions?.designWidth ?? 750, varName: wxssOptions?.rpxVar }\n : undefined\n\n const initOptions: Record<string, any> = {}\n if (result.tabBar) {\n initOptions.tabBar = result.tabBar\n }\n if (rpxConfig) {\n initOptions.rpx = rpxConfig\n }\n if (pluginOptions?.form?.preventDefault !== undefined) {\n initOptions.form = { preventDefault: pluginOptions.form.preventDefault }\n }\n\n const runtimeOptions: Record<string, any> = {}\n if (pluginOptions?.runtime?.executionMode) {\n runtimeOptions.executionMode = pluginOptions.runtime.executionMode\n }\n if (pluginOptions?.runtime?.warnings) {\n runtimeOptions.warnings = pluginOptions.runtime.warnings\n }\n if (pluginOptions?.runtime?.viewport) {\n runtimeOptions.viewport = pluginOptions.runtime.viewport\n }\n if (pluginOptions?.runtime?.routing) {\n runtimeOptions.routing = pluginOptions.runtime.routing\n }\n if (pluginOptions?.runtime?.seo) {\n runtimeOptions.seo = pluginOptions.runtime.seo\n }\n if (pluginOptions?.runtime?.resourceHints) {\n runtimeOptions.resourceHints = pluginOptions.runtime.resourceHints\n }\n if (Object.keys(runtimeOptions).length > 0) {\n initOptions.runtime = runtimeOptions\n }\n\n const initOptionsCode = Object.keys(initOptions).length > 0 ? `, ${JSON.stringify(initOptions)}` : ''\n bodyLines.push(`initializePageRoutes(${JSON.stringify(pageOrder)}${initOptionsCode})`)\n return [...importLines, ...bodyLines].join('\\n')\n}\n"],"mappings":"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"}
|
package/dist/plugin/files.mjs
CHANGED
|
@@ -21,7 +21,7 @@ async function readJsonFile(pathname) {
|
|
|
21
21
|
filepath: candidate,
|
|
22
22
|
preserveTemporaryFile: true
|
|
23
23
|
});
|
|
24
|
-
const resolved = typeof mod
|
|
24
|
+
const resolved = typeof mod === "function" ? await mod() : mod;
|
|
25
25
|
if (!isRecord(resolved)) return;
|
|
26
26
|
return resolved;
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.mjs","names":[],"sources":["../../src/plugin/files.ts"],"sourcesContent":["import { fs } from '@weapp-core/shared/fs'\nimport { extname } from 'pathe'\nimport { bundleRequire } from 'rolldown-require'\n\nimport { SCRIPT_EXTS, STYLE_EXTS, TEMPLATE_EXTS } from './constants'\n\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nexport async function readJsonFile(pathname: string) {\n const candidates = [pathname]\n if (pathname.endsWith('.json')) {\n candidates.push(`${pathname}.ts`, `${pathname}.js`)\n }\n\n for (const candidate of candidates) {\n if (!(await fs.pathExists(candidate))) {\n continue\n }\n if (candidate.endsWith('.json')) {\n const json = await fs.readJson(candidate).catch(() => undefined)\n if (!isRecord(json)) {\n return undefined\n }\n return json\n }\n const { mod } = await bundleRequire({\n filepath: candidate,\n preserveTemporaryFile: true,\n })\n const resolved = typeof mod
|
|
1
|
+
{"version":3,"file":"files.mjs","names":[],"sources":["../../src/plugin/files.ts"],"sourcesContent":["import { fs } from '@weapp-core/shared/fs'\nimport { extname } from 'pathe'\nimport { bundleRequire } from 'rolldown-require'\n\nimport { SCRIPT_EXTS, STYLE_EXTS, TEMPLATE_EXTS } from './constants'\n\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nexport async function readJsonFile(pathname: string) {\n const candidates = [pathname]\n if (pathname.endsWith('.json')) {\n candidates.push(`${pathname}.ts`, `${pathname}.js`)\n }\n\n for (const candidate of candidates) {\n if (!(await fs.pathExists(candidate))) {\n continue\n }\n if (candidate.endsWith('.json')) {\n const json = await fs.readJson(candidate).catch(() => undefined)\n if (!isRecord(json)) {\n return undefined\n }\n return json\n }\n const { mod } = await bundleRequire({\n filepath: candidate,\n preserveTemporaryFile: true,\n })\n const resolved = typeof mod === 'function'\n ? await mod()\n : mod\n if (!isRecord(resolved)) {\n return undefined\n }\n return resolved\n }\n\n return undefined\n}\n\nexport async function resolveJsonPath(basePath: string) {\n const candidates = [basePath]\n if (basePath.endsWith('.json')) {\n candidates.push(`${basePath}.ts`, `${basePath}.js`)\n }\n for (const candidate of candidates) {\n if (await fs.pathExists(candidate)) {\n return candidate\n }\n }\n return undefined\n}\n\nexport async function resolveScriptFile(basePath: string) {\n const ext = extname(basePath)\n if (ext && (await fs.pathExists(basePath))) {\n return basePath\n }\n for (const candidateExt of SCRIPT_EXTS) {\n const candidate = `${basePath}${candidateExt}`\n if (await fs.pathExists(candidate)) {\n return candidate\n }\n }\n return undefined\n}\n\nexport async function resolveStyleFile(scriptPath: string) {\n const base = scriptPath.replace(new RegExp(`${extname(scriptPath)}$`), '')\n for (const ext of STYLE_EXTS) {\n const candidate = `${base}${ext}`\n if (await fs.pathExists(candidate)) {\n return candidate\n }\n }\n return undefined\n}\n\nexport async function resolveTemplateFile(scriptPath: string) {\n const base = scriptPath.replace(new RegExp(`${extname(scriptPath)}$`), '')\n for (const ext of TEMPLATE_EXTS) {\n const candidate = `${base}${ext}`\n if (await fs.pathExists(candidate)) {\n return candidate\n }\n }\n return undefined\n}\n"],"mappings":";;;;;;AAMA,SAAgB,SAAS,OAAkD;CACzE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,eAAsB,aAAa,UAAkB;CACnD,MAAM,aAAa,CAAC,QAAQ;CAC5B,IAAI,SAAS,SAAS,OAAO,GAC3B,WAAW,KAAK,GAAG,SAAS,MAAM,GAAG,SAAS,IAAI;CAGpD,KAAK,MAAM,aAAa,YAAY;EAClC,IAAI,CAAE,MAAM,GAAG,WAAW,SAAS,GACjC;EAEF,IAAI,UAAU,SAAS,OAAO,GAAG;GAC/B,MAAM,OAAO,MAAM,GAAG,SAAS,SAAS,CAAC,CAAC,YAAY,MAAS;GAC/D,IAAI,CAAC,SAAS,IAAI,GAChB;GAEF,OAAO;EACT;EACA,MAAM,EAAE,QAAQ,MAAM,cAAc;GAClC,UAAU;GACV,uBAAuB;EACzB,CAAC;EACD,MAAM,WAAW,OAAO,QAAQ,aAC5B,MAAM,IAAI,IACV;EACJ,IAAI,CAAC,SAAS,QAAQ,GACpB;EAEF,OAAO;CACT;AAGF;AAEA,eAAsB,gBAAgB,UAAkB;CACtD,MAAM,aAAa,CAAC,QAAQ;CAC5B,IAAI,SAAS,SAAS,OAAO,GAC3B,WAAW,KAAK,GAAG,SAAS,MAAM,GAAG,SAAS,IAAI;CAEpD,KAAK,MAAM,aAAa,YACtB,IAAI,MAAM,GAAG,WAAW,SAAS,GAC/B,OAAO;AAIb;AAEA,eAAsB,kBAAkB,UAAkB;CAExD,IADY,QAAQ,QACd,KAAM,MAAM,GAAG,WAAW,QAAQ,GACtC,OAAO;CAET,KAAK,MAAM,gBAAgB,aAAa;EACtC,MAAM,YAAY,GAAG,WAAW;EAChC,IAAI,MAAM,GAAG,WAAW,SAAS,GAC/B,OAAO;CAEX;AAEF;AAEA,eAAsB,iBAAiB,YAAoB;CACzD,MAAM,OAAO,WAAW,QAAQ,IAAI,OAAO,GAAG,QAAQ,UAAU,EAAE,EAAE,GAAG,EAAE;CACzE,KAAK,MAAM,OAAO,YAAY;EAC5B,MAAM,YAAY,GAAG,OAAO;EAC5B,IAAI,MAAM,GAAG,WAAW,SAAS,GAC/B,OAAO;CAEX;AAEF;AAEA,eAAsB,oBAAoB,YAAoB;CAC5D,MAAM,OAAO,WAAW,QAAQ,IAAI,OAAO,GAAG,QAAQ,UAAU,EAAE,EAAE,GAAG,EAAE;CACzE,KAAK,MAAM,OAAO,eAAe;EAC/B,MAAM,YAAY,GAAG,OAAO;EAC5B,IAAI,MAAM,GAAG,WAAW,SAAS,GAC/B,OAAO;CAEX;AAEF"}
|