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
|
@@ -2,63 +2,81 @@ export { pluginVirtualFiles };
|
|
|
2
2
|
import { normalizePath } from 'vite';
|
|
3
3
|
import { generateVirtualFilePageEntry } from './pluginVirtualFiles/generateVirtualFilePageEntry.js';
|
|
4
4
|
import { generateVirtualFileGlobalEntryWithOldDesign } from './pluginVirtualFiles/generateVirtualFileGlobalEntryWithOldDesign.js';
|
|
5
|
-
import { assert, assertPosixPath, isScriptFile, addVirtualFileIdPrefix, isVirtualFileId, removeVirtualFileIdPrefix, } from '../utils.js';
|
|
5
|
+
import { assert, assertPosixPath, isScriptFile, addVirtualFileIdPrefix, isVirtualFileId, removeVirtualFileIdPrefix, escapeRegex, virtualFileIdPrefix1, virtualFileIdPrefix2, } from '../utils.js';
|
|
6
6
|
import { parseVirtualFileId } from '../../shared/virtualFileId.js';
|
|
7
7
|
import { reloadVikeConfig, isV1Design, getVikeConfigInternalOptional } from '../shared/resolveVikeConfigInternal.js';
|
|
8
8
|
import pc from '@brillout/picocolors';
|
|
9
9
|
import { logConfigInfo } from '../shared/loggerNotProd.js';
|
|
10
10
|
import { getModuleFilePathAbsolute } from '../shared/getFilePath.js';
|
|
11
|
-
import { updateUserFiles } from '../../runtime/globalContext.js';
|
|
11
|
+
import { isRunnable, updateUserFiles } from '../../runtime/globalContext.js';
|
|
12
12
|
import { isPlusFile } from '../shared/resolveVikeConfigInternal/crawlPlusFiles.js';
|
|
13
13
|
import { isTemporaryBuildFile } from '../shared/resolveVikeConfigInternal/transpileAndExecuteFile.js';
|
|
14
14
|
import { getVikeConfigError } from '../../shared/getVikeConfigError.js';
|
|
15
|
+
const filterRolldown = {
|
|
16
|
+
id: {
|
|
17
|
+
include: new RegExp(`^(${escapeRegex(virtualFileIdPrefix1)}|${escapeRegex(virtualFileIdPrefix2)})`),
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
const filterFunction = (id) => isVirtualFileId(id);
|
|
15
21
|
function pluginVirtualFiles() {
|
|
16
22
|
let config;
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
name: 'vike:pluginVirtualFiles',
|
|
26
|
+
configResolved: {
|
|
27
|
+
async handler(config_) {
|
|
28
|
+
config = config_;
|
|
29
|
+
// TO-DO/next-major-release: remove
|
|
30
|
+
if (!isV1Design())
|
|
31
|
+
config.experimental.importGlobRestoreExtension = true;
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
resolveId: {
|
|
35
|
+
filter: filterRolldown,
|
|
36
|
+
handler(id) {
|
|
37
|
+
assert(filterFunction(id));
|
|
38
|
+
return addVirtualFileIdPrefix(id);
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
handleHotUpdate: {
|
|
42
|
+
async handler(ctx) {
|
|
43
|
+
try {
|
|
44
|
+
return await handleHotUpdate(ctx, config);
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
// Vite swallows errors thrown by handleHotUpdate()
|
|
48
|
+
console.error(err);
|
|
49
|
+
throw err;
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
load: {
|
|
54
|
+
filter: filterRolldown,
|
|
55
|
+
async handler(id, options) {
|
|
56
|
+
assert(filterFunction(id));
|
|
57
|
+
id = removeVirtualFileIdPrefix(id);
|
|
58
|
+
const isDev = config._isDev;
|
|
59
|
+
assert(typeof isDev === 'boolean');
|
|
60
|
+
const idParsed = parseVirtualFileId(id);
|
|
61
|
+
if (idParsed) {
|
|
62
|
+
if (idParsed.type === 'page-entry') {
|
|
63
|
+
const code = await generateVirtualFilePageEntry(id, isDev);
|
|
64
|
+
return code;
|
|
65
|
+
}
|
|
66
|
+
if (idParsed.type === 'global-entry') {
|
|
67
|
+
const code = await generateVirtualFileGlobalEntryWithOldDesign(id, options, config, this.environment, isDev);
|
|
68
|
+
return code;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
configureServer: {
|
|
74
|
+
handler(server) {
|
|
75
|
+
handleFileAddRemove(server, config);
|
|
76
|
+
},
|
|
77
|
+
},
|
|
24
78
|
},
|
|
25
|
-
|
|
26
|
-
if (isVirtualFileId(id)) {
|
|
27
|
-
return addVirtualFileIdPrefix(id);
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
async handleHotUpdate(ctx) {
|
|
31
|
-
try {
|
|
32
|
-
return await handleHotUpdate(ctx, config);
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
// Vite swallows errors thrown by handleHotUpdate()
|
|
36
|
-
console.error(err);
|
|
37
|
-
throw err;
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
async load(id, options) {
|
|
41
|
-
if (!isVirtualFileId(id))
|
|
42
|
-
return undefined;
|
|
43
|
-
id = removeVirtualFileIdPrefix(id);
|
|
44
|
-
const isDev = config._isDev;
|
|
45
|
-
assert(typeof isDev === 'boolean');
|
|
46
|
-
const idParsed = parseVirtualFileId(id);
|
|
47
|
-
if (idParsed) {
|
|
48
|
-
if (idParsed.type === 'page-entry') {
|
|
49
|
-
const code = await generateVirtualFilePageEntry(id, isDev);
|
|
50
|
-
return code;
|
|
51
|
-
}
|
|
52
|
-
if (idParsed.type === 'global-entry') {
|
|
53
|
-
const code = await generateVirtualFileGlobalEntryWithOldDesign(id, options, config, this.environment, isDev);
|
|
54
|
-
return code;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
configureServer(server) {
|
|
59
|
-
handleFileAddRemove(server, config);
|
|
60
|
-
},
|
|
61
|
-
};
|
|
79
|
+
];
|
|
62
80
|
}
|
|
63
81
|
function handleFileAddRemove(server, config) {
|
|
64
82
|
server.watcher.prependListener('add', (f) => listener(f, false));
|
|
@@ -125,7 +143,9 @@ async function handleHotUpdate(ctx, config) {
|
|
|
125
143
|
// Ensure we invalidate `file` *before* server.ssrLoadModule() in updateUserFiles()
|
|
126
144
|
// Vite already invalidates it, but *after* handleHotUpdate() and thus after server.ssrLoadModule()
|
|
127
145
|
ctx.modules.forEach((mod) => server.moduleGraph.invalidateModule(mod));
|
|
128
|
-
|
|
146
|
+
if (isRunnable(server)) {
|
|
147
|
+
await updateUserFiles();
|
|
148
|
+
}
|
|
129
149
|
}
|
|
130
150
|
}
|
|
131
151
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
export { pluginWorkaroundCssModuleHmr };
|
|
2
2
|
function pluginWorkaroundCssModuleHmr() {
|
|
3
|
-
return
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
return [
|
|
4
|
+
{
|
|
5
|
+
name: 'vike:pluginWorkaroundCssModuleHmr',
|
|
6
|
+
handleHotUpdate: {
|
|
7
|
+
handler(ctx) {
|
|
8
|
+
// prevent full reload due to non self-accepting css module.
|
|
9
|
+
// here only "?direct" module should be filtered out as it doesn't have a parent module.
|
|
10
|
+
if (ctx.file.includes('module.css')) {
|
|
11
|
+
return ctx.modules.filter((m) => !m.id?.includes('?direct'));
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
},
|
|
11
15
|
},
|
|
12
|
-
|
|
16
|
+
];
|
|
13
17
|
}
|
|
@@ -4,30 +4,32 @@ export { pluginWorkaroundVite6HmrRegression };
|
|
|
4
4
|
// Workaround seems to work for docs page /banner (which is HTML-only)
|
|
5
5
|
// But doesn't seem to work for /examples/render-modes/ (see https://github.com/vikejs/vike/pull/2069 commit `renable HMR test for HTML-only`)
|
|
6
6
|
function pluginWorkaroundVite6HmrRegression() {
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
name: 'vike:pluginWorkaroundVite6HmrRegression',
|
|
10
|
+
enforce: 'post',
|
|
11
|
+
hotUpdate: {
|
|
12
|
+
order: 'post',
|
|
13
|
+
handler({ modules, server, timestamp }) {
|
|
14
|
+
if (this.environment.name !== 'ssr')
|
|
15
|
+
return;
|
|
16
|
+
let hasSsrOnlyModules = false;
|
|
17
|
+
const invalidatedModules = new Set();
|
|
18
|
+
for (const mod of modules) {
|
|
19
|
+
if (mod.id == null)
|
|
20
|
+
continue;
|
|
21
|
+
const clientModule = server.environments.client.moduleGraph.getModuleById(mod.id);
|
|
22
|
+
if (clientModule != null)
|
|
23
|
+
continue;
|
|
24
|
+
this.environment.moduleGraph.invalidateModule(mod, invalidatedModules, timestamp, true);
|
|
25
|
+
hasSsrOnlyModules = true;
|
|
26
|
+
}
|
|
27
|
+
if (hasSsrOnlyModules) {
|
|
28
|
+
server.ws.send({ type: 'full-reload' });
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
},
|
|
30
32
|
},
|
|
31
33
|
},
|
|
32
|
-
|
|
34
|
+
];
|
|
33
35
|
}
|
|
@@ -4,6 +4,8 @@ import MagicString from 'magic-string';
|
|
|
4
4
|
function getMagicString(code, id) {
|
|
5
5
|
const magicString = new MagicString(code);
|
|
6
6
|
const getMagicStringResult = () => {
|
|
7
|
+
if (!magicString.hasChanged())
|
|
8
|
+
return undefined;
|
|
7
9
|
return {
|
|
8
10
|
code: magicString.toString(),
|
|
9
11
|
map: magicString.generateMap({ hires: true, source: id }),
|
|
@@ -96,11 +96,11 @@ const configDefinitionsBuiltIn = {
|
|
|
96
96
|
meta: {
|
|
97
97
|
env: { config: true },
|
|
98
98
|
},
|
|
99
|
-
|
|
99
|
+
hasServerOnlyHook: {
|
|
100
100
|
env: { client: true },
|
|
101
101
|
eager: true,
|
|
102
102
|
_computed: (pageConfig) => {
|
|
103
|
-
const sources = ['data', 'onBeforeRender', 'onCreatePageContext']
|
|
103
|
+
const sources = ['data', 'onBeforeRender', 'onCreatePageContext', 'guard']
|
|
104
104
|
.map((hookName) => getConfigValueSourcesRelevant(hookName, {
|
|
105
105
|
isForClientSide: false,
|
|
106
106
|
// TO-DO/eventually/remove-server-router: let's eventually remove support for Server Routing
|
|
@@ -6,11 +6,11 @@ export type GlobalContextInternal = GlobalContextServerInternal | GlobalContextC
|
|
|
6
6
|
import type { PageFile } from './getPageFiles.js';
|
|
7
7
|
import type { PageConfigRuntime } from '../types/PageConfig.js';
|
|
8
8
|
import type { GlobalContextServerInternal } from '../node/runtime/globalContext.js';
|
|
9
|
-
import type { GlobalContextClientInternal } from '../client/runtime-client-routing/
|
|
9
|
+
import type { GlobalContextClientInternal } from '../client/runtime-client-routing/getGlobalContextClientInternal.js';
|
|
10
10
|
import { type Hook } from './hooks/getHook.js';
|
|
11
11
|
declare const getGlobalContextSyncErrMsg = "The global context isn't set yet, call getGlobalContextSync() later or use getGlobalContext() instead.";
|
|
12
|
-
declare function createGlobalContextShared<GlobalContextAdded extends
|
|
13
|
-
globalContext?:
|
|
12
|
+
declare function createGlobalContextShared<GlobalContextAdded extends {}, GlobalContextAddedAsync extends {}>(virtualFileExportsGlobalEntry: unknown, globalObject: {
|
|
13
|
+
globalContext?: {};
|
|
14
14
|
onCreateGlobalContextHooks?: Hook[];
|
|
15
15
|
previousCreateGlobalContextPromise?: Promise<void>;
|
|
16
16
|
}, addGlobalContext?: (globalContext: GlobalContextBase) => GlobalContextAdded, addGlobalContextTmp?: (globalContext: GlobalContextBase) => Promise<GlobalContextAdded>, addGlobalContextAsync?: (globalContext: GlobalContextBase) => Promise<GlobalContextAddedAsync>): Promise<{
|
|
@@ -64,7 +64,7 @@ declare function createGlobalContextShared<GlobalContextAdded extends Record<str
|
|
|
64
64
|
_pageConfigs: PageConfigRuntime[];
|
|
65
65
|
_pageConfigGlobal: import("../types/PageConfig.js").PageConfigGlobalRuntime;
|
|
66
66
|
_allPageIds: string[];
|
|
67
|
-
} & GlobalContextAdded & GlobalContextAddedAsync
|
|
67
|
+
} & GlobalContextAdded & Awaited<GlobalContextAddedAsync>>;
|
|
68
68
|
type GlobalContextBasePublic = Pick<GlobalContextBase, 'config' | 'pages' | 'isGlobalContext'>;
|
|
69
69
|
type GlobalContextBase = ReturnType<typeof createGlobalContextBase>;
|
|
70
70
|
declare function createGlobalContextBase(virtualFileExportsGlobalEntry: unknown): {
|
|
@@ -12,8 +12,9 @@ export type { AbortStatusCode };
|
|
|
12
12
|
export type { ErrorAbort };
|
|
13
13
|
export type { PageContextFromRewrite };
|
|
14
14
|
export type { UrlRedirect };
|
|
15
|
+
export type { PageContextAbort };
|
|
15
16
|
type RedirectStatusCode = number & Parameters<typeof redirect>[1];
|
|
16
|
-
type AbortStatusCode = number & Parameters<typeof render>[0];
|
|
17
|
+
type AbortStatusCode = number & Parameters<InferTwoOverloads<typeof render>[0]>[0];
|
|
17
18
|
type UrlRedirect = {
|
|
18
19
|
url: string;
|
|
19
20
|
statusCode: RedirectStatusCode;
|
|
@@ -36,16 +37,23 @@ declare function redirect(url: string, statusCode?: 301 | 302): AbortRedirect;
|
|
|
36
37
|
*
|
|
37
38
|
* https://vike.dev/render
|
|
38
39
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* `401` Unauthorized (user isn't logged in)
|
|
42
|
-
* `403` Forbidden (user is logged in but isn't allowed)
|
|
43
|
-
* `404` Not Found
|
|
44
|
-
* `410` Gone (use this instead of `404` if the page existed in the past, see https://github.com/vikejs/vike/issues/1097#issuecomment-1695260887)
|
|
45
|
-
* `429` Too Many Requests (rate limiting)
|
|
46
|
-
* `500` Internal Server Error (your client or server has a bug)
|
|
47
|
-
* `503` Service Unavailable (server is overloaded, or a third-party API isn't responding)
|
|
48
|
-
*
|
|
40
|
+
*
|
|
41
|
+
* **Recommended** status codes:
|
|
42
|
+
* `401` — Unauthorized (user isn't logged in)
|
|
43
|
+
* `403` — Forbidden (user is logged in but isn't allowed)
|
|
44
|
+
* `404` — Not Found
|
|
45
|
+
* `410` — Gone (use this instead of `404` if the page existed in the past, see https://github.com/vikejs/vike/issues/1097#issuecomment-1695260887)
|
|
46
|
+
* `429` — Too Many Requests (rate limiting)
|
|
47
|
+
* `500` — Internal Server Error (your client or server has a bug)
|
|
48
|
+
* `503` — Service Unavailable (server is overloaded, or a third-party API isn't responding)
|
|
49
|
+
*
|
|
50
|
+
* **Not recommended** status codes:
|
|
51
|
+
* `400` — See https://github.com/vikejs/vike/issues/1008#issuecomment-3270894445
|
|
52
|
+
* Other status codes — See https://github.com/vikejs/vike/issues/1008
|
|
53
|
+
*
|
|
54
|
+
* @param abortStatusCode - One of the recommended status codes listed above.
|
|
55
|
+
*
|
|
56
|
+
* @param abortReason - Sets `pageContext.abortReason` which is usually used by the error page to show a message to the user, see https://vike.dev/error-page
|
|
49
57
|
*/
|
|
50
58
|
declare function render(abortStatusCode: 401 | 403 | 404 | 410 | 429 | 500 | 503, abortReason?: AbortReason): Error;
|
|
51
59
|
/**
|
|
@@ -106,3 +114,7 @@ type PageContextFromAllRewrites = {
|
|
|
106
114
|
};
|
|
107
115
|
declare function getPageContextFromAllRewrites(pageContextsFromRewrite: PageContextFromRewrite[]): PageContextFromAllRewrites;
|
|
108
116
|
declare function assertNoInfiniteAbortLoop(rewriteCount: number, redirectCount: number): void;
|
|
117
|
+
type InferTwoOverloads<F extends Function> = F extends {
|
|
118
|
+
(...a1: infer A1): infer R1;
|
|
119
|
+
(...a0: infer A0): infer R0;
|
|
120
|
+
} ? [(...a1: A1) => R1, (...a0: A0) => R0] : never;
|
|
@@ -8,7 +8,7 @@ export { getPageContextFromAllRewrites };
|
|
|
8
8
|
export { AbortRender };
|
|
9
9
|
export { assertNoInfiniteAbortLoop };
|
|
10
10
|
import { isUserHookError } from '../hooks/execHook.js';
|
|
11
|
-
import { assert, assertInfo, assertUsage, assertUsageUrlPathnameAbsolute, assertUsageUrlRedirectTarget, assertWarning, checkType, hasProp, joinEnglish, objectAssign, truncateString, } from './utils.js';
|
|
11
|
+
import { assert, assertInfo, assertUsage, assertUsageUrlPathnameAbsolute, assertUsageUrlRedirectTarget, assertWarning, checkType, hasProp, isBrowser, joinEnglish, objectAssign, truncateString, } from './utils.js';
|
|
12
12
|
import pc from '@brillout/picocolors';
|
|
13
13
|
/**
|
|
14
14
|
* Abort the rendering of the current page, and redirect the user to another URL instead.
|
|
@@ -26,7 +26,13 @@ function redirect(url, statusCode) {
|
|
|
26
26
|
statusCode = 302;
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
|
-
|
|
29
|
+
if (
|
|
30
|
+
// Tree-shaking to save client-side KBs
|
|
31
|
+
!globalThis.__VIKE__IS_CLIENT ||
|
|
32
|
+
globalThis.__VIKE__IS_DEV ||
|
|
33
|
+
globalThis.__VIKE__IS_DEBUG) {
|
|
34
|
+
assertStatusCode(statusCode, [301, 302], 'redirect');
|
|
35
|
+
}
|
|
30
36
|
args.push(String(statusCode));
|
|
31
37
|
}
|
|
32
38
|
const pageContextAbort = {};
|
|
@@ -67,8 +73,14 @@ function render_(urlOrStatusCode, abortReason, abortCall, abortCaller, pageConte
|
|
|
67
73
|
return AbortRender(pageContextAbort);
|
|
68
74
|
}
|
|
69
75
|
else {
|
|
76
|
+
if (
|
|
77
|
+
// Tree-shaking to save client-side KBs
|
|
78
|
+
!globalThis.__VIKE__IS_CLIENT ||
|
|
79
|
+
globalThis.__VIKE__IS_DEV ||
|
|
80
|
+
globalThis.__VIKE__IS_DEBUG) {
|
|
81
|
+
assertStatusCode(urlOrStatusCode, [401, 403, 404, 410, 429, 500, 503], 'render');
|
|
82
|
+
}
|
|
70
83
|
const abortStatusCode = urlOrStatusCode;
|
|
71
|
-
assertStatusCode(urlOrStatusCode, [401, 403, 404, 410, 429, 500, 503], 'render');
|
|
72
84
|
objectAssign(pageContextAbort, {
|
|
73
85
|
abortStatusCode,
|
|
74
86
|
is404: abortStatusCode === 404,
|
|
@@ -132,8 +144,36 @@ function logAbortErrorHandled(err, isProduction, pageContext) {
|
|
|
132
144
|
});
|
|
133
145
|
}
|
|
134
146
|
function assertStatusCode(statusCode, expected, caller) {
|
|
135
|
-
|
|
136
|
-
|
|
147
|
+
assert(!globalThis.__VIKE__IS_CLIENT || globalThis.__VIKE__IS_DEV || globalThis.__VIKE__IS_DEBUG); // assert tree-shaking
|
|
148
|
+
// double check vike:pluginReplaceConstantsGlobalThis
|
|
149
|
+
if (globalThis.__VIKE__IS_CLIENT) {
|
|
150
|
+
assert(isBrowser());
|
|
151
|
+
assert(typeof globalThis.__VIKE__IS_DEV === 'boolean');
|
|
152
|
+
assert(typeof globalThis.__VIKE__IS_CLIENT === 'boolean');
|
|
153
|
+
assert(import.meta.env.SSR === false);
|
|
154
|
+
assert(import.meta.env.DEV === globalThis.__VIKE__IS_DEV);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
assert(!isBrowser());
|
|
158
|
+
if (import.meta.env) {
|
|
159
|
+
assert(typeof globalThis.__VIKE__IS_DEV === 'boolean');
|
|
160
|
+
assert(typeof globalThis.__VIKE__IS_CLIENT === 'boolean');
|
|
161
|
+
assert(import.meta.env.SSR === true);
|
|
162
|
+
assert(import.meta.env.DEV === globalThis.__VIKE__IS_DEV);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
// import.meta.env isn't defined when 'vike' is ssr.external
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const expectedEnglish = joinEnglish(expected.map((s) => pc.bold(String(s))), 'or');
|
|
169
|
+
const statusCodeWithColor = pc.bold(String(statusCode));
|
|
170
|
+
if (statusCode === 400) {
|
|
171
|
+
assert(!expected.includes(statusCode));
|
|
172
|
+
assertWarning(false, `We recommend against using the status code ${statusCodeWithColor} passed to ${caller}() — we recommend using ${pc.bold('404')} instead, see https://github.com/vikejs/vike/issues/1008#issuecomment-3270894445`, { onlyOnce: true, showStackTrace: true });
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
assertWarning(expected.includes(statusCode), `Unexpected status code ${statusCodeWithColor} passed to ${caller}() — we recommend using ${expectedEnglish} instead. (Or reach out at https://github.com/vikejs/vike/issues/1008 if you believe ${statusCodeWithColor} should be added.)`, { onlyOnce: true, showStackTrace: true });
|
|
176
|
+
}
|
|
137
177
|
}
|
|
138
178
|
function getPageContextFromAllRewrites(pageContextsFromRewrite) {
|
|
139
179
|
assertNoInfiniteLoop(pageContextsFromRewrite);
|
|
@@ -5,17 +5,21 @@ import { isBrowser } from '../../utils/isBrowser.js';
|
|
|
5
5
|
if (isBrowser()) {
|
|
6
6
|
assertClientRouting();
|
|
7
7
|
}
|
|
8
|
-
import { assert, assertUsage, isPlainObject, objectAssign } from './utils.js';
|
|
8
|
+
import { assert, assertUsage, isPlainObject, objectAssign, debug } from './utils.js';
|
|
9
9
|
import { resolvePrecedence } from './resolvePrecedence.js';
|
|
10
10
|
import { resolveRouteString } from './resolveRouteString.js';
|
|
11
11
|
import { resolveRouteFunction } from './resolveRouteFunction.js';
|
|
12
12
|
import { execHookOnBeforeRoute } from './execHookOnBeforeRoute.js';
|
|
13
|
-
import { debug } from './debug.js';
|
|
14
13
|
import pc from '@brillout/picocolors';
|
|
15
14
|
// TO-DO/next-major-release: make it sync
|
|
16
15
|
async function route(pageContext, skipOnBeforeRouteHook) {
|
|
17
|
-
debug('Pages routes:', pageContext._globalContext._pageRoutes);
|
|
18
16
|
const pageContextFromRoute = {};
|
|
17
|
+
if (
|
|
18
|
+
// Tree-shaking to save client-side KBs
|
|
19
|
+
!globalThis.__VIKE__IS_CLIENT ||
|
|
20
|
+
globalThis.__VIKE__IS_DEBUG) {
|
|
21
|
+
debug('vike:routing', 'Pages routes:', pageContext._globalContext._pageRoutes);
|
|
22
|
+
}
|
|
19
23
|
// onBeforeRoute()
|
|
20
24
|
if (!skipOnBeforeRouteHook) {
|
|
21
25
|
const pageContextFromOnBeforeRouteHook = await execHookOnBeforeRoute(pageContext);
|
|
@@ -80,7 +84,12 @@ async function route(pageContext, skipOnBeforeRouteHook) {
|
|
|
80
84
|
}));
|
|
81
85
|
resolvePrecedence(routeMatches);
|
|
82
86
|
const winner = routeMatches[0] ?? null;
|
|
83
|
-
|
|
87
|
+
if (
|
|
88
|
+
// Tree-shaking to save client-side KBs
|
|
89
|
+
!globalThis.__VIKE__IS_CLIENT ||
|
|
90
|
+
globalThis.__VIKE__IS_DEBUG) {
|
|
91
|
+
debug('vike:routing', `Route matches for URL ${pc.cyan(urlPathname)} (in precedence order):`, routeMatches);
|
|
92
|
+
}
|
|
84
93
|
// For vite-plugin-vercel https://github.com/magne4000/vite-plugin-vercel/blob/main/packages/vike-integration/vike.ts#L173
|
|
85
94
|
objectAssign(pageContextFromRoute, { _routeMatch: winner });
|
|
86
95
|
if (!winner) {
|
|
@@ -50,7 +50,7 @@ type HookName = HookNamePage | HookNameGlobal;
|
|
|
50
50
|
type HookNamePage = 'onHydrationEnd' | 'onBeforePrerenderStart' | 'onBeforeRender' | 'onPageTransitionStart' | 'onPageTransitionEnd' | 'onRenderHtml' | 'onRenderClient' | 'guard' | 'data' | 'onData' | 'route';
|
|
51
51
|
type HookNameGlobal = 'onBeforeRoute' | 'onPrerenderStart' | 'onCreatePageContext' | 'onCreateGlobalContext';
|
|
52
52
|
type HookNameOldDesign = 'render' | 'prerender' | 'onBeforePrerender';
|
|
53
|
-
type ConfigNameBuiltIn = Exclude<keyof ConfigBuiltIn, keyof VikeVitePluginOptions | 'onBeforeRoute' | 'onPrerenderStart' | 'vite' | 'redirects'> | 'prerender' | '
|
|
53
|
+
type ConfigNameBuiltIn = Exclude<keyof ConfigBuiltIn, keyof VikeVitePluginOptions | 'onBeforeRoute' | 'onPrerenderStart' | 'vite' | 'redirects'> | 'prerender' | 'hasServerOnlyHook' | 'isClientRuntimeLoaded' | 'onBeforeRenderEnv' | 'dataEnv' | 'hooksTimeout' | 'clientHooks' | 'middleware';
|
|
54
54
|
type ConfigNameGlobal = 'onPrerenderStart' | 'onBeforeRoute' | 'prerender' | 'disableAutoFullBuild' | 'includeAssetsImportedByServer' | 'baseAssets' | 'baseServer' | 'redirects' | 'trailingSlash' | 'disableUrlNormalization' | 'vite';
|
|
55
55
|
type Config = ConfigBuiltIn & Vike.Config;
|
|
56
56
|
/** @deprecated This type is deprecated, see https://vike.dev/data */
|
|
@@ -19,8 +19,8 @@ import type { From, PageContextConfig, Source, Sources } from '../shared/page-co
|
|
|
19
19
|
import type { Config } from './Config.js';
|
|
20
20
|
import type { AbortStatusCode } from '../shared/route/abort.js';
|
|
21
21
|
import type { GlobalContextServer } from '../node/runtime/globalContext.js';
|
|
22
|
-
import type { GlobalContextClient } from '../client/runtime-client-routing/
|
|
23
|
-
import type { GlobalContextClientWithServerRouting } from '../client/runtime-server-routing/
|
|
22
|
+
import type { GlobalContextClient } from '../client/runtime-client-routing/getGlobalContextClientInternal.js';
|
|
23
|
+
import type { GlobalContextClientWithServerRouting } from '../client/runtime-server-routing/getGlobalContextClientInternal.js';
|
|
24
24
|
type PageContextServer<Data = unknown> = PageContextBuiltInServer<Data> & Vike.PageContext & Vike.PageContextServer;
|
|
25
25
|
type PageContext<Data = unknown> = PageContextClient<Data> | PageContextServer<Data>;
|
|
26
26
|
type PageContextClient<Data = unknown> = PageContextBuiltInClientWithClientRouting<Data> & Vike.PageContext & Vike.PageContextClient;
|
|
@@ -137,9 +137,9 @@ type PageContextBuiltInCommon<Data> = PageContextConfig & {
|
|
|
137
137
|
};
|
|
138
138
|
type PageContextBuiltInServer<Data> = PageContextBuiltInCommon<Data> & PageContextUrlServer & {
|
|
139
139
|
/**
|
|
140
|
-
* Whether the
|
|
141
|
-
*
|
|
142
|
-
*
|
|
140
|
+
* Whether the environment is the client-side:
|
|
141
|
+
* - In the browser, the value is `true`.
|
|
142
|
+
* - Upon SSR and pre-rendering, the value is `false`.
|
|
143
143
|
*
|
|
144
144
|
* https://vike.dev/pageContext#isClientSide
|
|
145
145
|
*/
|
|
@@ -210,9 +210,9 @@ type PageContextBuiltInClientWithServerRouting<Data> = Partial<PageContextBuiltI
|
|
|
210
210
|
};
|
|
211
211
|
type PageContextClientCommon = {
|
|
212
212
|
/**
|
|
213
|
-
* Whether the
|
|
214
|
-
*
|
|
215
|
-
*
|
|
213
|
+
* Whether the environment is the client-side:
|
|
214
|
+
* - In the browser, the value is `true`.
|
|
215
|
+
* - Upon SSR and pre-rendering, the value is `false`.
|
|
216
216
|
*
|
|
217
217
|
* https://vike.dev/pageContext#isClientSide
|
|
218
218
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.240-commit-a80417c";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.
|
|
2
|
+
export const PROJECT_VERSION = '0.4.240-commit-a80417c';
|
package/dist/esm/utils/assert.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
export { debug };
|
|
1
2
|
export { createDebugger };
|
|
3
|
+
export { isDebug };
|
|
2
4
|
export { isDebugActivated };
|
|
3
|
-
|
|
4
|
-
declare const flags: readonly ["vike:crawl", "vike:error", "vike:esbuild-resolve", "vike:pluginExtractAssets", "vike:pluginExtractExportNames", "vike:glob", "vike:globalContext", "vike:log", "vike:optimizeDeps", "vike:outDir", "vike:pageFiles", "vike:pointer-imports", "vike:resolve", "vike:routing", "vike:setup", "vike:stream", "vike:virtualFiles", "vike:vite-rpc"];
|
|
5
|
+
declare const flags: ["vike", "vike:crawl", "vike:error", "vike:esbuild-resolve", "vike:pluginExtractAssets", "vike:pluginExtractExportNames", "vike:glob", "vike:globalContext", "vike:log", "vike:optimizeDeps", "vike:outDir", "vike:pageFiles", "vike:pointer-imports", "vike:requireResolve", "vike:routing", "vike:setup", "vike:stream", "vike:virtualFiles", "vike:vite-rpc"];
|
|
5
6
|
type Flag = (typeof flags)[number];
|
|
6
|
-
type Debug = ReturnType<typeof createDebugger>;
|
|
7
7
|
type Options = {
|
|
8
8
|
serialization?: {
|
|
9
9
|
emptyArray?: string;
|
|
@@ -13,4 +13,6 @@ declare function createDebugger(flag: Flag, optionsGlobal?: Options): ((...msgs:
|
|
|
13
13
|
options: (optionsLocal: Options) => (...msgs: unknown[]) => void;
|
|
14
14
|
isActivated: boolean;
|
|
15
15
|
};
|
|
16
|
+
declare function debug(flag: Flag, ...msgs: unknown[]): void;
|
|
16
17
|
declare function isDebugActivated(flag: Flag): boolean;
|
|
18
|
+
declare function isDebug(): boolean;
|