vike 0.4.237 → 0.4.238-commit-3c1a09d
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/csp.js +46 -0
- package/dist/cjs/node/runtime/globalContext.js +128 -112
- package/dist/cjs/node/runtime/html/injectAssets/getHtmlTags.js +11 -8
- package/dist/cjs/node/runtime/html/injectAssets/inferHtmlTags.js +5 -2
- package/dist/cjs/node/runtime/html/injectAssets/mergeScriptTags.js +4 -2
- 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 +57 -50
- 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 +23 -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 +10 -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 +14 -303
- package/dist/esm/node/prerender/runPrerender.js +8 -9
- package/dist/esm/node/prerender/runPrerenderEntry.js +1 -1
- package/dist/esm/node/runtime/csp.d.ts +12 -0
- package/dist/esm/node/runtime/csp.js +44 -0
- 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 +11 -8
- package/dist/esm/node/runtime/html/injectAssets/inferHtmlTags.d.ts +2 -1
- package/dist/esm/node/runtime/html/injectAssets/inferHtmlTags.js +5 -2
- package/dist/esm/node/runtime/html/injectAssets/mergeScriptTags.d.ts +2 -1
- package/dist/esm/node/runtime/html/injectAssets/mergeScriptTags.js +4 -2
- package/dist/esm/node/runtime/html/serializeContext.d.ts +2 -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 +108 -20
- package/dist/esm/node/runtime/renderPage/loadPageConfigsLazyServerSide.js +59 -52
- package/dist/esm/node/runtime/renderPage/preparePageContextForPublicUsageServer.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/{renderPageAlreadyRouted.d.ts → renderPageAfterRoute.d.ts} +30 -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 +24 -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 +10 -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 +13 -9
- package/dist/esm/types/PageConfig.d.ts +11 -9
- package/dist/esm/types/PageContext.d.ts +6 -0
- 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
|
@@ -35,21 +35,19 @@ const resolvePrerenderConfig_js_1 = require("../../prerender/resolvePrerenderCon
|
|
|
35
35
|
const getProxyForPublicUsage_js_1 = require("../../../shared/getProxyForPublicUsage.js");
|
|
36
36
|
const getVikeConfigError_js_1 = require("../../shared/getVikeConfigError.js");
|
|
37
37
|
(0, utils_js_1.assertIsNotProductionRuntime)();
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
let vikeConfigCtx = null; // Information provided by Vite's `config` and Vike's CLI. We could, if we want or need to, completely remove the dependency on Vite.
|
|
49
|
-
let prerenderContext;
|
|
38
|
+
const globalObject = (0, utils_js_1.getGlobalObject)('vite/shared/resolveVikeConfigInternal.ts', {
|
|
39
|
+
restartVite: false,
|
|
40
|
+
vikeConfigHasBuildError: null,
|
|
41
|
+
isV1Design_: null,
|
|
42
|
+
vikeConfigPromise: null,
|
|
43
|
+
// TO-DO/next-major-release: remove
|
|
44
|
+
vikeConfigSync: null,
|
|
45
|
+
vikeConfigCtx: null, // Information provided by Vite's `config` and Vike's CLI. We could, if we want or need to, completely remove the dependency on Vite.
|
|
46
|
+
prerenderContext: null,
|
|
47
|
+
});
|
|
50
48
|
function reloadVikeConfig() {
|
|
51
|
-
(0, utils_js_1.assert)(vikeConfigCtx);
|
|
52
|
-
const { userRootDir, vikeVitePluginOptions } = vikeConfigCtx;
|
|
49
|
+
(0, utils_js_1.assert)(globalObject.vikeConfigCtx);
|
|
50
|
+
const { userRootDir, vikeVitePluginOptions } = globalObject.vikeConfigCtx;
|
|
53
51
|
(0, utils_js_1.assert)(vikeVitePluginOptions);
|
|
54
52
|
resolveVikeConfigInternal_withErrorHandling(userRootDir, true, vikeVitePluginOptions);
|
|
55
53
|
}
|
|
@@ -57,15 +55,15 @@ async function getVikeConfigInternal(
|
|
|
57
55
|
// I don't remember the logic behind it — neither why we restart Vite's dev server, nor why we sometimes don't.
|
|
58
56
|
// TO-DO/eventually: re-think all that. Some + settings are expected to influence Vite's config (restarting Vite's dev server is needed) while some don't.
|
|
59
57
|
doNotRestartViteOnError = false) {
|
|
60
|
-
(0, utils_js_1.assert)(vikeConfigCtx);
|
|
61
|
-
const { userRootDir, isDev, vikeVitePluginOptions } = vikeConfigCtx;
|
|
58
|
+
(0, utils_js_1.assert)(globalObject.vikeConfigCtx);
|
|
59
|
+
const { userRootDir, isDev, vikeVitePluginOptions } = globalObject.vikeConfigCtx;
|
|
62
60
|
const vikeConfig = await getOrResolveVikeConfig(userRootDir, isDev, vikeVitePluginOptions, doNotRestartViteOnError);
|
|
63
61
|
return vikeConfig;
|
|
64
62
|
}
|
|
65
63
|
// TO-DO/next-major-release: remove
|
|
66
64
|
function getVikeConfigInternalSync() {
|
|
67
|
-
(0, utils_js_1.assert)(vikeConfigSync);
|
|
68
|
-
return vikeConfigSync;
|
|
65
|
+
(0, utils_js_1.assert)(globalObject.vikeConfigSync);
|
|
66
|
+
return globalObject.vikeConfigSync;
|
|
69
67
|
}
|
|
70
68
|
// TO-DO/eventually: this maybe(/probably?) isn't safe against race conditions upon file changes in development, thus:
|
|
71
69
|
// - Like getGlobalContext() and getGlobalContextSync() — make getVikeConfig() async and provide a getVikeConfigSync() while discourage using it
|
|
@@ -86,29 +84,29 @@ config) {
|
|
|
86
84
|
}
|
|
87
85
|
function setVikeConfigContext(vikeConfigCtx_) {
|
|
88
86
|
// If the user changes Vite's `config.root` => Vite completely reloads itself => setVikeConfigContext() is called again
|
|
89
|
-
vikeConfigCtx = vikeConfigCtx_;
|
|
87
|
+
globalObject.vikeConfigCtx = vikeConfigCtx_;
|
|
90
88
|
}
|
|
91
89
|
async function getOrResolveVikeConfig(userRootDir, isDev, vikeVitePluginOptions, doNotRestartViteOnError) {
|
|
92
|
-
if (!vikeConfigPromise) {
|
|
90
|
+
if (!globalObject.vikeConfigPromise) {
|
|
93
91
|
resolveVikeConfigInternal_withErrorHandling(userRootDir, isDev, vikeVitePluginOptions, doNotRestartViteOnError);
|
|
94
92
|
}
|
|
95
|
-
(0, utils_js_1.assert)(vikeConfigPromise);
|
|
96
|
-
const vikeConfig = await vikeConfigPromise;
|
|
93
|
+
(0, utils_js_1.assert)(globalObject.vikeConfigPromise);
|
|
94
|
+
const vikeConfig = await globalObject.vikeConfigPromise;
|
|
97
95
|
return vikeConfig;
|
|
98
96
|
}
|
|
99
97
|
async function getVikeConfigInternalOptional() {
|
|
100
|
-
if (!vikeConfigPromise)
|
|
98
|
+
if (!globalObject.vikeConfigPromise)
|
|
101
99
|
return null;
|
|
102
|
-
const vikeConfig = await vikeConfigPromise;
|
|
100
|
+
const vikeConfig = await globalObject.vikeConfigPromise;
|
|
103
101
|
return vikeConfig;
|
|
104
102
|
}
|
|
105
103
|
function isV1Design() {
|
|
106
|
-
(0, utils_js_1.assert)(typeof isV1Design_ === 'boolean');
|
|
107
|
-
return isV1Design_;
|
|
104
|
+
(0, utils_js_1.assert)(typeof globalObject.isV1Design_ === 'boolean');
|
|
105
|
+
return globalObject.isV1Design_;
|
|
108
106
|
}
|
|
109
107
|
async function resolveVikeConfigInternal_withErrorHandling(userRootDir, isDev, vikeVitePluginOptions, doNotRestartViteOnError) {
|
|
110
108
|
const { promise, resolve, reject } = (0, utils_js_1.genPromise)();
|
|
111
|
-
vikeConfigPromise = promise;
|
|
109
|
+
globalObject.vikeConfigPromise = promise;
|
|
112
110
|
const esbuildCache = {
|
|
113
111
|
transpileCache: {},
|
|
114
112
|
vikeConfigDependencies: new Set(),
|
|
@@ -125,10 +123,10 @@ async function resolveVikeConfigInternal_withErrorHandling(userRootDir, isDev, v
|
|
|
125
123
|
}
|
|
126
124
|
// There is a newer call — let the new call supersede the old one.
|
|
127
125
|
// We deliberately swallow the intermetidate state (including any potential error) — it's now outdated and has existed only for a very short period of time.
|
|
128
|
-
if (vikeConfigPromise !== promise) {
|
|
126
|
+
if (globalObject.vikeConfigPromise !== promise) {
|
|
129
127
|
// vikeConfigPromise.then(resolve).catch(reject)
|
|
130
128
|
try {
|
|
131
|
-
resolve(await vikeConfigPromise);
|
|
129
|
+
resolve(await globalObject.vikeConfigPromise);
|
|
132
130
|
}
|
|
133
131
|
catch (err) {
|
|
134
132
|
reject(err);
|
|
@@ -138,13 +136,13 @@ async function resolveVikeConfigInternal_withErrorHandling(userRootDir, isDev, v
|
|
|
138
136
|
if (!hasError) {
|
|
139
137
|
(0, utils_js_1.assert)(ret);
|
|
140
138
|
(0, utils_js_1.assert)(err === undefined);
|
|
141
|
-
const hadError = vikeConfigHasBuildError;
|
|
142
|
-
vikeConfigHasBuildError = false;
|
|
139
|
+
const hadError = globalObject.vikeConfigHasBuildError;
|
|
140
|
+
globalObject.vikeConfigHasBuildError = false;
|
|
143
141
|
(0, getVikeConfigError_js_1.setVikeConfigError)({ errorBuild: false });
|
|
144
142
|
if (hadError) {
|
|
145
143
|
(0, loggerNotProd_js_1.logConfigErrorRecover)();
|
|
146
|
-
if (restartVite) {
|
|
147
|
-
restartVite = false;
|
|
144
|
+
if (globalObject.restartVite) {
|
|
145
|
+
globalObject.restartVite = false;
|
|
148
146
|
restartViteDevServer();
|
|
149
147
|
}
|
|
150
148
|
}
|
|
@@ -153,10 +151,10 @@ async function resolveVikeConfigInternal_withErrorHandling(userRootDir, isDev, v
|
|
|
153
151
|
else {
|
|
154
152
|
(0, utils_js_1.assert)(ret === undefined);
|
|
155
153
|
(0, utils_js_1.assert)(err);
|
|
156
|
-
vikeConfigHasBuildError = true;
|
|
154
|
+
globalObject.vikeConfigHasBuildError = true;
|
|
157
155
|
(0, getVikeConfigError_js_1.setVikeConfigError)({ errorBuild: { err } });
|
|
158
156
|
if (!doNotRestartViteOnError)
|
|
159
|
-
restartVite = true;
|
|
157
|
+
globalObject.restartVite = true;
|
|
160
158
|
if (!isDev) {
|
|
161
159
|
reject(err);
|
|
162
160
|
}
|
|
@@ -170,8 +168,8 @@ async function resolveVikeConfigInternal(userRootDir, vikeVitePluginOptions, esb
|
|
|
170
168
|
const plusFilesAll = await (0, getPlusFilesAll_js_1.getPlusFilesAll)(userRootDir, esbuildCache);
|
|
171
169
|
const configDefinitionsResolved = await resolveConfigDefinitions(plusFilesAll, userRootDir, esbuildCache);
|
|
172
170
|
const { pageConfigGlobal, pageConfigs } = getPageConfigsBuildTime(configDefinitionsResolved, plusFilesAll, userRootDir);
|
|
173
|
-
if (!isV1Design_)
|
|
174
|
-
isV1Design_ = pageConfigs.length > 0;
|
|
171
|
+
if (!globalObject.isV1Design_)
|
|
172
|
+
globalObject.isV1Design_ = pageConfigs.length > 0;
|
|
175
173
|
// Backwards compatibility for vike(options) in vite.config.js
|
|
176
174
|
temp_interopVikeVitePlugin(pageConfigGlobal, vikeVitePluginOptions, userRootDir);
|
|
177
175
|
setCliAndApiOptions(pageConfigGlobal, configDefinitionsResolved);
|
|
@@ -181,7 +179,7 @@ async function resolveVikeConfigInternal(userRootDir, vikeVitePluginOptions, esb
|
|
|
181
179
|
// pages
|
|
182
180
|
const vikeConfigPublicPagesEager = (0, utils_js_1.objectFromEntries)(pageConfigs.map((pageConfig) => {
|
|
183
181
|
const pageConfigValues = getConfigValues(pageConfig, true);
|
|
184
|
-
return (0, resolveVikeConfigPublic_js_1.
|
|
182
|
+
return (0, resolveVikeConfigPublic_js_1.resolveVikeConfigPublicPageEagerLoaded)(pageConfigGlobalValues, pageConfig, pageConfigValues);
|
|
185
183
|
}));
|
|
186
184
|
const prerenderContext = resolvePrerenderContext({
|
|
187
185
|
config: vikeConfigPublicGlobal.config,
|
|
@@ -197,7 +195,7 @@ async function resolveVikeConfigInternal(userRootDir, vikeVitePluginOptions, esb
|
|
|
197
195
|
prerenderContext,
|
|
198
196
|
_vikeConfigDependencies: esbuildCache.vikeConfigDependencies,
|
|
199
197
|
};
|
|
200
|
-
vikeConfigSync = vikeConfig;
|
|
198
|
+
globalObject.vikeConfigSync = vikeConfig;
|
|
201
199
|
return vikeConfig;
|
|
202
200
|
}
|
|
203
201
|
async function resolveConfigDefinitions(plusFilesAll, userRootDir, esbuildCache) {
|
|
@@ -421,9 +419,9 @@ function temp_interopVikeVitePlugin(pageConfigGlobal, vikeVitePluginOptions, use
|
|
|
421
419
|
}
|
|
422
420
|
function setCliAndApiOptions(pageConfigGlobal, configDefinitionsResolved) {
|
|
423
421
|
// Vike API — passed options [lowest precedence]
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
426
|
-
addSources(
|
|
422
|
+
const vikeApiOperation = (0, context_js_1.getVikeApiOperation)();
|
|
423
|
+
if (vikeApiOperation?.options.vikeConfig) {
|
|
424
|
+
addSources(vikeApiOperation.options.vikeConfig, { definedBy: 'api', operation: vikeApiOperation.operation }, false);
|
|
427
425
|
}
|
|
428
426
|
const { configFromCliOptions, configFromEnvVar } = getVikeConfigFromCliOrEnv();
|
|
429
427
|
// Vike CLI options
|
|
@@ -1102,7 +1100,7 @@ function isGlobalLocation(locationId, plusFilesAll) {
|
|
|
1102
1100
|
}
|
|
1103
1101
|
function resolvePrerenderContext(vikeConfig) {
|
|
1104
1102
|
const { isPrerenderingEnabled, isPrerenderingEnabledForAllPages } = (0, resolvePrerenderConfig_js_1.resolvePrerenderConfigGlobal)(vikeConfig);
|
|
1105
|
-
prerenderContext ?? (prerenderContext = {
|
|
1103
|
+
globalObject.prerenderContext ?? (globalObject.prerenderContext = {
|
|
1106
1104
|
isPrerenderingEnabled: false,
|
|
1107
1105
|
isPrerenderingEnabledForAllPages: false,
|
|
1108
1106
|
// Set at runPrerender()
|
|
@@ -1110,9 +1108,9 @@ function resolvePrerenderContext(vikeConfig) {
|
|
|
1110
1108
|
// Set at runPrerender()
|
|
1111
1109
|
pageContexts: null,
|
|
1112
1110
|
});
|
|
1113
|
-
prerenderContext.isPrerenderingEnabled = isPrerenderingEnabled;
|
|
1114
|
-
prerenderContext.isPrerenderingEnabledForAllPages = isPrerenderingEnabledForAllPages;
|
|
1115
|
-
return prerenderContext;
|
|
1111
|
+
globalObject.prerenderContext.isPrerenderingEnabled = isPrerenderingEnabled;
|
|
1112
|
+
globalObject.prerenderContext.isPrerenderingEnabledForAllPages = isPrerenderingEnabledForAllPages;
|
|
1113
|
+
return globalObject.prerenderContext;
|
|
1116
1114
|
}
|
|
1117
1115
|
function restartViteDevServer() {
|
|
1118
1116
|
const viteDevServer = (0, globalContext_js_1.getViteDevServer)();
|
|
@@ -1149,7 +1147,7 @@ function getVikeConfigDummy(esbuildCache) {
|
|
|
1149
1147
|
prerenderContext: prerenderContextDummy,
|
|
1150
1148
|
_vikeConfigDependencies: esbuildCache.vikeConfigDependencies,
|
|
1151
1149
|
};
|
|
1152
|
-
vikeConfigSync = vikeConfigDummy;
|
|
1153
|
-
isV1Design_ = true;
|
|
1150
|
+
globalObject.vikeConfigSync = vikeConfigDummy;
|
|
1151
|
+
globalObject.isV1Design_ = true;
|
|
1154
1152
|
return vikeConfigDummy;
|
|
1155
1153
|
}
|
|
@@ -3,19 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getGlobalContextSyncErrMsg = void 0;
|
|
4
4
|
exports.createGlobalContextShared = createGlobalContextShared;
|
|
5
5
|
const utils_js_1 = require("./utils.js");
|
|
6
|
-
const
|
|
6
|
+
const parseVirtualFileExportsGlobalEntry_js_1 = require("./getPageFiles/parseVirtualFileExportsGlobalEntry.js");
|
|
7
7
|
const resolveVikeConfigPublic_js_1 = require("./page-configs/resolveVikeConfigPublic.js");
|
|
8
8
|
const execHook_js_1 = require("./hooks/execHook.js");
|
|
9
9
|
const prepareGlobalContextForPublicUsage_js_1 = require("./prepareGlobalContextForPublicUsage.js");
|
|
10
10
|
const getHook_js_1 = require("./hooks/getHook.js");
|
|
11
11
|
const getGlobalContextSyncErrMsg = "The global context isn't set yet, call getGlobalContextSync() later or use getGlobalContext() instead.";
|
|
12
12
|
exports.getGlobalContextSyncErrMsg = getGlobalContextSyncErrMsg;
|
|
13
|
-
const globalObject_ = (0, utils_js_1.getGlobalObject)('shared/createGlobalContextShared.ts', {});
|
|
14
13
|
// TO-DO/eventually use flat globalContext — like flat pageContext
|
|
15
|
-
async function createGlobalContextShared(
|
|
14
|
+
async function createGlobalContextShared(virtualFileExportsGlobalEntry, globalObject, addGlobalContext,
|
|
16
15
|
// TO-DO/next-major-release: we'll be able to remove addGlobalContextTmp after loadPageRoutes() is sync (it will be sync after we remove the old design)
|
|
17
16
|
addGlobalContextTmp, addGlobalContextAsync) {
|
|
18
|
-
const {
|
|
17
|
+
const { previousCreateGlobalContextPromise } = globalObject;
|
|
19
18
|
const { promise, resolve } = (0, utils_js_1.genPromise)({
|
|
20
19
|
// Avoid this Cloudflare Worker error:
|
|
21
20
|
// ```console
|
|
@@ -23,9 +22,12 @@ addGlobalContextTmp, addGlobalContextAsync) {
|
|
|
23
22
|
// ```
|
|
24
23
|
timeout: null,
|
|
25
24
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
globalObject.previousCreateGlobalContextPromise = promise;
|
|
26
|
+
if (previousCreateGlobalContextPromise) {
|
|
27
|
+
(0, utils_js_1.assert)(globalObject.globalContext);
|
|
28
|
+
await previousCreateGlobalContextPromise;
|
|
29
|
+
}
|
|
30
|
+
const globalContext = createGlobalContextBase(virtualFileExportsGlobalEntry);
|
|
29
31
|
let isNewGlobalContext;
|
|
30
32
|
if (!globalObject.globalContext) {
|
|
31
33
|
// We set globalObject.globalContext early and before any async operations, so that getGlobalContextSync() can be used early.
|
|
@@ -37,7 +39,7 @@ addGlobalContextTmp, addGlobalContextAsync) {
|
|
|
37
39
|
isNewGlobalContext = true;
|
|
38
40
|
}
|
|
39
41
|
if (addGlobalContext &&
|
|
40
|
-
//
|
|
42
|
+
// TO-DO/next-major-release: remove
|
|
41
43
|
globalContext._pageConfigs.length > 0) {
|
|
42
44
|
const globalContextAdded = addGlobalContext?.(globalContext);
|
|
43
45
|
(0, utils_js_1.objectAssign)(globalContext, globalContextAdded);
|
|
@@ -70,8 +72,8 @@ addGlobalContextTmp, addGlobalContextAsync) {
|
|
|
70
72
|
resolve();
|
|
71
73
|
return globalObject.globalContext;
|
|
72
74
|
}
|
|
73
|
-
function createGlobalContextBase(
|
|
74
|
-
const { pageFilesAll, allPageIds, pageConfigs, pageConfigGlobal, vikeConfigPublicGlobal, vikeConfigPublicPagesEager, } = getConfigsAll(
|
|
75
|
+
function createGlobalContextBase(virtualFileExportsGlobalEntry) {
|
|
76
|
+
const { pageFilesAll, allPageIds, pageConfigs, pageConfigGlobal, vikeConfigPublicGlobal, vikeConfigPublicPagesEager, } = getConfigsAll(virtualFileExportsGlobalEntry);
|
|
75
77
|
const globalContext = {
|
|
76
78
|
/**
|
|
77
79
|
* Useful for distinguishing `globalContext` from other objects and narrowing down TypeScript unions.
|
|
@@ -80,7 +82,7 @@ function createGlobalContextBase(virtualFileExports) {
|
|
|
80
82
|
*/
|
|
81
83
|
isGlobalContext: true,
|
|
82
84
|
_isOriginalObject: true,
|
|
83
|
-
|
|
85
|
+
_virtualFileExportsGlobalEntry: virtualFileExportsGlobalEntry,
|
|
84
86
|
_pageFilesAll: pageFilesAll,
|
|
85
87
|
_pageConfigs: pageConfigs,
|
|
86
88
|
_pageConfigGlobal: pageConfigGlobal,
|
|
@@ -92,14 +94,14 @@ function createGlobalContextBase(virtualFileExports) {
|
|
|
92
94
|
(0, utils_js_1.changeEnumerable)(globalContext, '_isOriginalObject', false);
|
|
93
95
|
return globalContext;
|
|
94
96
|
}
|
|
95
|
-
function getConfigsAll(
|
|
96
|
-
const { pageFilesAll, pageConfigs, pageConfigGlobal } = (0,
|
|
97
|
+
function getConfigsAll(virtualFileExportsGlobalEntry) {
|
|
98
|
+
const { pageFilesAll, pageConfigs, pageConfigGlobal } = (0, parseVirtualFileExportsGlobalEntry_js_1.parseVirtualFileExportsGlobalEntry)(virtualFileExportsGlobalEntry);
|
|
97
99
|
const allPageIds = getAllPageIds(pageFilesAll, pageConfigs);
|
|
98
100
|
const vikeConfigPublicGlobal = (0, resolveVikeConfigPublic_js_1.resolveVikeConfigPublicGlobal)({
|
|
99
101
|
pageConfigGlobalValues: pageConfigGlobal.configValues,
|
|
100
102
|
});
|
|
101
103
|
const vikeConfigPublicPagesEager = Object.fromEntries(pageConfigs.map((pageConfig) => {
|
|
102
|
-
return (0, resolveVikeConfigPublic_js_1.
|
|
104
|
+
return (0, resolveVikeConfigPublic_js_1.resolveVikeConfigPublicPageEagerLoaded)(pageConfigGlobal.configValues, pageConfig, pageConfig.configValues);
|
|
103
105
|
}));
|
|
104
106
|
return {
|
|
105
107
|
pageFilesAll,
|
|
@@ -1,35 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
// TODO/now: rename parseVirtualFileExportsEntryGlobal
|
|
5
|
-
// TODO/now: merge or collocate following both files?
|
|
6
|
-
// ```filesystem
|
|
7
|
-
// vike/packages/vike/shared/getPageFiles/parseVirtualFileExports.ts
|
|
8
|
-
// vike/shared/page-configs/serialize/parsePageConfigs.ts
|
|
9
|
-
// ```
|
|
3
|
+
exports.parseVirtualFileExportsGlobalEntry = parseVirtualFileExportsGlobalEntry;
|
|
10
4
|
// TO-DO/next-major-release: remove old design code, and remove all assertions.
|
|
11
5
|
const utils_js_1 = require("../utils.js");
|
|
12
6
|
const assert_exports_old_design_js_1 = require("./assert_exports_old_design.js");
|
|
13
7
|
const getPageFileObject_js_1 = require("./getPageFileObject.js");
|
|
14
8
|
const fileTypes_js_1 = require("./fileTypes.js");
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(
|
|
18
|
-
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(
|
|
19
|
-
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(
|
|
20
|
-
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(
|
|
21
|
-
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(
|
|
22
|
-
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(
|
|
23
|
-
(0, utils_js_1.hasProp)(
|
|
24
|
-
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(
|
|
25
|
-
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(
|
|
26
|
-
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(
|
|
27
|
-
const { pageConfigsSerialized, pageConfigGlobalSerialized } =
|
|
9
|
+
const parsePageConfigsSerialized_js_1 = require("../page-configs/serialize/parsePageConfigsSerialized.js");
|
|
10
|
+
function parseVirtualFileExportsGlobalEntry(virtualFileExportsGlobalEntry) {
|
|
11
|
+
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(virtualFileExportsGlobalEntry, 'pageFilesLazy', 'object'));
|
|
12
|
+
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(virtualFileExportsGlobalEntry, 'pageFilesEager', 'object'));
|
|
13
|
+
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(virtualFileExportsGlobalEntry, 'pageFilesExportNamesLazy', 'object'));
|
|
14
|
+
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(virtualFileExportsGlobalEntry, 'pageFilesExportNamesEager', 'object'));
|
|
15
|
+
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(virtualFileExportsGlobalEntry.pageFilesLazy, '.page'));
|
|
16
|
+
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(virtualFileExportsGlobalEntry.pageFilesLazy, '.page.client') ||
|
|
17
|
+
(0, utils_js_1.hasProp)(virtualFileExportsGlobalEntry.pageFilesLazy, '.page.server'));
|
|
18
|
+
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(virtualFileExportsGlobalEntry, 'pageFilesList', 'string[]'));
|
|
19
|
+
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(virtualFileExportsGlobalEntry, 'pageConfigsSerialized'));
|
|
20
|
+
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(virtualFileExportsGlobalEntry, 'pageConfigGlobalSerialized'));
|
|
21
|
+
const { pageConfigsSerialized, pageConfigGlobalSerialized } = virtualFileExportsGlobalEntry;
|
|
28
22
|
assertPageConfigsSerialized(pageConfigsSerialized);
|
|
29
23
|
assertPageConfigGlobalSerialized(pageConfigGlobalSerialized);
|
|
30
|
-
const { pageConfigs, pageConfigGlobal } = (0,
|
|
24
|
+
const { pageConfigs, pageConfigGlobal } = (0, parsePageConfigsSerialized_js_1.parsePageConfigsSerialized)(pageConfigsSerialized, pageConfigGlobalSerialized);
|
|
31
25
|
const pageFilesMap = {};
|
|
32
|
-
parseGlobResult(
|
|
26
|
+
parseGlobResult(virtualFileExportsGlobalEntry.pageFilesLazy).forEach(({ filePath, pageFile, globValue }) => {
|
|
33
27
|
pageFile = pageFilesMap[filePath] = pageFilesMap[filePath] ?? pageFile;
|
|
34
28
|
const loadModule = globValue;
|
|
35
29
|
assertLoadModule(loadModule);
|
|
@@ -40,7 +34,7 @@ function parseVirtualFileExports(virtualFileExports) {
|
|
|
40
34
|
}
|
|
41
35
|
};
|
|
42
36
|
});
|
|
43
|
-
parseGlobResult(
|
|
37
|
+
parseGlobResult(virtualFileExportsGlobalEntry.pageFilesExportNamesLazy).forEach(({ filePath, pageFile, globValue }) => {
|
|
44
38
|
pageFile = pageFilesMap[filePath] = pageFilesMap[filePath] ?? pageFile;
|
|
45
39
|
const loadModule = globValue;
|
|
46
40
|
assertLoadModule(loadModule);
|
|
@@ -53,20 +47,20 @@ function parseVirtualFileExports(virtualFileExports) {
|
|
|
53
47
|
};
|
|
54
48
|
});
|
|
55
49
|
// `pageFilesEager` contains `.page.route.js` files
|
|
56
|
-
parseGlobResult(
|
|
50
|
+
parseGlobResult(virtualFileExportsGlobalEntry.pageFilesEager).forEach(({ filePath, pageFile, globValue }) => {
|
|
57
51
|
pageFile = pageFilesMap[filePath] = pageFilesMap[filePath] ?? pageFile;
|
|
58
52
|
const moduleExports = globValue;
|
|
59
53
|
(0, utils_js_1.assert)((0, utils_js_1.isObject)(moduleExports));
|
|
60
54
|
pageFile.fileExports = moduleExports;
|
|
61
55
|
});
|
|
62
|
-
parseGlobResult(
|
|
56
|
+
parseGlobResult(virtualFileExportsGlobalEntry.pageFilesExportNamesEager).forEach(({ filePath, pageFile, globValue }) => {
|
|
63
57
|
pageFile = pageFilesMap[filePath] = pageFilesMap[filePath] ?? pageFile;
|
|
64
58
|
const moduleExports = globValue;
|
|
65
59
|
(0, utils_js_1.assert)((0, utils_js_1.isObject)(moduleExports));
|
|
66
60
|
(0, utils_js_1.assert)((0, utils_js_1.hasProp)(moduleExports, 'exportNames', 'string[]'), pageFile.filePath);
|
|
67
61
|
pageFile.exportNames = moduleExports.exportNames;
|
|
68
62
|
});
|
|
69
|
-
|
|
63
|
+
virtualFileExportsGlobalEntry.pageFilesList.forEach((filePath) => {
|
|
70
64
|
pageFilesMap[filePath] = pageFilesMap[filePath] ?? (0, getPageFileObject_js_1.getPageFileObject)(filePath);
|
|
71
65
|
});
|
|
72
66
|
const pageFilesAll = Object.values(pageFilesMap);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadAndParseVirtualFilePageEntry = loadAndParseVirtualFilePageEntry;
|
|
4
|
+
const utils_js_1 = require("../utils.js");
|
|
5
|
+
const parsePageConfigsSerialized_js_1 = require("./serialize/parsePageConfigsSerialized.js");
|
|
6
|
+
async function loadAndParseVirtualFilePageEntry(pageConfig, isDev) {
|
|
7
|
+
if ('isPageEntryLoaded' in pageConfig &&
|
|
8
|
+
// We don't need to cache in dev, since Vite already caches the virtual module
|
|
9
|
+
!isDev) {
|
|
10
|
+
return pageConfig;
|
|
11
|
+
}
|
|
12
|
+
const { moduleId, moduleExportsPromise } = pageConfig.loadVirtualFilePageEntry();
|
|
13
|
+
const virtualFileExportsPageEntry = await moduleExportsPromise;
|
|
14
|
+
// `configValuesLoaded` is sometimes `undefined` https://github.com/vikejs/vike/discussions/2092
|
|
15
|
+
if (!virtualFileExportsPageEntry)
|
|
16
|
+
(0, utils_js_1.assert)(false, { moduleExportsPromise, virtualFileExportsPageEntry, moduleId });
|
|
17
|
+
const configValues = parseVirtualFileExportsPageEntry(virtualFileExportsPageEntry);
|
|
18
|
+
Object.assign(pageConfig.configValues, configValues);
|
|
19
|
+
(0, utils_js_1.objectAssign)(pageConfig, { isPageEntryLoaded: true });
|
|
20
|
+
return pageConfig;
|
|
21
|
+
}
|
|
22
|
+
function parseVirtualFileExportsPageEntry(virtualFileExportsPageEntry) {
|
|
23
|
+
const configValues = (0, parsePageConfigsSerialized_js_1.parseConfigValuesSerialized)(virtualFileExportsPageEntry.configValuesSerialized);
|
|
24
|
+
return configValues;
|
|
25
|
+
}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// TODO/now: rename PageConfig names
|
|
3
|
+
// - Use `Internal` suffix, i.e. {Page,Global}ConfigInternal
|
|
4
|
+
// - While keeping {Page,Global}ConfigPublic or remove Public suffix and rename it to {Page,Global}Config ?
|
|
5
|
+
// - rename EagerLoaded EagerlyLoaded
|
|
6
|
+
// - remove `LazyLoaded` suffix
|
|
7
|
+
// TODO/now: rename VikeConfigPublicPageLazyLoaded PageContextSomething (for `pageContext: PageContextSomething` usage)
|
|
2
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
10
|
};
|
|
5
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
12
|
exports.resolveVikeConfigPublicGlobal = resolveVikeConfigPublicGlobal;
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
13
|
+
exports.resolveVikeConfigPublicPageEagerLoaded = resolveVikeConfigPublicPageEagerLoaded;
|
|
14
|
+
exports.resolveVikeConfigPublicPageLazyLoaded = resolveVikeConfigPublicPageLazyLoaded;
|
|
9
15
|
const assert_exports_old_design_js_1 = require("../getPageFiles/assert_exports_old_design.js");
|
|
10
16
|
const getConfigDefinedAt_js_1 = require("./getConfigDefinedAt.js");
|
|
11
17
|
const helpers_js_1 = require("./helpers.js");
|
|
12
18
|
const utils_js_1 = require("../utils.js");
|
|
13
19
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
14
|
-
function
|
|
20
|
+
function resolveVikeConfigPublicPageEagerLoaded(pageConfigGlobalValues, pageConfig, pageConfigValues) {
|
|
15
21
|
const vikeConfigPublicPage_ = resolveVikeConfigPublic_base({ pageConfigGlobalValues, pageConfigValues });
|
|
16
22
|
const vikeConfigPublicPage = getPublicCopy(vikeConfigPublicPage_);
|
|
17
23
|
let page;
|
|
@@ -46,7 +52,7 @@ function resolveVikeConfigPublicGlobal({ pageConfigGlobalValues, }) {
|
|
|
46
52
|
const vikeConfigPublicGlobal = resolveVikeConfigPublic_V1Design({ configValues: pageConfigGlobalValues });
|
|
47
53
|
return getPublicCopy(vikeConfigPublicGlobal);
|
|
48
54
|
}
|
|
49
|
-
function
|
|
55
|
+
function resolveVikeConfigPublicPageLazyLoaded(pageFiles, // V0.4 design
|
|
50
56
|
pageConfig, // V1 design
|
|
51
57
|
pageConfigGlobal) {
|
|
52
58
|
const config = {};
|
package/dist/cjs/shared/page-configs/serialize/{parsePageConfigs.js → parsePageConfigsSerialized.js}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.parsePageConfigsSerialized = parsePageConfigsSerialized;
|
|
4
4
|
exports.parseConfigValuesSerialized = parseConfigValuesSerialized;
|
|
5
5
|
const utils_js_1 = require("../../utils.js");
|
|
6
6
|
const getConfigDefinedAt_js_1 = require("../getConfigDefinedAt.js");
|
|
7
7
|
const parse_1 = require("@brillout/json-serializer/parse");
|
|
8
8
|
const assertPlusFileExport_js_1 = require("../assertPlusFileExport.js");
|
|
9
|
-
function
|
|
9
|
+
function parsePageConfigsSerialized(pageConfigsSerialized, pageConfigGlobalSerialized) {
|
|
10
10
|
// pageConfigs
|
|
11
11
|
const pageConfigs = pageConfigsSerialized.map((pageConfigSerialized) => {
|
|
12
12
|
const configValues = parseConfigValuesSerialized(pageConfigSerialized.configValuesSerialized);
|
|
@@ -16,9 +16,9 @@ const getConfigValueSourcesRelevant_js_1 = require("../../../node/vite/plugins/p
|
|
|
16
16
|
const stringifyOptions = { forbidReactElements: true };
|
|
17
17
|
const REPLACE_ME_BEFORE = '__VIKE__REPLACE_ME_BEFORE__';
|
|
18
18
|
const REPLACE_ME_AFTER = '__VIKE__REPLACE_ME_AFTER__';
|
|
19
|
-
// This file is never loaded on the client-side but we save it under the vike/shared/ directory in order to collocate it with
|
|
20
|
-
// - vike/shared/page-configs/serialize/
|
|
21
|
-
// -
|
|
19
|
+
// 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()
|
|
20
|
+
// - vike/shared/page-configs/serialize/parsePageConfigsSerialized.ts
|
|
21
|
+
// - parsePageConfigsSerialized() is loaded on both the client- and server-side.
|
|
22
22
|
(0, utils_js_1.assertIsNotBrowser)();
|
|
23
23
|
(0, assertSetup_js_1.assertIsNotProductionRuntime)();
|
|
24
24
|
function serializeConfigValues(pageConfig, importStatements, filesEnv, runtimeEnv, tabspace, isEager) {
|
|
@@ -28,7 +28,6 @@ async function execHookOnBeforeRoute(pageContext) {
|
|
|
28
28
|
}
|
|
29
29
|
(0, utils_js_1.objectAssign)(pageContextFromOnBeforeRouteHook, {
|
|
30
30
|
_routingProvidedByOnBeforeRouteHook: true,
|
|
31
|
-
_debugRouteMatches: 'CUSTOM_ROUTING',
|
|
32
31
|
});
|
|
33
32
|
return pageContextFromOnBeforeRouteHook;
|
|
34
33
|
}
|
|
@@ -86,7 +86,6 @@ async function route(pageContext, skipOnBeforeRouteHook) {
|
|
|
86
86
|
(0, resolvePrecedence_js_1.resolvePrecedence)(routeMatches);
|
|
87
87
|
const winner = routeMatches[0] ?? null;
|
|
88
88
|
(0, debug_js_1.debug)(`Route matches for URL ${picocolors_1.default.cyan(urlPathname)} (in precedence order):`, routeMatches);
|
|
89
|
-
(0, utils_js_1.objectAssign)(pageContextFromRoute, { _debugRouteMatches: routeMatches });
|
|
90
89
|
// For vite-plugin-vercel https://github.com/magne4000/vite-plugin-vercel/blob/main/packages/vike-integration/vike.ts#L173
|
|
91
90
|
(0, utils_js_1.objectAssign)(pageContextFromRoute, { _routeMatch: winner });
|
|
92
91
|
if (!winner) {
|
|
@@ -17,6 +17,7 @@ const assert_js_1 = require("./assert.js");
|
|
|
17
17
|
const assertIsNotBrowser_js_1 = require("./assertIsNotBrowser.js");
|
|
18
18
|
const debug_js_1 = require("./debug.js");
|
|
19
19
|
const getGlobalObject_js_1 = require("./getGlobalObject.js");
|
|
20
|
+
const isNonRunnableDev_js_1 = require("./isNonRunnableDev.js");
|
|
20
21
|
const isVitest_js_1 = require("./isVitest.js");
|
|
21
22
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
22
23
|
(0, assertIsNotBrowser_js_1.assertIsNotBrowser)();
|
|
@@ -29,8 +30,6 @@ function assertIsNotProductionRuntime() {
|
|
|
29
30
|
setup.shouldNotBeProduction = true;
|
|
30
31
|
}
|
|
31
32
|
function onSetupRuntime() {
|
|
32
|
-
if (true)
|
|
33
|
-
return; // TODO/now refactor this
|
|
34
33
|
if (debug.isActivated)
|
|
35
34
|
debug('assertSetup()', new Error().stack);
|
|
36
35
|
if (isTest())
|
|
@@ -38,7 +37,7 @@ function onSetupRuntime() {
|
|
|
38
37
|
assertNodeEnvIsNotUndefinedString();
|
|
39
38
|
if (!setup.viteDevServer && setup.isViteDev === undefined) {
|
|
40
39
|
// TO-DO/eventually: make it assertUsage() again once https://github.com/vikejs/vike/issues/1528 is implemented.
|
|
41
|
-
(0, assert_js_1.assertWarning)(!isNodeEnvDev(), `The ${getEnvDescription()}, which is contradictory because the environment seems to be a production environment (Vite isn't loaded), see ${picocolors_1.default.underline('https://vike.dev/NODE_ENV')} and ${picocolors_1.default.underline('https://vike.dev/warning/setup')}`, { onlyOnce: true });
|
|
40
|
+
(0, assert_js_1.assertWarning)(!isNodeEnvDev() || (0, isNonRunnableDev_js_1.isNonRunnableDev)(), `The ${getEnvDescription()}, which is contradictory because the environment seems to be a production environment (Vite isn't loaded), see ${picocolors_1.default.underline('https://vike.dev/NODE_ENV')} and ${picocolors_1.default.underline('https://vike.dev/warning/setup')}`, { onlyOnce: true });
|
|
42
41
|
(0, assert_js_1.assertUsage)(!setup.vikeVitePlugin, `Vike's Vite plugin (the ${picocolors_1.default.cyan('vike/plugin')} module) shouldn't be loaded in production, see ${picocolors_1.default.underline('https://vike.dev/warning/setup')}`);
|
|
43
42
|
// This assert() one of the main goal of this file: it ensures assertIsNotProductionRuntime()
|
|
44
43
|
(0, assert_js_1.assert)(!setup.shouldNotBeProduction);
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.assertVersion = assertVersion;
|
|
4
4
|
exports.isVersionOrAbove = isVersionOrAbove;
|
|
5
5
|
const assert_js_1 = require("./assert.js");
|
|
6
|
+
const assertIsNotBrowser_js_1 = require("./assertIsNotBrowser.js");
|
|
7
|
+
(0, assertIsNotBrowser_js_1.assertIsNotBrowser)();
|
|
6
8
|
function assertVersion(dependencyName, versionActual, versionExpected) {
|
|
7
9
|
(0, assert_js_1.assert)(versionActual);
|
|
8
10
|
(0, assert_js_1.assert)(versionExpected);
|
package/dist/cjs/utils/debug.js
CHANGED
|
@@ -5,17 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createDebugger = createDebugger;
|
|
7
7
|
exports.isDebugActivated = isDebugActivated;
|
|
8
|
-
const isBrowser_js_1 = require("./isBrowser.js");
|
|
9
8
|
const isCallable_js_1 = require("./isCallable.js");
|
|
10
9
|
const objectAssign_js_1 = require("./objectAssign.js");
|
|
11
10
|
const assert_js_1 = require("./assert.js");
|
|
12
11
|
const checkType_js_1 = require("./checkType.js");
|
|
13
|
-
const
|
|
12
|
+
const getTerminalWidth_js_1 = require("./getTerminalWidth.js");
|
|
14
13
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
15
14
|
const isArray_js_1 = require("./isArray.js");
|
|
16
15
|
const isObject_js_1 = require("./isObject.js");
|
|
17
16
|
const debug_js_1 = require("../shared/route/debug.js");
|
|
18
|
-
|
|
17
|
+
const assertIsNotBrowser_js_1 = require("./assertIsNotBrowser.js");
|
|
18
|
+
(0, assertIsNotBrowser_js_1.assertIsNotBrowser)();
|
|
19
19
|
(0, debug_js_1.setCreateDebugger)(createDebugger); // for isomorphic code
|
|
20
20
|
const flags = [
|
|
21
21
|
'vike:crawl',
|
|
@@ -117,7 +117,7 @@ function formatMsg(info, options, padding, position) {
|
|
|
117
117
|
return str;
|
|
118
118
|
}
|
|
119
119
|
function pad(str, padding) {
|
|
120
|
-
const terminalWidth = (0,
|
|
120
|
+
const terminalWidth = (0, getTerminalWidth_js_1.getTerminalWidth)();
|
|
121
121
|
const lines = [];
|
|
122
122
|
str.split('\n').forEach((line) => {
|
|
123
123
|
if (!terminalWidth) {
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getGlobalObject = getGlobalObject;
|
|
4
|
-
exports.assertIsSingleModuleInstance = assertIsSingleModuleInstance;
|
|
5
|
-
const assert_js_1 = require("./assert.js");
|
|
6
4
|
/** Share information across module instances. */
|
|
7
|
-
function getGlobalObject(
|
|
8
|
-
const
|
|
9
|
-
const globalObject = (
|
|
5
|
+
function getGlobalObject(moduleId, defaultValue) {
|
|
6
|
+
const globals = getGlobals();
|
|
7
|
+
const globalObject = (globals[moduleId] ?? (globals[moduleId] = defaultValue));
|
|
10
8
|
return globalObject;
|
|
11
9
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
(
|
|
16
|
-
|
|
17
|
-
function getGlobalObjects() {
|
|
18
|
-
const projectKey = '_vike';
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
const globalObjects = (globalThis[projectKey] = globalThis[projectKey] || {});
|
|
21
|
-
return globalObjects;
|
|
10
|
+
function getGlobals() {
|
|
11
|
+
var _a;
|
|
12
|
+
globalThis._vike ?? (globalThis._vike = {});
|
|
13
|
+
(_a = globalThis._vike).globals ?? (_a.globals = {});
|
|
14
|
+
return globalThis._vike.globals;
|
|
22
15
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNonRunnableDev = isNonRunnableDev;
|
|
4
|
+
const assert_js_1 = require("./assert.js");
|
|
5
|
+
const assertIsNotBrowser_js_1 = require("./assertIsNotBrowser.js");
|
|
6
|
+
(0, assertIsNotBrowser_js_1.assertIsNotBrowser)();
|
|
7
|
+
function isNonRunnableDev() {
|
|
8
|
+
if (typeof __VIKE__IS_NON_RUNNABLE_DEV === 'undefined')
|
|
9
|
+
return false;
|
|
10
|
+
(0, assert_js_1.assert)(__VIKE__IS_NON_RUNNABLE_DEV === true);
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.scriptFileExtensionPattern = exports.scriptFileExtensionList = void 0;
|
|
4
4
|
exports.isScriptFile = isScriptFile;
|
|
5
5
|
exports.isPlainScriptFile = isPlainScriptFile;
|
|
6
6
|
exports.isTemplateFile = isTemplateFile;
|