vike 0.4.237 → 0.4.238
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/cjs/__internal/index.js +3 -3
- package/dist/cjs/client/runtime-client-routing/globalContext.js +2 -2
- package/dist/cjs/client/runtime-server-routing/globalContext.js +2 -2
- package/dist/cjs/client/runtime-server-routing/utils.js +1 -1
- package/dist/cjs/client/shared/createGetGlobalContextClient.js +5 -5
- package/dist/cjs/node/api/build.js +5 -31
- package/dist/cjs/node/api/context.js +13 -12
- package/dist/cjs/node/api/dev.js +0 -2
- package/dist/cjs/node/api/index.js +0 -2
- package/dist/cjs/node/api/onLoad.js +2 -2
- package/dist/cjs/node/api/prepareViteApiCall.js +2 -3
- package/dist/cjs/node/api/preview.js +2 -3
- package/dist/cjs/node/api/utils.js +1 -0
- package/dist/cjs/node/cli/index.js +2 -2
- package/dist/cjs/node/cli/onLoad.js +2 -2
- package/dist/cjs/node/prerender/runPrerender.js +7 -8
- package/dist/cjs/node/prerender/runPrerenderEntry.js +1 -1
- package/dist/cjs/node/runtime/globalContext.js +128 -112
- package/dist/cjs/node/runtime/html/injectAssets/getHtmlTags.js +1 -1
- package/dist/cjs/node/runtime/renderPage/analyzePage.js +6 -4
- package/dist/cjs/node/runtime/renderPage/createPageContextServerSide.js +1 -1
- package/dist/cjs/node/runtime/renderPage/execHookOnRenderHtml.js +1 -11
- package/dist/cjs/node/runtime/renderPage/getPageAssets/getManifestEntry.js +5 -4
- package/dist/cjs/node/runtime/renderPage/getPageAssets/{retrieveAssetsDev.js → retrievePageAssetsDev.js} +21 -6
- package/dist/cjs/node/runtime/renderPage/getPageAssets/{retrieveAssetsProd.js → retrievePageAssetsProd.js} +19 -2
- package/dist/cjs/node/runtime/renderPage/getPageAssets.js +5 -34
- package/dist/cjs/node/runtime/renderPage/loadPageConfigsLazyServerSide.js +42 -46
- package/dist/cjs/node/runtime/renderPage/{renderPageAlreadyRouted.js → renderPageAfterRoute.js} +3 -4
- package/dist/cjs/node/runtime/renderPage.js +18 -16
- package/dist/cjs/node/runtime/utils.js +3 -2
- package/dist/cjs/node/runtime-dev/createDevMiddleware.js +0 -2
- package/dist/cjs/node/shared/virtualFileId.js +110 -0
- package/dist/cjs/node/vite/index.js +3 -3
- package/dist/cjs/node/vite/onLoad.js +5 -3
- package/dist/cjs/node/vite/plugins/pluginBuild/handleAssetsManifest.js +29 -30
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildApp.js +122 -10
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildConfig.js +12 -17
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginDistPackageJsonFile.js +2 -10
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginModuleBanner.js +5 -11
- package/dist/cjs/node/vite/plugins/pluginBuild/{pluginBuildEntry.js → pluginProdBuildEntry.js} +11 -11
- package/dist/cjs/node/vite/plugins/pluginBuild.js +2 -4
- package/dist/cjs/node/vite/plugins/pluginDev/determineFsAllowList.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginDev/determineOptimizeDeps.js +6 -5
- package/dist/cjs/node/vite/plugins/pluginEnvVars.js +6 -13
- package/dist/cjs/node/vite/plugins/pluginExtractAssets.js +7 -7
- package/dist/cjs/node/vite/plugins/pluginExtractExportNames.js +6 -2
- package/dist/cjs/node/vite/plugins/pluginFileEnv.js +4 -3
- package/dist/cjs/node/vite/plugins/pluginNonRunnableDev.js +11 -11
- package/dist/cjs/node/vite/plugins/pluginPreview.js +4 -7
- package/dist/cjs/node/vite/plugins/pluginReplaceConstants.js +6 -13
- package/dist/cjs/node/vite/plugins/pluginSetGlobalContext.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/{getVirtualFilePageConfigsEager.js → generateVirtualFileGlobalEntry.js} +5 -6
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/{getVirtualFileEntry.js → generateVirtualFileGlobalEntryWithOldDesign.js} +12 -12
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/{getVirtualFilePageConfigLazy.js → generateVirtualFilePageEntry.js} +10 -11
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/getConfigValueSourcesRelevant.js +51 -21
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles.js +14 -12
- package/dist/cjs/node/vite/shared/findPageFiles.js +1 -1
- package/dist/cjs/node/vite/shared/{resolveClientEntriesDev.js → getClientEntrySrcDev.js} +3 -3
- package/dist/cjs/node/vite/shared/getHttpRequestAsyncStore.js +8 -6
- package/dist/cjs/node/vite/shared/getMagicString.js +1 -1
- package/dist/cjs/node/vite/shared/getOutDirs.js +21 -22
- package/dist/cjs/node/vite/shared/getViteConfigRuntime.js +1 -1
- package/dist/cjs/node/vite/shared/isViteServerSide.js +68 -0
- package/dist/cjs/node/vite/shared/loggerVite/removeSuperfluousViteLog.js +6 -4
- package/dist/cjs/node/vite/shared/loggerVite.js +1 -1
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js +20 -36
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles.js +5 -4
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal.js +46 -48
- package/dist/cjs/shared/createGlobalContextShared.js +16 -14
- package/dist/cjs/shared/getPageFiles/{parseVirtualFileExports.js → parseVirtualFileExportsGlobalEntry.js} +20 -26
- package/dist/cjs/shared/page-configs/loadAndParseVirtualFilePageEntry.js +25 -0
- package/dist/cjs/shared/page-configs/resolveVikeConfigPublic.js +9 -4
- package/dist/cjs/shared/page-configs/serialize/{parsePageConfigs.js → parsePageConfigsSerialized.js} +2 -2
- package/dist/cjs/shared/page-configs/serialize/serializeConfigValues.js +3 -3
- package/dist/cjs/shared/route/execHookOnBeforeRoute.js +0 -1
- package/dist/cjs/shared/route/index.js +0 -1
- package/dist/cjs/types/VikeGlobalInternal.js +2 -0
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/assertSetup.js +2 -3
- package/dist/cjs/utils/assertVersion.js +2 -0
- package/dist/cjs/utils/debug.js +4 -4
- package/dist/cjs/utils/getGlobalObject.js +8 -15
- package/dist/cjs/utils/isNonRunnableDev.js +12 -0
- package/dist/cjs/utils/isScriptFile.js +1 -1
- package/dist/cjs/utils/path.js +5 -5
- package/dist/cjs/utils/requireResolve.js +13 -12
- package/dist/cjs/utils/{augmentType.js → updateType.js} +3 -3
- package/dist/esm/__internal/index.d.ts +2 -2
- package/dist/esm/__internal/index.js +3 -3
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.js +2 -2
- package/dist/esm/client/runtime-client-routing/getPageContextCurrent.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.d.ts +12 -12
- package/dist/esm/client/runtime-client-routing/globalContext.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/globalContext.js +2 -2
- package/dist/esm/client/runtime-client-routing/prefetch/getPrefetchSettings.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/prefetch.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/prefetch.js +2 -2
- package/dist/esm/client/runtime-client-routing/preparePageContextForPublicUsageClient.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.d.ts +6 -7
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.js +6 -6
- package/dist/esm/client/runtime-client-routing/utils.d.ts +1 -1
- package/dist/esm/client/runtime-client-routing/utils.js +1 -1
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.d.ts +3 -3
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.js +3 -3
- package/dist/esm/client/runtime-server-routing/globalContext.d.ts +2 -2
- package/dist/esm/client/runtime-server-routing/globalContext.js +2 -2
- package/dist/esm/client/runtime-server-routing/preparePageContextForPublicUsageClient.d.ts +2 -2
- package/dist/esm/client/runtime-server-routing/utils.d.ts +1 -1
- package/dist/esm/client/runtime-server-routing/utils.js +1 -1
- package/dist/esm/client/shared/createGetGlobalContextClient.d.ts +3 -3
- package/dist/esm/client/shared/createGetGlobalContextClient.js +5 -5
- package/dist/esm/client/shared/execHookOnRenderClient.d.ts +2 -2
- package/dist/esm/client/shared/loadPageConfigsLazyClientSide.d.ts +1 -1
- package/dist/esm/client/shared/loadPageConfigsLazyClientSide.js +4 -4
- package/dist/esm/client/shared/preparePageContextForPublicUsageClientShared.d.ts +2 -2
- package/dist/esm/node/api/build.d.ts +2 -2
- package/dist/esm/node/api/build.js +6 -32
- package/dist/esm/node/api/context.d.ts +10 -10
- package/dist/esm/node/api/context.js +13 -12
- package/dist/esm/node/api/dev.d.ts +2 -2
- package/dist/esm/node/api/dev.js +0 -2
- package/dist/esm/node/api/index.js +0 -2
- package/dist/esm/node/api/onLoad.js +1 -1
- package/dist/esm/node/api/prepareViteApiCall.d.ts +3 -5
- package/dist/esm/node/api/prepareViteApiCall.js +3 -4
- package/dist/esm/node/api/preview.d.ts +2 -2
- package/dist/esm/node/api/preview.js +2 -3
- package/dist/esm/node/api/types.d.ts +4 -4
- package/dist/esm/node/api/utils.d.ts +1 -0
- package/dist/esm/node/api/utils.js +1 -0
- package/dist/esm/node/cli/index.js +1 -1
- package/dist/esm/node/cli/onLoad.js +1 -1
- package/dist/esm/node/prerender/runPrerender.d.ts +13 -304
- package/dist/esm/node/prerender/runPrerender.js +8 -9
- package/dist/esm/node/prerender/runPrerenderEntry.js +1 -1
- package/dist/esm/node/runtime/globalContext.d.ts +13 -13
- package/dist/esm/node/runtime/globalContext.js +125 -109
- package/dist/esm/node/runtime/html/injectAssets/getHtmlTags.js +1 -1
- package/dist/esm/node/runtime/renderPage/analyzePage.d.ts +4 -3
- package/dist/esm/node/runtime/renderPage/analyzePage.js +6 -4
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.js +2 -2
- package/dist/esm/node/runtime/renderPage/execHookOnRenderHtml.d.ts +0 -1
- package/dist/esm/node/runtime/renderPage/execHookOnRenderHtml.js +1 -11
- package/dist/esm/node/runtime/renderPage/execHookServer.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/getPageAssets/getManifestEntry.js +5 -4
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrievePageAssetsDev.d.ts +10 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets/{retrieveAssetsDev.js → retrievePageAssetsDev.js} +22 -7
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrievePageAssetsProd.d.ts +10 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets/{retrieveAssetsProd.js → retrievePageAssetsProd.js} +19 -2
- package/dist/esm/node/runtime/renderPage/getPageAssets.d.ts +2 -10
- package/dist/esm/node/runtime/renderPage/getPageAssets.js +4 -33
- package/dist/esm/node/runtime/renderPage/handleErrorWithoutErrorPage.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/loadPageConfigsLazyServerSide.d.ts +106 -20
- package/dist/esm/node/runtime/renderPage/loadPageConfigsLazyServerSide.js +44 -48
- package/dist/esm/node/runtime/renderPage/preparePageContextForPublicUsageServer.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/{renderPageAlreadyRouted.d.ts → renderPageAfterRoute.d.ts} +26 -10
- package/dist/esm/node/runtime/renderPage/{renderPageAlreadyRouted.js → renderPageAfterRoute.js} +5 -6
- package/dist/esm/node/runtime/renderPage.d.ts +9 -6
- package/dist/esm/node/runtime/renderPage.js +20 -18
- package/dist/esm/node/runtime/utils.d.ts +3 -2
- package/dist/esm/node/runtime/utils.js +3 -2
- package/dist/esm/node/runtime-dev/createDevMiddleware.d.ts +2 -2
- package/dist/esm/node/runtime-dev/createDevMiddleware.js +0 -2
- package/dist/esm/node/shared/virtualFileId.d.ts +28 -0
- package/dist/esm/node/shared/virtualFileId.js +107 -0
- package/dist/esm/node/vite/index.js +3 -3
- package/dist/esm/node/vite/onLoad.js +5 -3
- package/dist/esm/node/vite/plugins/pluginBuild/handleAssetsManifest.d.ts +5 -6
- package/dist/esm/node/vite/plugins/pluginBuild/handleAssetsManifest.js +31 -32
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildApp.js +119 -10
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildConfig.js +12 -17
- package/dist/esm/node/vite/plugins/pluginBuild/pluginDistPackageJsonFile.js +2 -10
- package/dist/esm/node/vite/plugins/pluginBuild/pluginModuleBanner.js +5 -8
- package/dist/esm/node/vite/plugins/pluginBuild/{pluginBuildEntry.d.ts → pluginProdBuildEntry.d.ts} +2 -2
- package/dist/esm/node/vite/plugins/pluginBuild/{pluginBuildEntry.js → pluginProdBuildEntry.js} +12 -12
- package/dist/esm/node/vite/plugins/pluginBuild.js +2 -4
- package/dist/esm/node/vite/plugins/pluginDev/determineFsAllowList.js +3 -3
- package/dist/esm/node/vite/plugins/pluginDev/determineOptimizeDeps.js +6 -5
- package/dist/esm/node/vite/plugins/pluginEnvVars.js +6 -10
- package/dist/esm/node/vite/plugins/pluginExtractAssets.js +5 -5
- package/dist/esm/node/vite/plugins/pluginExtractExportNames.js +6 -2
- package/dist/esm/node/vite/plugins/pluginFileEnv.js +4 -3
- package/dist/esm/node/vite/plugins/pluginNonRunnableDev.js +12 -12
- package/dist/esm/node/vite/plugins/pluginPreview.js +5 -8
- package/dist/esm/node/vite/plugins/pluginReplaceConstants.js +6 -10
- package/dist/esm/node/vite/plugins/pluginSetGlobalContext.js +2 -2
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/generateVirtualFileGlobalEntry.d.ts +2 -0
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/{getVirtualFilePageConfigsEager.js → generateVirtualFileGlobalEntry.js} +5 -6
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/generateVirtualFileGlobalEntryWithOldDesign.d.ts +6 -0
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/{getVirtualFileEntry.js → generateVirtualFileGlobalEntryWithOldDesign.js} +11 -11
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/generateVirtualFilePageEntry.d.ts +2 -0
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/{getVirtualFilePageConfigLazy.js → generateVirtualFilePageEntry.js} +10 -11
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/getConfigValueSourcesRelevant.d.ts +5 -1
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/getConfigValueSourcesRelevant.js +52 -22
- package/dist/esm/node/vite/plugins/pluginVirtualFiles.js +14 -12
- package/dist/esm/node/vite/shared/findPageFiles.js +1 -1
- package/dist/esm/node/vite/shared/getClientEntrySrcDev.d.ts +4 -0
- package/dist/esm/node/vite/shared/{resolveClientEntriesDev.js → getClientEntrySrcDev.js} +4 -4
- package/dist/esm/node/vite/shared/getHttpRequestAsyncStore.js +9 -7
- package/dist/esm/node/vite/shared/getMagicString.js +1 -1
- package/dist/esm/node/vite/shared/getOutDirs.d.ts +4 -3
- package/dist/esm/node/vite/shared/getOutDirs.js +21 -22
- package/dist/esm/node/vite/shared/getViteConfigRuntime.js +1 -1
- package/dist/esm/node/vite/shared/isViteServerSide.d.ts +18 -0
- package/dist/esm/node/vite/shared/isViteServerSide.js +66 -0
- package/dist/esm/node/vite/shared/loggerVite/removeSuperfluousViteLog.js +7 -5
- package/dist/esm/node/vite/shared/loggerVite.js +1 -1
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.d.ts +3 -2
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js +21 -37
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles.js +6 -5
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal.d.ts +4 -2
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal.js +49 -51
- package/dist/esm/shared/createGlobalContextShared.d.ts +7 -6
- package/dist/esm/shared/createGlobalContextShared.js +18 -16
- package/dist/esm/shared/getPageFiles/{parseVirtualFileExports.d.ts → parseVirtualFileExportsGlobalEntry.d.ts} +2 -2
- package/dist/esm/shared/getPageFiles/{parseVirtualFileExports.js → parseVirtualFileExportsGlobalEntry.js} +20 -26
- package/dist/esm/shared/getPageFiles.d.ts +1 -1
- package/dist/esm/shared/hooks/execHook.d.ts +2 -2
- package/dist/esm/shared/hooks/getHook.d.ts +3 -3
- package/dist/esm/shared/page-configs/loadAndParseVirtualFilePageEntry.d.ts +3 -0
- package/dist/esm/shared/page-configs/loadAndParseVirtualFilePageEntry.js +23 -0
- package/dist/esm/shared/page-configs/resolveVikeConfigPublic.d.ts +9 -9
- package/dist/esm/shared/page-configs/resolveVikeConfigPublic.js +9 -4
- package/dist/esm/shared/page-configs/serialize/PageConfigSerialized.d.ts +1 -1
- package/dist/esm/shared/page-configs/serialize/{parsePageConfigs.d.ts → parsePageConfigsSerialized.d.ts} +2 -2
- package/dist/esm/shared/page-configs/serialize/{parsePageConfigs.js → parsePageConfigsSerialized.js} +2 -2
- package/dist/esm/shared/page-configs/serialize/serializeConfigValues.js +3 -3
- package/dist/esm/shared/route/execHookOnBeforeRoute.d.ts +3 -3
- package/dist/esm/shared/route/execHookOnBeforeRoute.js +0 -1
- package/dist/esm/shared/route/index.d.ts +5 -6
- package/dist/esm/shared/route/index.js +0 -1
- package/dist/esm/types/Config.d.ts +3 -7
- package/dist/esm/types/PageConfig.d.ts +11 -9
- package/dist/esm/types/VikeGlobalInternal.d.ts +4 -0
- package/dist/esm/types/VikeGlobalInternal.js +1 -0
- package/dist/esm/types/VikeNamespace.d.ts +13 -0
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/assertSetup.js +2 -3
- package/dist/esm/utils/assertVersion.js +2 -0
- package/dist/esm/utils/debug.js +3 -3
- package/dist/esm/utils/getGlobalObject.d.ts +6 -5
- package/dist/esm/utils/getGlobalObject.js +8 -15
- package/dist/esm/utils/isNonRunnableDev.d.ts +2 -0
- package/dist/esm/utils/isNonRunnableDev.js +10 -0
- package/dist/esm/utils/isScriptFile.d.ts +1 -1
- package/dist/esm/utils/isScriptFile.js +1 -1
- package/dist/esm/utils/path.d.ts +2 -0
- package/dist/esm/utils/path.js +5 -5
- package/dist/esm/utils/requireResolve.d.ts +4 -4
- package/dist/esm/utils/requireResolve.js +13 -12
- package/dist/esm/utils/updateType.d.ts +3 -0
- package/dist/esm/utils/updateType.js +7 -0
- package/package.json +6 -6
- package/dist/cjs/node/runtime/renderPage/debugPageFiles.js +0 -52
- package/dist/cjs/node/shared/virtualFiles/virtualFileEntry.js +0 -31
- package/dist/cjs/node/shared/virtualFiles/virtualFilePageConfigLazy.js +0 -45
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginAutoFullBuild.js +0 -149
- package/dist/cjs/node/vite/shared/applyRegExWithMagicString.js +0 -11
- package/dist/cjs/node/vite/shared/isViteServerBuild.js +0 -47
- package/dist/cjs/shared/page-configs/loadConfigValues.js +0 -21
- package/dist/esm/node/runtime/renderPage/debugPageFiles.d.ts +0 -23
- package/dist/esm/node/runtime/renderPage/debugPageFiles.js +0 -47
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsDev.d.ts +0 -4
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.d.ts +0 -4
- package/dist/esm/node/shared/virtualFiles/virtualFileEntry.d.ts +0 -11
- package/dist/esm/node/shared/virtualFiles/virtualFileEntry.js +0 -28
- package/dist/esm/node/shared/virtualFiles/virtualFilePageConfigLazy.d.ts +0 -9
- package/dist/esm/node/shared/virtualFiles/virtualFilePageConfigLazy.js +0 -43
- package/dist/esm/node/vite/plugins/pluginBuild/pluginAutoFullBuild.d.ts +0 -5
- package/dist/esm/node/vite/plugins/pluginBuild/pluginAutoFullBuild.js +0 -144
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/getVirtualFileEntry.d.ts +0 -5
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigLazy.d.ts +0 -3
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigsEager.d.ts +0 -2
- package/dist/esm/node/vite/shared/applyRegExWithMagicString.d.ts +0 -3
- package/dist/esm/node/vite/shared/applyRegExWithMagicString.js +0 -9
- package/dist/esm/node/vite/shared/isViteServerBuild.d.ts +0 -15
- package/dist/esm/node/vite/shared/isViteServerBuild.js +0 -45
- package/dist/esm/node/vite/shared/resolveClientEntriesDev.d.ts +0 -4
- package/dist/esm/shared/page-configs/loadConfigValues.d.ts +0 -3
- package/dist/esm/shared/page-configs/loadConfigValues.js +0 -19
- package/dist/esm/utils/augmentType.d.ts +0 -3
- package/dist/esm/utils/augmentType.js +0 -7
- /package/dist/cjs/utils/{getTerminWidth.js → getTerminalWidth.js} +0 -0
- /package/dist/esm/utils/{getTerminWidth.d.ts → getTerminalWidth.d.ts} +0 -0
- /package/dist/esm/utils/{getTerminWidth.js → getTerminalWidth.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { parsePageConfigsSerialized };
|
|
2
2
|
export { parseConfigValuesSerialized };
|
|
3
3
|
import type { ConfigValues, PageConfigRuntime, PageConfigGlobalRuntime } from '../../../types/PageConfig.js';
|
|
4
4
|
import type { PageConfigGlobalRuntimeSerialized, PageConfigRuntimeSerialized } from './PageConfigSerialized.js';
|
|
5
5
|
import type { ConfigValueSerialized } from './PageConfigSerialized.js';
|
|
6
|
-
declare function
|
|
6
|
+
declare function parsePageConfigsSerialized(pageConfigsSerialized: PageConfigRuntimeSerialized[], pageConfigGlobalSerialized: PageConfigGlobalRuntimeSerialized): {
|
|
7
7
|
pageConfigs: PageConfigRuntime[];
|
|
8
8
|
pageConfigGlobal: PageConfigGlobalRuntime;
|
|
9
9
|
};
|
package/dist/esm/shared/page-configs/serialize/{parsePageConfigs.js → parsePageConfigsSerialized.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { parsePageConfigsSerialized };
|
|
2
2
|
export { parseConfigValuesSerialized };
|
|
3
3
|
import { assert, assertUsage, isCallable } from '../../utils.js';
|
|
4
4
|
import { getConfigDefinedAt } from '../getConfigDefinedAt.js';
|
|
5
5
|
import { parseTransform } from '@brillout/json-serializer/parse';
|
|
6
6
|
import { assertPlusFileExport } from '../assertPlusFileExport.js';
|
|
7
|
-
function
|
|
7
|
+
function parsePageConfigsSerialized(pageConfigsSerialized, pageConfigGlobalSerialized) {
|
|
8
8
|
// pageConfigs
|
|
9
9
|
const pageConfigs = pageConfigsSerialized.map((pageConfigSerialized) => {
|
|
10
10
|
const configValues = parseConfigValuesSerialized(pageConfigSerialized.configValuesSerialized);
|
|
@@ -11,9 +11,9 @@ import { getConfigValueSourcesRelevant, isRuntimeEnvMatch, } from '../../../node
|
|
|
11
11
|
const stringifyOptions = { forbidReactElements: true };
|
|
12
12
|
const REPLACE_ME_BEFORE = '__VIKE__REPLACE_ME_BEFORE__';
|
|
13
13
|
const REPLACE_ME_AFTER = '__VIKE__REPLACE_ME_AFTER__';
|
|
14
|
-
// This file is never loaded on the client-side but we save it under the vike/shared/ directory in order to collocate it with
|
|
15
|
-
// - vike/shared/page-configs/serialize/
|
|
16
|
-
// -
|
|
14
|
+
// This file is never loaded on the client-side but we save it under the vike/shared/ directory in order to collocate it with parsePageConfigsSerialized()
|
|
15
|
+
// - vike/shared/page-configs/serialize/parsePageConfigsSerialized.ts
|
|
16
|
+
// - parsePageConfigsSerialized() is loaded on both the client- and server-side.
|
|
17
17
|
assertIsNotBrowser();
|
|
18
18
|
assertIsNotProductionRuntime();
|
|
19
19
|
function serializeConfigValues(pageConfig, importStatements, filesEnv, runtimeEnv, tabspace, isEager) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { execHookOnBeforeRoute };
|
|
2
|
-
import type {
|
|
3
|
-
declare function execHookOnBeforeRoute(pageContext:
|
|
2
|
+
import type { PageContextBeforeRoute, PageContextAfterRoute } from './index.js';
|
|
3
|
+
declare function execHookOnBeforeRoute(pageContext: PageContextBeforeRoute): Promise<null | ({
|
|
4
4
|
_routingProvidedByOnBeforeRouteHook: true;
|
|
5
|
-
} &
|
|
5
|
+
} & PageContextAfterRoute) | {
|
|
6
6
|
_routingProvidedByOnBeforeRouteHook: false;
|
|
7
7
|
}>;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
export { route };
|
|
2
|
-
export type {
|
|
3
|
-
export type {
|
|
2
|
+
export type { PageContextBeforeRoute };
|
|
3
|
+
export type { PageContextAfterRoute };
|
|
4
4
|
export type { PageRoutes };
|
|
5
5
|
export type { RouteMatches };
|
|
6
6
|
import { type PageContextUrlInternal, type PageContextUrlSource } from '../getPageContextUrlComputed.js';
|
|
7
7
|
import type { PageRoutes, RouteType } from './loadPageRoutes.js';
|
|
8
8
|
import type { GlobalContextInternal } from '../createGlobalContextShared.js';
|
|
9
|
-
type
|
|
9
|
+
type PageContextBeforeRoute = PageContextUrlInternal & {
|
|
10
10
|
_globalContext: GlobalContextInternal;
|
|
11
11
|
} & PageContextUrlSource;
|
|
12
|
-
type
|
|
12
|
+
type PageContextAfterRoute = {
|
|
13
13
|
pageId: string | null;
|
|
14
14
|
routeParams: Record<string, string>;
|
|
15
15
|
_routingProvidedByOnBeforeRouteHook?: boolean;
|
|
16
|
-
_debugRouteMatches: RouteMatches;
|
|
17
16
|
};
|
|
18
17
|
type RouteMatch = {
|
|
19
18
|
pageId: string;
|
|
@@ -23,4 +22,4 @@ type RouteMatch = {
|
|
|
23
22
|
routeParams: Record<string, string>;
|
|
24
23
|
};
|
|
25
24
|
type RouteMatches = 'CUSTOM_ROUTING' | RouteMatch[];
|
|
26
|
-
declare function route(pageContext:
|
|
25
|
+
declare function route(pageContext: PageContextBeforeRoute, skipOnBeforeRouteHook?: true): Promise<PageContextAfterRoute>;
|
|
@@ -81,7 +81,6 @@ async function route(pageContext, skipOnBeforeRouteHook) {
|
|
|
81
81
|
resolvePrecedence(routeMatches);
|
|
82
82
|
const winner = routeMatches[0] ?? null;
|
|
83
83
|
debug(`Route matches for URL ${pc.cyan(urlPathname)} (in precedence order):`, routeMatches);
|
|
84
|
-
objectAssign(pageContextFromRoute, { _debugRouteMatches: routeMatches });
|
|
85
84
|
// For vite-plugin-vercel https://github.com/magne4000/vite-plugin-vercel/blob/main/packages/vike-integration/vike.ts#L173
|
|
86
85
|
objectAssign(pageContextFromRoute, { _routeMatch: winner });
|
|
87
86
|
if (!winner) {
|
|
@@ -50,7 +50,7 @@ type HookName = HookNamePage | HookNameGlobal;
|
|
|
50
50
|
type HookNamePage = 'onHydrationEnd' | 'onBeforePrerenderStart' | 'onBeforeRender' | 'onPageTransitionStart' | 'onPageTransitionEnd' | 'onRenderHtml' | 'onRenderClient' | 'guard' | 'data' | 'onData' | 'route';
|
|
51
51
|
type HookNameGlobal = 'onBeforeRoute' | 'onPrerenderStart' | 'onCreatePageContext' | 'onCreateGlobalContext';
|
|
52
52
|
type HookNameOldDesign = 'render' | 'prerender' | 'onBeforePrerender';
|
|
53
|
-
type ConfigNameBuiltIn = Exclude<keyof
|
|
53
|
+
type ConfigNameBuiltIn = Exclude<keyof ConfigBuiltIn, keyof VikeVitePluginOptions | 'onBeforeRoute' | 'onPrerenderStart' | 'vite' | 'redirects'> | 'prerender' | 'serverOnlyHooks' | 'isClientRuntimeLoaded' | 'onBeforeRenderEnv' | 'dataEnv' | 'hooksTimeout' | 'clientHooks' | 'middleware';
|
|
54
54
|
type ConfigNameGlobal = 'onPrerenderStart' | 'onBeforeRoute' | 'prerender' | 'disableAutoFullBuild' | 'includeAssetsImportedByServer' | 'baseAssets' | 'baseServer' | 'redirects' | 'trailingSlash' | 'disableUrlNormalization' | 'vite';
|
|
55
55
|
type Config = ConfigBuiltIn & Vike.Config & (VikePackages.ConfigVikeReact | VikePackages.ConfigVikeVue | VikePackages.ConfigVikeSolid | VikePackages.ConfigVikeSvelte | VikePackages.ConfigVikeAngular);
|
|
56
56
|
/** @deprecated This type is deprecated, see https://vike.dev/data */
|
|
@@ -403,12 +403,8 @@ type ConfigBuiltIn = {
|
|
|
403
403
|
includeAssetsImportedByServer?: boolean;
|
|
404
404
|
/** @deprecated See https://vike.dev/disableAutoFullBuild */
|
|
405
405
|
disableAutoFullBuild?: boolean | 'prerender';
|
|
406
|
-
/**
|
|
407
|
-
|
|
408
|
-
*
|
|
409
|
-
* @experimental
|
|
410
|
-
*/
|
|
411
|
-
vite6BuilderApp?: boolean;
|
|
406
|
+
/** @deprecated It's value is now always true. */
|
|
407
|
+
vite6BuilderApp?: true;
|
|
412
408
|
/** The Base URL of your server.
|
|
413
409
|
*
|
|
414
410
|
* https://vike.dev/base-url
|
|
@@ -20,12 +20,13 @@ export type { DefinedAtFile };
|
|
|
20
20
|
export type { DefinedAt };
|
|
21
21
|
export type { DefinedBy };
|
|
22
22
|
export type { DefinedAtFilePath };
|
|
23
|
+
export type { VirtualFileExportsPageEntry };
|
|
23
24
|
import type { ConfigValueSerialized } from '../shared/page-configs/serialize/PageConfigSerialized.js';
|
|
24
25
|
import type { LocationId } from '../node/vite/shared/resolveVikeConfigInternal/filesystemRouting.js';
|
|
25
26
|
import type { FilePath } from './FilePath.js';
|
|
26
27
|
import type { ConfigDefinitionsInternal } from '../node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js';
|
|
27
28
|
import type { PlusFile } from '../node/vite/shared/resolveVikeConfigInternal/getPlusFilesAll.js';
|
|
28
|
-
import type {
|
|
29
|
+
import type { ApiOperation } from '../node/api/types.js';
|
|
29
30
|
type PageConfigCommon = {
|
|
30
31
|
pageId: string;
|
|
31
32
|
} & PageConfigRoute;
|
|
@@ -43,7 +44,7 @@ type PageConfigRoute = {
|
|
|
43
44
|
type PageConfigRuntime = PageConfigCommon & {
|
|
44
45
|
configValues: ConfigValues;
|
|
45
46
|
/** Load config values that are lazily loaded such as config.Page */
|
|
46
|
-
|
|
47
|
+
loadVirtualFilePageEntry: LoadVirtualFilePageEntry;
|
|
47
48
|
};
|
|
48
49
|
/** Global config that applies to all pages, runtime data structure */
|
|
49
50
|
type PageConfigGlobalRuntime = {
|
|
@@ -64,14 +65,15 @@ type PageConfigGlobalBuildTime = {
|
|
|
64
65
|
};
|
|
65
66
|
/** Same as PageConfigRuntime but also contains all lazily loaded config values such as config.Page */
|
|
66
67
|
type PageConfigRuntimeLoaded = PageConfigRuntime & {
|
|
67
|
-
/** Whether
|
|
68
|
-
|
|
68
|
+
/** Whether loadVirtualFilePageEntry() was called */
|
|
69
|
+
isPageEntryLoaded: true;
|
|
69
70
|
};
|
|
70
|
-
type
|
|
71
|
+
type LoadVirtualFilePageEntry = () => {
|
|
71
72
|
moduleId: string;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
moduleExportsPromise: Promise<VirtualFileExportsPageEntry>;
|
|
74
|
+
};
|
|
75
|
+
type VirtualFileExportsPageEntry = {
|
|
76
|
+
configValuesSerialized: Record<string, ConfigValueSerialized>;
|
|
75
77
|
};
|
|
76
78
|
/** In what environment(s) the config value is loaded.
|
|
77
79
|
*
|
|
@@ -142,7 +144,7 @@ type DefinedBy = {
|
|
|
142
144
|
definedBy: 'cli' | 'env';
|
|
143
145
|
} | {
|
|
144
146
|
definedBy: 'api';
|
|
145
|
-
operation:
|
|
147
|
+
operation: ApiOperation;
|
|
146
148
|
};
|
|
147
149
|
type DefinedAtFile = {
|
|
148
150
|
filePathToShowToUser: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,6 +8,7 @@ declare global {
|
|
|
8
8
|
* https://vike.dev/meta#typescript
|
|
9
9
|
*/
|
|
10
10
|
interface Config {
|
|
11
|
+
_interfaceIsNotAny?: never;
|
|
11
12
|
}
|
|
12
13
|
/** Refine the `pageContext.config` type.
|
|
13
14
|
*
|
|
@@ -16,42 +17,49 @@ declare global {
|
|
|
16
17
|
* https://vike.dev/meta#typescript
|
|
17
18
|
*/
|
|
18
19
|
interface ConfigResolved {
|
|
20
|
+
_interfaceIsNotAny?: never;
|
|
19
21
|
}
|
|
20
22
|
/** Extend the `PageContext` type (`import type { PageContext } from 'vike/types'`).
|
|
21
23
|
*
|
|
22
24
|
* https://vike.dev/pageContext#typescript
|
|
23
25
|
*/
|
|
24
26
|
interface PageContext {
|
|
27
|
+
_interfaceIsNotAny?: never;
|
|
25
28
|
}
|
|
26
29
|
/** Extend the `PageContextClient` type (`import type { PageContextClient } from 'vike/types'`).
|
|
27
30
|
*
|
|
28
31
|
* https://vike.dev/pageContext#typescript
|
|
29
32
|
*/
|
|
30
33
|
interface PageContextClient {
|
|
34
|
+
_interfaceIsNotAny?: never;
|
|
31
35
|
}
|
|
32
36
|
/** Extend the `PageContextServer` type (`import type { PageContextServer } from 'vike/types'`).
|
|
33
37
|
*
|
|
34
38
|
* https://vike.dev/pageContext#typescript
|
|
35
39
|
*/
|
|
36
40
|
interface PageContextServer {
|
|
41
|
+
_interfaceIsNotAny?: never;
|
|
37
42
|
}
|
|
38
43
|
/** Extend the `GlobalContext` type (`import type { GlobalContext } from 'vike/types'`).
|
|
39
44
|
*
|
|
40
45
|
* https://vike.dev/globalContext#typescript
|
|
41
46
|
*/
|
|
42
47
|
interface GlobalContext {
|
|
48
|
+
_interfaceIsNotAny?: never;
|
|
43
49
|
}
|
|
44
50
|
/** Extend the `GlobalContextClient` type (`import type { GlobalContextClient } from 'vike/types'`).
|
|
45
51
|
*
|
|
46
52
|
* https://vike.dev/globalContext#typescript
|
|
47
53
|
*/
|
|
48
54
|
interface GlobalContextClient {
|
|
55
|
+
_interfaceIsNotAny?: never;
|
|
49
56
|
}
|
|
50
57
|
/** Extend the `GlobalContextServer` type (`import type { GlobalContextServer } from 'vike/types'`).
|
|
51
58
|
*
|
|
52
59
|
* https://vike.dev/globalContext#typescript
|
|
53
60
|
*/
|
|
54
61
|
interface GlobalContextServer {
|
|
62
|
+
_interfaceIsNotAny?: never;
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
65
|
/** This namespace is only used by:
|
|
@@ -65,14 +73,19 @@ declare global {
|
|
|
65
73
|
*/
|
|
66
74
|
namespace VikePackages {
|
|
67
75
|
interface ConfigVikeReact {
|
|
76
|
+
_interfaceIsNotAny?: never;
|
|
68
77
|
}
|
|
69
78
|
interface ConfigVikeVue {
|
|
79
|
+
_interfaceIsNotAny?: never;
|
|
70
80
|
}
|
|
71
81
|
interface ConfigVikeSolid {
|
|
82
|
+
_interfaceIsNotAny?: never;
|
|
72
83
|
}
|
|
73
84
|
interface ConfigVikeSvelte {
|
|
85
|
+
_interfaceIsNotAny?: never;
|
|
74
86
|
}
|
|
75
87
|
interface ConfigVikeAngular {
|
|
88
|
+
_interfaceIsNotAny?: never;
|
|
76
89
|
}
|
|
77
90
|
}
|
|
78
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.238";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.
|
|
2
|
+
export const PROJECT_VERSION = '0.4.238';
|
|
@@ -12,6 +12,7 @@ import { assert, assertUsage, assertWarning } from './assert.js';
|
|
|
12
12
|
import { assertIsNotBrowser } from './assertIsNotBrowser.js';
|
|
13
13
|
import { createDebugger } from './debug.js';
|
|
14
14
|
import { getGlobalObject } from './getGlobalObject.js';
|
|
15
|
+
import { isNonRunnableDev } from './isNonRunnableDev.js';
|
|
15
16
|
import { isVitest } from './isVitest.js';
|
|
16
17
|
import pc from '@brillout/picocolors';
|
|
17
18
|
assertIsNotBrowser();
|
|
@@ -24,8 +25,6 @@ function assertIsNotProductionRuntime() {
|
|
|
24
25
|
setup.shouldNotBeProduction = true;
|
|
25
26
|
}
|
|
26
27
|
function onSetupRuntime() {
|
|
27
|
-
if (true)
|
|
28
|
-
return; // TODO/now refactor this
|
|
29
28
|
if (debug.isActivated)
|
|
30
29
|
debug('assertSetup()', new Error().stack);
|
|
31
30
|
if (isTest())
|
|
@@ -33,7 +32,7 @@ function onSetupRuntime() {
|
|
|
33
32
|
assertNodeEnvIsNotUndefinedString();
|
|
34
33
|
if (!setup.viteDevServer && setup.isViteDev === undefined) {
|
|
35
34
|
// TO-DO/eventually: make it assertUsage() again once https://github.com/vikejs/vike/issues/1528 is implemented.
|
|
36
|
-
assertWarning(!isNodeEnvDev(), `The ${getEnvDescription()}, which is contradictory because the environment seems to be a production environment (Vite isn't loaded), see ${pc.underline('https://vike.dev/NODE_ENV')} and ${pc.underline('https://vike.dev/warning/setup')}`, { onlyOnce: true });
|
|
35
|
+
assertWarning(!isNodeEnvDev() || isNonRunnableDev(), `The ${getEnvDescription()}, which is contradictory because the environment seems to be a production environment (Vite isn't loaded), see ${pc.underline('https://vike.dev/NODE_ENV')} and ${pc.underline('https://vike.dev/warning/setup')}`, { onlyOnce: true });
|
|
37
36
|
assertUsage(!setup.vikeVitePlugin, `Vike's Vite plugin (the ${pc.cyan('vike/plugin')} module) shouldn't be loaded in production, see ${pc.underline('https://vike.dev/warning/setup')}`);
|
|
38
37
|
// This assert() one of the main goal of this file: it ensures assertIsNotProductionRuntime()
|
|
39
38
|
assert(!setup.shouldNotBeProduction);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { assertVersion };
|
|
2
2
|
export { isVersionOrAbove };
|
|
3
3
|
import { assert, assertUsage } from './assert.js';
|
|
4
|
+
import { assertIsNotBrowser } from './assertIsNotBrowser.js';
|
|
5
|
+
assertIsNotBrowser();
|
|
4
6
|
function assertVersion(dependencyName, versionActual, versionExpected) {
|
|
5
7
|
assert(versionActual);
|
|
6
8
|
assert(versionExpected);
|
package/dist/esm/utils/debug.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export { createDebugger };
|
|
2
2
|
export { isDebugActivated };
|
|
3
|
-
import { isBrowser } from './isBrowser.js';
|
|
4
3
|
import { isCallable } from './isCallable.js';
|
|
5
4
|
import { objectAssign } from './objectAssign.js';
|
|
6
5
|
import { assert, assertUsage } from './assert.js';
|
|
7
6
|
import { checkType } from './checkType.js';
|
|
8
|
-
import { getTerminalWidth } from './
|
|
7
|
+
import { getTerminalWidth } from './getTerminalWidth.js';
|
|
9
8
|
import pc from '@brillout/picocolors';
|
|
10
9
|
import { isArray } from './isArray.js';
|
|
11
10
|
import { isObject } from './isObject.js';
|
|
12
11
|
import { setCreateDebugger } from '../shared/route/debug.js';
|
|
13
|
-
|
|
12
|
+
import { assertIsNotBrowser } from './assertIsNotBrowser.js';
|
|
13
|
+
assertIsNotBrowser();
|
|
14
14
|
setCreateDebugger(createDebugger); // for isomorphic code
|
|
15
15
|
const flags = [
|
|
16
16
|
'vike:crawl',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { getGlobalObject };
|
|
2
|
-
|
|
3
|
-
type
|
|
2
|
+
import type { VikeGlobalInternal } from '../types/VikeGlobalInternal.js';
|
|
3
|
+
type ModuleId = `${string}.ts`;
|
|
4
4
|
/** Share information across module instances. */
|
|
5
|
-
declare function getGlobalObject<T extends Record<string, unknown> = never>(
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
declare function getGlobalObject<T extends Record<string, unknown> = never>(moduleId: ModuleId, defaultValue: T): T;
|
|
6
|
+
declare global {
|
|
7
|
+
var _vike: VikeGlobalInternal;
|
|
8
|
+
}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
export { getGlobalObject };
|
|
2
|
-
export { assertIsSingleModuleInstance };
|
|
3
|
-
import { assert } from './assert.js';
|
|
4
2
|
/** Share information across module instances. */
|
|
5
|
-
function getGlobalObject(
|
|
6
|
-
const
|
|
7
|
-
const globalObject = (
|
|
3
|
+
function getGlobalObject(moduleId, defaultValue) {
|
|
4
|
+
const globals = getGlobals();
|
|
5
|
+
const globalObject = (globals[moduleId] ?? (globals[moduleId] = defaultValue));
|
|
8
6
|
return globalObject;
|
|
9
7
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function getGlobalObjects() {
|
|
16
|
-
const projectKey = '_vike';
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
const globalObjects = (globalThis[projectKey] = globalThis[projectKey] || {});
|
|
19
|
-
return globalObjects;
|
|
8
|
+
function getGlobals() {
|
|
9
|
+
var _a;
|
|
10
|
+
globalThis._vike ?? (globalThis._vike = {});
|
|
11
|
+
(_a = globalThis._vike).globals ?? (_a.globals = {});
|
|
12
|
+
return globalThis._vike.globals;
|
|
20
13
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { isNonRunnableDev };
|
|
2
|
+
import { assert } from './assert.js';
|
|
3
|
+
import { assertIsNotBrowser } from './assertIsNotBrowser.js';
|
|
4
|
+
assertIsNotBrowser();
|
|
5
|
+
function isNonRunnableDev() {
|
|
6
|
+
if (typeof __VIKE__IS_NON_RUNNABLE_DEV === 'undefined')
|
|
7
|
+
return false;
|
|
8
|
+
assert(__VIKE__IS_NON_RUNNABLE_DEV === true);
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { isScriptFile };
|
|
2
2
|
export { isPlainScriptFile };
|
|
3
3
|
export { isTemplateFile };
|
|
4
|
-
export { scriptFileExtensionPattern };
|
|
5
4
|
export { scriptFileExtensionList };
|
|
5
|
+
export { scriptFileExtensionPattern };
|
|
6
6
|
declare const scriptFileExtensionList: readonly ["js", "cjs", "mjs", "ts", "cts", "mts", "jsx", "cjsx", "mjsx", "tsx", "ctsx", "mtsx", "vue", "svelte", "marko", "md", "mdx"];
|
|
7
7
|
declare const scriptFileExtensionPattern: string;
|
|
8
8
|
declare function isScriptFile(filePath: string): boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { isScriptFile };
|
|
2
2
|
export { isPlainScriptFile };
|
|
3
3
|
export { isTemplateFile };
|
|
4
|
-
export { scriptFileExtensionPattern };
|
|
5
4
|
export { scriptFileExtensionList };
|
|
5
|
+
export { scriptFileExtensionPattern };
|
|
6
6
|
// We can't use a RegExp:
|
|
7
7
|
// - Needs to work with Micromatch: https://github.com/micromatch/micromatch because:
|
|
8
8
|
// - Vite's `import.meta.glob()` uses Micromatch
|
package/dist/esm/utils/path.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export { pathJoin };
|
|
2
2
|
export { pathIsRelative };
|
|
3
|
+
export { pathIsAbsolute };
|
|
3
4
|
export { toPosixPath };
|
|
4
5
|
export { assertPosixPath };
|
|
5
6
|
/**********************/
|
|
6
7
|
/****** SHIMS *********/
|
|
7
8
|
/**********************/
|
|
8
9
|
declare function pathJoin(path1: string, path2: string): string;
|
|
10
|
+
declare function pathIsAbsolute(filePath: string): boolean;
|
|
9
11
|
/**********************/
|
|
10
12
|
/****** UTILS *********/
|
|
11
13
|
/**********************/
|
package/dist/esm/utils/path.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { pathJoin };
|
|
2
2
|
export { pathIsRelative };
|
|
3
|
+
export { pathIsAbsolute };
|
|
3
4
|
export { toPosixPath };
|
|
4
5
|
export { assertPosixPath };
|
|
5
6
|
// Utilities for handling file paths.
|
|
@@ -20,12 +21,11 @@ function pathJoin(path1, path2) {
|
|
|
20
21
|
joined = '/' + joined;
|
|
21
22
|
return joined;
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
const IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]
|
|
25
|
-
function pathIsAbsolute(filePath
|
|
26
|
-
|
|
24
|
+
// https://github.com/brillout/telefunc/blob/0fd44322acbd07857ae29361ba7c998607f17dd5/telefunc/utils/path-shim.ts#L17-L21
|
|
25
|
+
const IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
26
|
+
function pathIsAbsolute(filePath) {
|
|
27
|
+
return IS_ABSOLUTE_RE.test(filePath);
|
|
27
28
|
}
|
|
28
|
-
//*/
|
|
29
29
|
/**********************/
|
|
30
30
|
/****** UTILS *********/
|
|
31
31
|
/**********************/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { requireResolveOptional };
|
|
2
2
|
export { requireResolveOptionalDir };
|
|
3
3
|
export { requireResolveNpmPackage };
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
4
|
+
export { requireResolveDistFile };
|
|
5
|
+
export { getPackageNodeModulesDirectory };
|
|
6
6
|
declare function requireResolveOptional({ importPath, importerFilePath, userRootDir, }: {
|
|
7
7
|
importPath: string;
|
|
8
8
|
importerFilePath: string;
|
|
@@ -17,5 +17,5 @@ declare function requireResolveNpmPackage({ importPathNpmPackage, userRootDir, }
|
|
|
17
17
|
importPathNpmPackage: string;
|
|
18
18
|
userRootDir: string;
|
|
19
19
|
}): string;
|
|
20
|
-
declare function
|
|
21
|
-
declare function
|
|
20
|
+
declare function requireResolveDistFile(distFile: `dist/esm/${string}.js`): string;
|
|
21
|
+
declare function getPackageNodeModulesDirectory(): string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { requireResolveOptional };
|
|
2
2
|
export { requireResolveOptionalDir };
|
|
3
3
|
export { requireResolveNpmPackage };
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
4
|
+
export { requireResolveDistFile };
|
|
5
|
+
export { getPackageNodeModulesDirectory };
|
|
6
6
|
import { assert } from './assert.js';
|
|
7
7
|
import { assertIsNotBrowser } from './assertIsNotBrowser.js';
|
|
8
8
|
import { assertIsNotProductionRuntime } from './assertSetup.js';
|
|
@@ -104,11 +104,11 @@ function requireResolveNpmPackage({ importPathNpmPackage, userRootDir, }) {
|
|
|
104
104
|
throw res.err;
|
|
105
105
|
return res.importPathResolvedFilePath;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
const
|
|
109
|
-
assertPosixPath(
|
|
110
|
-
assertPosixPath(
|
|
111
|
-
const importPathResolvedFilePath = makeNodeFriendly(path.posix.join(
|
|
107
|
+
function requireResolveDistFile(distFile) {
|
|
108
|
+
const packageNodeModulesDirectory = getPackageNodeModulesDirectory();
|
|
109
|
+
assertPosixPath(packageNodeModulesDirectory);
|
|
110
|
+
assertPosixPath(distFile);
|
|
111
|
+
const importPathResolvedFilePath = makeNodeFriendly(path.posix.join(packageNodeModulesDirectory, distFile));
|
|
112
112
|
// Double check
|
|
113
113
|
{
|
|
114
114
|
const res = requireResolve_(importPathResolvedFilePath,
|
|
@@ -166,11 +166,12 @@ function addFileExtensionsToRequireResolve(require_) {
|
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
// [RELATIVE_PATH_FROM_DIST] Current file:
|
|
171
|
-
assert(importMetaUrl.includes('/dist/esm/') || importMetaUrl.includes('/dist/cjs/'));
|
|
172
|
-
const
|
|
173
|
-
|
|
169
|
+
function getPackageNodeModulesDirectory() {
|
|
170
|
+
// [RELATIVE_PATH_FROM_DIST] Current file: node_modules/${packageName}/dist/esm/utils/requireResolve.js
|
|
171
|
+
assert(importMetaUrl.includes('/dist/esm/utils/') || importMetaUrl.includes('/dist/cjs/utils/'));
|
|
172
|
+
const packageNodeModulesDirectory = path.posix.join(removeFilePrefix(path.dirname(importMetaUrl)), '../../../');
|
|
173
|
+
// Return `node_modules/${packageName}/`
|
|
174
|
+
return packageNodeModulesDirectory;
|
|
174
175
|
}
|
|
175
176
|
function getFakeImporterFile(dirPath) {
|
|
176
177
|
assertPosixPath(dirPath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.238",
|
|
4
4
|
"repository": "https://github.com/vikejs/vike",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": {
|
|
@@ -129,10 +129,10 @@
|
|
|
129
129
|
},
|
|
130
130
|
"dependencies": {
|
|
131
131
|
"@brillout/import": "^0.2.6",
|
|
132
|
-
"@brillout/json-serializer": "^0.5.
|
|
132
|
+
"@brillout/json-serializer": "^0.5.20",
|
|
133
133
|
"@brillout/picocolors": "^1.0.26",
|
|
134
134
|
"@brillout/require-shim": "^0.1.2",
|
|
135
|
-
"@brillout/vite-plugin-server-entry": "^0.7.
|
|
135
|
+
"@brillout/vite-plugin-server-entry": "^0.7.13",
|
|
136
136
|
"acorn": "^8.0.0",
|
|
137
137
|
"cac": "^6.0.0",
|
|
138
138
|
"es-module-lexer": "^1.0.0",
|
|
@@ -144,11 +144,11 @@
|
|
|
144
144
|
"sirv": "^3.0.1",
|
|
145
145
|
"source-map-support": "^0.5.0",
|
|
146
146
|
"tinyglobby": "^0.2.10",
|
|
147
|
-
"vite": ">=
|
|
147
|
+
"vite": ">=6.0.0"
|
|
148
148
|
},
|
|
149
149
|
"peerDependencies": {
|
|
150
150
|
"react-streaming": ">=0.3.42",
|
|
151
|
-
"vite": ">=
|
|
151
|
+
"vite": ">=6.0.0"
|
|
152
152
|
},
|
|
153
153
|
"peerDependenciesMeta": {
|
|
154
154
|
"react-streaming": {
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
"react-streaming": "^0.4.3",
|
|
264
264
|
"rimraf": "^5.0.5",
|
|
265
265
|
"typescript": "^5.8.3",
|
|
266
|
-
"vite": "^7.
|
|
266
|
+
"vite": "^7.1.3"
|
|
267
267
|
},
|
|
268
268
|
"scripts": {
|
|
269
269
|
"dev": "tsc --watch",
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.debugPageFiles = debugPageFiles;
|
|
7
|
-
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
8
|
-
const utils_js_1 = require("../utils.js");
|
|
9
|
-
function debugPageFiles({ pageContext, isHtmlOnly, isClientRouting, pageFilesLoaded, pageFilesServerSide, pageFilesClientSide, clientEntries, clientDependencies, }) {
|
|
10
|
-
const debug = (0, utils_js_1.createDebugger)('vike:pageFiles', { serialization: { emptyArray: 'None' } });
|
|
11
|
-
const padding = ' - ';
|
|
12
|
-
debug('All page files:', printPageFiles(pageContext._globalContext._pageFilesAll, true));
|
|
13
|
-
debug(`URL:`, pageContext.urlOriginal);
|
|
14
|
-
debug.options({ serialization: { emptyArray: 'No match' } })(`Routing:`, printRouteMatches(pageContext._debugRouteMatches));
|
|
15
|
-
debug(`pageId:`, pageContext.pageId);
|
|
16
|
-
debug('Page type:', isHtmlOnly ? 'HTML-only' : 'SSR/SPA');
|
|
17
|
-
debug(`Routing type:`, !isHtmlOnly && isClientRouting ? 'Client Routing' : 'Server Routing');
|
|
18
|
-
debug('Server-side page files:', printPageFiles(pageFilesLoaded));
|
|
19
|
-
(0, utils_js_1.assert)(samePageFiles(pageFilesLoaded, pageFilesServerSide));
|
|
20
|
-
debug('Client-side page files:', printPageFiles(pageFilesClientSide));
|
|
21
|
-
debug('Client-side entries:', clientEntries);
|
|
22
|
-
debug('Client-side dependencies:', clientDependencies);
|
|
23
|
-
return;
|
|
24
|
-
function printRouteMatches(debugRouteMatches) {
|
|
25
|
-
if (debugRouteMatches === 'ROUTING_ERROR') {
|
|
26
|
-
return 'Routing Failed';
|
|
27
|
-
}
|
|
28
|
-
if (debugRouteMatches === 'CUSTOM_ROUTING') {
|
|
29
|
-
return 'Custom Routing';
|
|
30
|
-
}
|
|
31
|
-
return debugRouteMatches;
|
|
32
|
-
}
|
|
33
|
-
function printPageFiles(pageFiles, genericPageFilesLast = false) {
|
|
34
|
-
if (pageFiles.length === 0) {
|
|
35
|
-
return 'None';
|
|
36
|
-
}
|
|
37
|
-
return ('\n' +
|
|
38
|
-
pageFiles
|
|
39
|
-
.sort((p1, p2) => p1.filePath.localeCompare(p2.filePath))
|
|
40
|
-
.sort((0, utils_js_1.makeFirst)((p) => (p.isRendererPageFile ? !genericPageFilesLast : null)))
|
|
41
|
-
.sort((0, utils_js_1.makeFirst)((p) => (p.isDefaultPageFile ? !genericPageFilesLast : null)))
|
|
42
|
-
.map((p) => p.filePath)
|
|
43
|
-
.map((s) => s.split('_default.page.').join(`${picocolors_1.default.blue('_default')}.page.`))
|
|
44
|
-
.map((s) => s.split('/renderer/').join(`/${picocolors_1.default.red('renderer')}/`))
|
|
45
|
-
.map((s) => padding + s)
|
|
46
|
-
.join('\n'));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function samePageFiles(pageFiles1, pageFiles2) {
|
|
50
|
-
return (pageFiles1.every((p1) => pageFiles2.some((p2) => p2.filePath === p1.filePath)) &&
|
|
51
|
-
pageFiles2.every((p2) => pageFiles1.some((p1) => p1.filePath === p2.filePath)));
|
|
52
|
-
}
|