vike 0.0.0-alpha.0 → 0.4.142-commit-6eb0dd3
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/RenderErrorPage.js +2 -0
- package/__internal/setup.js +2 -0
- package/__internal.js +2 -0
- package/abort.js +2 -0
- package/cli.js +2 -0
- package/client/router.js +2 -0
- package/client.js +2 -0
- package/dist/cjs/__internal/index.js +31 -0
- package/dist/cjs/node/cli/bin.js +44 -0
- package/dist/cjs/node/cli/index.js +11 -0
- package/dist/cjs/node/cli/onLoad.js +8 -0
- package/dist/cjs/node/cli/utils.js +21 -0
- package/dist/cjs/node/client/router.js +15 -0
- package/dist/cjs/node/createPageRenderer.js +133 -0
- package/dist/cjs/node/importBuild.js +3 -0
- package/dist/cjs/node/plugin/index.js +70 -0
- package/dist/cjs/node/plugin/onLoad.js +13 -0
- package/dist/cjs/node/plugin/plugins/autoFullBuild.js +104 -0
- package/dist/cjs/node/plugin/plugins/baseUrls.js +43 -0
- package/dist/cjs/node/plugin/plugins/buildConfig.js +252 -0
- package/dist/cjs/node/plugin/plugins/commonConfig/assertResolveAlias.js +73 -0
- package/dist/cjs/node/plugin/plugins/commonConfig.js +80 -0
- package/dist/cjs/node/plugin/plugins/config/assertVikeConfig.js +74 -0
- package/dist/cjs/node/plugin/plugins/config/findConfigVikeFromStemPackages.js +27 -0
- package/dist/cjs/node/plugin/plugins/config/index.js +77 -0
- package/dist/cjs/node/plugin/plugins/config/pickFirst.js +7 -0
- package/dist/cjs/node/plugin/plugins/config/resolveBase.js +48 -0
- package/dist/cjs/node/plugin/plugins/config/resolveExtensions.js +107 -0
- package/dist/cjs/node/plugin/plugins/config/stemUtils.js +85 -0
- package/dist/cjs/node/plugin/plugins/devConfig/determineFsAllowList.js +42 -0
- package/dist/cjs/node/plugin/plugins/devConfig/determineOptimizeDeps.js +125 -0
- package/dist/cjs/node/plugin/plugins/devConfig/index.js +87 -0
- package/dist/cjs/node/plugin/plugins/distFileNames.js +169 -0
- package/dist/cjs/node/plugin/plugins/envVars.js +84 -0
- package/dist/cjs/node/plugin/plugins/extensionsAssets.js +101 -0
- package/dist/cjs/node/plugin/plugins/extractAssetsPlugin.js +234 -0
- package/dist/cjs/node/plugin/plugins/extractExportNamesPlugin.js +95 -0
- package/dist/cjs/node/plugin/plugins/importBuild/index.js +54 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/generateEagerImport.js +21 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +242 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/index.js +140 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/debug.js +5 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getFilePathToShowToUser.js +10 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +100 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/filesystemRouting.js +176 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +1120 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +79 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigs.js +160 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/helpers.js +34 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/isConfigEnvMatch.js +13 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/replaceImportStatements.js +154 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/transpileAndExecuteFile.js +283 -0
- package/dist/cjs/node/plugin/plugins/manifest.js +59 -0
- package/dist/cjs/node/plugin/plugins/packageJsonFile.js +45 -0
- package/dist/cjs/node/plugin/plugins/previewConfig.js +61 -0
- package/dist/cjs/node/plugin/plugins/removeRequireHookPlugin.js +18 -0
- package/dist/cjs/node/plugin/plugins/setGlobalContext.js +31 -0
- package/dist/cjs/node/plugin/plugins/suppressRollupWarning.js +51 -0
- package/dist/cjs/node/plugin/shared/addSsrMiddleware.js +41 -0
- package/dist/cjs/node/plugin/shared/findPageFiles.js +24 -0
- package/dist/cjs/node/plugin/shared/getConfigValueSource.js +25 -0
- package/dist/cjs/node/plugin/shared/getHttpRequestAsyncStore.js +122 -0
- package/dist/cjs/node/plugin/shared/isAsset.js +41 -0
- package/dist/cjs/node/plugin/shared/isErrorDebug.js +8 -0
- package/dist/cjs/node/plugin/shared/isViteCliCall.js +84 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelReact.js +15 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelSolid.js +15 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errEsbuild.js +38 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx.js +26 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errPostcss.js +30 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwc.js +19 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwcBig.js +19 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueCss.js +29 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueHtml.js +13 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueJavascript.js +15 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet.js +168 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd/log.js +114 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd.js +224 -0
- package/dist/cjs/node/plugin/shared/loggerVite/removeSuperfluousViteLog.js +25 -0
- package/dist/cjs/node/plugin/shared/loggerVite.js +61 -0
- package/dist/cjs/node/plugin/shared/parseEsModule.js +34 -0
- package/dist/cjs/node/plugin/shared/removeSourceMap.js +12 -0
- package/dist/cjs/node/plugin/shared/rollupIsEsm.js +16 -0
- package/dist/cjs/node/plugin/utils.js +41 -0
- package/dist/cjs/node/prerender/index.js +5 -0
- package/dist/cjs/node/prerender/runPrerender.js +707 -0
- package/dist/cjs/node/prerender/utils.js +31 -0
- package/dist/cjs/node/runtime/globalContext/loadImportBuild.js +30 -0
- package/dist/cjs/node/runtime/globalContext.js +163 -0
- package/dist/cjs/node/runtime/html/injectAssets/getHtmlTags.js +161 -0
- package/dist/cjs/node/runtime/html/injectAssets/getViteDevScripts.js +28 -0
- package/dist/cjs/node/runtime/html/injectAssets/inferHtmlTags.js +52 -0
- package/dist/cjs/node/runtime/html/injectAssets/injectAssets__public.js +32 -0
- package/dist/cjs/node/runtime/html/injectAssets/injectHtmlTags.js +157 -0
- package/dist/cjs/node/runtime/html/injectAssets/mergeScriptTags.js +71 -0
- package/dist/cjs/node/runtime/html/injectAssets/sanitizeJson.js +9 -0
- package/dist/cjs/node/runtime/html/injectAssets.js +76 -0
- package/dist/cjs/node/runtime/html/renderHtml.js +237 -0
- package/dist/cjs/node/runtime/html/serializePageContextClientSide.js +117 -0
- package/dist/cjs/node/runtime/html/stream/react-streaming.js +36 -0
- package/dist/cjs/node/runtime/html/stream.js +751 -0
- package/dist/cjs/node/runtime/index-common.js +23 -0
- package/dist/cjs/node/runtime/index-deprecated.js +61 -0
- package/dist/cjs/node/runtime/index.js +19 -0
- package/dist/cjs/node/runtime/onLoad.js +12 -0
- package/dist/cjs/node/runtime/page-files/setup.js +23 -0
- package/dist/cjs/node/runtime/renderPage/analyzePage.js +69 -0
- package/dist/cjs/node/runtime/renderPage/assertArguments.js +43 -0
- package/dist/cjs/node/runtime/renderPage/createHttpResponseObject/assertNoInfiniteHttpRedirect.js +44 -0
- package/dist/cjs/node/runtime/renderPage/createHttpResponseObject.js +68 -0
- package/dist/cjs/node/runtime/renderPage/debugPageFiles.js +53 -0
- package/dist/cjs/node/runtime/renderPage/executeOnBeforeRenderHook.js +23 -0
- package/dist/cjs/node/runtime/renderPage/executeOnRenderHtmlHook.js +139 -0
- package/dist/cjs/node/runtime/renderPage/getEarlyHints.js +46 -0
- package/dist/cjs/node/runtime/renderPage/getHttpResponseBody.js +131 -0
- package/dist/cjs/node/runtime/renderPage/getPageAssets/assertClientEntryId.js +25 -0
- package/dist/cjs/node/runtime/renderPage/getPageAssets/getManifestEntry.js +128 -0
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsDev.js +75 -0
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +61 -0
- package/dist/cjs/node/runtime/renderPage/getPageAssets/sortPageAssetsForEarlyHintsHeader.js +33 -0
- package/dist/cjs/node/runtime/renderPage/getPageAssets.js +133 -0
- package/dist/cjs/node/runtime/renderPage/handleErrorWithoutErrorPage.js +43 -0
- package/dist/cjs/node/runtime/renderPage/handlePageContextRequestUrl.js +33 -0
- package/dist/cjs/node/runtime/renderPage/inferMediaType.js +41 -0
- package/dist/cjs/node/runtime/renderPage/isConfigInvalid.js +8 -0
- package/dist/cjs/node/runtime/renderPage/isNewError.js +23 -0
- package/dist/cjs/node/runtime/renderPage/loadPageFilesServerSide.js +100 -0
- package/dist/cjs/node/runtime/renderPage/log404/index.js +144 -0
- package/dist/cjs/node/runtime/renderPage/loggerProd.js +23 -0
- package/dist/cjs/node/runtime/renderPage/loggerRuntime.js +17 -0
- package/dist/cjs/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.js +19 -0
- package/dist/cjs/node/runtime/renderPage/renderPageAlreadyRouted.js +186 -0
- package/dist/cjs/node/runtime/renderPage.js +405 -0
- package/dist/cjs/node/runtime/utils.js +71 -0
- package/dist/cjs/node/shared/ViteManifest.js +2 -0
- package/dist/cjs/node/shared/assertPluginManifest.js +24 -0
- package/dist/cjs/node/shared/assertRuntimeManifest.js +19 -0
- package/dist/cjs/node/shared/extractAssetsQuery.js +29 -0
- package/dist/cjs/node/shared/getClientEntryFilePath.js +18 -0
- package/dist/cjs/node/shared/getConfigVike.js +8 -0
- package/dist/cjs/node/shared/utils.js +33 -0
- package/dist/cjs/node/shared/virtual-files/virtualFileImportUserCode.js +27 -0
- package/dist/cjs/node/shared/virtual-files/virtualFilePageConfigValuesAll.js +39 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/shared/ConfigVike.js +2 -0
- package/dist/cjs/shared/RenderErrorPage.js +6 -0
- package/dist/cjs/shared/VikeNamespace.js +2 -0
- package/dist/cjs/shared/abort.js +16 -0
- package/dist/cjs/shared/addIs404ToPageProps.js +26 -0
- package/dist/cjs/shared/addUrlComputedProps.js +111 -0
- package/dist/cjs/shared/assertHookReturnedObject.js +22 -0
- package/dist/cjs/shared/assertOnBeforeRenderHookReturn.js +22 -0
- package/dist/cjs/shared/assertPageContextProvidedByUser.js +21 -0
- package/dist/cjs/shared/assertPageFilePath.js +12 -0
- package/dist/cjs/shared/determinePageIdOld.js +12 -0
- package/dist/cjs/shared/error-page.js +41 -0
- package/dist/cjs/shared/getPageContextRequestUrl.js +16 -0
- package/dist/cjs/shared/getPageFiles/analyzeClientSide.js +22 -0
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/ClientDependency.js +2 -0
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/analyzeExports.js +51 -0
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/determineClientEntry.js +30 -0
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/getExportNames.js +16 -0
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide.js +61 -0
- package/dist/cjs/shared/getPageFiles/analyzePageServerSide.js +23 -0
- package/dist/cjs/shared/getPageFiles/assertExports.js +24 -0
- package/dist/cjs/shared/getPageFiles/assertPageConfigs.js +19 -0
- package/dist/cjs/shared/getPageFiles/fileTypes.js +53 -0
- package/dist/cjs/shared/getPageFiles/getAllPageIdFiles.js +106 -0
- package/dist/cjs/shared/getPageFiles/getExports.js +146 -0
- package/dist/cjs/shared/getPageFiles/getPageFileObject.js +62 -0
- package/dist/cjs/shared/getPageFiles/parseGlobResults.js +127 -0
- package/dist/cjs/shared/getPageFiles/setPageFiles.js +47 -0
- package/dist/cjs/shared/getPageFiles.js +18 -0
- package/dist/cjs/shared/hooks/executeHook.js +74 -0
- package/dist/cjs/shared/hooks/getHook.js +29 -0
- package/dist/cjs/shared/notSerializable.js +5 -0
- package/dist/cjs/shared/page-configs/Config/PageContextConfig.js +2 -0
- package/dist/cjs/shared/page-configs/Config/helpers.js +2 -0
- package/dist/cjs/shared/page-configs/Config.js +2 -0
- package/dist/cjs/shared/page-configs/PageConfig.js +2 -0
- package/dist/cjs/shared/page-configs/findPageConfig.js +11 -0
- package/dist/cjs/shared/page-configs/getExportPath.js +31 -0
- package/dist/cjs/shared/page-configs/loadPageCode.js +63 -0
- package/dist/cjs/shared/page-configs/utils.js +80 -0
- package/dist/cjs/shared/route/abort.js +161 -0
- package/dist/cjs/shared/route/debug.js +14 -0
- package/dist/cjs/shared/route/deduceRouteStringFromFilesystemPath.js +53 -0
- package/dist/cjs/shared/route/executeGuardHook.js +40 -0
- package/dist/cjs/shared/route/executeOnBeforeRouteHook.js +56 -0
- package/dist/cjs/shared/route/index.js +119 -0
- package/dist/cjs/shared/route/loadPageRoutes.js +197 -0
- package/dist/cjs/shared/route/resolvePrecedence.js +72 -0
- package/dist/cjs/shared/route/resolveRedirects.js +55 -0
- package/dist/cjs/shared/route/resolveRoute.js +21 -0
- package/dist/cjs/shared/route/resolveRouteFunction.js +70 -0
- package/dist/cjs/shared/route/resolveRouteString.js +101 -0
- package/dist/cjs/shared/route/routing.js +9 -0
- package/dist/cjs/shared/route/utils.js +43 -0
- package/dist/cjs/shared/sortPageContext.js +17 -0
- package/dist/cjs/shared/types.js +2 -0
- package/dist/cjs/shared/utils.js +43 -0
- package/dist/cjs/types/index-dreprecated.js +3 -0
- package/dist/cjs/types/index.js +2 -0
- package/dist/cjs/utils/PromiseType.js +2 -0
- package/dist/cjs/utils/arrayIncludes.js +7 -0
- package/dist/cjs/utils/assert.js +194 -0
- package/dist/cjs/utils/assertDefaultExport.js +53 -0
- package/dist/cjs/utils/assertIsBrowser.js +9 -0
- package/dist/cjs/utils/assertIsNotBrowser.js +10 -0
- package/dist/cjs/utils/assertIsNotProductionRuntime.js +44 -0
- package/dist/cjs/utils/assertNodeVersion.js +14 -0
- package/dist/cjs/utils/assertPathIsFilesystemAbsolute.js +20 -0
- package/dist/cjs/utils/assertRoutingType.js +30 -0
- package/dist/cjs/utils/assertSingleInstance.js +97 -0
- package/dist/cjs/utils/autoRetry.js +23 -0
- package/dist/cjs/utils/capitalizeFirstLetter.js +10 -0
- package/dist/cjs/utils/cast.js +7 -0
- package/dist/cjs/utils/checkType.js +7 -0
- package/dist/cjs/utils/compareString.js +11 -0
- package/dist/cjs/utils/createErrorWithCleanStackTrace.js +46 -0
- package/dist/cjs/utils/debug.js +109 -0
- package/dist/cjs/utils/debugGlob.js +6 -0
- package/dist/cjs/utils/deepEqual.js +11 -0
- package/dist/cjs/utils/dynamicImport.js +8 -0
- package/dist/cjs/utils/escapeRegex.js +8 -0
- package/dist/cjs/utils/filesystemPathHandling.js +19 -0
- package/dist/cjs/utils/findUserPackageJsonPath.js +24 -0
- package/dist/cjs/utils/freezePartial.js +36 -0
- package/dist/cjs/utils/getCurrentUrl.js +19 -0
- package/dist/cjs/utils/getDependencyPackageJson.js +91 -0
- package/dist/cjs/utils/getFileExtension.js +17 -0
- package/dist/cjs/utils/getFilePathAbsolute.js +66 -0
- package/dist/cjs/utils/getGlobalObject.js +11 -0
- package/dist/cjs/utils/getMostSimilar.js +69 -0
- package/dist/cjs/utils/getOutDirs.js +121 -0
- package/dist/cjs/utils/getPropAccessNotation.js +10 -0
- package/dist/cjs/utils/getRandomId.js +15 -0
- package/dist/cjs/utils/getTerminWidth.js +8 -0
- package/dist/cjs/utils/getValuePrintable.js +11 -0
- package/dist/cjs/utils/hasProp.js +48 -0
- package/dist/cjs/utils/hasPropertyGetter.js +8 -0
- package/dist/cjs/utils/humanizeTime.js +25 -0
- package/dist/cjs/utils/isBrowser.js +9 -0
- package/dist/cjs/utils/isCallable.js +7 -0
- package/dist/cjs/utils/isDev.js +32 -0
- package/dist/cjs/utils/isEquivalentError.js +18 -0
- package/dist/cjs/utils/isHtml.js +10 -0
- package/dist/cjs/utils/isNodeJS.js +17 -0
- package/dist/cjs/utils/isNotNullish.js +5 -0
- package/dist/cjs/utils/isNpmPackage.js +96 -0
- package/dist/cjs/utils/isObject.js +7 -0
- package/dist/cjs/utils/isObjectWithKeys.js +16 -0
- package/dist/cjs/utils/isPlainObject.js +18 -0
- package/dist/cjs/utils/isPromise.js +8 -0
- package/dist/cjs/utils/isReact.js +24 -0
- package/dist/cjs/utils/isScriptFile.js +53 -0
- package/dist/cjs/utils/isStemPackageName.js +14 -0
- package/dist/cjs/utils/isStringRecord.js +7 -0
- package/dist/cjs/utils/isVitest.js +7 -0
- package/dist/cjs/utils/joinEnglish.js +14 -0
- package/dist/cjs/utils/mergeCumulativeValues.js +21 -0
- package/dist/cjs/utils/nodeEnv.js +16 -0
- package/dist/cjs/utils/objectAssign.js +10 -0
- package/dist/cjs/utils/objectEntries.js +8 -0
- package/dist/cjs/utils/objectKeys.js +10 -0
- package/dist/cjs/utils/pLimit.js +135 -0
- package/dist/cjs/utils/parseUrl-extras.js +96 -0
- package/dist/cjs/utils/parseUrl.js +221 -0
- package/dist/cjs/utils/path-shim.js +15 -0
- package/dist/cjs/utils/projectInfo.js +14 -0
- package/dist/cjs/utils/removeEmptyLines.js +10 -0
- package/dist/cjs/utils/removeFileExtention.js +7 -0
- package/dist/cjs/utils/resolve.js +60 -0
- package/dist/cjs/utils/serverSideRouteTo.js +7 -0
- package/dist/cjs/utils/sleep.js +7 -0
- package/dist/cjs/utils/slice.js +36 -0
- package/dist/cjs/utils/sorter.js +60 -0
- package/dist/cjs/utils/stringifyStringArray.js +7 -0
- package/dist/cjs/utils/stripAnsi.js +22 -0
- package/dist/cjs/utils/styleFileRE.js +5 -0
- package/dist/cjs/utils/throttle.js +16 -0
- package/dist/cjs/utils/trackLogs.js +31 -0
- package/dist/cjs/utils/trimWithAnsi.js +41 -0
- package/dist/cjs/utils/truncateString.js +19 -0
- package/dist/cjs/utils/unique.js +7 -0
- package/dist/cjs/utils/urlToFile.js +36 -0
- package/dist/cjs/utils/virtual-files.js +33 -0
- package/dist/cjs/utils/viteIsSSR.js +23 -0
- package/dist/cjs/utils/warnIfErrorIsNotObject.js +24 -0
- package/dist/esm/__internal/index.d.ts +17 -0
- package/dist/esm/__internal/index.js +27 -0
- package/dist/esm/client/client-routing-runtime/createPageContext.d.ts +18 -0
- package/dist/esm/client/client-routing-runtime/createPageContext.js +35 -0
- package/dist/esm/client/client-routing-runtime/entry.d.ts +1 -0
- package/dist/esm/client/client-routing-runtime/entry.js +9 -0
- package/dist/esm/client/client-routing-runtime/getBaseServer.d.ts +1 -0
- package/dist/esm/client/client-routing-runtime/getBaseServer.js +11 -0
- package/dist/esm/client/client-routing-runtime/getPageContext/removeBuiltInOverrides.d.ts +7 -0
- package/dist/esm/client/client-routing-runtime/getPageContext/removeBuiltInOverrides.js +22 -0
- package/dist/esm/client/client-routing-runtime/getPageContext.d.ts +29 -0
- package/dist/esm/client/client-routing-runtime/getPageContext.js +240 -0
- package/dist/esm/client/client-routing-runtime/getPageId.d.ts +10 -0
- package/dist/esm/client/client-routing-runtime/getPageId.js +17 -0
- package/dist/esm/client/client-routing-runtime/history.d.ts +13 -0
- package/dist/esm/client/client-routing-runtime/history.js +71 -0
- package/dist/esm/client/client-routing-runtime/index.d.ts +18 -0
- package/dist/esm/client/client-routing-runtime/index.js +7 -0
- package/dist/esm/client/client-routing-runtime/isExternalLink.d.ts +2 -0
- package/dist/esm/client/client-routing-runtime/isExternalLink.js +4 -0
- package/dist/esm/client/client-routing-runtime/navigate.d.ts +17 -0
- package/dist/esm/client/client-routing-runtime/navigate.js +34 -0
- package/dist/esm/client/client-routing-runtime/navigationState.d.ts +5 -0
- package/dist/esm/client/client-routing-runtime/navigationState.js +14 -0
- package/dist/esm/client/client-routing-runtime/onLoad.d.ts +2 -0
- package/dist/esm/client/client-routing-runtime/onLoad.js +8 -0
- package/dist/esm/client/client-routing-runtime/pageFiles.d.ts +1 -0
- package/dist/esm/client/client-routing-runtime/pageFiles.js +4 -0
- package/dist/esm/client/client-routing-runtime/prefetch/alreadyPrefetched.d.ts +4 -0
- package/dist/esm/client/client-routing-runtime/prefetch/alreadyPrefetched.js +16 -0
- package/dist/esm/client/client-routing-runtime/prefetch/getPrefetchSettings.d.ts +11 -0
- package/dist/esm/client/client-routing-runtime/prefetch/getPrefetchSettings.js +82 -0
- package/dist/esm/client/client-routing-runtime/prefetch.d.ts +15 -0
- package/dist/esm/client/client-routing-runtime/prefetch.js +89 -0
- package/dist/esm/client/client-routing-runtime/skipLink/isClientSideRoutable.d.ts +2 -0
- package/dist/esm/client/client-routing-runtime/skipLink/isClientSideRoutable.js +15 -0
- package/dist/esm/client/client-routing-runtime/skipLink.d.ts +3 -0
- package/dist/esm/client/client-routing-runtime/skipLink.js +61 -0
- package/dist/esm/client/client-routing-runtime/useClientRouter.d.ts +6 -0
- package/dist/esm/client/client-routing-runtime/useClientRouter.js +493 -0
- package/dist/esm/client/client-routing-runtime/utils.d.ts +22 -0
- package/dist/esm/client/client-routing-runtime/utils.js +28 -0
- package/dist/esm/client/node.d.ts +1 -0
- package/dist/esm/client/node.js +9 -0
- package/dist/esm/client/server-routing-runtime/entry.d.ts +1 -0
- package/dist/esm/client/server-routing-runtime/entry.js +17 -0
- package/dist/esm/client/server-routing-runtime/getPageContext.d.ts +14 -0
- package/dist/esm/client/server-routing-runtime/getPageContext.js +36 -0
- package/dist/esm/client/server-routing-runtime/index.d.ts +16 -0
- package/dist/esm/client/server-routing-runtime/index.js +2 -0
- package/dist/esm/client/server-routing-runtime/onLoad.d.ts +2 -0
- package/dist/esm/client/server-routing-runtime/onLoad.js +5 -0
- package/dist/esm/client/server-routing-runtime/pageFiles.d.ts +1 -0
- package/dist/esm/client/server-routing-runtime/pageFiles.js +4 -0
- package/dist/esm/client/server-routing-runtime/utils.d.ts +14 -0
- package/dist/esm/client/server-routing-runtime/utils.js +18 -0
- package/dist/esm/client/shared/executeOnRenderClientHook.d.ts +11 -0
- package/dist/esm/client/shared/executeOnRenderClientHook.js +63 -0
- package/dist/esm/client/shared/getPageContextProxyForUser.d.ts +11 -0
- package/dist/esm/client/shared/getPageContextProxyForUser.js +66 -0
- package/dist/esm/client/shared/getPageContextSerializedInHtml.d.ts +5 -0
- package/dist/esm/client/shared/getPageContextSerializedInHtml.js +16 -0
- package/dist/esm/client/shared/loadPageFilesClientSide.d.ts +8 -0
- package/dist/esm/client/shared/loadPageFilesClientSide.js +64 -0
- package/dist/esm/client/shared/preparePageContextForUserConsumptionClientSide.d.ts +12 -0
- package/dist/esm/client/shared/preparePageContextForUserConsumptionClientSide.js +53 -0
- package/dist/esm/node/cli/bin.d.ts +1 -0
- package/dist/esm/node/cli/bin.js +42 -0
- package/dist/esm/node/cli/index.d.ts +2 -0
- package/dist/esm/node/cli/index.js +7 -0
- package/dist/esm/node/cli/onLoad.d.ts +2 -0
- package/dist/esm/node/cli/onLoad.js +5 -0
- package/dist/esm/node/cli/utils.d.ts +2 -0
- package/dist/esm/node/cli/utils.js +5 -0
- package/dist/esm/node/client/router.d.ts +4 -0
- package/dist/esm/node/client/router.js +12 -0
- package/dist/esm/node/createPageRenderer.d.ts +13 -0
- package/dist/esm/node/createPageRenderer.js +131 -0
- package/dist/esm/node/importBuild.d.ts +1 -0
- package/dist/esm/node/importBuild.js +3 -0
- package/dist/esm/node/plugin/index.d.ts +6 -0
- package/dist/esm/node/plugin/index.js +64 -0
- package/dist/esm/node/plugin/onLoad.d.ts +2 -0
- package/dist/esm/node/plugin/onLoad.js +10 -0
- package/dist/esm/node/plugin/plugins/autoFullBuild.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/autoFullBuild.js +98 -0
- package/dist/esm/node/plugin/plugins/baseUrls.d.ts +4 -0
- package/dist/esm/node/plugin/plugins/baseUrls.js +40 -0
- package/dist/esm/node/plugin/plugins/buildConfig.d.ts +12 -0
- package/dist/esm/node/plugin/plugins/buildConfig.js +246 -0
- package/dist/esm/node/plugin/plugins/commonConfig/assertResolveAlias.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/commonConfig/assertResolveAlias.js +67 -0
- package/dist/esm/node/plugin/plugins/commonConfig.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/commonConfig.js +74 -0
- package/dist/esm/node/plugin/plugins/config/assertVikeConfig.d.ts +7 -0
- package/dist/esm/node/plugin/plugins/config/assertVikeConfig.js +71 -0
- package/dist/esm/node/plugin/plugins/config/findConfigVikeFromStemPackages.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/config/findConfigVikeFromStemPackages.js +24 -0
- package/dist/esm/node/plugin/plugins/config/index.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/config/index.js +71 -0
- package/dist/esm/node/plugin/plugins/config/pickFirst.d.ts +1 -0
- package/dist/esm/node/plugin/plugins/config/pickFirst.js +3 -0
- package/dist/esm/node/plugin/plugins/config/resolveBase.d.ts +10 -0
- package/dist/esm/node/plugin/plugins/config/resolveBase.js +42 -0
- package/dist/esm/node/plugin/plugins/config/resolveExtensions.d.ts +4 -0
- package/dist/esm/node/plugin/plugins/config/resolveExtensions.js +101 -0
- package/dist/esm/node/plugin/plugins/config/stemUtils.d.ts +8 -0
- package/dist/esm/node/plugin/plugins/config/stemUtils.js +79 -0
- package/dist/esm/node/plugin/plugins/devConfig/determineFsAllowList.d.ts +4 -0
- package/dist/esm/node/plugin/plugins/devConfig/determineFsAllowList.js +36 -0
- package/dist/esm/node/plugin/plugins/devConfig/determineOptimizeDeps.d.ts +4 -0
- package/dist/esm/node/plugin/plugins/devConfig/determineOptimizeDeps.js +122 -0
- package/dist/esm/node/plugin/plugins/devConfig/index.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/devConfig/index.js +84 -0
- package/dist/esm/node/plugin/plugins/distFileNames.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/distFileNames.js +163 -0
- package/dist/esm/node/plugin/plugins/envVars.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/envVars.js +81 -0
- package/dist/esm/node/plugin/plugins/extensionsAssets.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/extensionsAssets.js +95 -0
- package/dist/esm/node/plugin/plugins/extractAssetsPlugin.d.ts +5 -0
- package/dist/esm/node/plugin/plugins/extractAssetsPlugin.js +232 -0
- package/dist/esm/node/plugin/plugins/extractExportNamesPlugin.d.ts +7 -0
- package/dist/esm/node/plugin/plugins/extractExportNamesPlugin.js +92 -0
- package/dist/esm/node/plugin/plugins/importBuild/index.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/importBuild/index.js +48 -0
- package/dist/esm/node/plugin/plugins/importUserCode/generateEagerImport.d.ts +5 -0
- package/dist/esm/node/plugin/plugins/importUserCode/generateEagerImport.js +18 -0
- package/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.d.ts +6 -0
- package/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +236 -0
- package/dist/esm/node/plugin/plugins/importUserCode/index.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/importUserCode/index.js +134 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/debug.d.ts +8 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/debug.js +2 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getFilePathToShowToUser.d.ts +7 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getFilePathToShowToUser.js +7 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.d.ts +53 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +97 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/filesystemRouting.d.ts +31 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/filesystemRouting.js +174 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.d.ts +15 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +1114 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +73 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigs.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigs.js +154 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/helpers.d.ts +5 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/helpers.js +31 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/isConfigEnvMatch.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/isConfigEnvMatch.js +10 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/replaceImportStatements.d.ts +31 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/replaceImportStatements.js +148 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/transpileAndExecuteFile.d.ts +12 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/transpileAndExecuteFile.js +277 -0
- package/dist/esm/node/plugin/plugins/manifest.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/manifest.js +53 -0
- package/dist/esm/node/plugin/plugins/packageJsonFile.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/packageJsonFile.js +42 -0
- package/dist/esm/node/plugin/plugins/previewConfig.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/previewConfig.js +55 -0
- package/dist/esm/node/plugin/plugins/removeRequireHookPlugin.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/removeRequireHookPlugin.js +15 -0
- package/dist/esm/node/plugin/plugins/setGlobalContext.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/setGlobalContext.js +28 -0
- package/dist/esm/node/plugin/plugins/suppressRollupWarning.d.ts +3 -0
- package/dist/esm/node/plugin/plugins/suppressRollupWarning.js +48 -0
- package/dist/esm/node/plugin/shared/addSsrMiddleware.d.ts +4 -0
- package/dist/esm/node/plugin/shared/addSsrMiddleware.js +38 -0
- package/dist/esm/node/plugin/shared/findPageFiles.d.ts +4 -0
- package/dist/esm/node/plugin/shared/findPageFiles.js +18 -0
- package/dist/esm/node/plugin/shared/getConfigValueSource.d.ts +7 -0
- package/dist/esm/node/plugin/shared/getConfigValueSource.js +22 -0
- package/dist/esm/node/plugin/shared/getHttpRequestAsyncStore.d.ts +11 -0
- package/dist/esm/node/plugin/shared/getHttpRequestAsyncStore.js +103 -0
- package/dist/esm/node/plugin/shared/isAsset.d.ts +2 -0
- package/dist/esm/node/plugin/shared/isAsset.js +38 -0
- package/dist/esm/node/plugin/shared/isErrorDebug.d.ts +2 -0
- package/dist/esm/node/plugin/shared/isErrorDebug.js +5 -0
- package/dist/esm/node/plugin/shared/isViteCliCall.d.ts +10 -0
- package/dist/esm/node/plugin/shared/isViteCliCall.js +81 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelReact.d.ts +16 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelReact.js +12 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelSolid.d.ts +16 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelSolid.js +12 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errEsbuild.d.ts +33 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errEsbuild.js +35 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx.d.ts +47 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx.js +23 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errPostcss.d.ts +30 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errPostcss.js +27 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwc.d.ts +16 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwc.js +16 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwcBig.d.ts +16 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwcBig.js +16 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueCss.d.ts +30 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueCss.js +26 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueHtml.d.ts +14 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueHtml.js +10 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueJavascript.d.ts +16 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueJavascript.js +12 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet.d.ts +15 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet.js +163 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/log.d.ts +14 -0
- package/dist/esm/node/plugin/shared/loggerNotProd/log.js +108 -0
- package/dist/esm/node/plugin/shared/loggerNotProd.d.ts +39 -0
- package/dist/esm/node/plugin/shared/loggerNotProd.js +218 -0
- package/dist/esm/node/plugin/shared/loggerVite/removeSuperfluousViteLog.d.ts +6 -0
- package/dist/esm/node/plugin/shared/loggerVite/removeSuperfluousViteLog.js +22 -0
- package/dist/esm/node/plugin/shared/loggerVite.d.ts +3 -0
- package/dist/esm/node/plugin/shared/loggerVite.js +58 -0
- package/dist/esm/node/plugin/shared/parseEsModule.d.ts +11 -0
- package/dist/esm/node/plugin/shared/parseEsModule.js +31 -0
- package/dist/esm/node/plugin/shared/removeSourceMap.d.ts +7 -0
- package/dist/esm/node/plugin/shared/removeSourceMap.js +9 -0
- package/dist/esm/node/plugin/shared/rollupIsEsm.d.ts +3 -0
- package/dist/esm/node/plugin/shared/rollupIsEsm.js +12 -0
- package/dist/esm/node/plugin/utils.d.ts +19 -0
- package/dist/esm/node/plugin/utils.js +25 -0
- package/dist/esm/node/prerender/index.d.ts +1 -0
- package/dist/esm/node/prerender/index.js +1 -0
- package/dist/esm/node/prerender/runPrerender.d.ts +53 -0
- package/dist/esm/node/prerender/runPrerender.js +678 -0
- package/dist/esm/node/prerender/utils.d.ts +13 -0
- package/dist/esm/node/prerender/utils.js +15 -0
- package/dist/esm/node/runtime/globalContext/loadImportBuild.d.ts +18 -0
- package/dist/esm/node/runtime/globalContext/loadImportBuild.js +27 -0
- package/dist/esm/node/runtime/globalContext.d.ts +52 -0
- package/dist/esm/node/runtime/globalContext.js +157 -0
- package/dist/esm/node/runtime/html/injectAssets/getHtmlTags.d.ts +27 -0
- package/dist/esm/node/runtime/html/injectAssets/getHtmlTags.js +155 -0
- package/dist/esm/node/runtime/html/injectAssets/getViteDevScripts.d.ts +2 -0
- package/dist/esm/node/runtime/html/injectAssets/getViteDevScripts.js +22 -0
- package/dist/esm/node/runtime/html/injectAssets/inferHtmlTags.d.ts +7 -0
- package/dist/esm/node/runtime/html/injectAssets/inferHtmlTags.js +49 -0
- package/dist/esm/node/runtime/html/injectAssets/injectAssets__public.d.ts +2 -0
- package/dist/esm/node/runtime/html/injectAssets/injectAssets__public.js +29 -0
- package/dist/esm/node/runtime/html/injectAssets/injectHtmlTags.d.ts +10 -0
- package/dist/esm/node/runtime/html/injectAssets/injectHtmlTags.js +155 -0
- package/dist/esm/node/runtime/html/injectAssets/mergeScriptTags.d.ts +2 -0
- package/dist/esm/node/runtime/html/injectAssets/mergeScriptTags.js +68 -0
- package/dist/esm/node/runtime/html/injectAssets/sanitizeJson.d.ts +2 -0
- package/dist/esm/node/runtime/html/injectAssets/sanitizeJson.js +6 -0
- package/dist/esm/node/runtime/html/injectAssets.d.ts +34 -0
- package/dist/esm/node/runtime/html/injectAssets.js +73 -0
- package/dist/esm/node/runtime/html/renderHtml.d.ts +33 -0
- package/dist/esm/node/runtime/html/renderHtml.js +231 -0
- package/dist/esm/node/runtime/html/serializePageContextClientSide.d.ts +22 -0
- package/dist/esm/node/runtime/html/serializePageContextClientSide.js +111 -0
- package/dist/esm/node/runtime/html/stream/react-streaming.d.ts +25 -0
- package/dist/esm/node/runtime/html/stream/react-streaming.js +33 -0
- package/dist/esm/node/runtime/html/stream.d.ts +84 -0
- package/dist/esm/node/runtime/html/stream.js +745 -0
- package/dist/esm/node/runtime/index-common.d.ts +10 -0
- package/dist/esm/node/runtime/index-common.js +11 -0
- package/dist/esm/node/runtime/index-deprecated.d.ts +17 -0
- package/dist/esm/node/runtime/index-deprecated.js +40 -0
- package/dist/esm/node/runtime/index.d.ts +1 -0
- package/dist/esm/node/runtime/index.js +3 -0
- package/dist/esm/node/runtime/onLoad.d.ts +2 -0
- package/dist/esm/node/runtime/onLoad.js +9 -0
- package/dist/esm/node/runtime/page-files/setup.d.ts +1 -0
- package/dist/esm/node/runtime/page-files/setup.js +21 -0
- package/dist/esm/node/runtime/renderPage/analyzePage.d.ts +5 -0
- package/dist/esm/node/runtime/renderPage/analyzePage.js +66 -0
- package/dist/esm/node/runtime/renderPage/assertArguments.d.ts +2 -0
- package/dist/esm/node/runtime/renderPage/assertArguments.js +37 -0
- package/dist/esm/node/runtime/renderPage/createHttpResponseObject/assertNoInfiniteHttpRedirect.d.ts +2 -0
- package/dist/esm/node/runtime/renderPage/createHttpResponseObject/assertNoInfiniteHttpRedirect.js +38 -0
- package/dist/esm/node/runtime/renderPage/createHttpResponseObject.d.ts +28 -0
- package/dist/esm/node/runtime/renderPage/createHttpResponseObject.js +65 -0
- package/dist/esm/node/runtime/renderPage/debugPageFiles.d.ts +24 -0
- package/dist/esm/node/runtime/renderPage/debugPageFiles.js +47 -0
- package/dist/esm/node/runtime/renderPage/executeOnBeforeRenderHook.d.ts +7 -0
- package/dist/esm/node/runtime/renderPage/executeOnBeforeRenderHook.js +20 -0
- package/dist/esm/node/runtime/renderPage/executeOnRenderHtmlHook.d.ts +25 -0
- package/dist/esm/node/runtime/renderPage/executeOnRenderHtmlHook.js +133 -0
- package/dist/esm/node/runtime/renderPage/getEarlyHints.d.ts +7 -0
- package/dist/esm/node/runtime/renderPage/getEarlyHints.js +43 -0
- package/dist/esm/node/runtime/renderPage/getHttpResponseBody.d.ts +31 -0
- package/dist/esm/node/runtime/renderPage/getHttpResponseBody.js +125 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets/assertClientEntryId.d.ts +2 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets/assertClientEntryId.js +22 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets/getManifestEntry.d.ts +6 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets/getManifestEntry.js +125 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsDev.d.ts +4 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsDev.js +72 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.d.ts +4 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +58 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets/sortPageAssetsForEarlyHintsHeader.d.ts +3 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets/sortPageAssetsForEarlyHintsHeader.js +30 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets.d.ts +19 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets.js +130 -0
- package/dist/esm/node/runtime/renderPage/handleErrorWithoutErrorPage.d.ts +11 -0
- package/dist/esm/node/runtime/renderPage/handleErrorWithoutErrorPage.js +37 -0
- package/dist/esm/node/runtime/renderPage/handlePageContextRequestUrl.d.ts +5 -0
- package/dist/esm/node/runtime/renderPage/handlePageContextRequestUrl.js +30 -0
- package/dist/esm/node/runtime/renderPage/inferMediaType.d.ts +7 -0
- package/dist/esm/node/runtime/renderPage/inferMediaType.js +38 -0
- package/dist/esm/node/runtime/renderPage/isConfigInvalid.d.ts +2 -0
- package/dist/esm/node/runtime/renderPage/isConfigInvalid.js +4 -0
- package/dist/esm/node/runtime/renderPage/isNewError.d.ts +4 -0
- package/dist/esm/node/runtime/renderPage/isNewError.js +20 -0
- package/dist/esm/node/runtime/renderPage/loadPageFilesServerSide.d.ts +29 -0
- package/dist/esm/node/runtime/renderPage/loadPageFilesServerSide.js +97 -0
- package/dist/esm/node/runtime/renderPage/log404/index.d.ts +10 -0
- package/dist/esm/node/runtime/renderPage/log404/index.js +138 -0
- package/dist/esm/node/runtime/renderPage/loggerProd.d.ts +2 -0
- package/dist/esm/node/runtime/renderPage/loggerProd.js +17 -0
- package/dist/esm/node/runtime/renderPage/loggerRuntime.d.ts +5 -0
- package/dist/esm/node/runtime/renderPage/loggerRuntime.js +15 -0
- package/dist/esm/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.d.ts +26 -0
- package/dist/esm/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.js +16 -0
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +265 -0
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.js +180 -0
- package/dist/esm/node/runtime/renderPage.d.ts +17 -0
- package/dist/esm/node/runtime/renderPage.js +399 -0
- package/dist/esm/node/runtime/utils.d.ts +52 -0
- package/dist/esm/node/runtime/utils.js +55 -0
- package/dist/esm/node/shared/ViteManifest.d.ts +13 -0
- package/dist/esm/node/shared/ViteManifest.js +1 -0
- package/dist/esm/node/shared/assertPluginManifest.d.ts +14 -0
- package/dist/esm/node/shared/assertPluginManifest.js +21 -0
- package/dist/esm/node/shared/assertRuntimeManifest.d.ts +11 -0
- package/dist/esm/node/shared/assertRuntimeManifest.js +16 -0
- package/dist/esm/node/shared/extractAssetsQuery.d.ts +4 -0
- package/dist/esm/node/shared/extractAssetsQuery.js +26 -0
- package/dist/esm/node/shared/getClientEntryFilePath.d.ts +3 -0
- package/dist/esm/node/shared/getClientEntryFilePath.js +15 -0
- package/dist/esm/node/shared/getConfigVike.d.ts +3 -0
- package/dist/esm/node/shared/getConfigVike.js +5 -0
- package/dist/esm/node/shared/utils.d.ts +15 -0
- package/dist/esm/node/shared/utils.js +17 -0
- package/dist/esm/node/shared/virtual-files/virtualFileImportUserCode.d.ts +11 -0
- package/dist/esm/node/shared/virtual-files/virtualFileImportUserCode.js +24 -0
- package/dist/esm/node/shared/virtual-files/virtualFilePageConfigValuesAll.d.ts +9 -0
- package/dist/esm/node/shared/virtual-files/virtualFilePageConfigValuesAll.js +36 -0
- package/dist/esm/shared/ConfigVike.d.ts +128 -0
- package/dist/esm/shared/ConfigVike.js +1 -0
- package/dist/esm/shared/RenderErrorPage.d.ts +1 -0
- package/dist/esm/shared/RenderErrorPage.js +2 -0
- package/dist/esm/shared/VikeNamespace.d.ts +43 -0
- package/dist/esm/shared/VikeNamespace.js +1 -0
- package/dist/esm/shared/abort.d.ts +1 -0
- package/dist/esm/shared/abort.js +11 -0
- package/dist/esm/shared/addIs404ToPageProps.d.ts +7 -0
- package/dist/esm/shared/addIs404ToPageProps.js +23 -0
- package/dist/esm/shared/addUrlComputedProps.d.ts +62 -0
- package/dist/esm/shared/addUrlComputedProps.js +108 -0
- package/dist/esm/shared/assertHookReturnedObject.d.ts +4 -0
- package/dist/esm/shared/assertHookReturnedObject.js +19 -0
- package/dist/esm/shared/assertOnBeforeRenderHookReturn.d.ts +4 -0
- package/dist/esm/shared/assertOnBeforeRenderHookReturn.js +16 -0
- package/dist/esm/shared/assertPageContextProvidedByUser.d.ts +5 -0
- package/dist/esm/shared/assertPageContextProvidedByUser.js +15 -0
- package/dist/esm/shared/assertPageFilePath.d.ts +2 -0
- package/dist/esm/shared/assertPageFilePath.js +9 -0
- package/dist/esm/shared/determinePageIdOld.d.ts +2 -0
- package/dist/esm/shared/determinePageIdOld.js +9 -0
- package/dist/esm/shared/error-page.d.ts +8 -0
- package/dist/esm/shared/error-page.js +38 -0
- package/dist/esm/shared/getPageContextRequestUrl.d.ts +6 -0
- package/dist/esm/shared/getPageContextRequestUrl.js +13 -0
- package/dist/esm/shared/getPageFiles/analyzeClientSide.d.ts +7 -0
- package/dist/esm/shared/getPageFiles/analyzeClientSide.js +19 -0
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/ClientDependency.d.ts +6 -0
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/ClientDependency.js +1 -0
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/analyzeExports.d.ts +10 -0
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/analyzeExports.js +48 -0
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/determineClientEntry.d.ts +14 -0
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/determineClientEntry.js +27 -0
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/getExportNames.d.ts +3 -0
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/getExportNames.js +13 -0
- package/dist/esm/shared/getPageFiles/analyzePageClientSide.d.ts +17 -0
- package/dist/esm/shared/getPageFiles/analyzePageClientSide.js +58 -0
- package/dist/esm/shared/getPageFiles/analyzePageServerSide.d.ts +5 -0
- package/dist/esm/shared/getPageFiles/analyzePageServerSide.js +20 -0
- package/dist/esm/shared/getPageFiles/assertExports.d.ts +7 -0
- package/dist/esm/shared/getPageFiles/assertExports.js +21 -0
- package/dist/esm/shared/getPageFiles/assertPageConfigs.d.ts +5 -0
- package/dist/esm/shared/getPageFiles/assertPageConfigs.js +16 -0
- package/dist/esm/shared/getPageFiles/fileTypes.d.ts +8 -0
- package/dist/esm/shared/getPageFiles/fileTypes.js +50 -0
- package/dist/esm/shared/getPageFiles/getAllPageIdFiles.d.ts +5 -0
- package/dist/esm/shared/getPageFiles/getAllPageIdFiles.js +103 -0
- package/dist/esm/shared/getPageFiles/getExports.d.ts +39 -0
- package/dist/esm/shared/getPageFiles/getExports.js +140 -0
- package/dist/esm/shared/getPageFiles/getPageFileObject.d.ts +18 -0
- package/dist/esm/shared/getPageFiles/getPageFileObject.js +59 -0
- package/dist/esm/shared/getPageFiles/parseGlobResults.d.ts +8 -0
- package/dist/esm/shared/getPageFiles/parseGlobResults.js +124 -0
- package/dist/esm/shared/getPageFiles/setPageFiles.d.ts +13 -0
- package/dist/esm/shared/getPageFiles/setPageFiles.js +44 -0
- package/dist/esm/shared/getPageFiles.d.ts +9 -0
- package/dist/esm/shared/getPageFiles.js +8 -0
- package/dist/esm/shared/hooks/executeHook.d.ts +5 -0
- package/dist/esm/shared/hooks/executeHook.js +71 -0
- package/dist/esm/shared/hooks/getHook.d.ts +24 -0
- package/dist/esm/shared/hooks/getHook.js +26 -0
- package/dist/esm/shared/notSerializable.d.ts +1 -0
- package/dist/esm/shared/notSerializable.js +2 -0
- package/dist/esm/shared/page-configs/Config/PageContextConfig.d.ts +8 -0
- package/dist/esm/shared/page-configs/Config/PageContextConfig.js +1 -0
- package/dist/esm/shared/page-configs/Config/helpers.d.ts +10 -0
- package/dist/esm/shared/page-configs/Config/helpers.js +1 -0
- package/dist/esm/shared/page-configs/Config.d.ts +131 -0
- package/dist/esm/shared/page-configs/Config.js +1 -0
- package/dist/esm/shared/page-configs/PageConfig.d.ts +97 -0
- package/dist/esm/shared/page-configs/PageConfig.js +1 -0
- package/dist/esm/shared/page-configs/findPageConfig.d.ts +3 -0
- package/dist/esm/shared/page-configs/findPageConfig.js +8 -0
- package/dist/esm/shared/page-configs/getExportPath.d.ts +2 -0
- package/dist/esm/shared/page-configs/getExportPath.js +28 -0
- package/dist/esm/shared/page-configs/loadPageCode.d.ts +3 -0
- package/dist/esm/shared/page-configs/loadPageCode.js +57 -0
- package/dist/esm/shared/page-configs/utils.d.ts +28 -0
- package/dist/esm/shared/page-configs/utils.js +74 -0
- package/dist/esm/shared/route/abort.d.ts +103 -0
- package/dist/esm/shared/route/abort.js +155 -0
- package/dist/esm/shared/route/debug.d.ts +3 -0
- package/dist/esm/shared/route/debug.js +11 -0
- package/dist/esm/shared/route/deduceRouteStringFromFilesystemPath.d.ts +7 -0
- package/dist/esm/shared/route/deduceRouteStringFromFilesystemPath.js +50 -0
- package/dist/esm/shared/route/executeGuardHook.d.ts +8 -0
- package/dist/esm/shared/route/executeGuardHook.js +37 -0
- package/dist/esm/shared/route/executeOnBeforeRouteHook.d.ts +17 -0
- package/dist/esm/shared/route/executeOnBeforeRouteHook.js +50 -0
- package/dist/esm/shared/route/index.d.ts +31 -0
- package/dist/esm/shared/route/index.js +113 -0
- package/dist/esm/shared/route/loadPageRoutes.d.ts +29 -0
- package/dist/esm/shared/route/loadPageRoutes.js +194 -0
- package/dist/esm/shared/route/resolvePrecedence.d.ts +8 -0
- package/dist/esm/shared/route/resolvePrecedence.js +69 -0
- package/dist/esm/shared/route/resolveRedirects.d.ts +4 -0
- package/dist/esm/shared/route/resolveRedirects.js +50 -0
- package/dist/esm/shared/route/resolveRoute.d.ts +5 -0
- package/dist/esm/shared/route/resolveRoute.js +15 -0
- package/dist/esm/shared/route/resolveRouteFunction.d.ts +14 -0
- package/dist/esm/shared/route/resolveRouteFunction.js +64 -0
- package/dist/esm/shared/route/resolveRouteString.d.ts +17 -0
- package/dist/esm/shared/route/resolveRouteString.js +95 -0
- package/dist/esm/shared/route/routing.d.ts +1 -0
- package/dist/esm/shared/route/routing.js +5 -0
- package/dist/esm/shared/route/utils.d.ts +18 -0
- package/dist/esm/shared/route/utils.js +27 -0
- package/dist/esm/shared/sortPageContext.d.ts +2 -0
- package/dist/esm/shared/sortPageContext.js +14 -0
- package/dist/esm/shared/types.d.ts +127 -0
- package/dist/esm/shared/types.js +1 -0
- package/dist/esm/shared/utils.d.ts +23 -0
- package/dist/esm/shared/utils.js +27 -0
- package/dist/esm/types/index-dreprecated.d.ts +51 -0
- package/dist/esm/types/index-dreprecated.js +2 -0
- package/dist/esm/types/index.d.ts +47 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/utils/PromiseType.d.ts +1 -0
- package/dist/esm/utils/PromiseType.js +1 -0
- package/dist/esm/utils/arrayIncludes.d.ts +1 -0
- package/dist/esm/utils/arrayIncludes.js +3 -0
- package/dist/esm/utils/assert.d.ts +29 -0
- package/dist/esm/utils/assert.js +188 -0
- package/dist/esm/utils/assertDefaultExport.d.ts +8 -0
- package/dist/esm/utils/assertDefaultExport.js +47 -0
- package/dist/esm/utils/assertIsBrowser.d.ts +2 -0
- package/dist/esm/utils/assertIsBrowser.js +6 -0
- package/dist/esm/utils/assertIsNotBrowser.d.ts +3 -0
- package/dist/esm/utils/assertIsNotBrowser.js +7 -0
- package/dist/esm/utils/assertIsNotProductionRuntime.d.ts +10 -0
- package/dist/esm/utils/assertIsNotProductionRuntime.js +41 -0
- package/dist/esm/utils/assertNodeVersion.d.ts +2 -0
- package/dist/esm/utils/assertNodeVersion.js +11 -0
- package/dist/esm/utils/assertPathIsFilesystemAbsolute.d.ts +3 -0
- package/dist/esm/utils/assertPathIsFilesystemAbsolute.js +14 -0
- package/dist/esm/utils/assertRoutingType.d.ts +6 -0
- package/dist/esm/utils/assertRoutingType.js +24 -0
- package/dist/esm/utils/assertSingleInstance.d.ts +6 -0
- package/dist/esm/utils/assertSingleInstance.js +94 -0
- package/dist/esm/utils/autoRetry.d.ts +2 -0
- package/dist/esm/utils/autoRetry.js +20 -0
- package/dist/esm/utils/capitalizeFirstLetter.d.ts +2 -0
- package/dist/esm/utils/capitalizeFirstLetter.js +7 -0
- package/dist/esm/utils/cast.d.ts +4 -0
- package/dist/esm/utils/cast.js +4 -0
- package/dist/esm/utils/checkType.d.ts +2 -0
- package/dist/esm/utils/checkType.js +2 -0
- package/dist/esm/utils/compareString.d.ts +2 -0
- package/dist/esm/utils/compareString.js +8 -0
- package/dist/esm/utils/createErrorWithCleanStackTrace.d.ts +2 -0
- package/dist/esm/utils/createErrorWithCleanStackTrace.js +43 -0
- package/dist/esm/utils/debug.d.ts +15 -0
- package/dist/esm/utils/debug.js +106 -0
- package/dist/esm/utils/debugGlob.d.ts +8 -0
- package/dist/esm/utils/debugGlob.js +3 -0
- package/dist/esm/utils/deepEqual.d.ts +1 -0
- package/dist/esm/utils/deepEqual.js +7 -0
- package/dist/esm/utils/dynamicImport.d.ts +2 -0
- package/dist/esm/utils/dynamicImport.js +4 -0
- package/dist/esm/utils/escapeRegex.d.ts +1 -0
- package/dist/esm/utils/escapeRegex.js +4 -0
- package/dist/esm/utils/filesystemPathHandling.d.ts +4 -0
- package/dist/esm/utils/filesystemPathHandling.js +16 -0
- package/dist/esm/utils/findUserPackageJsonPath.d.ts +2 -0
- package/dist/esm/utils/findUserPackageJsonPath.js +18 -0
- package/dist/esm/utils/freezePartial.d.ts +2 -0
- package/dist/esm/utils/freezePartial.js +30 -0
- package/dist/esm/utils/getCurrentUrl.d.ts +4 -0
- package/dist/esm/utils/getCurrentUrl.js +16 -0
- package/dist/esm/utils/getDependencyPackageJson.d.ts +6 -0
- package/dist/esm/utils/getDependencyPackageJson.js +85 -0
- package/dist/esm/utils/getFileExtension.d.ts +2 -0
- package/dist/esm/utils/getFileExtension.js +14 -0
- package/dist/esm/utils/getFilePathAbsolute.d.ts +5 -0
- package/dist/esm/utils/getFilePathAbsolute.js +60 -0
- package/dist/esm/utils/getGlobalObject.d.ts +4 -0
- package/dist/esm/utils/getGlobalObject.js +7 -0
- package/dist/esm/utils/getMostSimilar.d.ts +2 -0
- package/dist/esm/utils/getMostSimilar.js +66 -0
- package/dist/esm/utils/getOutDirs.d.ts +16 -0
- package/dist/esm/utils/getOutDirs.js +115 -0
- package/dist/esm/utils/getPropAccessNotation.d.ts +2 -0
- package/dist/esm/utils/getPropAccessNotation.js +7 -0
- package/dist/esm/utils/getRandomId.d.ts +2 -0
- package/dist/esm/utils/getRandomId.js +12 -0
- package/dist/esm/utils/getTerminWidth.d.ts +1 -0
- package/dist/esm/utils/getTerminWidth.js +4 -0
- package/dist/esm/utils/getValuePrintable.d.ts +1 -0
- package/dist/esm/utils/getValuePrintable.js +7 -0
- package/dist/esm/utils/hasProp.d.ts +14 -0
- package/dist/esm/utils/hasProp.js +45 -0
- package/dist/esm/utils/hasPropertyGetter.d.ts +1 -0
- package/dist/esm/utils/hasPropertyGetter.js +4 -0
- package/dist/esm/utils/humanizeTime.d.ts +2 -0
- package/dist/esm/utils/humanizeTime.js +22 -0
- package/dist/esm/utils/isBrowser.d.ts +1 -0
- package/dist/esm/utils/isBrowser.js +5 -0
- package/dist/esm/utils/isCallable.d.ts +1 -0
- package/dist/esm/utils/isCallable.js +3 -0
- package/dist/esm/utils/isDev.d.ts +7 -0
- package/dist/esm/utils/isDev.js +29 -0
- package/dist/esm/utils/isEquivalentError.d.ts +2 -0
- package/dist/esm/utils/isEquivalentError.js +15 -0
- package/dist/esm/utils/isHtml.d.ts +2 -0
- package/dist/esm/utils/isHtml.js +7 -0
- package/dist/esm/utils/isNodeJS.d.ts +1 -0
- package/dist/esm/utils/isNodeJS.js +13 -0
- package/dist/esm/utils/isNotNullish.d.ts +1 -0
- package/dist/esm/utils/isNotNullish.js +1 -0
- package/dist/esm/utils/isNpmPackage.d.ts +17 -0
- package/dist/esm/utils/isNpmPackage.js +94 -0
- package/dist/esm/utils/isObject.d.ts +1 -0
- package/dist/esm/utils/isObject.js +3 -0
- package/dist/esm/utils/isObjectWithKeys.d.ts +4 -0
- package/dist/esm/utils/isObjectWithKeys.js +13 -0
- package/dist/esm/utils/isPlainObject.d.ts +3 -0
- package/dist/esm/utils/isPlainObject.js +15 -0
- package/dist/esm/utils/isPromise.d.ts +1 -0
- package/dist/esm/utils/isPromise.js +4 -0
- package/dist/esm/utils/isReact.d.ts +1 -0
- package/dist/esm/utils/isReact.js +20 -0
- package/dist/esm/utils/isScriptFile.d.ts +8 -0
- package/dist/esm/utils/isScriptFile.js +50 -0
- package/dist/esm/utils/isStemPackageName.d.ts +1 -0
- package/dist/esm/utils/isStemPackageName.js +10 -0
- package/dist/esm/utils/isStringRecord.d.ts +1 -0
- package/dist/esm/utils/isStringRecord.js +3 -0
- package/dist/esm/utils/isVitest.d.ts +1 -0
- package/dist/esm/utils/isVitest.js +3 -0
- package/dist/esm/utils/joinEnglish.d.ts +2 -0
- package/dist/esm/utils/joinEnglish.js +11 -0
- package/dist/esm/utils/mergeCumulativeValues.d.ts +2 -0
- package/dist/esm/utils/mergeCumulativeValues.js +18 -0
- package/dist/esm/utils/nodeEnv.d.ts +4 -0
- package/dist/esm/utils/nodeEnv.js +13 -0
- package/dist/esm/utils/objectAssign.d.ts +2 -0
- package/dist/esm/utils/objectAssign.js +7 -0
- package/dist/esm/utils/objectEntries.d.ts +4 -0
- package/dist/esm/utils/objectEntries.js +5 -0
- package/dist/esm/utils/objectKeys.d.ts +2 -0
- package/dist/esm/utils/objectKeys.js +6 -0
- package/dist/esm/utils/pLimit.d.ts +14 -0
- package/dist/esm/utils/pLimit.js +131 -0
- package/dist/esm/utils/parseUrl-extras.d.ts +17 -0
- package/dist/esm/utils/parseUrl-extras.js +93 -0
- package/dist/esm/utils/parseUrl.d.ts +22 -0
- package/dist/esm/utils/parseUrl.js +216 -0
- package/dist/esm/utils/path-shim.d.ts +2 -0
- package/dist/esm/utils/path-shim.js +12 -0
- package/dist/esm/utils/projectInfo.d.ts +11 -0
- package/dist/esm/utils/projectInfo.js +11 -0
- package/dist/esm/utils/removeEmptyLines.d.ts +1 -0
- package/dist/esm/utils/removeEmptyLines.js +6 -0
- package/dist/esm/utils/removeFileExtention.d.ts +1 -0
- package/dist/esm/utils/removeFileExtention.js +3 -0
- package/dist/esm/utils/resolve.d.ts +2 -0
- package/dist/esm/utils/resolve.js +57 -0
- package/dist/esm/utils/serverSideRouteTo.d.ts +2 -0
- package/dist/esm/utils/serverSideRouteTo.js +4 -0
- package/dist/esm/utils/sleep.d.ts +1 -0
- package/dist/esm/utils/sleep.js +3 -0
- package/dist/esm/utils/slice.d.ts +3 -0
- package/dist/esm/utils/slice.js +33 -0
- package/dist/esm/utils/sorter.d.ts +8 -0
- package/dist/esm/utils/sorter.js +57 -0
- package/dist/esm/utils/stringifyStringArray.d.ts +2 -0
- package/dist/esm/utils/stringifyStringArray.js +4 -0
- package/dist/esm/utils/stripAnsi.d.ts +2 -0
- package/dist/esm/utils/stripAnsi.js +19 -0
- package/dist/esm/utils/styleFileRE.d.ts +1 -0
- package/dist/esm/utils/styleFileRE.js +2 -0
- package/dist/esm/utils/throttle.d.ts +2 -0
- package/dist/esm/utils/throttle.js +13 -0
- package/dist/esm/utils/trackLogs.d.ts +1 -0
- package/dist/esm/utils/trackLogs.js +26 -0
- package/dist/esm/utils/trimWithAnsi.d.ts +4 -0
- package/dist/esm/utils/trimWithAnsi.js +38 -0
- package/dist/esm/utils/truncateString.d.ts +1 -0
- package/dist/esm/utils/truncateString.js +15 -0
- package/dist/esm/utils/unique.d.ts +2 -0
- package/dist/esm/utils/unique.js +4 -0
- package/dist/esm/utils/urlToFile.d.ts +4 -0
- package/dist/esm/utils/urlToFile.js +33 -0
- package/dist/esm/utils/virtual-files.d.ts +6 -0
- package/dist/esm/utils/virtual-files.js +30 -0
- package/dist/esm/utils/viteIsSSR.d.ts +11 -0
- package/dist/esm/utils/viteIsSSR.js +20 -0
- package/dist/esm/utils/warnIfErrorIsNotObject.d.ts +2 -0
- package/dist/esm/utils/warnIfErrorIsNotObject.js +18 -0
- package/node/cli/bin-entry.js +3 -0
- package/package.json +198 -1
- package/plugin.js +2 -0
- package/prerender.js +2 -0
- package/readme.md +3 -1
- package/routing.js +2 -0
- package/server.js +2 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Prettify transpilation errors
|
|
3
|
+
// - Doesn't work for optimize errors: https://gist.github.com/brillout/9b7bb78ae866558b292ea1b516a986ec
|
|
4
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.getPrettyErrMessage = exports.isEquivalentErrorWithCodeSnippet = exports.isErrorWithCodeSnippet = exports.getPrettyErrorWithCodeSnippet = void 0;
|
|
9
|
+
// Copied & adapted from https://github.com/vitejs/vite/blob/9c114c5c72a6af87e3330d5573362554b4511265/packages/vite/src/node/server/middlewares/error.ts
|
|
10
|
+
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
11
|
+
const utils_js_1 = require("../../utils.js");
|
|
12
|
+
function isErrorWithCodeSnippet(err) {
|
|
13
|
+
if (!(0, utils_js_1.isObject)(err)) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
const { id, frame, message } = err;
|
|
17
|
+
if (typeof id !== 'string' || !id.trim()) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
if (typeof frame === 'string' && frame.trim()) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
if (typeof message === 'string' && containsCodeSnippet(message)) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
exports.isErrorWithCodeSnippet = isErrorWithCodeSnippet;
|
|
29
|
+
function getPrettyErrorWithCodeSnippet(err, userRootDir) {
|
|
30
|
+
/* Uncomment to inspect and/or create fixture for ./errorWithCodeSnippet.spec.ts
|
|
31
|
+
console.log('userRootDir', userRootDir)
|
|
32
|
+
console.log('err.message', err.message)
|
|
33
|
+
console.log('err.stack', (err as any).stack)
|
|
34
|
+
console.log('err.pluginCode', (err as any).pluginCode)
|
|
35
|
+
console.log('Object.keys(err)', Object.keys(err))
|
|
36
|
+
console.log('err', err)
|
|
37
|
+
// For copy-pasting errors while preserving terminal ANSI colors
|
|
38
|
+
console.log(
|
|
39
|
+
'JSON.stringify(err)',
|
|
40
|
+
JSON.stringify({
|
|
41
|
+
...err,
|
|
42
|
+
message: err.message,
|
|
43
|
+
stack: (err as any).stack
|
|
44
|
+
})
|
|
45
|
+
)
|
|
46
|
+
//*/
|
|
47
|
+
(0, utils_js_1.assert)(isErrorWithCodeSnippet(err));
|
|
48
|
+
let { id, frame } = err;
|
|
49
|
+
const msgFirstLine = [
|
|
50
|
+
picocolors_1.default.red('Failed to transpile'),
|
|
51
|
+
picocolors_1.default.bold(picocolors_1.default.red((0, utils_js_1.getFilePathVite)(normalizeId(id), userRootDir))),
|
|
52
|
+
picocolors_1.default.red('because:')
|
|
53
|
+
].join(' ');
|
|
54
|
+
const errMsg = getPrettyErrMessage(err);
|
|
55
|
+
if (errMsg && containsCodeSnippet(errMsg)) {
|
|
56
|
+
// Conditionally swallowing frame is a risky move but worth it thanks to logErrorDebugNote()
|
|
57
|
+
// We swallow frame because many tools set 'error.frame' to something rubbish, for example:
|
|
58
|
+
// - @vitejs/plugin-vue
|
|
59
|
+
// - @vitejs/plugin-react-swc
|
|
60
|
+
// - @mdx-js/rollup
|
|
61
|
+
frame = undefined;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
(0, utils_js_1.assert)(frame);
|
|
65
|
+
frame = frame.trim();
|
|
66
|
+
(0, utils_js_1.assert)(frame);
|
|
67
|
+
frame = picocolors_1.default.yellow(frame);
|
|
68
|
+
}
|
|
69
|
+
let msg = [msgFirstLine, errMsg, frame].filter(Boolean).join('\n');
|
|
70
|
+
msg = (0, utils_js_1.removeEmptyLines)(msg);
|
|
71
|
+
/* Vite already does a fairly good job at showing a concise error in the layover
|
|
72
|
+
server.ws.send({
|
|
73
|
+
type: 'error',
|
|
74
|
+
err: msg
|
|
75
|
+
})
|
|
76
|
+
*/
|
|
77
|
+
return msg;
|
|
78
|
+
}
|
|
79
|
+
exports.getPrettyErrorWithCodeSnippet = getPrettyErrorWithCodeSnippet;
|
|
80
|
+
function getPrettyErrMessage(err) {
|
|
81
|
+
const { id, frame } = err;
|
|
82
|
+
let errMsg = err.message;
|
|
83
|
+
if (!errMsg || !errMsg.trim())
|
|
84
|
+
return null;
|
|
85
|
+
const trail = /(?:\:|)(?:\s|$)/;
|
|
86
|
+
// Remove "Transform failed with 1 error:" (redundant since we already print an intro message)
|
|
87
|
+
errMsg = errMsg.split(reg([/Transform failed with \d* error(?:s|)/, trail], 'gi')).join('');
|
|
88
|
+
// Remove "/home/rom/code/vike/examples/react-full-v1/components/Counter.tsx:1:8:" (redundant since we already print the filename)
|
|
89
|
+
const pos = /(?:\:\d+|)/;
|
|
90
|
+
errMsg = errMsg.split(reg([id, pos, pos, trail], 'gi')).join('');
|
|
91
|
+
errMsg = errMsg.split(reg([normalizeId(id), pos, pos, trail], 'gi')).join('');
|
|
92
|
+
// Remove "ERROR:" (useless)
|
|
93
|
+
errMsg = errMsg.split(reg(['ERROR:', trail])).join('');
|
|
94
|
+
// Remove "Internal server error:" (useless)
|
|
95
|
+
errMsg = errMsg.split(reg(['Internal server error', trail])).join('');
|
|
96
|
+
if (containsCodeSnippet(errMsg)) {
|
|
97
|
+
errMsg = removeStandaloneCodePosition(errMsg);
|
|
98
|
+
}
|
|
99
|
+
errMsg = errMsg.trim();
|
|
100
|
+
if (frame && frame.includes(errMsg))
|
|
101
|
+
errMsg = '';
|
|
102
|
+
return errMsg;
|
|
103
|
+
}
|
|
104
|
+
exports.getPrettyErrMessage = getPrettyErrMessage;
|
|
105
|
+
function containsCodeSnippet(str) {
|
|
106
|
+
str = (0, utils_js_1.stripAnsi)(str);
|
|
107
|
+
let codeBlockSize = 0;
|
|
108
|
+
for (const line of str.split('\n')) {
|
|
109
|
+
if (!isCodeSnippetLine(line)) {
|
|
110
|
+
codeBlockSize = 0;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
codeBlockSize++;
|
|
114
|
+
}
|
|
115
|
+
if (codeBlockSize >= 3) {
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
function isCodeSnippetLine(line) {
|
|
122
|
+
// Babel
|
|
123
|
+
if (/[\s\d>]*\|/.test(line))
|
|
124
|
+
return true;
|
|
125
|
+
// SWC
|
|
126
|
+
if (/[\s\d>]*(╭─|│|·)/.test(line))
|
|
127
|
+
return true;
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
function reg(parts, flags = '') {
|
|
131
|
+
return new RegExp(parts.map((part) => (typeof part === 'string' ? (0, utils_js_1.escapeRegex)(part) : part.source)).join(''), flags);
|
|
132
|
+
}
|
|
133
|
+
function removeStandaloneCodePosition(errMsg) {
|
|
134
|
+
// Remove weird standalone code position " (2:7) "
|
|
135
|
+
errMsg = errMsg
|
|
136
|
+
.split('\n')
|
|
137
|
+
.map((line) => {
|
|
138
|
+
const posRE = /(\s|^)\(\d+:\d+\)(\s|$)/;
|
|
139
|
+
(0, utils_js_1.assert)(posRE.test(' (1:2)'));
|
|
140
|
+
(0, utils_js_1.assert)(posRE.test('(13:42) '));
|
|
141
|
+
if (!isCodeSnippetLine(line)) {
|
|
142
|
+
line = line.split(posRE).join('');
|
|
143
|
+
}
|
|
144
|
+
return line;
|
|
145
|
+
})
|
|
146
|
+
.join('\n');
|
|
147
|
+
return errMsg;
|
|
148
|
+
}
|
|
149
|
+
function isEquivalentErrorWithCodeSnippet(err1, err2) {
|
|
150
|
+
if (!(0, utils_js_1.isObject)(err1) || !(0, utils_js_1.isObject)(err2))
|
|
151
|
+
return false;
|
|
152
|
+
if (isDefinedAndSame(err1.message, err2.message) &&
|
|
153
|
+
isDefinedAndSame(err1.frame, err2.frame) &&
|
|
154
|
+
isDefinedAndSame(err1.id, err2.id)) {
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
exports.isEquivalentErrorWithCodeSnippet = isEquivalentErrorWithCodeSnippet;
|
|
160
|
+
function isDefinedAndSame(val1, val2) {
|
|
161
|
+
return val1 && val1 === val2;
|
|
162
|
+
}
|
|
163
|
+
function normalizeId(id) {
|
|
164
|
+
id = (0, utils_js_1.toPosixPath)(id);
|
|
165
|
+
// remove query
|
|
166
|
+
id = id.split('?')[0];
|
|
167
|
+
return id;
|
|
168
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.screenHasErrors = exports.clearScreen = exports.isFirstLog = exports.logDirectly = exports.logWithVikeTag = exports.logWithViteTag = void 0;
|
|
7
|
+
const utils_js_1 = require("../../utils.js");
|
|
8
|
+
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
9
|
+
const isErrorDebug_js_1 = require("../isErrorDebug.js");
|
|
10
|
+
const globalContext_js_1 = require("../../../runtime/globalContext.js");
|
|
11
|
+
(0, utils_js_1.assertIsNotProductionRuntime)();
|
|
12
|
+
let isFirstLog = true;
|
|
13
|
+
exports.isFirstLog = isFirstLog;
|
|
14
|
+
let screenHasErrors = false;
|
|
15
|
+
exports.screenHasErrors = screenHasErrors;
|
|
16
|
+
function logWithVikeTag(msg, logType, category, showVikeVersion = false) {
|
|
17
|
+
const projectTag = getProjectTag(showVikeVersion);
|
|
18
|
+
msg = prependTags(msg, projectTag, category, logType);
|
|
19
|
+
logDirectly(msg, logType);
|
|
20
|
+
}
|
|
21
|
+
exports.logWithVikeTag = logWithVikeTag;
|
|
22
|
+
function getProjectTag(showVikeVersion) {
|
|
23
|
+
let projectTag;
|
|
24
|
+
if (showVikeVersion) {
|
|
25
|
+
projectTag = `[${utils_js_1.projectInfo.npmPackageName}@${utils_js_1.projectInfo.projectVersion}]`;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
projectTag = `[${utils_js_1.projectInfo.npmPackageName}]`;
|
|
29
|
+
}
|
|
30
|
+
return projectTag;
|
|
31
|
+
}
|
|
32
|
+
function logWithViteTag(msg, logType, category) {
|
|
33
|
+
msg = prependTags(msg, '[vite]', category, logType);
|
|
34
|
+
logDirectly(msg, logType);
|
|
35
|
+
}
|
|
36
|
+
exports.logWithViteTag = logWithViteTag;
|
|
37
|
+
// Not production => every log is triggered by logDirectly()
|
|
38
|
+
// - Even all Vite logs also go through logDirectly() (see interceptors of loggerVite.ts)
|
|
39
|
+
// - Production => logs aren't managed by loggerNotProd.ts => logDirectly() is never called (not even loaded as asserted by assertIsVitePluginCode())
|
|
40
|
+
function logDirectly(thing, logType) {
|
|
41
|
+
applyViteSourceMapToStackTrace(thing);
|
|
42
|
+
exports.isFirstLog = isFirstLog = false;
|
|
43
|
+
if (logType === 'info') {
|
|
44
|
+
console.log(thing);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (logType === 'warn') {
|
|
48
|
+
console.warn(thing);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (logType === 'error') {
|
|
52
|
+
exports.screenHasErrors = screenHasErrors = true;
|
|
53
|
+
console.error(thing);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (logType === 'error-recover') {
|
|
57
|
+
// stderr because user will most likely want to know about error recovering
|
|
58
|
+
console.error(thing);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
(0, utils_js_1.assert)(false);
|
|
62
|
+
}
|
|
63
|
+
exports.logDirectly = logDirectly;
|
|
64
|
+
function clearScreen(viteConfig) {
|
|
65
|
+
// We use Vite's logger in order to respect the user's `clearScreen: false` setting
|
|
66
|
+
viteConfig.logger.clearScreen('error');
|
|
67
|
+
exports.screenHasErrors = screenHasErrors = false;
|
|
68
|
+
}
|
|
69
|
+
exports.clearScreen = clearScreen;
|
|
70
|
+
function applyViteSourceMapToStackTrace(thing) {
|
|
71
|
+
if ((0, isErrorDebug_js_1.isErrorDebug)())
|
|
72
|
+
return;
|
|
73
|
+
if (!(0, utils_js_1.hasProp)(thing, 'stack'))
|
|
74
|
+
return;
|
|
75
|
+
const viteDevServer = (0, globalContext_js_1.getViteDevServer)();
|
|
76
|
+
if (!viteDevServer)
|
|
77
|
+
return;
|
|
78
|
+
// Apply Vite's source maps
|
|
79
|
+
viteDevServer.ssrFixStacktrace(thing);
|
|
80
|
+
}
|
|
81
|
+
function prependTags(msg, projectTag, category, logType) {
|
|
82
|
+
const color = (s) => {
|
|
83
|
+
if (logType === 'error' && !hasRed(msg))
|
|
84
|
+
return picocolors_1.default.bold(picocolors_1.default.red(s));
|
|
85
|
+
if (logType === 'error-recover' && !hasGreen(msg))
|
|
86
|
+
return picocolors_1.default.bold(picocolors_1.default.green(s));
|
|
87
|
+
if (logType === 'warn' && !hasYellow(msg))
|
|
88
|
+
return picocolors_1.default.yellow(s);
|
|
89
|
+
if (projectTag === '[vite]')
|
|
90
|
+
return picocolors_1.default.bold(picocolors_1.default.cyan(s));
|
|
91
|
+
if (projectTag.startsWith(`[${utils_js_1.projectInfo.npmPackageName}`))
|
|
92
|
+
return picocolors_1.default.bold(picocolors_1.default.cyan(s));
|
|
93
|
+
(0, utils_js_1.assert)(false);
|
|
94
|
+
};
|
|
95
|
+
let tag = color(`${projectTag}`);
|
|
96
|
+
if (category) {
|
|
97
|
+
tag = tag + picocolors_1.default.dim(`[${category}]`);
|
|
98
|
+
}
|
|
99
|
+
const timestamp = picocolors_1.default.dim(new Date().toLocaleTimeString());
|
|
100
|
+
const whitespace = /\s|\[/.test((0, utils_js_1.stripAnsi)(msg)[0]) ? '' : ' ';
|
|
101
|
+
return `${timestamp} ${tag}${whitespace}${msg}`;
|
|
102
|
+
}
|
|
103
|
+
function hasRed(str) {
|
|
104
|
+
// https://github.com/brillout/picocolors/blob/e291f2a3e3251a7f218ab6369ae94434d85d0eb0/picocolors.js#L57
|
|
105
|
+
return str.includes('\x1b[31m');
|
|
106
|
+
}
|
|
107
|
+
function hasGreen(str) {
|
|
108
|
+
// https://github.com/brillout/picocolors/blob/e291f2a3e3251a7f218ab6369ae94434d85d0eb0/picocolors.js#L58
|
|
109
|
+
return str.includes('\x1b[32m');
|
|
110
|
+
}
|
|
111
|
+
function hasYellow(str) {
|
|
112
|
+
// https://github.com/brillout/picocolors/blob/e291f2a3e3251a7f218ab6369ae94434d85d0eb0/picocolors.js#L59
|
|
113
|
+
return str.includes('\x1b[33m');
|
|
114
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Non-production logger used for:
|
|
3
|
+
// - Development
|
|
4
|
+
// - Preview
|
|
5
|
+
// - Build
|
|
6
|
+
// - Pre-rendering
|
|
7
|
+
// In other words: everywhere except in production
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.clearLogs = exports.logErrorDebugNote = exports.logConfigErrorRecover = exports.logConfigError = exports.logConfigInfo = exports.logViteErrorContainingCodeSnippet = exports.logViteAny = void 0;
|
|
13
|
+
const abort_js_1 = require("../../../shared/route/abort.js");
|
|
14
|
+
const globalContext_js_1 = require("../../runtime/globalContext.js");
|
|
15
|
+
const loggerRuntime_js_1 = require("../../runtime/renderPage/loggerRuntime.js");
|
|
16
|
+
const utils_js_1 = require("../utils.js");
|
|
17
|
+
const getHttpRequestAsyncStore_js_1 = require("./getHttpRequestAsyncStore.js");
|
|
18
|
+
const isErrorDebug_js_1 = require("./isErrorDebug.js");
|
|
19
|
+
const errorWithCodeSnippet_js_1 = require("./loggerNotProd/errorWithCodeSnippet.js");
|
|
20
|
+
const transpileAndExecuteFile_js_1 = require("../plugins/importUserCode/v1-design/transpileAndExecuteFile.js");
|
|
21
|
+
const log_js_1 = require("./loggerNotProd/log.js");
|
|
22
|
+
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
23
|
+
const isNewError_js_1 = require("../../runtime/renderPage/isNewError.js");
|
|
24
|
+
const isConfigInvalid_js_1 = require("../../runtime/renderPage/isConfigInvalid.js");
|
|
25
|
+
(0, utils_js_1.assertIsNotProductionRuntime)();
|
|
26
|
+
(0, loggerRuntime_js_1.overwriteRuntimeProductionLogger)(logRuntimeError, logRuntimeInfo);
|
|
27
|
+
(0, utils_js_1.overwriteAssertProductionLogger)(assertLogger);
|
|
28
|
+
function logRuntimeInfo(msg, httpRequestId, logType, clearErrors) {
|
|
29
|
+
if (clearErrors)
|
|
30
|
+
clearLogs({ clearErrors: true });
|
|
31
|
+
const category = getCategory(httpRequestId);
|
|
32
|
+
(0, utils_js_1.assert)(category);
|
|
33
|
+
(0, log_js_1.logWithVikeTag)(msg, logType, category);
|
|
34
|
+
}
|
|
35
|
+
function logViteAny(msg, logType, httpRequestId, prependViteTag) {
|
|
36
|
+
if (prependViteTag) {
|
|
37
|
+
const category = getCategory(httpRequestId);
|
|
38
|
+
(0, log_js_1.logWithViteTag)(msg, logType, category);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
(0, log_js_1.logDirectly)(msg, logType);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.logViteAny = logViteAny;
|
|
45
|
+
function logConfigInfo(msg, logType) {
|
|
46
|
+
const category = getConfigCategory();
|
|
47
|
+
(0, log_js_1.logWithVikeTag)(msg, logType, category);
|
|
48
|
+
}
|
|
49
|
+
exports.logConfigInfo = logConfigInfo;
|
|
50
|
+
function logConfigErrorRecover() {
|
|
51
|
+
const msg = picocolors_1.default.bold(picocolors_1.default.green('Configuration successfully loaded'));
|
|
52
|
+
clearLogs({ clearAlsoIfConfigIsInvalid: true });
|
|
53
|
+
const category = getConfigCategory();
|
|
54
|
+
(0, log_js_1.logWithVikeTag)(msg, 'error-recover', category);
|
|
55
|
+
}
|
|
56
|
+
exports.logConfigErrorRecover = logConfigErrorRecover;
|
|
57
|
+
function logRuntimeError(err,
|
|
58
|
+
/** `httpRequestId` is `null` when pre-rendering */
|
|
59
|
+
httpRequestId) {
|
|
60
|
+
logErr(err, httpRequestId);
|
|
61
|
+
}
|
|
62
|
+
function logViteErrorContainingCodeSnippet(err) {
|
|
63
|
+
logErr(err);
|
|
64
|
+
}
|
|
65
|
+
exports.logViteErrorContainingCodeSnippet = logViteErrorContainingCodeSnippet;
|
|
66
|
+
function logErr(err, httpRequestId = null) {
|
|
67
|
+
(0, utils_js_1.warnIfErrorIsNotObject)(err);
|
|
68
|
+
if ((0, abort_js_1.isAbortError)(err) && !(0, isErrorDebug_js_1.isErrorDebug)()) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const store = (0, getHttpRequestAsyncStore_js_1.getHttpRequestAsyncStore)();
|
|
72
|
+
(0, isNewError_js_1.setAlreadyLogged)(err);
|
|
73
|
+
if ((0, getHttpRequestAsyncStore_js_1.getHttpRequestAsyncStore)()?.shouldErrorBeSwallowed(err)) {
|
|
74
|
+
if (!(0, isErrorDebug_js_1.isErrorDebug)())
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
store?.markErrorAsLogged(err);
|
|
79
|
+
}
|
|
80
|
+
const category = getCategory(httpRequestId);
|
|
81
|
+
if (!(0, isErrorDebug_js_1.isErrorDebug)()) {
|
|
82
|
+
if ((0, errorWithCodeSnippet_js_1.isErrorWithCodeSnippet)(err)) {
|
|
83
|
+
// We handle transpile errors globally because wrapping viteDevServer.ssrLoadModule() wouldn't be enough: transpile errors can be thrown not only when calling viteDevServer.ssrLoadModule() but also later when loading user code with import() (since Vite lazy-transpiles import() calls)
|
|
84
|
+
const viteConfig = (0, globalContext_js_1.getViteConfig)();
|
|
85
|
+
(0, utils_js_1.assert)(viteConfig);
|
|
86
|
+
let prettyErr = (0, errorWithCodeSnippet_js_1.getPrettyErrorWithCodeSnippet)(err, viteConfig.root);
|
|
87
|
+
(0, utils_js_1.assert)((0, utils_js_1.stripAnsi)(prettyErr).startsWith('Failed to transpile'));
|
|
88
|
+
(0, log_js_1.logWithViteTag)(prettyErr, 'error', category);
|
|
89
|
+
logErrorDebugNote();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
{
|
|
93
|
+
const logged = handleAssertMsg(err, category);
|
|
94
|
+
if (logged)
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Needs to be after assertion messages handling, because user hooks may throw an assertion error
|
|
99
|
+
const hook = (0, utils_js_1.isUserHookError)(err);
|
|
100
|
+
if (hook) {
|
|
101
|
+
const { hookName, hookFilePath } = hook;
|
|
102
|
+
(0, log_js_1.logWithVikeTag)(picocolors_1.default.red(`Following error was thrown by the ${hookName}() hook defined at ${hookFilePath}`), 'error', category);
|
|
103
|
+
}
|
|
104
|
+
else if (category) {
|
|
105
|
+
logFallbackErrIntro(category);
|
|
106
|
+
}
|
|
107
|
+
(0, log_js_1.logDirectly)(err, 'error');
|
|
108
|
+
}
|
|
109
|
+
function logConfigError(err) {
|
|
110
|
+
clearLogs({ clearAlsoIfConfigIsInvalid: true });
|
|
111
|
+
(0, utils_js_1.warnIfErrorIsNotObject)(err);
|
|
112
|
+
const category = getConfigCategory();
|
|
113
|
+
{
|
|
114
|
+
const errIntroMsg = (0, transpileAndExecuteFile_js_1.getConfigExececutionErrorIntroMsg)(err);
|
|
115
|
+
if (errIntroMsg) {
|
|
116
|
+
(0, utils_js_1.assert)((0, utils_js_1.stripAnsi)(errIntroMsg).startsWith('Failed to execute'));
|
|
117
|
+
(0, log_js_1.logWithVikeTag)(errIntroMsg, 'error', category);
|
|
118
|
+
(0, log_js_1.logDirectly)(err, 'error');
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
{
|
|
123
|
+
const errMsgFormatted = (0, transpileAndExecuteFile_js_1.getConfigBuildErrorFormatted)(err);
|
|
124
|
+
if (errMsgFormatted) {
|
|
125
|
+
(0, utils_js_1.assert)((0, utils_js_1.stripAnsi)(errMsgFormatted).startsWith('Failed to transpile'));
|
|
126
|
+
if (!(0, isErrorDebug_js_1.isErrorDebug)()) {
|
|
127
|
+
(0, log_js_1.logWithVikeTag)(errMsgFormatted, 'error', category);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
(0, log_js_1.logDirectly)(err, 'error');
|
|
131
|
+
}
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
{
|
|
136
|
+
const logged = handleAssertMsg(err, category);
|
|
137
|
+
if (logged)
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (category)
|
|
141
|
+
logFallbackErrIntro(category);
|
|
142
|
+
(0, log_js_1.logDirectly)(err, 'error');
|
|
143
|
+
}
|
|
144
|
+
exports.logConfigError = logConfigError;
|
|
145
|
+
function logFallbackErrIntro(category) {
|
|
146
|
+
(0, log_js_1.logWithVikeTag)(picocolors_1.default.bold(picocolors_1.default.red('[Error] An error was thrown:')), 'error', category);
|
|
147
|
+
}
|
|
148
|
+
function getConfigCategory() {
|
|
149
|
+
const category = getCategory() ?? 'config';
|
|
150
|
+
return category;
|
|
151
|
+
}
|
|
152
|
+
function handleAssertMsg(err, category) {
|
|
153
|
+
const res = (0, utils_js_1.getAssertErrMsg)(err);
|
|
154
|
+
if (!res)
|
|
155
|
+
return false;
|
|
156
|
+
const { assertMsg, showVikeVersion } = res;
|
|
157
|
+
(0, log_js_1.logWithVikeTag)(assertMsg, 'error', category, showVikeVersion);
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
function assertLogger(thing, logType) {
|
|
161
|
+
const category = getCategory();
|
|
162
|
+
const res = (0, utils_js_1.getAssertErrMsg)(thing);
|
|
163
|
+
/* Risk of infinite loop
|
|
164
|
+
assert(res)
|
|
165
|
+
*/
|
|
166
|
+
if (!res)
|
|
167
|
+
throw new Error('Internal error, reach out to a maintainer');
|
|
168
|
+
const { assertMsg, showVikeVersion } = res;
|
|
169
|
+
(0, log_js_1.logWithVikeTag)(assertMsg, logType, category, showVikeVersion);
|
|
170
|
+
}
|
|
171
|
+
function clearLogs(conditions = {}) {
|
|
172
|
+
if (!conditions.clearAlsoIfConfigIsInvalid && isConfigInvalid_js_1.isConfigInvalid) {
|
|
173
|
+
// Avoid hiding the config error: the config error is printed only once
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (conditions.clearErrors && !log_js_1.screenHasErrors) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (conditions.clearIfFirstLog && !log_js_1.isFirstLog) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const viteConfig = (0, globalContext_js_1.getViteConfig)();
|
|
183
|
+
if (viteConfig) {
|
|
184
|
+
(0, log_js_1.clearScreen)(viteConfig);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.clearLogs = clearLogs;
|
|
188
|
+
/** Note shown to user when vike does something risky:
|
|
189
|
+
* - When vike dedupes (i.e. swallows) an error with getHttpRequestAsyncStore().shouldErrorBeSwallowed(err)
|
|
190
|
+
* - When vike modifies the error with getPrettyErrorWithCodeSnippet(err)
|
|
191
|
+
*/
|
|
192
|
+
function logErrorDebugNote() {
|
|
193
|
+
if ((0, isErrorDebug_js_1.isErrorDebug)())
|
|
194
|
+
return;
|
|
195
|
+
const store = (0, getHttpRequestAsyncStore_js_1.getHttpRequestAsyncStore)();
|
|
196
|
+
if (store) {
|
|
197
|
+
if (store.errorDebugNoteAlreadyShown)
|
|
198
|
+
return;
|
|
199
|
+
store.errorDebugNoteAlreadyShown = true;
|
|
200
|
+
}
|
|
201
|
+
const msg = picocolors_1.default.dim([
|
|
202
|
+
'┌─────────────────────────────────────────────────────────────────────┐',
|
|
203
|
+
"│ Error isn't helpful? See https://vike.dev/errors#verbose │",
|
|
204
|
+
'└─────────────────────────────────────────────────────────────────────┘'
|
|
205
|
+
].join('\n'));
|
|
206
|
+
(0, log_js_1.logDirectly)(msg, 'error');
|
|
207
|
+
}
|
|
208
|
+
exports.logErrorDebugNote = logErrorDebugNote;
|
|
209
|
+
function getCategory(httpRequestId = null) {
|
|
210
|
+
const store = (0, getHttpRequestAsyncStore_js_1.getHttpRequestAsyncStore)();
|
|
211
|
+
if (store?.httpRequestId !== undefined) {
|
|
212
|
+
if (httpRequestId === null) {
|
|
213
|
+
httpRequestId = store.httpRequestId;
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
(0, utils_js_1.assert)(httpRequestId === store.httpRequestId);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (httpRequestId === null)
|
|
220
|
+
return null;
|
|
221
|
+
// const category = httpRequestId % 2 === 1 ? (`request-${httpRequestId}` as const) : (`request(${httpRequestId})` as const)
|
|
222
|
+
const category = `request(${httpRequestId})`;
|
|
223
|
+
return category;
|
|
224
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeSuperfluousViteLog_disable = exports.removeSuperfluousViteLog_enable = exports.removeSuperfluousViteLog = void 0;
|
|
4
|
+
const utils_js_1 = require("../../utils.js");
|
|
5
|
+
const superfluousLog = 'Forced re-optimization of dependencies';
|
|
6
|
+
let enabled = false;
|
|
7
|
+
function removeSuperfluousViteLog(msg) {
|
|
8
|
+
if (!enabled) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
if (msg.toLowerCase().includes('forced') && msg.toLowerCase().includes('optimization')) {
|
|
12
|
+
(0, utils_js_1.assert)(msg === superfluousLog, msg); // assertion fails => Vite changed its message => update this function
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
exports.removeSuperfluousViteLog = removeSuperfluousViteLog;
|
|
18
|
+
function removeSuperfluousViteLog_enable() {
|
|
19
|
+
enabled = true;
|
|
20
|
+
}
|
|
21
|
+
exports.removeSuperfluousViteLog_enable = removeSuperfluousViteLog_enable;
|
|
22
|
+
function removeSuperfluousViteLog_disable() {
|
|
23
|
+
enabled = false;
|
|
24
|
+
}
|
|
25
|
+
exports.removeSuperfluousViteLog_disable = removeSuperfluousViteLog_disable;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.improveViteLogs = void 0;
|
|
4
|
+
const utils_js_1 = require("../utils.js");
|
|
5
|
+
const loggerNotProd_js_1 = require("./loggerNotProd.js");
|
|
6
|
+
const errorWithCodeSnippet_js_1 = require("./loggerNotProd/errorWithCodeSnippet.js");
|
|
7
|
+
const getHttpRequestAsyncStore_js_1 = require("./getHttpRequestAsyncStore.js");
|
|
8
|
+
const removeSuperfluousViteLog_js_1 = require("./loggerVite/removeSuperfluousViteLog.js");
|
|
9
|
+
const isErrorDebug_js_1 = require("./isErrorDebug.js");
|
|
10
|
+
function improveViteLogs(config) {
|
|
11
|
+
intercept('info', config);
|
|
12
|
+
intercept('warn', config);
|
|
13
|
+
intercept('error', config);
|
|
14
|
+
}
|
|
15
|
+
exports.improveViteLogs = improveViteLogs;
|
|
16
|
+
function intercept(logType, config) {
|
|
17
|
+
config.logger[logType] = (msg, options = {}) => {
|
|
18
|
+
(0, utils_js_1.assert)(!(0, isErrorDebug_js_1.isErrorDebug)());
|
|
19
|
+
if ((0, removeSuperfluousViteLog_js_1.removeSuperfluousViteLog)(msg))
|
|
20
|
+
return;
|
|
21
|
+
if (!!options.timestamp) {
|
|
22
|
+
msg = (0, utils_js_1.trimWithAnsi)(msg);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
// No timestamp => no "[vite]" tag prepended => we don't trim the beginning of the message
|
|
26
|
+
msg = (0, utils_js_1.trimWithAnsiTrailOnly)(msg);
|
|
27
|
+
}
|
|
28
|
+
msg = cleanFirstViteLog(msg);
|
|
29
|
+
const store = (0, getHttpRequestAsyncStore_js_1.getHttpRequestAsyncStore)();
|
|
30
|
+
// Dedupe Vite error messages
|
|
31
|
+
if (options.error && store?.shouldErrorBeSwallowed(options.error)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
// Remove this once https://github.com/vitejs/vite/pull/13495 is released
|
|
35
|
+
if (msg.startsWith('Transform failed with ') && store && logType === 'error') {
|
|
36
|
+
store.markErrorMessageAsLogged(msg);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (options.error && (0, errorWithCodeSnippet_js_1.isErrorWithCodeSnippet)(options.error)) {
|
|
40
|
+
(0, loggerNotProd_js_1.logViteErrorContainingCodeSnippet)(options.error);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// Only allow Vite to clear its first log. All other clearing is controlled by vike.
|
|
44
|
+
if (options.clear)
|
|
45
|
+
(0, loggerNotProd_js_1.clearLogs)({ clearIfFirstLog: true });
|
|
46
|
+
if (options.error)
|
|
47
|
+
store?.markErrorAsLogged(options.error);
|
|
48
|
+
// Vite's default logger preprends the "[vite]" tag if and only if options.timestamp is true
|
|
49
|
+
const prependViteTag = options.timestamp || !!store?.httpRequestId;
|
|
50
|
+
(0, loggerNotProd_js_1.logViteAny)(msg, logType, store?.httpRequestId ?? null, prependViteTag);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function cleanFirstViteLog(msg) {
|
|
54
|
+
const isFirstVitLog = msg.includes('VITE') && msg.includes('ready');
|
|
55
|
+
if (isFirstVitLog) {
|
|
56
|
+
return (0, utils_js_1.removeEmptyLines)(msg);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return msg;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getImportStatements = exports.getExportNames = void 0;
|
|
4
|
+
const es_module_lexer_1 = require("es-module-lexer");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
6
|
+
async function getExportNames(src) {
|
|
7
|
+
const parseResult = await parseEsModule(src);
|
|
8
|
+
const [imports, exports] = parseResult;
|
|
9
|
+
const exportNames = exports.map((e) => e.n);
|
|
10
|
+
// This seems to be the only way to detect re-exports
|
|
11
|
+
// - https://github.com/brillout/es-module-lexer_tests
|
|
12
|
+
// - https://github.com/vitejs/vite/blob/8469bf0a5e38cbf08ec28e598ab155d339edc442/packages/vite/src/node/optimizer/index.ts#L978-L981
|
|
13
|
+
const wildcardReExports = [];
|
|
14
|
+
imports.forEach(({ n, ss, se }) => {
|
|
15
|
+
const exp = src.slice(ss, se);
|
|
16
|
+
if (/export\s+\*\s+from/.test(exp)) {
|
|
17
|
+
// `n` is `undefined` for dynamic imports with variable, e.g. `import(moduleName)`
|
|
18
|
+
(0, utils_js_1.assert)(n);
|
|
19
|
+
wildcardReExports.push(n);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return { wildcardReExports, exportNames };
|
|
23
|
+
}
|
|
24
|
+
exports.getExportNames = getExportNames;
|
|
25
|
+
async function getImportStatements(src) {
|
|
26
|
+
const parseResult = await parseEsModule(src);
|
|
27
|
+
const imports = parseResult[0].slice();
|
|
28
|
+
return imports;
|
|
29
|
+
}
|
|
30
|
+
exports.getImportStatements = getImportStatements;
|
|
31
|
+
async function parseEsModule(src) {
|
|
32
|
+
await es_module_lexer_1.init;
|
|
33
|
+
return (0, es_module_lexer_1.parse)(src);
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeSourceMap = void 0;
|
|
4
|
+
function removeSourceMap(code) {
|
|
5
|
+
return {
|
|
6
|
+
code,
|
|
7
|
+
// Remove Source Map to save KBs
|
|
8
|
+
// - https://rollupjs.org/guide/en/#source-code-transformations
|
|
9
|
+
map: { mappings: '' }
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
exports.removeSourceMap = removeSourceMap;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rollupIsEsm = void 0;
|
|
4
|
+
const utils_js_1 = require("../utils.js");
|
|
5
|
+
function rollupIsEsm(rollupOptions) {
|
|
6
|
+
const { format } = rollupOptions;
|
|
7
|
+
(0, utils_js_1.assert)(typeof format === 'string');
|
|
8
|
+
(0, utils_js_1.assert)(format === 'amd' ||
|
|
9
|
+
format === 'cjs' ||
|
|
10
|
+
format === 'es' ||
|
|
11
|
+
format === 'iife' ||
|
|
12
|
+
format === 'system' ||
|
|
13
|
+
format === 'umd');
|
|
14
|
+
return format === 'es';
|
|
15
|
+
}
|
|
16
|
+
exports.rollupIsEsm = rollupIsEsm;
|