vike 0.4.239 → 0.4.240-commit-a80417c
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/esm/client/index.d.ts +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.d.ts +1 -1
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.js +1 -1
- package/dist/esm/client/runtime-client-routing/entry.js +5 -3
- package/dist/esm/client/runtime-client-routing/getBaseServer.js +0 -1
- package/dist/esm/client/runtime-client-routing/{globalContext.d.ts → getGlobalContextClientInternal.d.ts} +2 -2
- package/dist/esm/client/runtime-client-routing/{globalContext.js → getGlobalContextClientInternal.js} +8 -4
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.d.ts +6 -6
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.js +1 -1
- package/dist/esm/client/runtime-client-routing/isClientSideRoutable.d.ts +1 -1
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.d.ts +4 -4
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.js +102 -77
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.d.ts +1 -1
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.js +1 -1
- package/dist/esm/client/runtime-server-routing/entry.js +5 -3
- package/dist/esm/client/runtime-server-routing/{globalContext.d.ts → getGlobalContextClientInternal.d.ts} +2 -2
- package/dist/esm/client/runtime-server-routing/getGlobalContextClientInternal.js +6 -0
- package/dist/esm/client/shared/execHookOnRenderClient.d.ts +1 -1
- package/dist/esm/client/shared/{createGetGlobalContextClient.d.ts → getGlobalContextClientInternalShared.d.ts} +11 -8
- package/dist/esm/client/shared/getGlobalContextClientInternalShared.js +66 -0
- package/dist/esm/client/shared/loadPageConfigsLazyClientSide.js +1 -3
- package/dist/esm/node/prerender/runPrerender.d.ts +4 -2
- package/dist/esm/node/prerender/runPrerender.js +5 -2
- package/dist/esm/node/runtime/globalContext.d.ts +15 -2
- package/dist/esm/node/runtime/globalContext.js +46 -32
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.d.ts +4 -2
- package/dist/esm/node/runtime/renderPage/loadPageConfigsLazyServerSide.d.ts +4 -2
- package/dist/esm/node/runtime/renderPage/renderPageAfterRoute.d.ts +8 -4
- package/dist/esm/node/runtime/renderPage.d.ts +4 -2
- package/dist/esm/node/vite/index.js +42 -18
- package/dist/esm/node/vite/onLoad.js +1 -1
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/handleAssetsManifest.d.ts +4 -0
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/handleAssetsManifest.js +21 -6
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginBuildApp.js +24 -20
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginBuildConfig.js +20 -6
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginDistFileNames.d.ts +1 -1
- package/dist/esm/node/vite/plugins/build/pluginDistFileNames.js +253 -0
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginDistPackageJsonFile.d.ts +1 -1
- package/dist/esm/node/vite/plugins/build/pluginDistPackageJsonFile.js +40 -0
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginModuleBanner.d.ts +1 -1
- package/dist/esm/node/vite/plugins/build/pluginModuleBanner.js +49 -0
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginProdBuildEntry.js +4 -2
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginSuppressRollupWarning.d.ts +1 -1
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginSuppressRollupWarning.js +27 -23
- package/dist/esm/node/vite/plugins/non-runnable-dev/pluginReplaceConstantsNonRunnableDev.d.ts +7 -0
- package/dist/esm/node/vite/plugins/non-runnable-dev/pluginReplaceConstantsNonRunnableDev.js +47 -0
- package/dist/esm/node/vite/plugins/{pluginNonRunnableDev.d.ts → non-runnable-dev/pluginViteRPC.d.ts} +3 -7
- package/dist/esm/node/vite/plugins/non-runnable-dev/pluginViteRPC.js +30 -0
- package/dist/esm/node/vite/plugins/pluginBaseUrls.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginBaseUrls.js +39 -33
- package/dist/esm/node/vite/plugins/pluginCommon.js +8 -28
- package/dist/esm/node/vite/plugins/pluginDev/determineFsAllowList.js +0 -1
- package/dist/esm/node/vite/plugins/pluginDev/determineOptimizeDeps.js +1 -1
- package/dist/esm/node/vite/plugins/pluginDev.js +51 -47
- package/dist/esm/node/vite/plugins/pluginExtractAssets.js +108 -92
- package/dist/esm/node/vite/plugins/pluginExtractExportNames.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginExtractExportNames.js +39 -23
- package/dist/esm/node/vite/plugins/pluginFileEnv.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginFileEnv.js +117 -92
- package/dist/esm/node/vite/plugins/pluginPreview.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginPreview.js +38 -30
- package/dist/esm/node/vite/plugins/pluginReplaceConstantsEnvVars.d.ts +3 -0
- package/dist/esm/node/vite/plugins/pluginReplaceConstantsEnvVars.js +127 -0
- package/dist/esm/node/vite/plugins/pluginReplaceConstantsGlobalThis.d.ts +17 -0
- package/dist/esm/node/vite/plugins/pluginReplaceConstantsGlobalThis.js +52 -0
- package/dist/esm/node/vite/plugins/pluginReplaceConstantsPageContext.d.ts +3 -0
- package/dist/esm/node/vite/plugins/pluginReplaceConstantsPageContext.js +89 -0
- package/dist/esm/node/vite/plugins/pluginSetGlobalContext.js +4 -2
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/generateVirtualFilePageEntry.js +1 -1
- package/dist/esm/node/vite/plugins/pluginVirtualFiles.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginVirtualFiles.js +67 -47
- package/dist/esm/node/vite/plugins/pluginWorkaroundCssModuleHmr.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginWorkaroundCssModuleHmr.js +13 -9
- package/dist/esm/node/vite/plugins/pluginWorkaroundVite6HmrRegression.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginWorkaroundVite6HmrRegression.js +26 -24
- package/dist/esm/node/vite/shared/getMagicString.d.ts +1 -1
- package/dist/esm/node/vite/shared/getMagicString.js +2 -0
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js +2 -2
- package/dist/esm/shared/createGlobalContextShared.d.ts +4 -4
- package/dist/esm/shared/route/abort.d.ts +23 -11
- package/dist/esm/shared/route/abort.js +45 -5
- package/dist/esm/shared/route/index.js +13 -4
- package/dist/esm/shared/route/utils.d.ts +1 -0
- package/dist/esm/shared/route/utils.js +1 -0
- package/dist/esm/types/Config.d.ts +1 -1
- package/dist/esm/types/PageContext.d.ts +8 -8
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/assert.js +1 -0
- package/dist/esm/utils/debug.d.ts +5 -3
- package/dist/esm/utils/debug.js +30 -16
- package/dist/esm/utils/findPackageJson.js +0 -1
- package/dist/esm/utils/getGlobalObject.d.ts +5 -1
- package/dist/esm/utils/getGlobalObject.js +5 -1
- package/dist/esm/utils/getViteRPC.js +0 -2
- package/dist/esm/utils/isDev.js +3 -1
- package/dist/esm/utils/isNonRunnableDev.js +2 -2
- package/dist/esm/utils/requireResolve.js +1 -2
- package/dist/esm/utils/virtualFileId.d.ts +4 -0
- package/dist/esm/utils/virtualFileId.js +14 -11
- package/package.json +8 -27
- package/dist/cjs/__internal/index.js +0 -35
- package/dist/cjs/client/runtime-client-routing/globalContext.js +0 -49
- package/dist/cjs/client/runtime-client-routing/prefetch/PrefetchSetting.js +0 -2
- package/dist/cjs/client/runtime-server-routing/globalContext.js +0 -41
- package/dist/cjs/client/runtime-server-routing/onLoad.js +0 -7
- package/dist/cjs/client/runtime-server-routing/utils.js +0 -34
- package/dist/cjs/client/shared/createGetGlobalContextClient.js +0 -65
- package/dist/cjs/client/shared/getJsonSerializedInHtml.js +0 -40
- package/dist/cjs/client/shared/preparePageContextForPublicUsageClientShared.js +0 -41
- package/dist/cjs/client/shared/utils.js +0 -23
- package/dist/cjs/node/api/build.js +0 -24
- package/dist/cjs/node/api/context.js +0 -23
- package/dist/cjs/node/api/dev.js +0 -18
- package/dist/cjs/node/api/index.js +0 -44
- package/dist/cjs/node/api/onLoad.js +0 -9
- package/dist/cjs/node/api/prepareViteApiCall.js +0 -206
- package/dist/cjs/node/api/prerender.js +0 -18
- package/dist/cjs/node/api/preview.js +0 -38
- package/dist/cjs/node/api/types.js +0 -2
- package/dist/cjs/node/api/utils.js +0 -27
- package/dist/cjs/node/cli/context.js +0 -17
- package/dist/cjs/node/cli/entry.js +0 -121
- package/dist/cjs/node/cli/index.js +0 -12
- package/dist/cjs/node/cli/onLoad.js +0 -9
- package/dist/cjs/node/cli/parseCli.js +0 -95
- package/dist/cjs/node/cli/utils.js +0 -24
- package/dist/cjs/node/client/router.js +0 -19
- package/dist/cjs/node/createPageRenderer.js +0 -132
- package/dist/cjs/node/importBuild.js +0 -3
- package/dist/cjs/node/prerender/context.js +0 -26
- package/dist/cjs/node/prerender/index.js +0 -12
- package/dist/cjs/node/prerender/resolvePrerenderConfig.js +0 -66
- package/dist/cjs/node/prerender/runPrerender.js +0 -777
- package/dist/cjs/node/prerender/runPrerenderEntry.js +0 -55
- package/dist/cjs/node/prerender/utils.js +0 -37
- package/dist/cjs/node/runtime/globalContext.js +0 -572
- package/dist/cjs/node/runtime/index-deprecated.js +0 -33
- package/dist/cjs/node/runtime/index.js +0 -74
- package/dist/cjs/node/runtime/loggerRuntime.js +0 -17
- package/dist/cjs/node/runtime/onLoad.js +0 -29
- package/dist/cjs/node/runtime/page-files/setup.js +0 -5
- package/dist/cjs/node/runtime/renderPage/analyzePage.js +0 -71
- package/dist/cjs/node/runtime/renderPage/assertArguments.js +0 -42
- package/dist/cjs/node/runtime/renderPage/createHttpResponse/assertNoInfiniteHttpRedirect.js +0 -51
- package/dist/cjs/node/runtime/renderPage/createHttpResponse.js +0 -114
- package/dist/cjs/node/runtime/renderPage/createPageContextServerSide.js +0 -59
- package/dist/cjs/node/runtime/renderPage/csp.js +0 -47
- package/dist/cjs/node/runtime/renderPage/execHookDataAndOnBeforeRender.js +0 -31
- package/dist/cjs/node/runtime/renderPage/execHookOnRenderHtml.js +0 -120
- package/dist/cjs/node/runtime/renderPage/execHookServer.js +0 -8
- package/dist/cjs/node/runtime/renderPage/getCacheControl.js +0 -24
- package/dist/cjs/node/runtime/renderPage/getEarlyHints.js +0 -20
- package/dist/cjs/node/runtime/renderPage/getHttpResponseBody.js +0 -137
- package/dist/cjs/node/runtime/renderPage/getPageAssets/getManifestEntry.js +0 -125
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrievePageAssetsDev.js +0 -86
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrievePageAssetsProd.js +0 -77
- package/dist/cjs/node/runtime/renderPage/getPageAssets/sortPageAssetsForEarlyHintsHeader.js +0 -36
- package/dist/cjs/node/runtime/renderPage/getPageAssets.js +0 -50
- package/dist/cjs/node/runtime/renderPage/handleErrorWithoutErrorPage.js +0 -41
- package/dist/cjs/node/runtime/renderPage/handlePageContextRequestUrl.js +0 -68
- package/dist/cjs/node/runtime/renderPage/headersResponse.js +0 -48
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/getHtmlTags.js +0 -269
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/getViteDevScript.js +0 -32
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/inferHtmlTags.js +0 -55
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/injectAssets__public.js +0 -31
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/injectHtmlTags.js +0 -161
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/mergeScriptTags.js +0 -73
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/sanitizeJson.js +0 -8
- package/dist/cjs/node/runtime/renderPage/html/injectAssets.js +0 -93
- package/dist/cjs/node/runtime/renderPage/html/propKeys.js +0 -47
- package/dist/cjs/node/runtime/renderPage/html/renderHtml.js +0 -245
- package/dist/cjs/node/runtime/renderPage/html/serializeContext.js +0 -189
- package/dist/cjs/node/runtime/renderPage/html/stream/react-streaming.js +0 -36
- package/dist/cjs/node/runtime/renderPage/html/stream.js +0 -829
- package/dist/cjs/node/runtime/renderPage/inferMediaType.js +0 -81
- package/dist/cjs/node/runtime/renderPage/isFontFallback.js +0 -29
- package/dist/cjs/node/runtime/renderPage/isNewError.js +0 -25
- package/dist/cjs/node/runtime/renderPage/loadPageConfigsLazyServerSide.js +0 -124
- package/dist/cjs/node/runtime/renderPage/log404/index.js +0 -154
- package/dist/cjs/node/runtime/renderPage/logErrorHint/errors.js +0 -20
- package/dist/cjs/node/runtime/renderPage/logErrorHint.js +0 -200
- package/dist/cjs/node/runtime/renderPage/loggerProd.js +0 -34
- package/dist/cjs/node/runtime/renderPage/preparePageContextForPublicUsageServer.js +0 -10
- package/dist/cjs/node/runtime/renderPage/renderPageAfterRoute.js +0 -83
- package/dist/cjs/node/runtime/renderPage/resolveRedirects.js +0 -71
- package/dist/cjs/node/runtime/renderPage.js +0 -502
- package/dist/cjs/node/runtime/universal-middleware.js +0 -20
- package/dist/cjs/node/runtime/utils.js +0 -83
- package/dist/cjs/node/runtime-dev/createDevMiddleware.js +0 -27
- package/dist/cjs/node/runtime-dev/index.js +0 -42
- package/dist/cjs/node/shared/assertV1Design.js +0 -30
- package/dist/cjs/node/shared/extractAssetsQuery.js +0 -29
- package/dist/cjs/node/shared/getVikeConfigError.js +0 -22
- package/dist/cjs/node/shared/isErrorDebug.js +0 -7
- package/dist/cjs/node/shared/prependEntriesDir.js +0 -13
- package/dist/cjs/node/shared/resolveBase.js +0 -35
- package/dist/cjs/node/shared/utils.js +0 -35
- package/dist/cjs/node/shared/virtualFileId.js +0 -110
- package/dist/cjs/node/vite/index.js +0 -69
- package/dist/cjs/node/vite/onLoad.js +0 -21
- package/dist/cjs/node/vite/plugins/pluginBaseUrls.js +0 -48
- package/dist/cjs/node/vite/plugins/pluginBuild/handleAssetsManifest.js +0 -342
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildApp.js +0 -179
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildConfig.js +0 -220
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginDistFileNames.js +0 -254
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginDistPackageJsonFile.js +0 -36
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginModuleBanner.js +0 -41
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginProdBuildEntry.js +0 -109
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginSuppressRollupWarning.js +0 -63
- package/dist/cjs/node/vite/plugins/pluginBuild.js +0 -21
- package/dist/cjs/node/vite/plugins/pluginCommon/assertResolveAlias.js +0 -88
- package/dist/cjs/node/vite/plugins/pluginCommon.js +0 -197
- package/dist/cjs/node/vite/plugins/pluginDev/determineFsAllowList.js +0 -28
- package/dist/cjs/node/vite/plugins/pluginDev/determineOptimizeDeps.js +0 -163
- package/dist/cjs/node/vite/plugins/pluginDev.js +0 -107
- package/dist/cjs/node/vite/plugins/pluginEnvVars.js +0 -87
- package/dist/cjs/node/vite/plugins/pluginExtractAssets.js +0 -227
- package/dist/cjs/node/vite/plugins/pluginExtractExportNames.js +0 -99
- package/dist/cjs/node/vite/plugins/pluginFileEnv.js +0 -149
- package/dist/cjs/node/vite/plugins/pluginNonRunnableDev.js +0 -52
- package/dist/cjs/node/vite/plugins/pluginPreview.js +0 -76
- package/dist/cjs/node/vite/plugins/pluginReplaceConstants.js +0 -69
- package/dist/cjs/node/vite/plugins/pluginSetGlobalContext.js +0 -49
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/debug.js +0 -5
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/generateVirtualFileGlobalEntry.js +0 -56
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/generateVirtualFileGlobalEntryWithOldDesign.js +0 -190
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/generateVirtualFilePageEntry.js +0 -54
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/getConfigValueSourcesRelevant.js +0 -97
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles.js +0 -215
- package/dist/cjs/node/vite/plugins/pluginWorkaroundCssModuleHmr.js +0 -15
- package/dist/cjs/node/vite/plugins/pluginWorkaroundVite6HmrRegression.js +0 -35
- package/dist/cjs/node/vite/shared/addSsrMiddleware.js +0 -60
- package/dist/cjs/node/vite/shared/findPageFiles.js +0 -25
- package/dist/cjs/node/vite/shared/getAssetsDir.js +0 -10
- package/dist/cjs/node/vite/shared/getClientEntrySrcDev.js +0 -42
- package/dist/cjs/node/vite/shared/getEnvVarObject.js +0 -37
- package/dist/cjs/node/vite/shared/getFilePath.js +0 -172
- package/dist/cjs/node/vite/shared/getHttpRequestAsyncStore.js +0 -125
- package/dist/cjs/node/vite/shared/getMagicString.js +0 -18
- package/dist/cjs/node/vite/shared/getManifestFilePathRelative.js +0 -10
- package/dist/cjs/node/vite/shared/getOutDirs.js +0 -146
- package/dist/cjs/node/vite/shared/getViteConfigRuntime.js +0 -21
- package/dist/cjs/node/vite/shared/isAsset.js +0 -40
- package/dist/cjs/node/vite/shared/isViteCliCall.js +0 -83
- package/dist/cjs/node/vite/shared/isViteServerSide.js +0 -68
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelReact.js +0 -15
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelSolid.js +0 -15
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errEsbuild.js +0 -38
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx1.js +0 -26
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx2.js +0 -85
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errPostcss.js +0 -30
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwc.js +0 -19
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwcBig.js +0 -19
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueCss.js +0 -29
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueHtml.js +0 -13
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueJavascript.js +0 -15
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet.js +0 -162
- package/dist/cjs/node/vite/shared/loggerNotProd/log.js +0 -102
- package/dist/cjs/node/vite/shared/loggerNotProd.js +0 -208
- package/dist/cjs/node/vite/shared/loggerVite/removeSuperfluousViteLog.js +0 -26
- package/dist/cjs/node/vite/shared/loggerVite.js +0 -54
- package/dist/cjs/node/vite/shared/normalizeId.js +0 -9
- package/dist/cjs/node/vite/shared/parseEsModule.js +0 -33
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/assertExtensions.js +0 -136
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js +0 -262
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles/ignorePatternsBuiltIn.js +0 -18
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles.js +0 -252
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/filesystemRouting.js +0 -190
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/getConfigFileExport.js +0 -17
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/getPlusFilesAll.js +0 -127
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/loadFileAtConfigTime.js +0 -129
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/pointerImports.js +0 -195
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/resolvePointerImport.js +0 -102
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/transpileAndExecuteFile.js +0 -425
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal.js +0 -1151
- package/dist/cjs/node/vite/shared/rollupIsEsm.js +0 -15
- package/dist/cjs/node/vite/utils.js +0 -45
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/shared/NOT_SERIALIZABLE.js +0 -4
- package/dist/cjs/shared/RenderErrorPage.js +0 -6
- package/dist/cjs/shared/abort.js +0 -16
- package/dist/cjs/shared/addIs404ToPageProps.js +0 -18
- package/dist/cjs/shared/assertHookReturnedObject.js +0 -21
- package/dist/cjs/shared/assertOnBeforeRenderHookReturn.js +0 -21
- package/dist/cjs/shared/assertPageContextProvidedByUser.js +0 -20
- package/dist/cjs/shared/createGlobalContextShared.js +0 -109
- package/dist/cjs/shared/createPageContextShared.js +0 -17
- package/dist/cjs/shared/determinePageIdOld.js +0 -11
- package/dist/cjs/shared/error-page.js +0 -40
- package/dist/cjs/shared/getPageContext.js +0 -6
- package/dist/cjs/shared/getPageContextRequestUrl.js +0 -16
- package/dist/cjs/shared/getPageContextUrlComputed.js +0 -132
- package/dist/cjs/shared/getPageFiles/analyzeClientSide.js +0 -19
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/ClientDependency.js +0 -2
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/analyzeExports.js +0 -50
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/determineClientEntry.js +0 -30
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/getExportNames.js +0 -15
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide.js +0 -59
- package/dist/cjs/shared/getPageFiles/analyzePageServerSide.js +0 -22
- package/dist/cjs/shared/getPageFiles/assert_exports_old_design.js +0 -24
- package/dist/cjs/shared/getPageFiles/fileTypes.js +0 -52
- package/dist/cjs/shared/getPageFiles/getAllPageIdFiles.js +0 -102
- package/dist/cjs/shared/getPageFiles/getPageFileObject.js +0 -56
- package/dist/cjs/shared/getPageFiles/parseVirtualFileExportsGlobalEntry.js +0 -100
- package/dist/cjs/shared/getPageFiles.js +0 -7
- package/dist/cjs/shared/getProxyForPublicUsage.js +0 -56
- package/dist/cjs/shared/hooks/execHook.js +0 -147
- package/dist/cjs/shared/hooks/getHook.js +0 -173
- package/dist/cjs/shared/htmlElementIds.js +0 -5
- package/dist/cjs/shared/misc/isServerSideError.js +0 -4
- package/dist/cjs/shared/misc/pageContextInitIsPassedToClient.js +0 -4
- package/dist/cjs/shared/modifyUrl.js +0 -28
- package/dist/cjs/shared/modifyUrlSameOrigin.js +0 -47
- package/dist/cjs/shared/page-configs/assertPlusFileExport.js +0 -42
- package/dist/cjs/shared/page-configs/findPageConfig.js +0 -10
- package/dist/cjs/shared/page-configs/getConfigDefinedAt.js +0 -65
- package/dist/cjs/shared/page-configs/getConfigValueBuildTime.js +0 -68
- package/dist/cjs/shared/page-configs/getConfigValueRuntime.js +0 -10
- package/dist/cjs/shared/page-configs/getConfigValueTyped.js +0 -32
- package/dist/cjs/shared/page-configs/getExportPath.js +0 -29
- package/dist/cjs/shared/page-configs/helpers.js +0 -27
- package/dist/cjs/shared/page-configs/loadAndParseVirtualFilePageEntry.js +0 -25
- package/dist/cjs/shared/page-configs/resolveVikeConfigPublic.js +0 -287
- package/dist/cjs/shared/page-configs/serialize/PageConfigSerialized.js +0 -2
- package/dist/cjs/shared/page-configs/serialize/assertPageConfigsSerialized.js +0 -1
- package/dist/cjs/shared/page-configs/serialize/parsePageConfigsSerialized.js +0 -145
- package/dist/cjs/shared/page-configs/serialize/serializeConfigValues.js +0 -290
- package/dist/cjs/shared/prepareGlobalContextForPublicUsage.js +0 -10
- package/dist/cjs/shared/preparePageContextForPublicUsage.js +0 -80
- package/dist/cjs/shared/route/abort.js +0 -178
- package/dist/cjs/shared/route/debug.js +0 -23
- package/dist/cjs/shared/route/deduceRouteStringFromFilesystemPath.js +0 -52
- package/dist/cjs/shared/route/execHookGuard.js +0 -37
- package/dist/cjs/shared/route/execHookOnBeforeRoute.js +0 -84
- package/dist/cjs/shared/route/index.js +0 -107
- package/dist/cjs/shared/route/loadPageRoutes.js +0 -197
- package/dist/cjs/shared/route/noRouteMatch.js +0 -4
- package/dist/cjs/shared/route/resolvePrecedence.js +0 -93
- package/dist/cjs/shared/route/resolveRoute.js +0 -20
- package/dist/cjs/shared/route/resolveRouteFunction.js +0 -73
- package/dist/cjs/shared/route/resolveRouteString.js +0 -153
- package/dist/cjs/shared/route/resolveUrlPathname.js +0 -47
- package/dist/cjs/shared/route/routing.js +0 -9
- package/dist/cjs/shared/route/utils.js +0 -40
- package/dist/cjs/shared/utils.js +0 -49
- package/dist/cjs/types/Config/ConfigResolved.js +0 -2
- package/dist/cjs/types/Config.js +0 -2
- package/dist/cjs/types/FilePath.js +0 -2
- package/dist/cjs/types/PageConfig.js +0 -2
- package/dist/cjs/types/PageContext.js +0 -2
- package/dist/cjs/types/VikeGlobalInternal.js +0 -2
- package/dist/cjs/types/VikeNamespace.js +0 -2
- package/dist/cjs/types/ViteManifest.js +0 -2
- package/dist/cjs/types/defineConfig.js +0 -6
- package/dist/cjs/types/index-dreprecated.js +0 -3
- package/dist/cjs/types/index.js +0 -5
- package/dist/cjs/utils/PROJECT_VERSION.js +0 -5
- package/dist/cjs/utils/PromiseType.js +0 -2
- package/dist/cjs/utils/assert.js +0 -211
- package/dist/cjs/utils/assertIsBrowser.js +0 -8
- package/dist/cjs/utils/assertIsNotBrowser.js +0 -9
- package/dist/cjs/utils/assertKeys.js +0 -27
- package/dist/cjs/utils/assertNodeVersion.js +0 -14
- package/dist/cjs/utils/assertRoutingType.js +0 -29
- package/dist/cjs/utils/assertSetup.js +0 -171
- package/dist/cjs/utils/assertSingleInstance.js +0 -110
- package/dist/cjs/utils/assertVersion.js +0 -60
- package/dist/cjs/utils/capitalizeFirstLetter.js +0 -9
- package/dist/cjs/utils/cast.js +0 -6
- package/dist/cjs/utils/catchInfiniteLoop.js +0 -34
- package/dist/cjs/utils/changeEnumerable.js +0 -8
- package/dist/cjs/utils/checkType.js +0 -6
- package/dist/cjs/utils/compareString.js +0 -10
- package/dist/cjs/utils/createErrorWithCleanStackTrace.js +0 -39
- package/dist/cjs/utils/debug.js +0 -178
- package/dist/cjs/utils/debugGlob.js +0 -6
- package/dist/cjs/utils/deepEqual.js +0 -10
- package/dist/cjs/utils/escapeHtml.js +0 -13
- package/dist/cjs/utils/escapeRegex.js +0 -7
- package/dist/cjs/utils/findFile.js +0 -30
- package/dist/cjs/utils/findPackageJson.js +0 -18
- package/dist/cjs/utils/formatHintLog.js +0 -17
- package/dist/cjs/utils/freezePartial.js +0 -35
- package/dist/cjs/utils/genPromise.js +0 -51
- package/dist/cjs/utils/getFileExtension.js +0 -16
- package/dist/cjs/utils/getGlobalObject.js +0 -15
- package/dist/cjs/utils/getMostSimilar.js +0 -68
- package/dist/cjs/utils/getPropAccessNotation.js +0 -9
- package/dist/cjs/utils/getRandomId.js +0 -14
- package/dist/cjs/utils/getTerminalWidth.js +0 -7
- package/dist/cjs/utils/getValuePrintable.js +0 -10
- package/dist/cjs/utils/getViteRPC.js +0 -79
- package/dist/cjs/utils/hasProp.js +0 -50
- package/dist/cjs/utils/humanizeTime.js +0 -24
- package/dist/cjs/utils/includes.js +0 -13
- package/dist/cjs/utils/injectRollupInputs.js +0 -29
- package/dist/cjs/utils/isArray.js +0 -7
- package/dist/cjs/utils/isArrayOfStrings.js +0 -7
- package/dist/cjs/utils/isBrowser.js +0 -8
- package/dist/cjs/utils/isCallable.js +0 -6
- package/dist/cjs/utils/isDev.js +0 -20
- package/dist/cjs/utils/isDocker.js +0 -45
- package/dist/cjs/utils/isEqualStringList.js +0 -13
- package/dist/cjs/utils/isFilePathAbsoluteFilesystem.js +0 -66
- package/dist/cjs/utils/isHtml.js +0 -9
- package/dist/cjs/utils/isImportPath.js +0 -21
- package/dist/cjs/utils/isNodeJS.js +0 -16
- package/dist/cjs/utils/isNonRunnableDev.js +0 -12
- package/dist/cjs/utils/isNullish.js +0 -16
- package/dist/cjs/utils/isObject.js +0 -6
- package/dist/cjs/utils/isObjectOfStrings.js +0 -7
- package/dist/cjs/utils/isObjectWithKeys.js +0 -15
- package/dist/cjs/utils/isPlainObject.js +0 -19
- package/dist/cjs/utils/isPromise.js +0 -7
- package/dist/cjs/utils/isPropertyGetter.js +0 -7
- package/dist/cjs/utils/isReact.js +0 -23
- package/dist/cjs/utils/isRunnableDevEnvironment.js +0 -9
- package/dist/cjs/utils/isSameErrorMessage.js +0 -9
- package/dist/cjs/utils/isScriptFile.js +0 -67
- package/dist/cjs/utils/isVikeReactApp.js +0 -8
- package/dist/cjs/utils/isVitest.js +0 -6
- package/dist/cjs/utils/joinEnglish.js +0 -14
- package/dist/cjs/utils/normalizeHeaders.js +0 -17
- package/dist/cjs/utils/objectAssign.js +0 -14
- package/dist/cjs/utils/objectAssignSafe.js +0 -7
- package/dist/cjs/utils/objectDefineProperty.js +0 -7
- package/dist/cjs/utils/objectEntries.js +0 -8
- package/dist/cjs/utils/objectEntriesForEach.js +0 -7
- package/dist/cjs/utils/objectFilter.js +0 -10
- package/dist/cjs/utils/objectFromEntries.js +0 -7
- package/dist/cjs/utils/objectKeys.js +0 -9
- package/dist/cjs/utils/objectReplace.js +0 -9
- package/dist/cjs/utils/onPageVisibilityChange.js +0 -18
- package/dist/cjs/utils/pLimit.js +0 -134
- package/dist/cjs/utils/parseNpmPackage.js +0 -106
- package/dist/cjs/utils/parseUrl-extras.js +0 -110
- package/dist/cjs/utils/parseUrl.js +0 -338
- package/dist/cjs/utils/path.js +0 -59
- package/dist/cjs/utils/pick.js +0 -12
- package/dist/cjs/utils/preservePropertyGetters.js +0 -30
- package/dist/cjs/utils/redirectHard.js +0 -6
- package/dist/cjs/utils/removeEmptyLines.js +0 -9
- package/dist/cjs/utils/removeFileExtension.js +0 -6
- package/dist/cjs/utils/requireResolve.js +0 -214
- package/dist/cjs/utils/rollupSourceMap.js +0 -19
- package/dist/cjs/utils/sleep.js +0 -6
- package/dist/cjs/utils/slice.js +0 -35
- package/dist/cjs/utils/sorter.js +0 -117
- package/dist/cjs/utils/stringifyStringArray.js +0 -6
- package/dist/cjs/utils/stripAnsi.js +0 -21
- package/dist/cjs/utils/styleFileRE.js +0 -6
- package/dist/cjs/utils/throttle.js +0 -15
- package/dist/cjs/utils/trackLogs.js +0 -31
- package/dist/cjs/utils/trimWithAnsi.js +0 -40
- package/dist/cjs/utils/truncateString.js +0 -23
- package/dist/cjs/utils/unique.js +0 -6
- package/dist/cjs/utils/updateType.js +0 -9
- package/dist/cjs/utils/urlToFile.js +0 -36
- package/dist/cjs/utils/virtualFileId.js +0 -39
- package/dist/cjs/utils/warnIfErrorIsNotObject.js +0 -23
- package/dist/esm/client/runtime-server-routing/globalContext.js +0 -5
- package/dist/esm/client/shared/createGetGlobalContextClient.js +0 -65
- package/dist/esm/node/vite/plugins/pluginBuild/pluginDistFileNames.js +0 -249
- package/dist/esm/node/vite/plugins/pluginBuild/pluginDistPackageJsonFile.js +0 -34
- package/dist/esm/node/vite/plugins/pluginBuild/pluginModuleBanner.js +0 -39
- package/dist/esm/node/vite/plugins/pluginBuild.d.ts +0 -3
- package/dist/esm/node/vite/plugins/pluginBuild.js +0 -19
- package/dist/esm/node/vite/plugins/pluginEnvVars.d.ts +0 -3
- package/dist/esm/node/vite/plugins/pluginEnvVars.js +0 -85
- package/dist/esm/node/vite/plugins/pluginNonRunnableDev.js +0 -50
- package/dist/esm/node/vite/plugins/pluginReplaceConstants.d.ts +0 -3
- package/dist/esm/node/vite/plugins/pluginReplaceConstants.js +0 -67
- package/dist/esm/shared/route/debug.d.ts +0 -6
- package/dist/esm/shared/route/debug.js +0 -21
- /package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginBuildApp.d.ts +0 -0
- /package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginBuildConfig.d.ts +0 -0
- /package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginProdBuildEntry.d.ts +0 -0
package/dist/esm/utils/debug.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
+
export { debug };
|
|
1
2
|
export { createDebugger };
|
|
3
|
+
export { isDebug };
|
|
2
4
|
export { isDebugActivated };
|
|
3
5
|
import { isCallable } from './isCallable.js';
|
|
4
6
|
import { objectAssign } from './objectAssign.js';
|
|
5
7
|
import { assert, assertUsage } from './assert.js';
|
|
6
|
-
import { checkType } from './checkType.js';
|
|
7
8
|
import { getTerminalWidth } from './getTerminalWidth.js';
|
|
8
9
|
import pc from '@brillout/picocolors';
|
|
9
10
|
import { isArray } from './isArray.js';
|
|
10
11
|
import { isObject } from './isObject.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
// Assert tree-shaking (ensure this module is loaded on the client-side only if debug is enabled).
|
|
13
|
+
assert(!globalThis.__VIKE__IS_CLIENT ||
|
|
14
|
+
globalThis.__VIKE__IS_DEBUG ||
|
|
15
|
+
// Vite doesn't do tree-shaking in dev (maybe it will with Rolldown?)
|
|
16
|
+
import.meta.env.DEV);
|
|
15
17
|
const flags = [
|
|
18
|
+
'vike',
|
|
16
19
|
'vike:crawl',
|
|
17
20
|
'vike:error',
|
|
18
21
|
'vike:esbuild-resolve',
|
|
@@ -25,7 +28,7 @@ const flags = [
|
|
|
25
28
|
'vike:outDir',
|
|
26
29
|
'vike:pageFiles',
|
|
27
30
|
'vike:pointer-imports',
|
|
28
|
-
'vike:
|
|
31
|
+
'vike:requireResolve',
|
|
29
32
|
'vike:routing',
|
|
30
33
|
'vike:setup',
|
|
31
34
|
'vike:stream',
|
|
@@ -33,14 +36,12 @@ const flags = [
|
|
|
33
36
|
'vike:vite-rpc',
|
|
34
37
|
];
|
|
35
38
|
const flagsSkipWildcard = ['vike:log'];
|
|
36
|
-
const flagRegex = /\bvike:[a-zA-Z-]+/g;
|
|
37
39
|
// We purposely read process.env.DEBUG early, in order to avoid users from the temptation to set process.env.DEBUG with JavaScript, since reading & writing process.env.DEBUG dynamically leads to inconsistencies such as https://github.com/vikejs/vike/issues/2239
|
|
38
40
|
const DEBUG = getDEBUG() ?? '';
|
|
39
41
|
if (isDebug())
|
|
40
42
|
Error.stackTraceLimit = Infinity;
|
|
41
43
|
assertFlagsActivated();
|
|
42
44
|
function createDebugger(flag, optionsGlobal) {
|
|
43
|
-
checkType(flag);
|
|
44
45
|
assert(flags.includes(flag));
|
|
45
46
|
const debugWithOptions = (optionsLocal) => {
|
|
46
47
|
return (...msgs) => {
|
|
@@ -52,6 +53,9 @@ function createDebugger(flag, optionsGlobal) {
|
|
|
52
53
|
objectAssign(debug, { options: debugWithOptions, isActivated: isDebugActivated(flag) });
|
|
53
54
|
return debug;
|
|
54
55
|
}
|
|
56
|
+
function debug(flag, ...msgs) {
|
|
57
|
+
return debug_(flag, {}, ...msgs);
|
|
58
|
+
}
|
|
55
59
|
function debug_(flag, options, ...msgs) {
|
|
56
60
|
if (!isDebugActivated(flag))
|
|
57
61
|
return;
|
|
@@ -80,10 +84,9 @@ function debug_(flag, options, ...msgs) {
|
|
|
80
84
|
});
|
|
81
85
|
}
|
|
82
86
|
function isDebugActivated(flag) {
|
|
83
|
-
checkType(flag);
|
|
84
87
|
assert(flags.includes(flag));
|
|
85
|
-
const { flagsActivated,
|
|
86
|
-
const isActivated = flagsActivated.includes(flag) || (
|
|
88
|
+
const { flagsActivated, isAll } = getFlagsActivated();
|
|
89
|
+
const isActivated = flagsActivated.includes(flag) || (isAll && !flagsSkipWildcard.includes(flag));
|
|
87
90
|
return isActivated;
|
|
88
91
|
}
|
|
89
92
|
function formatMsg(info, options, padding, position) {
|
|
@@ -153,16 +156,27 @@ function assertFlagsActivated() {
|
|
|
153
156
|
});
|
|
154
157
|
}
|
|
155
158
|
function getFlagsActivated() {
|
|
156
|
-
const flagsActivated = DEBUG.match(
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
+
const flagsActivated = DEBUG.match(/\bvike:[a-zA-Z-]+/g) ?? [];
|
|
160
|
+
const isAll = DEBUG.includes('vike:*');
|
|
161
|
+
const isGlobal = /\bvike\b[^:]/.test(DEBUG);
|
|
162
|
+
return { flagsActivated, isAll, isGlobal };
|
|
159
163
|
}
|
|
160
164
|
function isDebug() {
|
|
161
|
-
const { flagsActivated,
|
|
162
|
-
return
|
|
165
|
+
const { flagsActivated, isAll, isGlobal } = getFlagsActivated();
|
|
166
|
+
return isAll || flagsActivated.length > 0 || isGlobal;
|
|
163
167
|
}
|
|
164
168
|
function getDEBUG() {
|
|
165
169
|
let DEBUG;
|
|
170
|
+
// ssr.noExternal
|
|
171
|
+
/* // Full implementation:
|
|
172
|
+
// - https://github.com/vikejs/vike/commit/7637564a98f43e23834bcae2f7ada8d941958a34
|
|
173
|
+
// - https://github.com/vikejs/vike/pull/2718
|
|
174
|
+
// - We don't implement this yet because it crashes @cloudflare/vite-plugin
|
|
175
|
+
if (import.meta.env) {
|
|
176
|
+
return import.meta.env.DEBUG
|
|
177
|
+
}
|
|
178
|
+
//*/
|
|
179
|
+
// ssr.external
|
|
166
180
|
// - `process` can be undefined in edge workers
|
|
167
181
|
// - We want bundlers to be able to statically replace `process.env.*`
|
|
168
182
|
try {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { findPackageJson };
|
|
2
2
|
import { findFile } from './findFile.js';
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
|
-
// @ts-ignore import.meta.url is shimmed at dist/cjs by dist-cjs-fixup.js.
|
|
5
4
|
const importMetaUrl = import.meta.url;
|
|
6
5
|
const require_ = createRequire(importMetaUrl);
|
|
7
6
|
function findPackageJson(cwd) {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export { getGlobalObject };
|
|
2
2
|
import type { VikeGlobalInternal } from '../types/VikeGlobalInternal.js';
|
|
3
3
|
type ModuleId = `${string}.ts`;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Share information across module instances.
|
|
6
|
+
*
|
|
7
|
+
* @__NO_SIDE_EFFECTS__
|
|
8
|
+
*/
|
|
5
9
|
declare function getGlobalObject<T extends Record<string, unknown> = never>(moduleId: ModuleId, defaultValue: T): T;
|
|
6
10
|
declare global {
|
|
7
11
|
var _vike: VikeGlobalInternal;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export { getGlobalObject };
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Share information across module instances.
|
|
4
|
+
*
|
|
5
|
+
* @__NO_SIDE_EFFECTS__
|
|
6
|
+
*/
|
|
3
7
|
function getGlobalObject(moduleId, defaultValue) {
|
|
4
8
|
const globals = getGlobals();
|
|
5
9
|
const globalObject = (globals[moduleId] ?? (globals[moduleId] = defaultValue));
|
|
@@ -16,7 +16,6 @@ function getViteRPC() {
|
|
|
16
16
|
return globalObject.rpc;
|
|
17
17
|
}
|
|
18
18
|
function createRpcClient() {
|
|
19
|
-
// @ts-ignore CJS build doesn't support import.meta — TO-DO/eventually: let's remove this ts-ignore after we removed the CJS build
|
|
20
19
|
const hot = import.meta.hot;
|
|
21
20
|
assert(hot);
|
|
22
21
|
const listeners = [];
|
|
@@ -34,7 +33,6 @@ function createRpcClient() {
|
|
|
34
33
|
const rpc = new Proxy({}, {
|
|
35
34
|
get(_, functionName) {
|
|
36
35
|
return async (...functionArgs) => {
|
|
37
|
-
// @ts-ignore CJS build doesn't support import.meta — TO-DO/eventually: let's remove this ts-ignore after we removed the CJS build
|
|
38
36
|
const hot = import.meta.hot;
|
|
39
37
|
assert(hot);
|
|
40
38
|
const callId = getRandomId();
|
package/dist/esm/utils/isDev.js
CHANGED
|
@@ -5,8 +5,10 @@ import { assertUsage } from './assert.js';
|
|
|
5
5
|
function isDevCheck(configEnv) {
|
|
6
6
|
const { isPreview, command } = configEnv;
|
|
7
7
|
// Note that:
|
|
8
|
-
// - `assertVersion('Vite', version, '5.1.0')`
|
|
8
|
+
// - `assertVersion('Vite', version, '5.1.0')` isn't enough: https://github.com/vitejs/vite/pull/19355
|
|
9
9
|
// - We'll eventually be able to make this an assert() instead of assertUsage() once Vike requires a Vite version that supports this.meta.viteVersion
|
|
10
|
+
// - https://github.com/vitejs/vite/pull/20088
|
|
11
|
+
// - Released at 7.0.0: https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md#700-2025-06-24
|
|
10
12
|
assertUsage(typeof isPreview === 'boolean', 'You are using an old Vite version; make sure to use Vite 5.1.0 or above.');
|
|
11
13
|
return command === 'serve' && !isPreview;
|
|
12
14
|
}
|
|
@@ -3,8 +3,8 @@ import { assert } from './assert.js';
|
|
|
3
3
|
import { assertIsNotBrowser } from './assertIsNotBrowser.js';
|
|
4
4
|
assertIsNotBrowser();
|
|
5
5
|
function isNonRunnableDev() {
|
|
6
|
-
if (
|
|
6
|
+
if (globalThis.__VIKE__IS_NON_RUNNABLE_DEV === undefined)
|
|
7
7
|
return false;
|
|
8
|
-
assert(__VIKE__IS_NON_RUNNABLE_DEV === true);
|
|
8
|
+
assert(globalThis.__VIKE__IS_NON_RUNNABLE_DEV === true);
|
|
9
9
|
return true;
|
|
10
10
|
}
|
|
@@ -13,12 +13,11 @@ import path from 'node:path';
|
|
|
13
13
|
import { assertIsImportPathNpmPackage, isImportPathNpmPackageOrPathAlias } from './parseNpmPackage.js';
|
|
14
14
|
import { isNotNullish } from './isNullish.js';
|
|
15
15
|
import { createDebugger } from './debug.js';
|
|
16
|
-
// @ts-ignore import.meta.url is shimmed at dist/cjs by dist-cjs-fixup.js.
|
|
17
16
|
const importMetaUrl = import.meta.url;
|
|
18
17
|
assertPosixPath(importMetaUrl);
|
|
19
18
|
assertIsNotBrowser();
|
|
20
19
|
assertIsNotProductionRuntime();
|
|
21
|
-
const debug = createDebugger('vike:
|
|
20
|
+
const debug = createDebugger('vike:requireResolve');
|
|
22
21
|
// - We still can't use import.meta.resolve() as of 23.1.0 (November 2024) because `parent` argument requires an experimental flag.
|
|
23
22
|
// - https://stackoverflow.com/questions/54977743/do-require-resolve-for-es-modules#comment139581675_62272600
|
|
24
23
|
// - Passing context to createRequire(context) isn't equivalent to passing it to the `paths` argument of require.resolve()
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export { isVirtualFileId };
|
|
2
2
|
export { addVirtualFileIdPrefix };
|
|
3
3
|
export { removeVirtualFileIdPrefix };
|
|
4
|
+
export { virtualFileIdPrefix1 };
|
|
5
|
+
export { virtualFileIdPrefix2 };
|
|
6
|
+
declare const virtualFileIdPrefix1 = "virtual:vike:";
|
|
7
|
+
declare const virtualFileIdPrefix2: "\0virtual:vike:";
|
|
4
8
|
declare function isVirtualFileId(id: string): boolean;
|
|
5
9
|
declare function addVirtualFileIdPrefix(id: string): string;
|
|
6
10
|
declare function removeVirtualFileIdPrefix(id: string): string;
|
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
export { isVirtualFileId };
|
|
2
2
|
export { addVirtualFileIdPrefix };
|
|
3
3
|
export { removeVirtualFileIdPrefix };
|
|
4
|
+
export { virtualFileIdPrefix1 };
|
|
5
|
+
export { virtualFileIdPrefix2 };
|
|
4
6
|
import pc from '@brillout/picocolors';
|
|
5
7
|
import { assert, assertUsage } from './assert.js';
|
|
6
8
|
import { assertIsNotBrowser } from './assertIsNotBrowser.js';
|
|
7
9
|
assertIsNotBrowser();
|
|
8
|
-
const
|
|
10
|
+
const virtualFileIdPrefix1 = 'virtual:vike:';
|
|
9
11
|
// https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention
|
|
10
|
-
const
|
|
12
|
+
const convention = '\0';
|
|
13
|
+
const virtualFileIdPrefix2 = `${convention}${virtualFileIdPrefix1}`;
|
|
11
14
|
function isVirtualFileId(id) {
|
|
12
|
-
if (id.startsWith(
|
|
15
|
+
if (id.startsWith(virtualFileIdPrefix1))
|
|
13
16
|
return true;
|
|
14
|
-
if (id.startsWith(
|
|
17
|
+
if (id.startsWith(virtualFileIdPrefix2))
|
|
15
18
|
return true;
|
|
16
19
|
// https://github.com/vikejs/vike/issues/1985
|
|
17
|
-
assertUsage(!id.includes(
|
|
20
|
+
assertUsage(!id.includes(virtualFileIdPrefix1), `Encountered a module ID ${pc.cyan(id)} that is unexpected. Are you using a tool that modifies the ID of modules? For example, the baseUrl setting in tsconfig.json cannot be used.`);
|
|
18
21
|
return false;
|
|
19
22
|
}
|
|
20
23
|
function addVirtualFileIdPrefix(id) {
|
|
21
24
|
assert(isVirtualFileId(id));
|
|
22
|
-
if (!id.startsWith(
|
|
23
|
-
id =
|
|
25
|
+
if (!id.startsWith(convention)) {
|
|
26
|
+
id = convention + id;
|
|
24
27
|
}
|
|
25
|
-
assert(id.startsWith(
|
|
28
|
+
assert(id.startsWith(convention));
|
|
26
29
|
return id;
|
|
27
30
|
}
|
|
28
31
|
function removeVirtualFileIdPrefix(id) {
|
|
29
|
-
if (id.startsWith(
|
|
30
|
-
id = id.slice(
|
|
32
|
+
if (id.startsWith(convention)) {
|
|
33
|
+
id = id.slice(convention.length);
|
|
31
34
|
}
|
|
32
|
-
assert(!id.startsWith(
|
|
35
|
+
assert(!id.startsWith(convention));
|
|
33
36
|
return id;
|
|
34
37
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.240-commit-a80417c",
|
|
4
4
|
"repository": "https://github.com/vikejs/vike",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": {
|
|
7
7
|
"worker": "./dist/esm/node/runtime/index.js",
|
|
8
8
|
"workerd": "./dist/esm/node/runtime/index.js",
|
|
9
|
-
"require": "./dist/cjs/node/runtime/index.js",
|
|
10
9
|
"node": "./dist/esm/node/runtime/index.js",
|
|
11
10
|
"browser": "./dist/esm/client/node.js",
|
|
12
11
|
"types": "./dist/esm/node/runtime/index.d.ts",
|
|
@@ -21,7 +20,6 @@
|
|
|
21
20
|
"./client/router": {
|
|
22
21
|
"worker": "./dist/esm/node/client/router.js",
|
|
23
22
|
"workerd": "./dist/esm/node/client/router.js",
|
|
24
|
-
"require": "./dist/cjs/node/client/router.js",
|
|
25
23
|
"node": "./dist/esm/node/client/router.js",
|
|
26
24
|
"browser": "./dist/esm/client/runtime-client-routing/index.js",
|
|
27
25
|
"types": "./dist/esm/client/runtime-client-routing/index.d.ts",
|
|
@@ -30,32 +28,27 @@
|
|
|
30
28
|
"./routing": {
|
|
31
29
|
"worker": "./dist/esm/shared/route/routing.js",
|
|
32
30
|
"workerd": "./dist/esm/shared/route/routing.js",
|
|
33
|
-
"require": "./dist/cjs/shared/route/routing.js",
|
|
34
31
|
"node": "./dist/esm/shared/route/routing.js",
|
|
35
32
|
"browser": "./dist/esm/shared/route/routing.js",
|
|
36
33
|
"types": "./dist/esm/shared/route/routing.d.ts",
|
|
37
34
|
"default": "./dist/esm/shared/route/routing.js"
|
|
38
35
|
},
|
|
39
36
|
"./cli": {
|
|
40
|
-
"require": "./dist/cjs/node/cli/index.js",
|
|
41
37
|
"node": "./dist/esm/node/cli/index.js",
|
|
42
38
|
"types": "./dist/esm/node/cli/index.d.ts",
|
|
43
39
|
"default": "./dist/esm/node/cli/index.js"
|
|
44
40
|
},
|
|
45
41
|
"./api": {
|
|
46
|
-
"require": "./dist/cjs/node/api/index.js",
|
|
47
42
|
"node": "./dist/esm/node/api/index.js",
|
|
48
43
|
"types": "./dist/esm/node/api/index.d.ts",
|
|
49
44
|
"default": "./dist/esm/node/api/index.js"
|
|
50
45
|
},
|
|
51
46
|
"./prerender": {
|
|
52
|
-
"require": "./dist/cjs/node/prerender/index.js",
|
|
53
47
|
"node": "./dist/esm/node/prerender/index.js",
|
|
54
48
|
"types": "./dist/esm/node/prerender/index.d.ts",
|
|
55
49
|
"default": "./dist/esm/node/prerender/index.js"
|
|
56
50
|
},
|
|
57
51
|
"./plugin": {
|
|
58
|
-
"require": "./dist/cjs/node/vite/index.js",
|
|
59
52
|
"node": "./dist/esm/node/vite/index.js",
|
|
60
53
|
"types": "./dist/esm/node/vite/index.d.ts",
|
|
61
54
|
"default": "./dist/esm/node/vite/index.js"
|
|
@@ -63,7 +56,6 @@
|
|
|
63
56
|
"./RenderErrorPage": {
|
|
64
57
|
"worker": "./dist/esm/shared/RenderErrorPage.js",
|
|
65
58
|
"workerd": "./dist/esm/shared/RenderErrorPage.js",
|
|
66
|
-
"require": "./dist/cjs/shared/RenderErrorPage.js",
|
|
67
59
|
"node": "./dist/esm/shared/RenderErrorPage.js",
|
|
68
60
|
"browser": "./dist/esm/shared/RenderErrorPage.js",
|
|
69
61
|
"types": "./dist/esm/shared/RenderErrorPage.d.ts",
|
|
@@ -72,7 +64,6 @@
|
|
|
72
64
|
"./abort": {
|
|
73
65
|
"worker": "./dist/esm/shared/abort.js",
|
|
74
66
|
"workerd": "./dist/esm/shared/abort.js",
|
|
75
|
-
"require": "./dist/cjs/shared/abort.js",
|
|
76
67
|
"node": "./dist/esm/shared/abort.js",
|
|
77
68
|
"browser": "./dist/esm/shared/abort.js",
|
|
78
69
|
"types": "./dist/esm/shared/abort.d.ts",
|
|
@@ -81,7 +72,6 @@
|
|
|
81
72
|
"./getPageContext": {
|
|
82
73
|
"worker": "./dist/esm/shared/getPageContext.js",
|
|
83
74
|
"workerd": "./dist/esm/shared/getPageContext.js",
|
|
84
|
-
"require": "./dist/cjs/shared/getPageContext.js",
|
|
85
75
|
"node": "./dist/esm/shared/getPageContext.js",
|
|
86
76
|
"browser": "./dist/esm/shared/getPageContext.js",
|
|
87
77
|
"types": "./dist/esm/shared/getPageContext.d.ts",
|
|
@@ -90,7 +80,6 @@
|
|
|
90
80
|
"./modifyUrl": {
|
|
91
81
|
"worker": "./dist/esm/shared/modifyUrl.js",
|
|
92
82
|
"workerd": "./dist/esm/shared/modifyUrl.js",
|
|
93
|
-
"require": "./dist/cjs/shared/modifyUrl.js",
|
|
94
83
|
"node": "./dist/esm/shared/modifyUrl.js",
|
|
95
84
|
"browser": "./dist/esm/shared/modifyUrl.js",
|
|
96
85
|
"types": "./dist/esm/shared/modifyUrl.d.ts",
|
|
@@ -99,20 +88,17 @@
|
|
|
99
88
|
"./universal-middleware": {
|
|
100
89
|
"worker": "./dist/esm/node/runtime/universal-middleware.js",
|
|
101
90
|
"workerd": "./dist/esm/node/runtime/universal-middleware.js",
|
|
102
|
-
"require": "./dist/cjs/node/runtime/universal-middleware.js",
|
|
103
91
|
"node": "./dist/esm/node/runtime/universal-middleware.js",
|
|
104
92
|
"browser": "./dist/esm/client/node.js",
|
|
105
93
|
"types": "./dist/esm/node/runtime/universal-middleware.d.ts",
|
|
106
94
|
"default": "./dist/esm/node/runtime/universal-middleware.js"
|
|
107
95
|
},
|
|
108
96
|
"./__internal": {
|
|
109
|
-
"require": "./dist/cjs/__internal/index.js",
|
|
110
97
|
"node": "./dist/esm/__internal/index.js",
|
|
111
98
|
"types": "./dist/esm/__internal/index.d.ts",
|
|
112
99
|
"default": "./dist/esm/__internal/index.js"
|
|
113
100
|
},
|
|
114
101
|
"./__internal/setup": {
|
|
115
|
-
"require": "./dist/cjs/node/runtime/page-files/setup.js",
|
|
116
102
|
"node": "./dist/esm/node/runtime/page-files/setup.js",
|
|
117
103
|
"types": "./dist/esm/node/runtime/page-files/setup.d.ts",
|
|
118
104
|
"default": "./dist/esm/node/runtime/page-files/setup.js"
|
|
@@ -120,7 +106,6 @@
|
|
|
120
106
|
".": {
|
|
121
107
|
"worker": "./dist/esm/node/runtime/index.js",
|
|
122
108
|
"workerd": "./dist/esm/node/runtime/index.js",
|
|
123
|
-
"require": "./dist/cjs/node/runtime/index.js",
|
|
124
109
|
"node": "./dist/esm/node/runtime/index.js",
|
|
125
110
|
"browser": "./dist/esm/client/index.js",
|
|
126
111
|
"types": "./dist/esm/node/runtime/index.d.ts",
|
|
@@ -129,10 +114,10 @@
|
|
|
129
114
|
},
|
|
130
115
|
"dependencies": {
|
|
131
116
|
"@brillout/import": "^0.2.6",
|
|
132
|
-
"@brillout/json-serializer": "^0.5.
|
|
117
|
+
"@brillout/json-serializer": "^0.5.21",
|
|
133
118
|
"@brillout/picocolors": "^1.0.26",
|
|
134
119
|
"@brillout/require-shim": "^0.1.2",
|
|
135
|
-
"@brillout/vite-plugin-server-entry": "^0.7.
|
|
120
|
+
"@brillout/vite-plugin-server-entry": "^0.7.15",
|
|
136
121
|
"acorn": "^8.0.0",
|
|
137
122
|
"cac": "^6.0.0",
|
|
138
123
|
"es-module-lexer": "^1.0.0",
|
|
@@ -144,11 +129,11 @@
|
|
|
144
129
|
"sirv": "^3.0.1",
|
|
145
130
|
"source-map-support": "^0.5.0",
|
|
146
131
|
"tinyglobby": "^0.2.10",
|
|
147
|
-
"vite": ">=6.
|
|
132
|
+
"vite": ">=6.3.0"
|
|
148
133
|
},
|
|
149
134
|
"peerDependencies": {
|
|
150
135
|
"react-streaming": ">=0.3.42",
|
|
151
|
-
"vite": ">=6.
|
|
136
|
+
"vite": ">=6.3.0"
|
|
152
137
|
},
|
|
153
138
|
"peerDependenciesMeta": {
|
|
154
139
|
"react-streaming": {
|
|
@@ -262,16 +247,12 @@
|
|
|
262
247
|
"@types/source-map-support": "^0.5.10",
|
|
263
248
|
"react-streaming": "^0.4.3",
|
|
264
249
|
"rimraf": "^5.0.5",
|
|
265
|
-
"typescript": "^5.
|
|
266
|
-
"vite": "^7.1.
|
|
250
|
+
"typescript": "^5.9.2",
|
|
251
|
+
"vite": "^7.1.5"
|
|
267
252
|
},
|
|
268
253
|
"scripts": {
|
|
269
254
|
"dev": "tsc --watch",
|
|
270
|
-
"build": "rimraf dist/ &&
|
|
271
|
-
"build:esm": "tsc",
|
|
272
|
-
"build:cjs": "pnpm run build:cjs:ts && pnpm run build:cjs:fixup",
|
|
273
|
-
"build:cjs:ts": "tsc --project ./tsconfig.cjs.json",
|
|
274
|
-
"build:cjs:fixup": "node ./dist-cjs-fixup.mjs",
|
|
255
|
+
"build": "rimraf dist/ && tsc",
|
|
275
256
|
"========= Release": "",
|
|
276
257
|
"release": "release-me patch",
|
|
277
258
|
"release:minor": "release-me minor",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setGlobalContext_prodBuildEntry = void 0;
|
|
4
|
-
exports.route = route;
|
|
5
|
-
exports.getPagesAndRoutes = getPagesAndRoutes;
|
|
6
|
-
// Used by vike:build:pluginProdBuildEntry
|
|
7
|
-
var globalContext_js_1 = require("../node/runtime/globalContext.js");
|
|
8
|
-
Object.defineProperty(exports, "setGlobalContext_prodBuildEntry", { enumerable: true, get: function () { return globalContext_js_1.setGlobalContext_prodBuildEntry; } });
|
|
9
|
-
const index_js_1 = require("../shared/route/index.js");
|
|
10
|
-
const globalContext_js_2 = require("../node/runtime/globalContext.js");
|
|
11
|
-
const assertSetup_js_1 = require("../utils/assertSetup.js");
|
|
12
|
-
/**
|
|
13
|
-
* Used by {@link https://github.com/magne4000/vite-plugin-vercel|vite-plugin-vercel} to compute some rewrite rules and extract { isr } configs.
|
|
14
|
-
*
|
|
15
|
-
* TO-DO/eventually: remove
|
|
16
|
-
*/
|
|
17
|
-
async function getPagesAndRoutes() {
|
|
18
|
-
(0, assertSetup_js_1.setNodeEnvProduction)();
|
|
19
|
-
await (0, globalContext_js_2.initGlobalContext_getPagesAndRoutes)();
|
|
20
|
-
const { globalContext } = await (0, globalContext_js_2.getGlobalContextServerInternal)();
|
|
21
|
-
const {
|
|
22
|
-
//
|
|
23
|
-
_pageRoutes: pageRoutes, _pageFilesAll: pageFilesAll, _pageConfigs: pageConfigs, _allPageIds: allPageIds, } = globalContext;
|
|
24
|
-
return {
|
|
25
|
-
pageRoutes,
|
|
26
|
-
pageFilesAll,
|
|
27
|
-
pageConfigs,
|
|
28
|
-
allPageIds,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
async function route(pageContext) {
|
|
32
|
-
const pageContextFromRoute = await (0, index_js_1.route)(pageContext);
|
|
33
|
-
// Old interface
|
|
34
|
-
return { pageContextAddendum: pageContextFromRoute };
|
|
35
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.getGlobalContextClientInternal = void 0;
|
|
37
|
-
const createGetGlobalContextClient_js_1 = require("../shared/createGetGlobalContextClient.js");
|
|
38
|
-
const loadPageRoutes_js_1 = require("../../shared/route/loadPageRoutes.js");
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
const virtualFileExportsGlobalEntry = __importStar(require("virtual:vike:global-entry:client:client-routing"));
|
|
41
|
-
const getGlobalContextClientInternal = (0, createGetGlobalContextClient_js_1.createGetGlobalContextClient)(virtualFileExportsGlobalEntry, true, addGlobalContext);
|
|
42
|
-
exports.getGlobalContextClientInternal = getGlobalContextClientInternal;
|
|
43
|
-
async function addGlobalContext(globalContext) {
|
|
44
|
-
const { pageRoutes, onBeforeRouteHook } = await (0, loadPageRoutes_js_1.loadPageRoutes)(globalContext._pageFilesAll, globalContext._pageConfigs, globalContext._pageConfigGlobal, globalContext._allPageIds);
|
|
45
|
-
return {
|
|
46
|
-
_pageRoutes: pageRoutes,
|
|
47
|
-
_onBeforeRouteHook: onBeforeRouteHook,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.getGlobalContextClientInternal = void 0;
|
|
37
|
-
const createGetGlobalContextClient_js_1 = require("../shared/createGetGlobalContextClient.js");
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
const virtualFileExportsGlobalEntry = __importStar(require("virtual:vike:global-entry:client:server-routing"));
|
|
40
|
-
const getGlobalContextClientInternal = (0, createGetGlobalContextClient_js_1.createGetGlobalContextClient)(virtualFileExportsGlobalEntry, false);
|
|
41
|
-
exports.getGlobalContextClientInternal = getGlobalContextClientInternal;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Utils needed by Vike's client runtime (with Server Routing)
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
// We call onLoad() here so that it's called even when only a subset of the runtime is loaded. (Making the assert() calls inside onLoad() a lot stronger.)
|
|
19
|
-
const onLoad_js_1 = require("./onLoad.js");
|
|
20
|
-
(0, onLoad_js_1.onLoad)();
|
|
21
|
-
__exportStar(require("../../utils/assert.js"), exports);
|
|
22
|
-
__exportStar(require("../../utils/assertSingleInstance.js"), exports);
|
|
23
|
-
__exportStar(require("../../utils/checkType.js"), exports); // Only used by Server Routing (not needed for Client Routing)
|
|
24
|
-
__exportStar(require("../../utils/getGlobalObject.js"), exports);
|
|
25
|
-
__exportStar(require("../../utils/hasProp.js"), exports);
|
|
26
|
-
__exportStar(require("../../utils/isCallable.js"), exports);
|
|
27
|
-
__exportStar(require("../../utils/isObject.js"), exports);
|
|
28
|
-
__exportStar(require("../../utils/objectAssign.js"), exports);
|
|
29
|
-
__exportStar(require("../../utils/parseUrl.js"), exports);
|
|
30
|
-
__exportStar(require("../../utils/slice.js"), exports);
|
|
31
|
-
__exportStar(require("../../utils/unique.js"), exports); // Only used by Server Routing (not needed for Client Routing)
|
|
32
|
-
__exportStar(require("../../utils/getPropAccessNotation.js"), exports);
|
|
33
|
-
__exportStar(require("../../utils/updateType.js"), exports);
|
|
34
|
-
__exportStar(require("../../utils/changeEnumerable.js"), exports);
|