vike 0.4.231-commit-e1c3295 → 0.4.232-commit-134207d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/cjs/__internal/index.js +2 -2
- package/dist/cjs/client/runtime-client-routing/globalContext.js +1 -1
- package/dist/cjs/client/shared/createGetGlobalContextClient.js +2 -2
- package/dist/cjs/client/shared/preparePageContextForPublicUsageClientShared.js +2 -2
- package/dist/cjs/node/api/build.js +6 -2
- package/dist/cjs/node/api/dev.js +1 -1
- package/dist/cjs/node/api/prepareViteApiCall.js +8 -8
- package/dist/cjs/node/api/prerender.js +1 -1
- package/dist/cjs/node/api/preview.js +2 -2
- package/dist/cjs/node/cli/entry.js +1 -1
- package/dist/cjs/node/cli/parseCli.js +2 -2
- package/dist/cjs/node/client/router.js +1 -1
- package/dist/cjs/node/createPageRenderer.js +1 -1
- package/dist/cjs/node/prerender/context.js +1 -1
- package/dist/cjs/node/prerender/resolvePrerenderConfig.js +3 -2
- package/dist/cjs/node/prerender/runPrerender.js +91 -46
- package/dist/cjs/node/prerender/runPrerenderEntry.js +1 -1
- package/dist/cjs/node/prerender/utils.js +1 -0
- package/dist/cjs/node/runtime/globalContext.js +22 -15
- package/dist/cjs/node/runtime/html/injectAssets/getHtmlTags.js +7 -7
- package/dist/cjs/node/runtime/html/injectAssets/getViteDevScript.js +1 -1
- package/dist/cjs/node/runtime/html/injectAssets/inferHtmlTags.js +1 -1
- package/dist/cjs/node/runtime/html/injectAssets/injectAssets__public.js +5 -5
- package/dist/cjs/node/runtime/html/injectAssets/injectHtmlTags.js +3 -3
- package/dist/cjs/node/runtime/html/injectAssets.js +1 -1
- package/dist/cjs/node/runtime/html/renderHtml.js +8 -8
- package/dist/cjs/node/runtime/html/serializeContext.js +5 -5
- package/dist/cjs/node/runtime/html/stream.js +19 -19
- package/dist/cjs/node/runtime/index-deprecated.js +2 -2
- package/dist/cjs/node/runtime/index.js +1 -1
- package/dist/cjs/node/runtime/renderPage/analyzePage.js +4 -4
- package/dist/cjs/node/runtime/renderPage/assertArguments.js +1 -1
- package/dist/cjs/node/runtime/renderPage/createHttpResponse/assertNoInfiniteHttpRedirect.js +1 -1
- package/dist/cjs/node/runtime/renderPage/createHttpResponse.js +5 -6
- package/dist/cjs/node/runtime/renderPage/createPageContextServerSide.js +4 -4
- package/dist/cjs/node/runtime/renderPage/debugPageFiles.js +1 -1
- package/dist/cjs/node/runtime/renderPage/execHookServer.js +1 -4
- package/dist/cjs/node/runtime/renderPage/executeOnBeforeRenderAndDataHooks.js +1 -1
- package/dist/cjs/node/runtime/renderPage/executeOnRenderHtmlHook.js +3 -3
- package/dist/cjs/node/runtime/renderPage/getEarlyHints.js +1 -1
- package/dist/cjs/node/runtime/renderPage/getHttpResponseBody.js +1 -1
- package/dist/cjs/node/runtime/renderPage/getPageAssets/getManifestEntry.js +1 -1
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +1 -1
- package/dist/cjs/node/runtime/renderPage/getPageAssets.js +2 -2
- package/dist/cjs/node/runtime/renderPage/handleErrorWithoutErrorPage.js +1 -1
- package/dist/cjs/node/runtime/renderPage/handlePageContextRequestUrl.js +1 -1
- package/dist/cjs/node/runtime/renderPage/isFontFallback.js +3 -3
- package/dist/cjs/node/runtime/renderPage/isNewError.js +2 -1
- package/dist/cjs/node/runtime/renderPage/loadPageConfigsLazyServerSide.js +10 -10
- package/dist/cjs/node/runtime/renderPage/log404/index.js +4 -8
- package/dist/cjs/node/runtime/renderPage/logErrorHint/errors.js +2 -2
- package/dist/cjs/node/runtime/renderPage/logErrorHint.js +18 -18
- package/dist/cjs/node/runtime/renderPage/loggerProd.js +3 -3
- package/dist/cjs/node/runtime/renderPage/renderPageAlreadyRouted.js +1 -1
- package/dist/cjs/node/runtime/renderPage/resolveRedirects.js +22 -4
- package/dist/cjs/node/runtime/renderPage.js +17 -34
- package/dist/cjs/node/runtime/universal-middleware.js +2 -2
- package/dist/cjs/node/runtime/utils.js +1 -1
- package/dist/cjs/node/runtime-dev/createDevMiddleware.js +3 -3
- package/dist/cjs/node/shared/extractAssetsQuery.js +1 -1
- package/dist/cjs/node/shared/getVikeConfigError.js +22 -0
- package/dist/cjs/node/shared/resolveBase.js +1 -1
- package/dist/cjs/node/shared/utils.js +1 -0
- package/dist/cjs/node/shared/virtualFiles/virtualFilePageConfigLazy.js +2 -2
- package/dist/cjs/node/vite/index.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginBaseUrls.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginBuild/handleAssetsManifest.js +30 -28
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginAutoFullBuild.js +10 -10
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildApp.js +10 -10
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildConfig.js +10 -10
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildEntry.js +12 -13
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginDistFileNames.js +14 -12
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginDistPackageJsonFile.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginModuleBanner.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginSuppressRollupWarning.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginBuild.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginCommon/assertResolveAlias.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginCommon.js +14 -14
- package/dist/cjs/node/vite/plugins/pluginDev/determineFsAllowList.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginDev/determineOptimizeDeps.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginDev.js +8 -8
- package/dist/cjs/node/vite/plugins/pluginEnvVars.js +4 -4
- package/dist/cjs/node/vite/plugins/pluginExtractAssets.js +6 -6
- package/dist/cjs/node/vite/plugins/pluginExtractExportNames.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginFileEnv.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginPreview.js +9 -9
- package/dist/cjs/node/vite/plugins/pluginReplaceConstants.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginSetGlobalContext.js +6 -6
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/getVirtualFileEntry.js +10 -10
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigLazy.js +11 -1
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginWorkaroundCssModuleHmr.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginWorkaroundVite6HmrRegression.js +2 -2
- package/dist/cjs/node/vite/shared/addSsrMiddleware.js +3 -3
- package/dist/cjs/node/vite/shared/findPageFiles.js +1 -1
- package/dist/cjs/node/vite/shared/getFilePath.js +24 -24
- package/dist/cjs/node/vite/shared/getHttpRequestAsyncStore.js +4 -4
- package/dist/cjs/node/vite/shared/getOutDirs.js +2 -2
- package/dist/cjs/node/vite/shared/getViteConfigRuntime.js +3 -3
- package/dist/cjs/node/vite/shared/isAsset.js +1 -1
- package/dist/cjs/node/vite/shared/isViteCliCall.js +1 -1
- package/dist/cjs/node/vite/shared/isViteServerBuild.js +2 -2
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelReact.js +1 -1
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelSolid.js +1 -1
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errEsbuild.js +5 -5
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx1.js +3 -3
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx2.js +10 -10
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errPostcss.js +2 -2
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwc.js +2 -2
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwcBig.js +2 -2
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueCss.js +2 -2
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueHtml.js +1 -1
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueJavascript.js +1 -1
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet.js +3 -3
- package/dist/cjs/node/vite/shared/loggerNotProd.js +1 -1
- package/dist/cjs/node/vite/shared/resolveClientEntriesDev.js +2 -2
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/assertExtensions.js +2 -2
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js +50 -50
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles/ignorePatternsBuiltIn.js +1 -1
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles.js +13 -13
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/filesystemRouting.js +14 -5
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/getPlusFilesAll.js +4 -4
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/loadFileAtConfigTime.js +1 -1
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/pointerImports.js +5 -5
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/resolvePointerImport.js +5 -5
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/transpileAndExecuteFile.js +25 -25
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal.js +46 -46
- package/dist/cjs/node/vite/utils.js +2 -7
- package/dist/cjs/shared/assertHookReturnedObject.js +1 -1
- package/dist/cjs/shared/assertPageContextProvidedByUser.js +2 -2
- package/dist/cjs/shared/createGlobalContextShared.js +26 -18
- package/dist/cjs/shared/createPageContextShared.js +1 -1
- package/dist/cjs/shared/getPageContextRequestUrl.js +1 -1
- package/dist/cjs/shared/getPageContextUrlComputed.js +5 -5
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/analyzeExports.js +3 -3
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/determineClientEntry.js +1 -1
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide.js +3 -3
- package/dist/cjs/shared/getPageFiles/fileTypes.js +1 -1
- package/dist/cjs/shared/getPageFiles/getAllPageIdFiles.js +2 -2
- package/dist/cjs/shared/getPageFiles/getPageFileObject.js +1 -1
- package/dist/cjs/shared/getProxyForPublicUsage.js +2 -2
- package/dist/cjs/shared/hooks/execHook.js +2 -2
- package/dist/cjs/shared/hooks/getHook.js +4 -4
- package/dist/cjs/shared/modifyUrl.js +1 -1
- package/dist/cjs/shared/page-configs/assertPlusFileExport.js +2 -2
- package/dist/cjs/shared/page-configs/getConfigValueBuildTime.js +4 -4
- package/dist/cjs/shared/page-configs/resolveVikeConfigPublic.js +21 -21
- package/dist/cjs/shared/page-configs/serialize/parsePageConfigs.js +3 -3
- package/dist/cjs/shared/page-configs/serialize/serializeConfigValues.js +9 -9
- package/dist/cjs/shared/preparePageContextForPublicUsage.js +3 -3
- package/dist/cjs/shared/route/abort.js +7 -7
- package/dist/cjs/shared/route/debug.js +1 -1
- package/dist/cjs/shared/route/deduceRouteStringFromFilesystemPath.js +1 -1
- package/dist/cjs/shared/route/executeOnBeforeRouteHook.js +3 -3
- package/dist/cjs/shared/route/index.js +5 -5
- package/dist/cjs/shared/route/loadPageRoutes.js +8 -8
- package/dist/cjs/shared/route/resolvePrecedence.js +2 -2
- package/dist/cjs/shared/route/resolveRoute.js +1 -1
- package/dist/cjs/shared/route/resolveRouteFunction.js +2 -2
- package/dist/cjs/shared/utils.js +1 -0
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/assert.js +9 -9
- package/dist/cjs/utils/assertKeys.js +1 -1
- package/dist/cjs/utils/assertSetup.js +1 -1
- package/dist/cjs/utils/assertSingleInstance.js +5 -5
- package/dist/cjs/utils/catchInfiniteLoop.js +1 -1
- package/dist/cjs/utils/debug.js +1 -1
- package/dist/cjs/utils/findFile.js +5 -5
- package/dist/cjs/utils/findPackageJson.js +3 -3
- package/dist/cjs/utils/formatHintLog.js +1 -1
- package/dist/cjs/utils/freezePartial.js +1 -1
- package/dist/cjs/utils/genPromise.js +2 -2
- package/dist/cjs/utils/getMostSimilar.js +1 -1
- package/dist/cjs/utils/injectRollupInputs.js +2 -2
- package/dist/cjs/utils/isFilePathAbsoluteFilesystem.js +1 -1
- package/dist/cjs/utils/objectAssignSafe.js +1 -1
- package/dist/cjs/utils/pLimit.js +4 -4
- package/dist/cjs/utils/parseNpmPackage.js +2 -2
- package/dist/cjs/utils/parseUrl.js +3 -3
- package/dist/cjs/utils/path.js +1 -1
- package/dist/cjs/utils/preservePropertyGetters.js +1 -1
- package/dist/cjs/utils/{removeFileExtention.js → removeFileExtension.js} +2 -2
- package/dist/cjs/utils/requireResolve.js +10 -10
- package/dist/cjs/utils/rollupSourceMap.js +2 -2
- package/dist/cjs/utils/stripAnsi.js +1 -1
- package/dist/cjs/utils/styleFileRE.js +1 -0
- package/dist/cjs/utils/trimWithAnsi.js +1 -1
- package/dist/esm/__internal/index.js +2 -2
- package/dist/esm/client/index.d.ts +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/client/node.js +1 -1
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.js +1 -1
- package/dist/esm/client/runtime-client-routing/getPageContext/removeBuiltInOverrides.js +1 -1
- package/dist/esm/client/runtime-client-routing/getPageContextCurrent.js +1 -1
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.d.ts +2 -3
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.js +5 -5
- package/dist/esm/client/runtime-client-routing/globalContext.js +1 -1
- package/dist/esm/client/runtime-client-routing/history.js +6 -6
- package/dist/esm/client/runtime-client-routing/initClientRouter.js +1 -1
- package/dist/esm/client/runtime-client-routing/initOnLinkClick.js +1 -1
- package/dist/esm/client/runtime-client-routing/initOnPopState.js +1 -1
- package/dist/esm/client/runtime-client-routing/isClientSideRoutable.js +1 -1
- package/dist/esm/client/runtime-client-routing/navigate.js +1 -1
- package/dist/esm/client/runtime-client-routing/prefetch/getPrefetchSettings.js +2 -2
- package/dist/esm/client/runtime-client-routing/prefetch.js +10 -10
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.d.ts +1 -1
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.js +20 -20
- package/dist/esm/client/runtime-client-routing/setScrollPosition.js +1 -1
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.js +1 -1
- package/dist/esm/client/shared/createGetGlobalContextClient.js +3 -3
- package/dist/esm/client/shared/loadPageConfigsLazyClientSide.js +1 -1
- package/dist/esm/client/shared/preparePageContextForPublicUsageClientShared.js +3 -3
- package/dist/esm/node/api/build.js +6 -2
- package/dist/esm/node/api/dev.js +1 -1
- package/dist/esm/node/api/prepareViteApiCall.js +8 -8
- package/dist/esm/node/api/prerender.js +1 -1
- package/dist/esm/node/api/preview.js +2 -2
- package/dist/esm/node/cli/entry.js +1 -1
- package/dist/esm/node/cli/parseCli.js +2 -2
- package/dist/esm/node/client/router.js +1 -1
- package/dist/esm/node/createPageRenderer.js +1 -1
- package/dist/esm/node/prerender/context.d.ts +1 -1
- package/dist/esm/node/prerender/context.js +1 -1
- package/dist/esm/node/prerender/resolvePrerenderConfig.d.ts +1 -0
- package/dist/esm/node/prerender/resolvePrerenderConfig.js +3 -2
- package/dist/esm/node/prerender/runPrerender.d.ts +9 -6
- package/dist/esm/node/prerender/runPrerender.js +90 -45
- package/dist/esm/node/prerender/runPrerenderEntry.js +1 -1
- package/dist/esm/node/prerender/utils.d.ts +1 -0
- package/dist/esm/node/prerender/utils.js +1 -0
- package/dist/esm/node/runtime/globalContext.js +25 -18
- package/dist/esm/node/runtime/html/injectAssets/getHtmlTags.js +8 -8
- package/dist/esm/node/runtime/html/injectAssets/getViteDevScript.js +1 -1
- package/dist/esm/node/runtime/html/injectAssets/inferHtmlTags.js +1 -1
- package/dist/esm/node/runtime/html/injectAssets/injectAssets__public.js +5 -5
- package/dist/esm/node/runtime/html/injectAssets/injectHtmlTags.js +3 -3
- package/dist/esm/node/runtime/html/injectAssets.js +2 -2
- package/dist/esm/node/runtime/html/renderHtml.js +10 -10
- package/dist/esm/node/runtime/html/serializeContext.js +5 -5
- package/dist/esm/node/runtime/html/stream.d.ts +1 -1
- package/dist/esm/node/runtime/html/stream.js +21 -21
- package/dist/esm/node/runtime/index-deprecated.js +2 -2
- package/dist/esm/node/runtime/index.js +1 -1
- package/dist/esm/node/runtime/renderPage/analyzePage.js +4 -4
- package/dist/esm/node/runtime/renderPage/assertArguments.js +1 -1
- package/dist/esm/node/runtime/renderPage/createHttpResponse/assertNoInfiniteHttpRedirect.js +1 -1
- package/dist/esm/node/runtime/renderPage/createHttpResponse.js +5 -6
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.js +4 -4
- package/dist/esm/node/runtime/renderPage/debugPageFiles.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/debugPageFiles.js +1 -1
- package/dist/esm/node/runtime/renderPage/execHookServer.js +2 -5
- package/dist/esm/node/runtime/renderPage/executeOnBeforeRenderAndDataHooks.js +1 -1
- package/dist/esm/node/runtime/renderPage/executeOnRenderHtmlHook.js +5 -5
- package/dist/esm/node/runtime/renderPage/getEarlyHints.js +1 -1
- package/dist/esm/node/runtime/renderPage/getHttpResponseBody.js +2 -2
- package/dist/esm/node/runtime/renderPage/getPageAssets/getManifestEntry.js +1 -1
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +1 -1
- package/dist/esm/node/runtime/renderPage/getPageAssets.js +2 -2
- package/dist/esm/node/runtime/renderPage/handleErrorWithoutErrorPage.js +1 -1
- package/dist/esm/node/runtime/renderPage/handlePageContextRequestUrl.js +1 -1
- package/dist/esm/node/runtime/renderPage/isFontFallback.js +3 -3
- package/dist/esm/node/runtime/renderPage/isNewError.d.ts +2 -0
- package/dist/esm/node/runtime/renderPage/isNewError.js +2 -1
- package/dist/esm/node/runtime/renderPage/loadPageConfigsLazyServerSide.js +11 -11
- package/dist/esm/node/runtime/renderPage/log404/index.js +5 -9
- package/dist/esm/node/runtime/renderPage/logErrorHint/errors.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/logErrorHint/errors.js +1 -1
- package/dist/esm/node/runtime/renderPage/logErrorHint.js +18 -18
- package/dist/esm/node/runtime/renderPage/loggerProd.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/loggerProd.js +3 -3
- package/dist/esm/node/runtime/renderPage/preparePageContextForPublicUsageServer.js +1 -1
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.js +2 -2
- package/dist/esm/node/runtime/renderPage/resolveRedirects.d.ts +2 -0
- package/dist/esm/node/runtime/renderPage/resolveRedirects.js +24 -6
- package/dist/esm/node/runtime/renderPage.d.ts +0 -11
- package/dist/esm/node/runtime/renderPage.js +20 -37
- package/dist/esm/node/runtime/universal-middleware.js +2 -2
- package/dist/esm/node/runtime/utils.d.ts +1 -1
- package/dist/esm/node/runtime/utils.js +1 -1
- package/dist/esm/node/runtime-dev/createDevMiddleware.js +3 -3
- package/dist/esm/node/shared/extractAssetsQuery.js +1 -1
- package/dist/esm/node/shared/getVikeConfigError.d.ts +13 -0
- package/dist/esm/node/shared/getVikeConfigError.js +20 -0
- package/dist/esm/node/shared/resolveBase.js +1 -1
- package/dist/esm/node/shared/utils.d.ts +1 -0
- package/dist/esm/node/shared/utils.js +1 -0
- package/dist/esm/node/shared/virtualFiles/virtualFilePageConfigLazy.js +2 -2
- package/dist/esm/node/vite/index.js +2 -2
- package/dist/esm/node/vite/plugins/pluginBaseUrls.js +3 -3
- package/dist/esm/node/vite/plugins/pluginBuild/handleAssetsManifest.d.ts +3 -2
- package/dist/esm/node/vite/plugins/pluginBuild/handleAssetsManifest.js +14 -12
- package/dist/esm/node/vite/plugins/pluginBuild/pluginAutoFullBuild.js +10 -10
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildApp.js +10 -10
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildConfig.js +12 -12
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildEntry.d.ts +1 -2
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildEntry.js +11 -12
- package/dist/esm/node/vite/plugins/pluginBuild/pluginDistFileNames.js +11 -9
- package/dist/esm/node/vite/plugins/pluginBuild/pluginDistPackageJsonFile.js +2 -2
- package/dist/esm/node/vite/plugins/pluginBuild/pluginModuleBanner.js +3 -3
- package/dist/esm/node/vite/plugins/pluginBuild/pluginSuppressRollupWarning.js +3 -3
- package/dist/esm/node/vite/plugins/pluginBuild.js +1 -1
- package/dist/esm/node/vite/plugins/pluginCommon/assertResolveAlias.js +2 -2
- package/dist/esm/node/vite/plugins/pluginCommon.js +14 -14
- package/dist/esm/node/vite/plugins/pluginDev/determineFsAllowList.js +1 -1
- package/dist/esm/node/vite/plugins/pluginDev/determineOptimizeDeps.js +5 -5
- package/dist/esm/node/vite/plugins/pluginDev.js +8 -8
- package/dist/esm/node/vite/plugins/pluginEnvVars.js +5 -5
- package/dist/esm/node/vite/plugins/pluginExtractAssets.js +8 -8
- package/dist/esm/node/vite/plugins/pluginExtractExportNames.js +3 -3
- package/dist/esm/node/vite/plugins/pluginFileEnv.js +4 -4
- package/dist/esm/node/vite/plugins/pluginPreview.js +5 -5
- package/dist/esm/node/vite/plugins/pluginReplaceConstants.js +3 -3
- package/dist/esm/node/vite/plugins/pluginSetGlobalContext.js +7 -7
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/getVirtualFileEntry.js +11 -11
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigLazy.js +13 -3
- package/dist/esm/node/vite/plugins/pluginVirtualFiles.js +3 -3
- package/dist/esm/node/vite/plugins/pluginWorkaroundCssModuleHmr.js +1 -1
- package/dist/esm/node/vite/plugins/pluginWorkaroundVite6HmrRegression.js +2 -2
- package/dist/esm/node/vite/shared/addSsrMiddleware.js +3 -3
- package/dist/esm/node/vite/shared/findPageFiles.js +1 -1
- package/dist/esm/node/vite/shared/getFilePath.d.ts +5 -5
- package/dist/esm/node/vite/shared/getFilePath.js +22 -22
- package/dist/esm/node/vite/shared/getHttpRequestAsyncStore.js +4 -4
- package/dist/esm/node/vite/shared/getOutDirs.js +2 -2
- package/dist/esm/node/vite/shared/getViteConfigRuntime.js +3 -3
- package/dist/esm/node/vite/shared/isAsset.js +1 -1
- package/dist/esm/node/vite/shared/isViteCliCall.js +1 -1
- package/dist/esm/node/vite/shared/isViteServerBuild.js +2 -2
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelReact.js +1 -1
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelSolid.js +1 -1
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errEsbuild.js +5 -5
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx1.js +3 -3
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx2.js +10 -10
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errPostcss.js +2 -2
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwc.js +2 -2
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwcBig.js +2 -2
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueCss.js +2 -2
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueHtml.js +1 -1
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueJavascript.js +1 -1
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet.js +4 -4
- package/dist/esm/node/vite/shared/loggerNotProd.js +3 -3
- package/dist/esm/node/vite/shared/resolveClientEntriesDev.js +3 -3
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/assertExtensions.js +1 -1
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js +50 -50
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles/ignorePatternsBuiltIn.js +1 -1
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles.js +10 -10
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/filesystemRouting.js +14 -5
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/getPlusFilesAll.js +4 -4
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/loadFileAtConfigTime.js +1 -1
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/pointerImports.js +5 -5
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/resolvePointerImport.js +6 -6
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/transpileAndExecuteFile.js +14 -14
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal.d.ts +2 -2
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal.js +52 -52
- package/dist/esm/node/vite/utils.d.ts +0 -6
- package/dist/esm/node/vite/utils.js +2 -7
- package/dist/esm/shared/assertHookReturnedObject.js +1 -1
- package/dist/esm/shared/assertPageContextProvidedByUser.d.ts +1 -1
- package/dist/esm/shared/assertPageContextProvidedByUser.js +2 -2
- package/dist/esm/shared/createGlobalContextShared.d.ts +2 -0
- package/dist/esm/shared/createGlobalContextShared.js +28 -20
- package/dist/esm/shared/createPageContextShared.js +1 -1
- package/dist/esm/shared/getPageContextRequestUrl.js +1 -1
- package/dist/esm/shared/getPageContextUrlComputed.js +5 -5
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/analyzeExports.d.ts +1 -1
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/analyzeExports.js +3 -3
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/determineClientEntry.d.ts +1 -1
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/determineClientEntry.js +1 -1
- package/dist/esm/shared/getPageFiles/analyzePageClientSide.js +3 -3
- package/dist/esm/shared/getPageFiles/fileTypes.js +1 -1
- package/dist/esm/shared/getPageFiles/getAllPageIdFiles.js +2 -2
- package/dist/esm/shared/getPageFiles/getPageFileObject.js +1 -1
- package/dist/esm/shared/getProxyForPublicUsage.js +2 -2
- package/dist/esm/shared/hooks/execHook.js +3 -3
- package/dist/esm/shared/hooks/getHook.js +4 -4
- package/dist/esm/shared/modifyUrl.js +1 -1
- package/dist/esm/shared/modifyUrlSameOrigin.js +1 -1
- package/dist/esm/shared/page-configs/assertPlusFileExport.js +2 -2
- package/dist/esm/shared/page-configs/getConfigValueBuildTime.js +4 -4
- package/dist/esm/shared/page-configs/resolveVikeConfigPublic.d.ts +2 -2
- package/dist/esm/shared/page-configs/resolveVikeConfigPublic.js +22 -22
- package/dist/esm/shared/page-configs/serialize/parsePageConfigs.js +3 -3
- package/dist/esm/shared/page-configs/serialize/serializeConfigValues.js +11 -11
- package/dist/esm/shared/preparePageContextForPublicUsage.js +4 -4
- package/dist/esm/shared/route/abort.js +8 -8
- package/dist/esm/shared/route/debug.js +1 -1
- package/dist/esm/shared/route/deduceRouteStringFromFilesystemPath.js +1 -1
- package/dist/esm/shared/route/executeOnBeforeRouteHook.js +5 -5
- package/dist/esm/shared/route/index.js +6 -6
- package/dist/esm/shared/route/loadPageRoutes.js +8 -8
- package/dist/esm/shared/route/resolvePrecedence.d.ts +2 -2
- package/dist/esm/shared/route/resolvePrecedence.js +2 -2
- package/dist/esm/shared/route/resolveRoute.js +1 -1
- package/dist/esm/shared/route/resolveRouteFunction.js +2 -2
- package/dist/esm/shared/utils.d.ts +1 -0
- package/dist/esm/shared/utils.js +1 -0
- package/dist/esm/types/Config.d.ts +6 -0
- package/dist/esm/types/FilePath.d.ts +1 -1
- package/dist/esm/types/PageConfig.d.ts +1 -1
- package/dist/esm/types/PageContext.d.ts +2 -2
- package/dist/esm/types/index-dreprecated.d.ts +1 -1
- package/dist/esm/types/index.d.ts +3 -3
- 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 +9 -9
- package/dist/esm/utils/assertKeys.js +1 -1
- package/dist/esm/utils/assertSetup.js +1 -1
- package/dist/esm/utils/assertSingleInstance.js +5 -5
- package/dist/esm/utils/catchInfiniteLoop.js +1 -1
- package/dist/esm/utils/debug.js +1 -1
- package/dist/esm/utils/findFile.js +2 -2
- package/dist/esm/utils/findPackageJson.js +2 -2
- package/dist/esm/utils/formatHintLog.js +1 -1
- package/dist/esm/utils/freezePartial.js +1 -1
- package/dist/esm/utils/genPromise.d.ts +1 -1
- package/dist/esm/utils/genPromise.js +2 -2
- package/dist/esm/utils/getMostSimilar.js +1 -1
- package/dist/esm/utils/injectRollupInputs.js +2 -2
- package/dist/esm/utils/isFilePathAbsoluteFilesystem.js +1 -1
- package/dist/esm/utils/objectAssignSafe.js +1 -1
- package/dist/esm/utils/pLimit.js +4 -4
- package/dist/esm/utils/parseNpmPackage.js +2 -2
- package/dist/esm/utils/parseUrl.js +3 -3
- package/dist/esm/utils/path.js +1 -1
- package/dist/esm/utils/preservePropertyGetters.js +1 -1
- package/dist/esm/utils/removeFileExtension.d.ts +1 -0
- package/dist/esm/utils/{removeFileExtention.js → removeFileExtension.js} +1 -1
- package/dist/esm/utils/requireResolve.d.ts +3 -3
- package/dist/esm/utils/requireResolve.js +10 -10
- package/dist/esm/utils/rollupSourceMap.js +2 -2
- package/dist/esm/utils/stripAnsi.js +1 -1
- package/dist/esm/utils/styleFileRE.js +1 -0
- package/dist/esm/utils/trimWithAnsi.js +1 -1
- package/package.json +2 -2
- package/dist/esm/utils/removeFileExtention.d.ts +0 -1
|
@@ -3,99 +3,99 @@ import { assert, assertUsage } from '../../utils.js';
|
|
|
3
3
|
import { getConfigDefinedAt } from '../../../../shared/page-configs/getConfigDefinedAt.js';
|
|
4
4
|
const configDefinitionsBuiltIn = {
|
|
5
5
|
onRenderHtml: {
|
|
6
|
-
env: { server: true }
|
|
6
|
+
env: { server: true },
|
|
7
7
|
},
|
|
8
8
|
onRenderClient: {
|
|
9
|
-
env: { client: true }
|
|
9
|
+
env: { client: true },
|
|
10
10
|
},
|
|
11
11
|
onHydrationEnd: {
|
|
12
|
-
env: { client: true }
|
|
12
|
+
env: { client: true },
|
|
13
13
|
},
|
|
14
14
|
onPageTransitionStart: {
|
|
15
|
-
env: { client: true }
|
|
15
|
+
env: { client: true },
|
|
16
16
|
},
|
|
17
17
|
onPageTransitionEnd: {
|
|
18
|
-
env: { client: true }
|
|
18
|
+
env: { client: true },
|
|
19
19
|
},
|
|
20
20
|
onCreatePageContext: {
|
|
21
21
|
env: { server: true, client: true },
|
|
22
22
|
// Required because `onCreatePageContext()` is called before routing
|
|
23
23
|
global: true,
|
|
24
|
-
cumulative: true
|
|
24
|
+
cumulative: true,
|
|
25
25
|
},
|
|
26
26
|
onCreateGlobalContext: {
|
|
27
27
|
env: { server: true, client: true },
|
|
28
28
|
global: true,
|
|
29
|
-
cumulative: true
|
|
29
|
+
cumulative: true,
|
|
30
30
|
},
|
|
31
31
|
onBeforeRender: {
|
|
32
|
-
env: { server: true }
|
|
32
|
+
env: { server: true },
|
|
33
33
|
},
|
|
34
34
|
onBeforePrerenderStart: {
|
|
35
|
-
env: { server: true, production: true }
|
|
35
|
+
env: { server: true, production: true },
|
|
36
36
|
},
|
|
37
37
|
Page: {
|
|
38
|
-
env: { server: true, client: true }
|
|
38
|
+
env: { server: true, client: true },
|
|
39
39
|
},
|
|
40
40
|
passToClient: {
|
|
41
41
|
env: { server: true },
|
|
42
|
-
cumulative: true
|
|
42
|
+
cumulative: true,
|
|
43
43
|
},
|
|
44
44
|
route: {
|
|
45
45
|
env: {
|
|
46
46
|
server: true,
|
|
47
47
|
client: 'if-client-routing',
|
|
48
48
|
// For vite-plugin-vercel
|
|
49
|
-
config: true
|
|
49
|
+
config: true,
|
|
50
50
|
},
|
|
51
|
-
eager: true
|
|
51
|
+
eager: true,
|
|
52
52
|
},
|
|
53
53
|
guard: {
|
|
54
|
-
env: { server: true, client: 'if-client-routing' }
|
|
54
|
+
env: { server: true, client: 'if-client-routing' },
|
|
55
55
|
},
|
|
56
56
|
data: {
|
|
57
|
-
env: { server: true }
|
|
57
|
+
env: { server: true },
|
|
58
58
|
},
|
|
59
59
|
onData: {
|
|
60
60
|
env: { server: true, client: true },
|
|
61
|
-
cumulative: true
|
|
61
|
+
cumulative: true,
|
|
62
62
|
},
|
|
63
63
|
iKnowThePerformanceRisksOfAsyncRouteFunctions: {
|
|
64
64
|
env: { server: true, client: 'if-client-routing' },
|
|
65
|
-
eager: true
|
|
65
|
+
eager: true,
|
|
66
66
|
},
|
|
67
67
|
filesystemRoutingRoot: {
|
|
68
|
-
env: { config: true }
|
|
68
|
+
env: { config: true },
|
|
69
69
|
},
|
|
70
70
|
client: {
|
|
71
71
|
// The value of the client config is merely the file path to the client entry file, which is only needed on the sever-side
|
|
72
72
|
env: { server: true, config: true },
|
|
73
|
-
_valueIsFilePath: true
|
|
73
|
+
_valueIsFilePath: true,
|
|
74
74
|
},
|
|
75
75
|
clientRouting: {
|
|
76
76
|
// We could make it { client: false } but we don't yet because of some legacy V0.4 design code
|
|
77
77
|
env: { server: true, client: true, config: true },
|
|
78
|
-
eager: true
|
|
78
|
+
eager: true,
|
|
79
79
|
},
|
|
80
80
|
clientHooks: {
|
|
81
|
-
env: { config: true }
|
|
81
|
+
env: { config: true },
|
|
82
82
|
},
|
|
83
83
|
hydrationCanBeAborted: {
|
|
84
|
-
env: { client: true }
|
|
84
|
+
env: { client: true },
|
|
85
85
|
},
|
|
86
86
|
prefetch: {
|
|
87
87
|
env: { client: true },
|
|
88
|
-
eager: true
|
|
88
|
+
eager: true,
|
|
89
89
|
},
|
|
90
90
|
// TODO/v1-release: remove
|
|
91
91
|
prefetchStaticAssets: {
|
|
92
|
-
env: { client: true }
|
|
92
|
+
env: { client: true },
|
|
93
93
|
},
|
|
94
94
|
extends: {
|
|
95
|
-
env: { config: true }
|
|
95
|
+
env: { config: true },
|
|
96
96
|
},
|
|
97
97
|
meta: {
|
|
98
|
-
env: { config: true }
|
|
98
|
+
env: { config: true },
|
|
99
99
|
},
|
|
100
100
|
// Whether the page loads:
|
|
101
101
|
// - Vike's client runtime
|
|
@@ -120,98 +120,98 @@ const configDefinitionsBuiltIn = {
|
|
|
120
120
|
return (isConfigSet(configValueSources, 'onRenderClient') &&
|
|
121
121
|
isConfigSet(configValueSources, 'Page') &&
|
|
122
122
|
!!getConfigEnv(configValueSources, 'Page')?.client);
|
|
123
|
-
}
|
|
123
|
+
},
|
|
124
124
|
},
|
|
125
125
|
onBeforeRenderEnv: {
|
|
126
126
|
env: { client: true },
|
|
127
127
|
eager: true,
|
|
128
|
-
_computed: (configValueSources) => !isConfigSet(configValueSources, 'onBeforeRender') ? null : getConfigEnv(configValueSources, 'onBeforeRender')
|
|
128
|
+
_computed: (configValueSources) => !isConfigSet(configValueSources, 'onBeforeRender') ? null : getConfigEnv(configValueSources, 'onBeforeRender'),
|
|
129
129
|
},
|
|
130
130
|
dataEnv: {
|
|
131
131
|
env: { client: true },
|
|
132
132
|
eager: true,
|
|
133
|
-
_computed: (configValueSources) => !isConfigSet(configValueSources, 'data') ? null : getConfigEnv(configValueSources, 'data')
|
|
133
|
+
_computed: (configValueSources) => !isConfigSet(configValueSources, 'data') ? null : getConfigEnv(configValueSources, 'data'),
|
|
134
134
|
},
|
|
135
135
|
hooksTimeout: {
|
|
136
|
-
env: { server: true, client: true }
|
|
136
|
+
env: { server: true, client: true },
|
|
137
137
|
},
|
|
138
138
|
cacheControl: {
|
|
139
|
-
env: { server: true }
|
|
139
|
+
env: { server: true },
|
|
140
140
|
},
|
|
141
141
|
host: {
|
|
142
142
|
env: { config: true },
|
|
143
|
-
global: true
|
|
143
|
+
global: true,
|
|
144
144
|
},
|
|
145
145
|
port: {
|
|
146
146
|
env: { config: true },
|
|
147
|
-
global: true
|
|
147
|
+
global: true,
|
|
148
148
|
},
|
|
149
149
|
mode: {
|
|
150
150
|
env: { config: true },
|
|
151
|
-
global: true
|
|
151
|
+
global: true,
|
|
152
152
|
},
|
|
153
153
|
injectScriptsAt: {
|
|
154
|
-
env: { server: true }
|
|
154
|
+
env: { server: true },
|
|
155
155
|
},
|
|
156
156
|
name: {
|
|
157
|
-
env: { config: true }
|
|
157
|
+
env: { config: true },
|
|
158
158
|
},
|
|
159
159
|
require: {
|
|
160
|
-
env: { config: true }
|
|
160
|
+
env: { config: true },
|
|
161
161
|
},
|
|
162
162
|
keepScrollPosition: {
|
|
163
|
-
env: { client: true }
|
|
163
|
+
env: { client: true },
|
|
164
164
|
},
|
|
165
165
|
middleware: { env: { server: true }, cumulative: true, eager: true, global: true },
|
|
166
166
|
onPrerenderStart: {
|
|
167
167
|
env: { server: true, production: true },
|
|
168
168
|
eager: true,
|
|
169
|
-
global: true
|
|
169
|
+
global: true,
|
|
170
170
|
},
|
|
171
171
|
onBeforeRoute: {
|
|
172
172
|
env: { server: true, client: 'if-client-routing' },
|
|
173
173
|
eager: true,
|
|
174
|
-
global: true
|
|
174
|
+
global: true,
|
|
175
175
|
},
|
|
176
176
|
prerender: {
|
|
177
177
|
env: { config: true },
|
|
178
178
|
global: (value, { isGlobalLocation }) => typeof value === 'object' || isGlobalLocation,
|
|
179
|
-
cumulative: true
|
|
179
|
+
cumulative: true,
|
|
180
180
|
},
|
|
181
181
|
vite: { env: { config: true }, global: true, cumulative: true },
|
|
182
182
|
disableAutoFullBuild: {
|
|
183
183
|
env: { config: true },
|
|
184
|
-
global: true
|
|
184
|
+
global: true,
|
|
185
185
|
},
|
|
186
186
|
vite6BuilderApp: {
|
|
187
187
|
env: { config: true },
|
|
188
|
-
global: true
|
|
188
|
+
global: true,
|
|
189
189
|
},
|
|
190
190
|
includeAssetsImportedByServer: {
|
|
191
191
|
env: { config: true },
|
|
192
|
-
global: true
|
|
192
|
+
global: true,
|
|
193
193
|
},
|
|
194
194
|
baseAssets: {
|
|
195
195
|
env: { config: true, server: true },
|
|
196
|
-
global: true
|
|
196
|
+
global: true,
|
|
197
197
|
},
|
|
198
198
|
baseServer: {
|
|
199
199
|
env: { config: true, server: true },
|
|
200
|
-
global: true
|
|
200
|
+
global: true,
|
|
201
201
|
},
|
|
202
202
|
redirects: {
|
|
203
203
|
env: { server: true },
|
|
204
204
|
global: true,
|
|
205
|
-
cumulative: true
|
|
205
|
+
cumulative: true,
|
|
206
206
|
},
|
|
207
207
|
trailingSlash: {
|
|
208
208
|
env: { server: true },
|
|
209
|
-
global: true
|
|
209
|
+
global: true,
|
|
210
210
|
},
|
|
211
211
|
disableUrlNormalization: {
|
|
212
212
|
env: { server: true },
|
|
213
|
-
global: true
|
|
214
|
-
}
|
|
213
|
+
global: true,
|
|
214
|
+
},
|
|
215
215
|
};
|
|
216
216
|
function getConfigEnv(configValueSources, configName) {
|
|
217
217
|
const configValueSource = getConfigValueSource(configValueSources, configName);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { crawlPlusFiles };
|
|
2
2
|
export { isPlusFile };
|
|
3
3
|
export { getPlusFileValueConfigName };
|
|
4
|
-
import { assertPosixPath, assert, scriptFileExtensionPattern, assertIsSingleModuleInstance, assertIsNotProductionRuntime, isVersionOrAbove, isScriptFile, scriptFileExtensionList, createDebugger, deepEqual, assertUsage, assertFilePathAbsoluteFilesystem, assertWarning, hasProp, isNotNullish } from '../../utils.js';
|
|
5
|
-
import path from 'path';
|
|
4
|
+
import { assertPosixPath, assert, scriptFileExtensionPattern, assertIsSingleModuleInstance, assertIsNotProductionRuntime, isVersionOrAbove, isScriptFile, scriptFileExtensionList, createDebugger, deepEqual, assertUsage, assertFilePathAbsoluteFilesystem, assertWarning, hasProp, isNotNullish, } from '../../utils.js';
|
|
5
|
+
import path from 'node:path';
|
|
6
6
|
import { glob } from 'tinyglobby';
|
|
7
|
-
import { exec } from 'child_process';
|
|
8
|
-
import { promisify } from 'util';
|
|
7
|
+
import { exec } from 'node:child_process';
|
|
8
|
+
import { promisify } from 'node:util';
|
|
9
9
|
import { isTemporaryBuildFile } from './transpileAndExecuteFile.js';
|
|
10
10
|
import { getEnvVarObject } from '../getEnvVarObject.js';
|
|
11
11
|
import pc from '@brillout/picocolors';
|
|
@@ -69,7 +69,7 @@ async function gitLsFiles(userRootDir, ignorePatterns, ignoreMatchers) {
|
|
|
69
69
|
...ignorePatterns.map((pattern) => `--exclude="${pattern}"`),
|
|
70
70
|
// --others --exclude-standard => list untracked files (--others) while using .gitignore (--exclude-standard)
|
|
71
71
|
// --cached => list tracked files
|
|
72
|
-
'--others --exclude-standard --cached'
|
|
72
|
+
'--others --exclude-standard --cached',
|
|
73
73
|
].join(' ');
|
|
74
74
|
let filesAll;
|
|
75
75
|
let filesDeleted;
|
|
@@ -79,7 +79,7 @@ async function gitLsFiles(userRootDir, ignorePatterns, ignoreMatchers) {
|
|
|
79
79
|
// Main command
|
|
80
80
|
runCmd1(cmd, userRootDir),
|
|
81
81
|
// Get tracked but deleted files
|
|
82
|
-
runCmd1('git ls-files --deleted', userRootDir)
|
|
82
|
+
runCmd1('git ls-files --deleted', userRootDir),
|
|
83
83
|
]);
|
|
84
84
|
}
|
|
85
85
|
catch (err) {
|
|
@@ -119,7 +119,7 @@ async function tinyglobby(userRootDir, ignorePatterns) {
|
|
|
119
119
|
const options = {
|
|
120
120
|
ignore: ignorePatterns,
|
|
121
121
|
cwd: userRootDir,
|
|
122
|
-
dot: false
|
|
122
|
+
dot: false,
|
|
123
123
|
};
|
|
124
124
|
const files = await glob(pattern, options);
|
|
125
125
|
// Make build deterministic, in order to get a stable generated hash for dist/client/assets/entries/entry-client-routing.${hash}.js
|
|
@@ -145,7 +145,7 @@ async function isGitNotUsable(userRootDir) {
|
|
|
145
145
|
assert(stdout.startsWith(prefix));
|
|
146
146
|
const gitVersion = stdout.slice(prefix.length);
|
|
147
147
|
// - Works with Git 2.43.1 but also (most certainly) with earlier versions.
|
|
148
|
-
// - We didn't bother test which is the earliest
|
|
148
|
+
// - We didn't bother test which is the earliest version that works.
|
|
149
149
|
// - Git 2.32.0 doesn't seem to work: https://github.com/vikejs/vike/discussions/1549
|
|
150
150
|
// - Maybe it's because of StackBlitz: looking at the release notes, Git 2.32.0 should be working.
|
|
151
151
|
if (!isVersionOrAbove(gitVersion, '2.43.1'))
|
|
@@ -166,7 +166,7 @@ async function runCmd1(cmd, cwd) {
|
|
|
166
166
|
const { stdout } = await execA(cmd, {
|
|
167
167
|
cwd,
|
|
168
168
|
// https://github.com/vikejs/vike/issues/1982
|
|
169
|
-
maxBuffer: Infinity
|
|
169
|
+
maxBuffer: Infinity,
|
|
170
170
|
});
|
|
171
171
|
/* Not always true: https://github.com/vikejs/vike/issues/1440#issuecomment-1892831303
|
|
172
172
|
assert(res.stderr === '')
|
|
@@ -242,7 +242,7 @@ function getIgnore(userSettings) {
|
|
|
242
242
|
// We must pass the same settings than tinyglobby
|
|
243
243
|
// https://github.com/SuperchupuDev/tinyglobby/blob/fcfb08a36c3b4d48d5488c21000c95a956d9797c/src/index.ts#L191-L194
|
|
244
244
|
dot: false,
|
|
245
|
-
nocase: false
|
|
245
|
+
nocase: false,
|
|
246
246
|
}));
|
|
247
247
|
return { ignorePatterns, ignoreMatchers };
|
|
248
248
|
}
|
|
@@ -30,7 +30,16 @@ function getFilesystemRouteString(locationId) {
|
|
|
30
30
|
}
|
|
31
31
|
/** Filesystem Inheritance: get the apply root */
|
|
32
32
|
function getInheritanceRoot(locationId) {
|
|
33
|
-
return getLogicalPath(locationId, [
|
|
33
|
+
return getLogicalPath(locationId, [
|
|
34
|
+
'renderer',
|
|
35
|
+
// - Enable hooks defined by vike-{react,vue,solid} such as +onBeforeRenderClient to be defined at the root directory. In other words, avoid following error:
|
|
36
|
+
// ```bash
|
|
37
|
+
// [11:09:43.072][/test-preview.test.ts][npm run preview][stderr] Error: [vike][Wrong Usage] /+onBeforeRenderClient.ts sets the value of the config onBeforeRenderClient which is a custom config that is defined with https://vike.dev/meta at a path that doesn't apply to / — see https://vike.dev/config#inheritance
|
|
38
|
+
// ```
|
|
39
|
+
// - Not sure if it's a good idea? Could it make config inheritance confusing? Let's try for now and see how it goes.
|
|
40
|
+
// - TO-DO/eventually: update docs https://github.com/vikejs/vike/blob/5fcdc4d5094f1a4dcbefc0b481cdd30a205aef2d/docs/pages/filesystem-routing/%2BPage.mdx?plain=1#L98
|
|
41
|
+
'pages',
|
|
42
|
+
]);
|
|
34
43
|
}
|
|
35
44
|
/**
|
|
36
45
|
* getLogicalPath('/pages/some-page', ['pages']) => '/some-page'
|
|
@@ -109,14 +118,14 @@ function assertRedundantParentheses(dir, ignoredDirs, somePath) {
|
|
|
109
118
|
return;
|
|
110
119
|
}
|
|
111
120
|
const dirnameActual = dir;
|
|
112
|
-
const
|
|
121
|
+
const dirnameCorrect = dirWithoutParentheses;
|
|
113
122
|
const dirpathActual = somePath.slice(0, somePath.indexOf(dirnameActual) + dirnameActual.length);
|
|
114
|
-
const
|
|
123
|
+
const dirpathCorrect = dirpathActual.replaceAll(dirnameActual, dirnameCorrect);
|
|
115
124
|
const logDir = (d) => pc.bold(d + '/');
|
|
116
125
|
assertWarning(false, [
|
|
117
|
-
`The directories ${logDir(
|
|
126
|
+
`The directories ${logDir(dirnameCorrect)} are always ignored by Vike's Filesystem Routing`,
|
|
118
127
|
'(https://vike.dev/filesystem-routing):',
|
|
119
|
-
`rename directory ${logDir(dirpathActual)} to ${logDir(
|
|
128
|
+
`rename directory ${logDir(dirpathActual)} to ${logDir(dirpathCorrect)}`,
|
|
120
129
|
].join(' '), { onlyOnce: true });
|
|
121
130
|
}
|
|
122
131
|
function removeFilename(filePathAbsoluteUserRootDir) {
|
|
@@ -66,7 +66,7 @@ async function getPlusFilesAll(userRootDir, esbuildCache) {
|
|
|
66
66
|
filePath,
|
|
67
67
|
isConfigFile: false,
|
|
68
68
|
isNotLoaded: true,
|
|
69
|
-
configName
|
|
69
|
+
configName,
|
|
70
70
|
};
|
|
71
71
|
plusFilesAll[locationId] = plusFilesAll[locationId] ?? [];
|
|
72
72
|
plusFilesAll[locationId].push(plusFile);
|
|
@@ -74,7 +74,7 @@ async function getPlusFilesAll(userRootDir, esbuildCache) {
|
|
|
74
74
|
// - If `configDef` is `undefined` => we load the file +{configName}.js later.
|
|
75
75
|
// - We already need to load +meta.js here (to get the custom config definitions defined by the user)
|
|
76
76
|
await loadValueFile(plusFile, configDefinitionsBuiltIn, userRootDir, esbuildCache);
|
|
77
|
-
})
|
|
77
|
+
}),
|
|
78
78
|
]);
|
|
79
79
|
// Make lists element order deterministic
|
|
80
80
|
Object.entries(plusFilesAll).forEach(([_locationId, plusFiles]) => {
|
|
@@ -99,7 +99,7 @@ function getPlusFileFromConfigFile(configFile, isExtensionConfig, locationId, us
|
|
|
99
99
|
if (pointerImport) {
|
|
100
100
|
pointerImportsByConfigName[configName] = {
|
|
101
101
|
...pointerImport,
|
|
102
|
-
fileExportValueLoaded: false
|
|
102
|
+
fileExportValueLoaded: false,
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
});
|
|
@@ -110,7 +110,7 @@ function getPlusFileFromConfigFile(configFile, isExtensionConfig, locationId, us
|
|
|
110
110
|
pointerImportsByConfigName,
|
|
111
111
|
isConfigFile: true,
|
|
112
112
|
isExtensionConfig,
|
|
113
|
-
extendsFilePaths
|
|
113
|
+
extendsFilePaths,
|
|
114
114
|
};
|
|
115
115
|
return plusFile;
|
|
116
116
|
}
|
|
@@ -9,7 +9,7 @@ export { assertPointerImportPath };
|
|
|
9
9
|
// - Acorn plugin: https://github.com/acornjs/acorn/issues/983
|
|
10
10
|
// - Isn't stage 4 yet: https://github.com/tc39/proposal-import-attributes
|
|
11
11
|
// - Using a import path suffix such as `import { Layout } from './Layout?real` breaks TypeScript, and TypeScript isn't working on supporting query params: https://github.com/microsoft/TypeScript/issues/10988#issuecomment-867135453
|
|
12
|
-
// - Node.js >=21 supports import
|
|
12
|
+
// - Node.js >=21 supports import attributes: https://nodejs.org/api/esm.html#import-attributes
|
|
13
13
|
// - Esbuid supports
|
|
14
14
|
// - Blocker: https://github.com/evanw/esbuild/issues/3646
|
|
15
15
|
// - Ugly hack to make it work: https://github.com/brillout/esbuild-playground/tree/experiment/import-attribute
|
|
@@ -63,7 +63,7 @@ skipWarnings) {
|
|
|
63
63
|
const errMsg = [
|
|
64
64
|
`The following import in ${filePathToShowToUser2} has no effect:`,
|
|
65
65
|
quote,
|
|
66
|
-
'See https://vike.dev/config#pointer-imports'
|
|
66
|
+
'See https://vike.dev/config#pointer-imports',
|
|
67
67
|
].join('\n');
|
|
68
68
|
if (!skipWarnings) {
|
|
69
69
|
if (!isWarning) {
|
|
@@ -96,7 +96,7 @@ skipWarnings) {
|
|
|
96
96
|
spliceOperations.push({
|
|
97
97
|
start,
|
|
98
98
|
end,
|
|
99
|
-
replacement
|
|
99
|
+
replacement,
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
const codeMod = spliceMany(code, spliceOperations);
|
|
@@ -105,7 +105,7 @@ skipWarnings) {
|
|
|
105
105
|
function getImports(code) {
|
|
106
106
|
const { body } = parse(code, {
|
|
107
107
|
ecmaVersion: 'latest',
|
|
108
|
-
sourceType: 'module'
|
|
108
|
+
sourceType: 'module',
|
|
109
109
|
// https://github.com/acornjs/acorn/issues/1136
|
|
110
110
|
});
|
|
111
111
|
const imports = [];
|
|
@@ -118,7 +118,7 @@ function getImports(code) {
|
|
|
118
118
|
const import_ = 'import';
|
|
119
119
|
const SEP = ':';
|
|
120
120
|
const zeroWidthSpace = '\u200b';
|
|
121
|
-
function serializePointerImportData({ importPath, exportName, importStringWasGenerated }) {
|
|
121
|
+
function serializePointerImportData({ importPath, exportName, importStringWasGenerated, }) {
|
|
122
122
|
const tag = importStringWasGenerated ? zeroWidthSpace : '';
|
|
123
123
|
// `import:${importPath}:${importPath}`
|
|
124
124
|
return `${tag}${import_}${SEP}${importPath}${SEP}${exportName}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { resolvePointerImport };
|
|
2
2
|
export { resolvePointerImportData };
|
|
3
3
|
import pc from '@brillout/picocolors';
|
|
4
|
-
import { assert, assertPosixPath, assertUsage, isFilePathAbsolute, isImportPathRelative, isImportPathNpmPackageOrPathAlias, requireResolveOptional } from '../../utils.js';
|
|
4
|
+
import { assert, assertPosixPath, assertUsage, isFilePathAbsolute, isImportPathRelative, isImportPathNpmPackageOrPathAlias, requireResolveOptional, } from '../../utils.js';
|
|
5
5
|
import { assertPointerImportPath, parsePointerImportData } from './pointerImports.js';
|
|
6
6
|
import { getFilePathAbsoluteUserRootDir, getFilePathResolved, getFilePathUnresolved } from '../getFilePath.js';
|
|
7
7
|
function resolvePointerImport(configValue, importerFilePath, userRootDir, configName) {
|
|
@@ -16,7 +16,7 @@ function resolvePointerImport(configValue, importerFilePath, userRootDir, config
|
|
|
16
16
|
const fileExportPath = {
|
|
17
17
|
...filePath,
|
|
18
18
|
fileExportName: exportName,
|
|
19
|
-
fileExportPathToShowToUser
|
|
19
|
+
fileExportPathToShowToUser,
|
|
20
20
|
};
|
|
21
21
|
return { fileExportPath };
|
|
22
22
|
}
|
|
@@ -40,7 +40,7 @@ function resolvePointerImportData(pointerImportData, importerFilePath, userRootD
|
|
|
40
40
|
assertUsage(filePathAbsoluteUserRootDir, `The import path ${importPath} defined by ${importerFilePath.filePathToShowToUser} is ${errSuffix}`);
|
|
41
41
|
}
|
|
42
42
|
// Forbid node_modules/ because it's brittle: if node_modules/ lives outside of userRootDir then it crashes.
|
|
43
|
-
assertUsage(!filePathAbsoluteUserRootDir.includes('/node_modules/'), `The import path ${importPath} defined by ${importerFilePath.filePathToShowToUser} resolves to ${filePathAbsoluteFilesystem} inside of node_modules/ which is
|
|
43
|
+
assertUsage(!filePathAbsoluteUserRootDir.includes('/node_modules/'), `The import path ${importPath} defined by ${importerFilePath.filePathToShowToUser} resolves to ${filePathAbsoluteFilesystem} inside of node_modules/ which is forbidden: use an npm package import instead.`);
|
|
44
44
|
filePath = getFilePathResolved({ filePathAbsoluteUserRootDir, userRootDir });
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
@@ -50,13 +50,13 @@ function resolvePointerImportData(pointerImportData, importerFilePath, userRootD
|
|
|
50
50
|
filePath = getFilePathResolved({
|
|
51
51
|
userRootDir,
|
|
52
52
|
filePathAbsoluteFilesystem,
|
|
53
|
-
importPathAbsolute
|
|
53
|
+
importPathAbsolute,
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
else {
|
|
57
57
|
// We cannot resolve path aliases defined only in Vite
|
|
58
58
|
filePath = getFilePathUnresolved({
|
|
59
|
-
importPathAbsolute
|
|
59
|
+
importPathAbsolute,
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -69,7 +69,7 @@ function resolveImportPathWithNode(pointerImportData, importerFilePath, userRoot
|
|
|
69
69
|
const filePathAbsoluteFilesystem = requireResolveOptional({
|
|
70
70
|
importPath: pointerImportData.importPath,
|
|
71
71
|
importerFilePath: importerFilePathAbsolute,
|
|
72
|
-
userRootDir
|
|
72
|
+
userRootDir,
|
|
73
73
|
});
|
|
74
74
|
if (!filePathAbsoluteFilesystem) {
|
|
75
75
|
assert(!isImportPathRelative(pointerImportData.importPath));
|
|
@@ -2,12 +2,12 @@ export { transpileAndExecuteFile };
|
|
|
2
2
|
export { getConfigBuildErrorFormatted };
|
|
3
3
|
export { getConfigExecutionErrorIntroMsg };
|
|
4
4
|
export { isTemporaryBuildFile };
|
|
5
|
-
import { build, formatMessages, version } from 'esbuild';
|
|
6
|
-
import fs from 'fs';
|
|
7
|
-
import path from 'path';
|
|
5
|
+
import { build, formatMessages, version, } from 'esbuild';
|
|
6
|
+
import fs from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
8
8
|
import pc from '@brillout/picocolors';
|
|
9
9
|
import { import_ } from '@brillout/import';
|
|
10
|
-
import { assertPosixPath, getRandomId, assertIsNotProductionRuntime, assert, assertWarning, isObject, toPosixPath, assertUsage, isPlainScriptFile, createDebugger, assertFilePathAbsoluteFilesystem, assertIsImportPathNpmPackage, genPromise, isVitest, isImportPathNpmPackageOrPathAlias, isImportPathRelative, requireResolveOptionalDir } from '../../utils.js';
|
|
10
|
+
import { assertPosixPath, getRandomId, assertIsNotProductionRuntime, assert, assertWarning, isObject, toPosixPath, assertUsage, isPlainScriptFile, createDebugger, assertFilePathAbsoluteFilesystem, assertIsImportPathNpmPackage, genPromise, isVitest, isImportPathNpmPackageOrPathAlias, isImportPathRelative, requireResolveOptionalDir, } from '../../utils.js';
|
|
11
11
|
import { transformPointerImports } from './pointerImports.js';
|
|
12
12
|
import sourceMapSupport from 'source-map-support';
|
|
13
13
|
import { getFilePathAbsoluteUserRootDir } from '../getFilePath.js';
|
|
@@ -92,7 +92,7 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
|
|
|
92
92
|
treeShaking: false,
|
|
93
93
|
minify: false,
|
|
94
94
|
metafile: true,
|
|
95
|
-
bundle: true
|
|
95
|
+
bundle: true,
|
|
96
96
|
};
|
|
97
97
|
const pointerImports = {};
|
|
98
98
|
options.plugins = [
|
|
@@ -118,13 +118,13 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
|
|
|
118
118
|
if (debugEsbuildResolve.isActivated)
|
|
119
119
|
debugEsbuildResolve('resolved', resolved);
|
|
120
120
|
// Temporary workaround for https://github.com/evanw/esbuild/issues/3973
|
|
121
|
-
// -
|
|
121
|
+
// - Still required for esbuild@0.24.0 (November 2024).
|
|
122
122
|
// - Let's try to remove this workaround again later.
|
|
123
123
|
if (resolved.errors.length > 0) {
|
|
124
124
|
const resolvedWithNode = requireResolveOptionalDir({
|
|
125
125
|
importPath: path,
|
|
126
126
|
importerDir: toPosixPath(args.resolveDir),
|
|
127
|
-
userRootDir
|
|
127
|
+
userRootDir,
|
|
128
128
|
});
|
|
129
129
|
if (debugEsbuildResolve.isActivated)
|
|
130
130
|
debugEsbuildResolve('resolvedWithNode', resolvedWithNode);
|
|
@@ -199,7 +199,7 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
|
|
|
199
199
|
// - Path alias
|
|
200
200
|
const filePathAbsoluteUserRootDir = getFilePathAbsoluteUserRootDir({
|
|
201
201
|
filePathAbsoluteFilesystem: importPathResolved,
|
|
202
|
-
userRootDir
|
|
202
|
+
userRootDir,
|
|
203
203
|
});
|
|
204
204
|
if (filePathAbsoluteUserRootDir && !isNpmPkgImport) {
|
|
205
205
|
// `importPathOriginal` is most likely a path alias.
|
|
@@ -227,14 +227,14 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
|
|
|
227
227
|
pointerImports[importPathTranspiled] = isPointerImport;
|
|
228
228
|
return { external: true, path: importPathTranspiled };
|
|
229
229
|
});
|
|
230
|
-
}
|
|
230
|
+
},
|
|
231
231
|
},
|
|
232
232
|
// Track dependencies
|
|
233
233
|
{
|
|
234
234
|
name: 'vike:dependency-tracker',
|
|
235
235
|
setup(b) {
|
|
236
236
|
b.onLoad({ filter: /./ }, (args) => {
|
|
237
|
-
// We collect the dependency `args.path` in case the
|
|
237
|
+
// We collect the dependency `args.path` in case the build fails (upon build error => error is thrown => no metafile)
|
|
238
238
|
let { path } = args;
|
|
239
239
|
path = toPosixPath(path);
|
|
240
240
|
esbuildCache.vikeConfigDependencies.add(path);
|
|
@@ -249,8 +249,8 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
|
|
|
249
249
|
* - But implementing a fix is complex and isn't worth it.
|
|
250
250
|
b.onResolve(...)
|
|
251
251
|
*/
|
|
252
|
-
}
|
|
253
|
-
}
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
254
|
];
|
|
255
255
|
let result;
|
|
256
256
|
try {
|
|
@@ -319,7 +319,7 @@ async function formatBuildErr(err, filePath) {
|
|
|
319
319
|
assert(isObject(err) && err.errors);
|
|
320
320
|
const msgEsbuild = (await formatMessages(err.errors, {
|
|
321
321
|
kind: 'error',
|
|
322
|
-
color: true
|
|
322
|
+
color: true,
|
|
323
323
|
}))
|
|
324
324
|
.map((m) => m.trim())
|
|
325
325
|
.join('\n');
|
|
@@ -386,7 +386,7 @@ function getErrIntroMsg(operation, filePath) {
|
|
|
386
386
|
// prettier ignore
|
|
387
387
|
pc.red(`Failed to ${operation}`),
|
|
388
388
|
pc.bold(pc.red(filePathToShowToUserResolved)),
|
|
389
|
-
pc.red(`because:`)
|
|
389
|
+
pc.red(`because:`),
|
|
390
390
|
].join(' ');
|
|
391
391
|
return msg;
|
|
392
392
|
}
|
|
@@ -7,7 +7,7 @@ export { isV1Design };
|
|
|
7
7
|
export { getConfVal };
|
|
8
8
|
export { getConfigDefinitionOptional };
|
|
9
9
|
export { getVikeConfigFromCliOrEnv };
|
|
10
|
-
export {
|
|
10
|
+
export { isOverridden };
|
|
11
11
|
export type { VikeConfigInternal };
|
|
12
12
|
export { getVikeConfig };
|
|
13
13
|
export type { VikeConfig };
|
|
@@ -65,4 +65,4 @@ declare function getConfVal(plusFile: PlusFile, configName: string): null | {
|
|
|
65
65
|
} | {
|
|
66
66
|
valueIsLoaded: false;
|
|
67
67
|
};
|
|
68
|
-
declare function
|
|
68
|
+
declare function isOverridden(source: ConfigValueSource, configName: string, pageConfig: PageConfigBuildTime | PageConfigGlobalBuildTime): boolean;
|