vike 0.4.195-commit-3f77496 → 0.4.195-commit-f7e91ba
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/__internal/index.js +3 -4
- package/dist/cjs/node/cli/onLoad.js +1 -2
- package/dist/cjs/node/createPageRenderer.js +1 -2
- package/dist/cjs/node/plugin/index.js +3 -3
- package/dist/cjs/node/plugin/onLoad.js +1 -2
- package/dist/cjs/node/plugin/plugins/autoFullBuild.js +1 -2
- package/dist/cjs/node/plugin/plugins/baseUrls.js +1 -2
- package/dist/cjs/node/plugin/plugins/buildConfig/fixServerAssets.js +2 -3
- package/dist/cjs/node/plugin/plugins/buildConfig.js +4 -4
- package/dist/cjs/node/plugin/plugins/commonConfig/assertResolveAlias.js +1 -2
- package/dist/cjs/node/plugin/plugins/commonConfig.js +1 -2
- package/dist/cjs/node/plugin/plugins/config/assertVikeConfig.js +1 -2
- package/dist/cjs/node/plugin/plugins/config/index.js +1 -2
- package/dist/cjs/node/plugin/plugins/config/pickFirst.js +1 -2
- package/dist/cjs/node/plugin/plugins/config/resolveBase.js +2 -3
- package/dist/cjs/node/plugin/plugins/devConfig/determineFsAllowList.js +1 -2
- package/dist/cjs/node/plugin/plugins/devConfig/determineOptimizeDeps.js +1 -2
- package/dist/cjs/node/plugin/plugins/devConfig/index.js +1 -2
- package/dist/cjs/node/plugin/plugins/distFileNames.js +1 -2
- package/dist/cjs/node/plugin/plugins/envVars.js +1 -2
- package/dist/cjs/node/plugin/plugins/extractAssetsPlugin.js +2 -2
- package/dist/cjs/node/plugin/plugins/extractExportNamesPlugin.js +3 -3
- package/dist/cjs/node/plugin/plugins/fileEnv.js +109 -88
- package/dist/cjs/node/plugin/plugins/importBuild/getVikeManifest.js +1 -2
- package/dist/cjs/node/plugin/plugins/importBuild/index.js +2 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/addImportStatement.js +1 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +1 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/index.js +1 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/assertExtensions.js +2 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getConfigFileExport.js +1 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/crawlPlusFiles.js +1 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/filesystemRouting.js +8 -9
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.js +3 -4
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolvePointerImport.js +3 -4
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transformFileImports.js +3 -4
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +4 -5
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +6 -6
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +1 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigs.js +1 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/isRuntimeEnvMatch.js +1 -2
- package/dist/cjs/node/plugin/plugins/packageJsonFile.js +1 -2
- package/dist/cjs/node/plugin/plugins/previewConfig.js +1 -2
- package/dist/cjs/node/plugin/plugins/removeRequireHookPlugin.js +1 -2
- package/dist/cjs/node/plugin/plugins/setGlobalContext.js +1 -2
- package/dist/cjs/node/plugin/plugins/suppressRollupWarning.js +1 -2
- package/dist/cjs/node/plugin/plugins/workaroundCssModuleHmr.js +1 -2
- package/dist/cjs/node/plugin/resolveClientEntriesDev.js +1 -2
- package/dist/cjs/node/plugin/shared/addSsrMiddleware.js +1 -2
- package/dist/cjs/node/plugin/shared/findPageFiles.js +1 -2
- package/dist/cjs/node/plugin/shared/getAssetsDir.js +1 -2
- package/dist/cjs/node/plugin/shared/getFilePath.js +8 -9
- package/dist/cjs/node/plugin/shared/getHttpRequestAsyncStore.js +2 -3
- package/dist/cjs/node/plugin/shared/isAsset.js +1 -2
- package/dist/cjs/node/plugin/shared/isViteCliCall.js +2 -3
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet.js +4 -5
- package/dist/cjs/node/plugin/shared/loggerNotProd/log.js +4 -5
- package/dist/cjs/node/plugin/shared/loggerNotProd.js +6 -7
- package/dist/cjs/node/plugin/shared/loggerVite/removeSuperfluousViteLog.js +3 -4
- package/dist/cjs/node/plugin/shared/loggerVite.js +1 -2
- package/dist/cjs/node/plugin/shared/parseEsModule.js +2 -3
- package/dist/cjs/node/plugin/shared/rollupIsEsm.js +1 -2
- package/dist/cjs/node/plugin/shared/rollupSourceMap.js +2 -3
- package/dist/cjs/node/prerender/runPrerender.js +4 -5
- package/dist/cjs/node/runtime/globalContext/loadImportBuild.js +2 -3
- package/dist/cjs/node/runtime/globalContext.js +13 -14
- package/dist/cjs/node/runtime/html/injectAssets/getHtmlTags.js +1 -2
- package/dist/cjs/node/runtime/html/injectAssets/getViteDevScript.js +1 -2
- package/dist/cjs/node/runtime/html/injectAssets/inferHtmlTags.js +4 -4
- package/dist/cjs/node/runtime/html/injectAssets/injectAssets__public.js +1 -2
- package/dist/cjs/node/runtime/html/injectAssets/injectHtmlTags.js +6 -7
- package/dist/cjs/node/runtime/html/injectAssets/mergeScriptTags.js +1 -2
- package/dist/cjs/node/runtime/html/injectAssets/sanitizeJson.js +1 -2
- package/dist/cjs/node/runtime/html/injectAssets.js +2 -3
- package/dist/cjs/node/runtime/html/renderHtml.js +5 -6
- package/dist/cjs/node/runtime/html/serializePageContextClientSide.js +2 -3
- package/dist/cjs/node/runtime/html/stream/react-streaming.js +3 -4
- package/dist/cjs/node/runtime/html/stream.js +21 -22
- package/dist/cjs/node/runtime/onLoad.js +1 -2
- package/dist/cjs/node/runtime/page-files/getPageFilesExports.js +1 -2
- package/dist/cjs/node/runtime/renderPage/analyzePage.js +1 -2
- package/dist/cjs/node/runtime/renderPage/assertArguments.js +1 -2
- package/dist/cjs/node/runtime/renderPage/createHttpResponse/assertNoInfiniteHttpRedirect.js +1 -2
- package/dist/cjs/node/runtime/renderPage/createHttpResponse/getCacheControl.js +1 -2
- package/dist/cjs/node/runtime/renderPage/createHttpResponse.js +5 -6
- package/dist/cjs/node/runtime/renderPage/debugPageFiles.js +1 -2
- package/dist/cjs/node/runtime/renderPage/executeOnBeforeRenderAndDataHooks.js +1 -2
- package/dist/cjs/node/runtime/renderPage/executeOnRenderHtmlHook.js +1 -2
- package/dist/cjs/node/runtime/renderPage/getEarlyHints.js +1 -2
- package/dist/cjs/node/runtime/renderPage/getHttpResponseBody.js +2 -3
- package/dist/cjs/node/runtime/renderPage/getPageAssets/getManifestEntry.js +1 -2
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsDev.js +1 -2
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +1 -2
- package/dist/cjs/node/runtime/renderPage/getPageAssets/sortPageAssetsForEarlyHintsHeader.js +1 -2
- package/dist/cjs/node/runtime/renderPage/getPageAssets.js +2 -3
- package/dist/cjs/node/runtime/renderPage/handleErrorWithoutErrorPage.js +1 -2
- package/dist/cjs/node/runtime/renderPage/handlePageContextRequestUrl.js +1 -2
- package/dist/cjs/node/runtime/renderPage/inferMediaType.js +1 -2
- package/dist/cjs/node/runtime/renderPage/isNewError.js +2 -3
- package/dist/cjs/node/runtime/renderPage/loadUserFilesServerSide.js +1 -2
- package/dist/cjs/node/runtime/renderPage/log404/index.js +2 -3
- package/dist/cjs/node/runtime/renderPage/logErrorHint.js +2 -3
- package/dist/cjs/node/runtime/renderPage/loggerProd.js +2 -3
- package/dist/cjs/node/runtime/renderPage/loggerRuntime.js +2 -2
- package/dist/cjs/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.js +1 -2
- package/dist/cjs/node/runtime/renderPage/renderPageAlreadyRouted.js +5 -6
- package/dist/cjs/node/runtime/renderPage/resolveRedirects.js +2 -3
- package/dist/cjs/node/runtime/renderPage.js +2 -2
- package/dist/cjs/node/shared/assertPluginManifest.js +1 -2
- package/dist/cjs/node/shared/assertRuntimeManifest.js +1 -2
- package/dist/cjs/node/shared/assertV1Design.js +1 -2
- package/dist/cjs/node/shared/extractAssetsQuery.js +2 -3
- package/dist/cjs/node/shared/getConfigVike.js +1 -2
- package/dist/cjs/node/shared/isErrorDebug.js +1 -2
- package/dist/cjs/node/shared/prependEntriesDir.js +1 -2
- package/dist/cjs/node/shared/virtual-files/virtualFileImportUserCode.js +2 -2
- package/dist/cjs/node/shared/virtual-files/virtualFilePageConfigValuesAll.js +2 -3
- package/dist/cjs/shared/addIs404ToPageProps.js +1 -2
- package/dist/cjs/shared/assertHookReturnedObject.js +1 -2
- package/dist/cjs/shared/assertOnBeforeRenderHookReturn.js +1 -2
- package/dist/cjs/shared/assertPageContextProvidedByUser.js +1 -2
- package/dist/cjs/shared/assertPageFilePath.js +1 -2
- package/dist/cjs/shared/determinePageIdOld.js +1 -2
- package/dist/cjs/shared/error-page.js +3 -4
- package/dist/cjs/shared/getPageContextRequestUrl.js +2 -2
- package/dist/cjs/shared/getPageContextUrlComputed.js +2 -3
- package/dist/cjs/shared/getPageFiles/analyzeClientSide.js +1 -2
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/analyzeExports.js +1 -2
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/determineClientEntry.js +2 -3
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/getExportNames.js +1 -2
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide.js +2 -3
- package/dist/cjs/shared/getPageFiles/analyzePageServerSide.js +1 -2
- package/dist/cjs/shared/getPageFiles/assert_exports_old_design.js +3 -3
- package/dist/cjs/shared/getPageFiles/fileTypes.js +3 -3
- package/dist/cjs/shared/getPageFiles/getAllPageIdFiles.js +2 -3
- package/dist/cjs/shared/getPageFiles/getExports.js +1 -2
- package/dist/cjs/shared/getPageFiles/getPageFileObject.js +1 -2
- package/dist/cjs/shared/getPageFiles/parseGlobResults.js +1 -2
- package/dist/cjs/shared/getPageFiles/setPageFiles.js +3 -4
- package/dist/cjs/shared/hooks/executeHook.js +4 -5
- package/dist/cjs/shared/hooks/getHook.js +6 -7
- package/dist/cjs/shared/modifyUrl.js +1 -2
- package/dist/cjs/shared/page-configs/assertPlusFileExport.js +1 -2
- package/dist/cjs/shared/page-configs/findPageConfig.js +1 -2
- package/dist/cjs/shared/page-configs/getConfigDefinedAt.js +3 -4
- package/dist/cjs/shared/page-configs/getConfigValue.js +2 -3
- package/dist/cjs/shared/page-configs/getConfigValueBuildTime.js +1 -2
- package/dist/cjs/shared/page-configs/getExportPath.js +1 -2
- package/dist/cjs/shared/page-configs/helpers.js +3 -4
- package/dist/cjs/shared/page-configs/loadConfigValues.js +1 -2
- package/dist/cjs/shared/page-configs/serialize/parsePageConfigs.js +2 -3
- package/dist/cjs/shared/page-configs/serialize/serializeConfigValues.js +1 -2
- package/dist/cjs/shared/route/abort.js +9 -10
- package/dist/cjs/shared/route/debug.js +1 -2
- package/dist/cjs/shared/route/deduceRouteStringFromFilesystemPath.js +1 -2
- package/dist/cjs/shared/route/executeGuardHook.js +1 -2
- package/dist/cjs/shared/route/executeOnBeforeRouteHook.js +1 -2
- package/dist/cjs/shared/route/index.js +1 -2
- package/dist/cjs/shared/route/loadPageRoutes.js +1 -2
- package/dist/cjs/shared/route/resolvePrecedence.js +1 -2
- package/dist/cjs/shared/route/resolveRoute.js +1 -2
- package/dist/cjs/shared/route/resolveRouteFunction.js +4 -5
- package/dist/cjs/shared/route/resolveRouteString.js +6 -7
- package/dist/cjs/shared/route/resolveUrlPathname.js +1 -2
- package/dist/cjs/shared/sortPageContext.js +1 -2
- package/dist/cjs/types/defineConfig.js +1 -2
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/assert.js +10 -11
- package/dist/cjs/utils/assertIsBrowser.js +1 -2
- package/dist/cjs/utils/assertIsNotBrowser.js +1 -2
- package/dist/cjs/utils/assertIsNotProductionRuntime.js +6 -6
- package/dist/cjs/utils/assertKeys.js +1 -2
- package/dist/cjs/utils/assertNodeEnv.js +5 -6
- package/dist/cjs/utils/assertNodeVersion.js +1 -2
- package/dist/cjs/utils/assertRoutingType.js +3 -4
- package/dist/cjs/utils/assertSingleInstance.js +3 -4
- package/dist/cjs/utils/assertVersion.js +2 -3
- package/dist/cjs/utils/augmentType.js +1 -2
- package/dist/cjs/utils/capitalizeFirstLetter.js +1 -2
- package/dist/cjs/utils/cast.js +2 -3
- package/dist/cjs/utils/changeEnumerable.js +1 -2
- package/dist/cjs/utils/checkType.js +2 -3
- package/dist/cjs/utils/compareString.js +1 -2
- package/dist/cjs/utils/createErrorWithCleanStackTrace.js +1 -2
- package/dist/cjs/utils/debug.js +2 -3
- package/dist/cjs/utils/deepEqual.js +1 -2
- package/dist/cjs/utils/escapeHtml.js +1 -2
- package/dist/cjs/utils/escapeRegex.js +1 -2
- package/dist/cjs/utils/filesystemPathHandling.js +2 -3
- package/dist/cjs/utils/findFile.js +1 -2
- package/dist/cjs/utils/findPackageJson.js +1 -2
- package/dist/cjs/utils/formatHintLog.js +1 -2
- package/dist/cjs/utils/freezePartial.js +1 -2
- package/dist/cjs/utils/genPromise.js +1 -2
- package/dist/cjs/utils/getCurrentUrl.js +1 -2
- package/dist/cjs/utils/getFileExtension.js +1 -2
- package/dist/cjs/utils/getGlobalObject.js +2 -3
- package/dist/cjs/utils/getMostSimilar.js +1 -2
- package/dist/cjs/utils/getOutDirs.js +2 -3
- package/dist/cjs/utils/getPropAccessNotation.js +1 -2
- package/dist/cjs/utils/getRandomId.js +1 -2
- package/dist/cjs/utils/getTerminWidth.js +1 -2
- package/dist/cjs/utils/getValuePrintable.js +1 -2
- package/dist/cjs/utils/hasProp.js +1 -2
- package/dist/cjs/utils/humanizeTime.js +1 -2
- package/dist/cjs/utils/includes.js +1 -2
- package/dist/cjs/utils/injectRollupInputs.js +2 -3
- package/dist/cjs/utils/isArray.js +1 -2
- package/dist/cjs/utils/isArrayOfStrings.js +1 -2
- package/dist/cjs/utils/isBrowser.js +1 -2
- package/dist/cjs/utils/isCallable.js +1 -2
- package/dist/cjs/utils/isDev.js +2 -3
- package/dist/cjs/utils/isFilePathAbsoluteFilesystem.js +2 -3
- package/dist/cjs/utils/isHtml.js +1 -2
- package/dist/cjs/utils/isNodeJS.js +1 -2
- package/dist/cjs/utils/isNpmPackage.js +5 -6
- package/dist/cjs/utils/isObject.js +1 -2
- package/dist/cjs/utils/isObjectOfStrings.js +1 -2
- package/dist/cjs/utils/isObjectWithKeys.js +1 -2
- package/dist/cjs/utils/isPlainObject.js +1 -2
- package/dist/cjs/utils/isPromise.js +1 -2
- package/dist/cjs/utils/isPropertyGetter.js +1 -2
- package/dist/cjs/utils/isReact.js +1 -2
- package/dist/cjs/utils/isSameErrorMessage.js +1 -2
- package/dist/cjs/utils/isScriptFile.js +4 -4
- package/dist/cjs/utils/isVikeReactApp.js +1 -2
- package/dist/cjs/utils/isVitest.js +1 -2
- package/dist/cjs/utils/joinEnglish.js +1 -2
- package/dist/cjs/utils/normalizeHeaders.js +1 -2
- package/dist/cjs/utils/objectAssign.js +1 -2
- package/dist/cjs/utils/objectDefineProperty.js +1 -2
- package/dist/cjs/utils/objectEntries.js +1 -2
- package/dist/cjs/utils/objectEntriesForEach.js +1 -2
- package/dist/cjs/utils/objectFromEntries.js +1 -2
- package/dist/cjs/utils/objectKeys.js +1 -2
- package/dist/cjs/utils/onPageVisibilityChange.js +2 -3
- package/dist/cjs/utils/pLimit.js +1 -2
- package/dist/cjs/utils/parseUrl-extras.js +8 -9
- package/dist/cjs/utils/parseUrl.js +11 -12
- package/dist/cjs/utils/path-shim.js +1 -2
- package/dist/cjs/utils/redirectHard.js +1 -2
- package/dist/cjs/utils/removeEmptyLines.js +1 -2
- package/dist/cjs/utils/removeFileExtention.js +1 -2
- package/dist/cjs/utils/requireResolve.js +1 -2
- package/dist/cjs/utils/sleep.js +1 -2
- package/dist/cjs/utils/slice.js +1 -2
- package/dist/cjs/utils/sorter.js +5 -6
- package/dist/cjs/utils/stringifyStringArray.js +1 -2
- package/dist/cjs/utils/stripAnsi.js +1 -2
- package/dist/cjs/utils/throttle.js +1 -2
- package/dist/cjs/utils/trimWithAnsi.js +2 -3
- package/dist/cjs/utils/truncateString.js +1 -2
- package/dist/cjs/utils/unique.js +1 -2
- package/dist/cjs/utils/urlToFile.js +2 -2
- package/dist/cjs/utils/virtual-files.js +3 -4
- package/dist/cjs/utils/viteIsSSR.js +2 -3
- package/dist/cjs/utils/warnIfErrorIsNotObject.js +1 -2
- package/dist/esm/node/plugin/plugins/fileEnv.js +109 -87
- package/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +0 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/debug.d.ts +2 -2
- package/dist/esm/node/runtime/html/stream.d.ts +0 -1
- package/dist/esm/node/runtime/index-deprecated.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/getHttpResponseBody.d.ts +0 -1
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +6 -6
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/debugGlob.d.ts +2 -2
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/package.json +2 -2
|
@@ -3,7 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getFilePathResolved = getFilePathResolved;
|
|
7
|
+
exports.getFilePathUnresolved = getFilePathUnresolved;
|
|
8
|
+
exports.getFilePathAbsoluteUserRootDir = getFilePathAbsoluteUserRootDir;
|
|
9
|
+
exports.getFilePathToShowToUserFromUnkown = getFilePathToShowToUserFromUnkown;
|
|
10
|
+
exports.getModuleFilePathAbsolute = getModuleFilePathAbsolute;
|
|
11
|
+
exports.getModuleFilePathRelative = getModuleFilePathRelative;
|
|
12
|
+
exports.cleanFilePathUnkown = cleanFilePathUnkown;
|
|
13
|
+
exports.assertModuleId = assertModuleId;
|
|
7
14
|
const path_1 = __importDefault(require("path"));
|
|
8
15
|
const utils_js_1 = require("../utils.js");
|
|
9
16
|
function getFilePathResolved(args) {
|
|
@@ -32,7 +39,6 @@ function getFilePathResolved(args) {
|
|
|
32
39
|
};
|
|
33
40
|
return filePathResolved;
|
|
34
41
|
}
|
|
35
|
-
exports.getFilePathResolved = getFilePathResolved;
|
|
36
42
|
function getComputedProps(args) {
|
|
37
43
|
if ('filePathAbsoluteUserRootDir' in args) {
|
|
38
44
|
const importPathAbsolute = args.importPathAbsolute ?? null;
|
|
@@ -66,7 +72,6 @@ function getFilePathUnresolved(args) {
|
|
|
66
72
|
filePathAbsoluteFilesystem: null
|
|
67
73
|
};
|
|
68
74
|
}
|
|
69
|
-
exports.getFilePathUnresolved = getFilePathUnresolved;
|
|
70
75
|
function getFilePathAbsoluteUserFilesystem({ filePathAbsoluteUserRootDir, userRootDir }) {
|
|
71
76
|
(0, utils_js_1.assertPosixPath)(filePathAbsoluteUserRootDir);
|
|
72
77
|
(0, utils_js_1.assertPosixPath)(userRootDir);
|
|
@@ -82,7 +87,6 @@ function getFilePathAbsoluteUserRootDir({ filePathAbsoluteFilesystem, userRootDi
|
|
|
82
87
|
});
|
|
83
88
|
return filePathAbsoluteUserRootDir;
|
|
84
89
|
}
|
|
85
|
-
exports.getFilePathAbsoluteUserRootDir = getFilePathAbsoluteUserRootDir;
|
|
86
90
|
function getFilePathRelative({ filePathAbsoluteFilesystem, userRootDir }) {
|
|
87
91
|
(0, utils_js_1.assertPosixPath)(filePathAbsoluteFilesystem);
|
|
88
92
|
(0, utils_js_1.assertPosixPath)(userRootDir);
|
|
@@ -112,12 +116,10 @@ function getModuleFilePathAbsolute(moduleId, config) {
|
|
|
112
116
|
const { filePathAbsoluteUserRootDir, filePathAbsoluteFilesystem } = getModuleFilePath(moduleId, config);
|
|
113
117
|
return filePathAbsoluteUserRootDir || filePathAbsoluteFilesystem;
|
|
114
118
|
}
|
|
115
|
-
exports.getModuleFilePathAbsolute = getModuleFilePathAbsolute;
|
|
116
119
|
function getModuleFilePathRelative(moduleId, config) {
|
|
117
120
|
const { filePathRelativeUserRootDir } = getModuleFilePath(moduleId, config);
|
|
118
121
|
return filePathRelativeUserRootDir;
|
|
119
122
|
}
|
|
120
|
-
exports.getModuleFilePathRelative = getModuleFilePathRelative;
|
|
121
123
|
function getModuleFilePath(moduleId, config) {
|
|
122
124
|
const userRootDir = config.root;
|
|
123
125
|
assertModuleId(moduleId);
|
|
@@ -135,7 +137,6 @@ function assertModuleId(moduleId) {
|
|
|
135
137
|
(0, utils_js_1.assertPosixPath)(moduleId);
|
|
136
138
|
(0, utils_js_1.assertFilePathAbsoluteFilesystem)(moduleId); // Can moduleId be something else than the filesystem absolute path?
|
|
137
139
|
}
|
|
138
|
-
exports.assertModuleId = assertModuleId;
|
|
139
140
|
function getFilePathToShowToUserFromUnkown(
|
|
140
141
|
// We don't have any guarentee about filePath, e.g. about whether is filePathAbsoluteFilesystem or filePathAbsoluteUserRootDir
|
|
141
142
|
filePathUnkown, userRootDir) {
|
|
@@ -149,7 +150,6 @@ filePathUnkown, userRootDir) {
|
|
|
149
150
|
return getFilePathAbsoluteUserRootDir2(filePathUnkown, userRootDir);
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
|
-
exports.getFilePathToShowToUserFromUnkown = getFilePathToShowToUserFromUnkown;
|
|
153
153
|
function getFilePathAbsoluteUserRootDir2(filePathAbsoluteFilesystem, userRootDir) {
|
|
154
154
|
(0, utils_js_1.assert)(filePathAbsoluteFilesystem.startsWith(userRootDir));
|
|
155
155
|
let filePathAbsoluteUserRootDir = filePathAbsoluteFilesystem.slice(userRootDir.length);
|
|
@@ -162,7 +162,6 @@ function cleanFilePathUnkown(filePathUnknown) {
|
|
|
162
162
|
filePathUnknown = cleanModuleId(filePathUnknown);
|
|
163
163
|
return filePathUnknown;
|
|
164
164
|
}
|
|
165
|
-
exports.cleanFilePathUnkown = cleanFilePathUnkown;
|
|
166
165
|
function cleanModuleId(moduleId) {
|
|
167
166
|
// remove query
|
|
168
167
|
const parts = moduleId.split('?');
|
|
@@ -26,7 +26,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
26
|
return result;
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.getHttpRequestAsyncStore = getHttpRequestAsyncStore;
|
|
30
|
+
exports.installHttpRequestAsyncStore = installHttpRequestAsyncStore;
|
|
30
31
|
const renderPage_js_1 = require("../../runtime/renderPage.js");
|
|
31
32
|
const utils_js_1 = require("../utils.js");
|
|
32
33
|
const transpileAndExecuteFile_js_1 = require("../plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js");
|
|
@@ -73,7 +74,6 @@ async function installHttpRequestAsyncStore() {
|
|
|
73
74
|
});
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
exports.installHttpRequestAsyncStore = installHttpRequestAsyncStore;
|
|
77
77
|
function getHttpRequestAsyncStore() {
|
|
78
78
|
if (asyncLocalStorage === null)
|
|
79
79
|
return null;
|
|
@@ -81,7 +81,6 @@ function getHttpRequestAsyncStore() {
|
|
|
81
81
|
(0, utils_js_1.assert)(store === undefined || (0, utils_js_1.isObject)(store));
|
|
82
82
|
return store;
|
|
83
83
|
}
|
|
84
|
-
exports.getHttpRequestAsyncStore = getHttpRequestAsyncStore;
|
|
85
84
|
function isEquivalent(err1, err2) {
|
|
86
85
|
if (err1 === err2)
|
|
87
86
|
return true;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isAsset =
|
|
3
|
+
exports.isAsset = isAsset;
|
|
4
4
|
function isAsset(filename) {
|
|
5
5
|
return assetFileExtensions.some((ext) => filename.endsWith('.' + ext));
|
|
6
6
|
}
|
|
7
|
-
exports.isAsset = isAsset;
|
|
8
7
|
// Copied from Vite: https://github.com/vitejs/vite/blob/9d28ffd3410a3ea2b739cce31e845f59cebd3cc6/packages/vite/src/node/constants.ts#L83-L121
|
|
9
8
|
// Alternatively: check sirv's source code (it needs to send the right Content-Type header)
|
|
10
9
|
const assetFileExtensions = [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isViteCliCall = isViteCliCall;
|
|
4
|
+
exports.getViteConfigFromCli = getViteConfigFromCli;
|
|
4
5
|
const utils_js_1 = require("../utils.js");
|
|
5
6
|
const cac_1 = require("cac");
|
|
6
7
|
function isViteCliCall() {
|
|
@@ -15,7 +16,6 @@ function isViteCliCall() {
|
|
|
15
16
|
// Global install
|
|
16
17
|
execPath.endsWith('/bin/vite'));
|
|
17
18
|
}
|
|
18
|
-
exports.isViteCliCall = isViteCliCall;
|
|
19
19
|
function getViteConfigFromCli() {
|
|
20
20
|
if (!isViteCliCall())
|
|
21
21
|
return null;
|
|
@@ -81,4 +81,3 @@ function getViteConfigFromCli() {
|
|
|
81
81
|
return ret;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
exports.getViteConfigFromCli = getViteConfigFromCli;
|
|
@@ -5,7 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
6
|
};
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
8
|
+
exports.getPrettyErrorWithCodeSnippet = getPrettyErrorWithCodeSnippet;
|
|
9
|
+
exports.isErrorWithCodeSnippet = isErrorWithCodeSnippet;
|
|
10
|
+
exports.isEquivalentErrorWithCodeSnippet = isEquivalentErrorWithCodeSnippet;
|
|
11
|
+
exports.getPrettyErrMessage = getPrettyErrMessage;
|
|
9
12
|
// Copied & adapted from https://github.com/vitejs/vite/blob/9c114c5c72a6af87e3330d5573362554b4511265/packages/vite/src/node/server/middlewares/error.ts
|
|
10
13
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
11
14
|
const utils_js_1 = require("../../utils.js");
|
|
@@ -26,7 +29,6 @@ function isErrorWithCodeSnippet(err) {
|
|
|
26
29
|
}
|
|
27
30
|
return false;
|
|
28
31
|
}
|
|
29
|
-
exports.isErrorWithCodeSnippet = isErrorWithCodeSnippet;
|
|
30
32
|
function getPrettyErrorWithCodeSnippet(err, userRootDir) {
|
|
31
33
|
/* Uncomment to inspect and/or create fixture for ./errorWithCodeSnippet.spec.ts
|
|
32
34
|
console.log('userRootDir', userRootDir)
|
|
@@ -77,7 +79,6 @@ function getPrettyErrorWithCodeSnippet(err, userRootDir) {
|
|
|
77
79
|
*/
|
|
78
80
|
return msg;
|
|
79
81
|
}
|
|
80
|
-
exports.getPrettyErrorWithCodeSnippet = getPrettyErrorWithCodeSnippet;
|
|
81
82
|
function getPrettyErrMessage(err) {
|
|
82
83
|
const { id, frame } = err;
|
|
83
84
|
let errMsg = err.message;
|
|
@@ -102,7 +103,6 @@ function getPrettyErrMessage(err) {
|
|
|
102
103
|
errMsg = '';
|
|
103
104
|
return errMsg;
|
|
104
105
|
}
|
|
105
|
-
exports.getPrettyErrMessage = getPrettyErrMessage;
|
|
106
106
|
function containsCodeSnippet(str) {
|
|
107
107
|
str = (0, utils_js_1.stripAnsi)(str);
|
|
108
108
|
let codeBlockSize = 0;
|
|
@@ -157,7 +157,6 @@ function isEquivalentErrorWithCodeSnippet(err1, err2) {
|
|
|
157
157
|
}
|
|
158
158
|
return false;
|
|
159
159
|
}
|
|
160
|
-
exports.isEquivalentErrorWithCodeSnippet = isEquivalentErrorWithCodeSnippet;
|
|
161
160
|
function isDefinedAndSame(val1, val2) {
|
|
162
161
|
return val1 && val1 === val2;
|
|
163
162
|
}
|
|
@@ -3,7 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.logWithViteTag = logWithViteTag;
|
|
7
|
+
exports.logWithVikeTag = logWithVikeTag;
|
|
8
|
+
exports.logDirectly = logDirectly;
|
|
9
|
+
exports.applyViteSourceMapToStackTrace = applyViteSourceMapToStackTrace;
|
|
7
10
|
const utils_js_1 = require("../../utils.js");
|
|
8
11
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
9
12
|
const isErrorDebug_js_1 = require("../../../shared/isErrorDebug.js");
|
|
@@ -14,7 +17,6 @@ function logWithVikeTag(msg, logType, category, showVikeVersion = false) {
|
|
|
14
17
|
msg = prependTags(msg, projectTag, category, logType);
|
|
15
18
|
logDirectly(msg, logType);
|
|
16
19
|
}
|
|
17
|
-
exports.logWithVikeTag = logWithVikeTag;
|
|
18
20
|
function getProjectTag(showVikeVersion) {
|
|
19
21
|
let projectTag;
|
|
20
22
|
if (showVikeVersion) {
|
|
@@ -29,7 +31,6 @@ function logWithViteTag(msg, logType, category) {
|
|
|
29
31
|
msg = prependTags(msg, '[vite]', category, logType);
|
|
30
32
|
logDirectly(msg, logType);
|
|
31
33
|
}
|
|
32
|
-
exports.logWithViteTag = logWithViteTag;
|
|
33
34
|
// Not production => every log is triggered by logDirectly()
|
|
34
35
|
// - Even all Vite logs also go through logDirectly() (see interceptors of loggerVite.ts)
|
|
35
36
|
// - Production => logs aren't managed by loggerNotProd.ts => logDirectly() is never called (not even loaded as asserted by assertIsVitePluginCode())
|
|
@@ -54,7 +55,6 @@ function logDirectly(thing, logType) {
|
|
|
54
55
|
}
|
|
55
56
|
(0, utils_js_1.assert)(false);
|
|
56
57
|
}
|
|
57
|
-
exports.logDirectly = logDirectly;
|
|
58
58
|
function applyViteSourceMapToStackTrace(thing) {
|
|
59
59
|
if ((0, isErrorDebug_js_1.isErrorDebug)())
|
|
60
60
|
return;
|
|
@@ -66,7 +66,6 @@ function applyViteSourceMapToStackTrace(thing) {
|
|
|
66
66
|
// Apply Vite's source maps
|
|
67
67
|
viteDevServer.ssrFixStacktrace(thing);
|
|
68
68
|
}
|
|
69
|
-
exports.applyViteSourceMapToStackTrace = applyViteSourceMapToStackTrace;
|
|
70
69
|
function prependTags(msg, projectTag, category, logType) {
|
|
71
70
|
const color = (s) => {
|
|
72
71
|
if (logType === 'error' && !hasRed(msg))
|
|
@@ -9,7 +9,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.logViteAny = logViteAny;
|
|
13
|
+
exports.logViteError = logViteError;
|
|
14
|
+
exports.logConfigInfo = logConfigInfo;
|
|
15
|
+
exports.logConfigError = logConfigError;
|
|
16
|
+
exports.logConfigErrorRecover = logConfigErrorRecover;
|
|
17
|
+
exports.logErrorDebugNote = logErrorDebugNote;
|
|
13
18
|
const abort_js_1 = require("../../../shared/route/abort.js");
|
|
14
19
|
const globalContext_js_1 = require("../../runtime/globalContext.js");
|
|
15
20
|
const loggerRuntime_js_1 = require("../../runtime/renderPage/loggerRuntime.js");
|
|
@@ -40,18 +45,15 @@ function logViteAny(msg, logType, httpRequestId, prependViteTag) {
|
|
|
40
45
|
(0, log_js_1.logDirectly)(msg, logType);
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
|
-
exports.logViteAny = logViteAny;
|
|
44
48
|
function logConfigInfo(msg, logType) {
|
|
45
49
|
const category = getConfigCategory();
|
|
46
50
|
(0, log_js_1.logWithVikeTag)(msg, logType, category);
|
|
47
51
|
}
|
|
48
|
-
exports.logConfigInfo = logConfigInfo;
|
|
49
52
|
function logConfigErrorRecover() {
|
|
50
53
|
const msg = picocolors_1.default.bold(picocolors_1.default.green('Configuration successfully loaded'));
|
|
51
54
|
const category = getConfigCategory();
|
|
52
55
|
(0, log_js_1.logWithVikeTag)(msg, 'error-recover', category);
|
|
53
56
|
}
|
|
54
|
-
exports.logConfigErrorRecover = logConfigErrorRecover;
|
|
55
57
|
function logRuntimeError(err,
|
|
56
58
|
// httpRequestId is `null` when pre-rendering
|
|
57
59
|
httpRequestId) {
|
|
@@ -62,7 +64,6 @@ function logViteError(err,
|
|
|
62
64
|
httpRequestId) {
|
|
63
65
|
logErr(err, httpRequestId, true);
|
|
64
66
|
}
|
|
65
|
-
exports.logViteError = logViteError;
|
|
66
67
|
function logErr(err, httpRequestId = null, errorComesFromVite) {
|
|
67
68
|
(0, utils_js_1.warnIfErrorIsNotObject)(err);
|
|
68
69
|
if ((0, abort_js_1.isAbortError)(err) && !(0, isErrorDebug_js_1.isErrorDebug)()) {
|
|
@@ -142,7 +143,6 @@ function logConfigError(err) {
|
|
|
142
143
|
logFallbackErrIntro(category, false);
|
|
143
144
|
(0, log_js_1.logDirectly)(err, 'error');
|
|
144
145
|
}
|
|
145
|
-
exports.logConfigError = logConfigError;
|
|
146
146
|
function logFallbackErrIntro(category, errorComesFromVite) {
|
|
147
147
|
const msg = errorComesFromVite ? 'Transpilation error' : 'An error was thrown';
|
|
148
148
|
(0, log_js_1.logWithVikeTag)(picocolors_1.default.bold(picocolors_1.default.red(`[Error] ${msg}:`)), 'error', category);
|
|
@@ -188,7 +188,6 @@ function logErrorDebugNote() {
|
|
|
188
188
|
const msg = picocolors_1.default.dim((0, utils_js_1.formatHintLog)("Error isn't helpful? See https://vike.dev/errors#verbose"));
|
|
189
189
|
(0, log_js_1.logDirectly)(msg, 'error');
|
|
190
190
|
}
|
|
191
|
-
exports.logErrorDebugNote = logErrorDebugNote;
|
|
192
191
|
function getCategory(httpRequestId = null) {
|
|
193
192
|
const store = (0, getHttpRequestAsyncStore_js_1.getHttpRequestAsyncStore)();
|
|
194
193
|
if (store?.httpRequestId !== undefined) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.removeSuperfluousViteLog = removeSuperfluousViteLog;
|
|
4
|
+
exports.removeSuperfluousViteLog_enable = removeSuperfluousViteLog_enable;
|
|
5
|
+
exports.removeSuperfluousViteLog_disable = removeSuperfluousViteLog_disable;
|
|
4
6
|
const utils_js_1 = require("../../utils.js");
|
|
5
7
|
const superfluousLog = 'Forced re-optimization of dependencies';
|
|
6
8
|
let enabled = false;
|
|
@@ -14,12 +16,9 @@ function removeSuperfluousViteLog(msg) {
|
|
|
14
16
|
}
|
|
15
17
|
return false;
|
|
16
18
|
}
|
|
17
|
-
exports.removeSuperfluousViteLog = removeSuperfluousViteLog;
|
|
18
19
|
function removeSuperfluousViteLog_enable() {
|
|
19
20
|
enabled = true;
|
|
20
21
|
}
|
|
21
|
-
exports.removeSuperfluousViteLog_enable = removeSuperfluousViteLog_enable;
|
|
22
22
|
function removeSuperfluousViteLog_disable() {
|
|
23
23
|
enabled = false;
|
|
24
24
|
}
|
|
25
|
-
exports.removeSuperfluousViteLog_disable = removeSuperfluousViteLog_disable;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.improveViteLogs =
|
|
3
|
+
exports.improveViteLogs = improveViteLogs;
|
|
4
4
|
const utils_js_1 = require("../utils.js");
|
|
5
5
|
const loggerNotProd_js_1 = require("./loggerNotProd.js");
|
|
6
6
|
const getHttpRequestAsyncStore_js_1 = require("./getHttpRequestAsyncStore.js");
|
|
@@ -11,7 +11,6 @@ function improveViteLogs(config) {
|
|
|
11
11
|
intercept('warn', config);
|
|
12
12
|
intercept('error', config);
|
|
13
13
|
}
|
|
14
|
-
exports.improveViteLogs = improveViteLogs;
|
|
15
14
|
function intercept(logType, config) {
|
|
16
15
|
config.logger[logType] = (msg, options = {}) => {
|
|
17
16
|
(0, utils_js_1.assert)(!(0, isErrorDebug_js_1.isErrorDebug)());
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getExportNames = getExportNames;
|
|
4
|
+
exports.getImportStatements = getImportStatements;
|
|
4
5
|
const es_module_lexer_1 = require("es-module-lexer");
|
|
5
6
|
const utils_js_1 = require("../utils.js");
|
|
6
7
|
async function getExportNames(src) {
|
|
@@ -21,13 +22,11 @@ async function getExportNames(src) {
|
|
|
21
22
|
});
|
|
22
23
|
return { wildcardReExports, exportNames };
|
|
23
24
|
}
|
|
24
|
-
exports.getExportNames = getExportNames;
|
|
25
25
|
async function getImportStatements(src) {
|
|
26
26
|
const parseResult = await parseEsModule(src);
|
|
27
27
|
const imports = parseResult[0].slice();
|
|
28
28
|
return imports;
|
|
29
29
|
}
|
|
30
|
-
exports.getImportStatements = getImportStatements;
|
|
31
30
|
async function parseEsModule(src) {
|
|
32
31
|
await es_module_lexer_1.init;
|
|
33
32
|
return (0, es_module_lexer_1.parse)(src);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rollupIsEsm =
|
|
3
|
+
exports.rollupIsEsm = rollupIsEsm;
|
|
4
4
|
const utils_js_1 = require("../utils.js");
|
|
5
5
|
function rollupIsEsm(rollupOptions) {
|
|
6
6
|
const { format } = rollupOptions;
|
|
@@ -13,4 +13,3 @@ function rollupIsEsm(rollupOptions) {
|
|
|
13
13
|
format === 'umd');
|
|
14
14
|
return format === 'es';
|
|
15
15
|
}
|
|
16
|
-
exports.rollupIsEsm = rollupIsEsm;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.sourceMapRemove = sourceMapRemove;
|
|
4
|
+
exports.sourceMapPassthrough = sourceMapPassthrough;
|
|
4
5
|
// https://rollupjs.org/guide/en/#source-code-transformations
|
|
5
6
|
/** Remove entire source mapping, to save KBs. */
|
|
6
7
|
function sourceMapRemove(code) {
|
|
@@ -9,7 +10,6 @@ function sourceMapRemove(code) {
|
|
|
9
10
|
map: { mappings: '' }
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
|
-
exports.sourceMapRemove = sourceMapRemove;
|
|
13
13
|
/** Don't provide any source map, pass through current source map instead. */
|
|
14
14
|
function sourceMapPassthrough(code) {
|
|
15
15
|
return {
|
|
@@ -17,4 +17,3 @@ function sourceMapPassthrough(code) {
|
|
|
17
17
|
map: null
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
exports.sourceMapPassthrough = sourceMapPassthrough;
|
|
@@ -26,7 +26,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.runPrerenderFromAPI = runPrerenderFromAPI;
|
|
30
|
+
exports.runPrerenderFromCLI = runPrerenderFromCLI;
|
|
31
|
+
exports.runPrerenderFromAutoFullBuild = runPrerenderFromAutoFullBuild;
|
|
32
|
+
exports.runPrerender_forceExit = runPrerender_forceExit;
|
|
30
33
|
require("../runtime/page-files/setup.js");
|
|
31
34
|
const path_1 = __importDefault(require("path"));
|
|
32
35
|
const index_js_1 = require("../../shared/route/index.js");
|
|
@@ -58,7 +61,6 @@ async function runPrerenderFromAPI(options = {}) {
|
|
|
58
61
|
// - We purposely propagate the error to the user land, so that the error interrupts the user land. It's also, I guess, a nice-to-have that the user has control over the error.
|
|
59
62
|
// - We don't use logErrorHint() because we don't have control over what happens with the error. For example, if the user land purposely swallows the error then the hint shouldn't be logged. Also, it's best if the hint is shown to the user *after* the error, but we cannot do/guarentee that.
|
|
60
63
|
}
|
|
61
|
-
exports.runPrerenderFromAPI = runPrerenderFromAPI;
|
|
62
64
|
async function runPrerenderFromCLI(options) {
|
|
63
65
|
try {
|
|
64
66
|
await runPrerender(options, '$ vike prerender');
|
|
@@ -69,7 +71,6 @@ async function runPrerenderFromCLI(options) {
|
|
|
69
71
|
process.exit(1);
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
|
-
exports.runPrerenderFromCLI = runPrerenderFromCLI;
|
|
73
74
|
async function runPrerenderFromAutoFullBuild(options) {
|
|
74
75
|
try {
|
|
75
76
|
await runPrerender(options, null);
|
|
@@ -80,7 +81,6 @@ async function runPrerenderFromAutoFullBuild(options) {
|
|
|
80
81
|
process.exit(1);
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
|
-
exports.runPrerenderFromAutoFullBuild = runPrerenderFromAutoFullBuild;
|
|
84
84
|
async function runPrerender(options, manuallyTriggered) {
|
|
85
85
|
checkOutdatedOptions(options);
|
|
86
86
|
(0, globalContext_js_1.setGlobalContext_isPrerendering)();
|
|
@@ -728,7 +728,6 @@ function runPrerender_forceExit() {
|
|
|
728
728
|
assertInfo(false, "Pre-rendering was forced exit. (Didn't gracefully exit because the event queue isn't empty. This is usally fine, see ...", { onlyOnce: false })
|
|
729
729
|
*/
|
|
730
730
|
}
|
|
731
|
-
exports.runPrerender_forceExit = runPrerender_forceExit;
|
|
732
731
|
function assertIsNotAbort(err, urlOr404) {
|
|
733
732
|
if (!(0, abort_js_1.isAbortError)(err))
|
|
734
733
|
return;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.loadImportBuild = loadImportBuild;
|
|
4
|
+
exports.setImportBuildGetters = setImportBuildGetters;
|
|
4
5
|
const runtime_1 = require("@brillout/vite-plugin-server-entry/runtime");
|
|
5
6
|
const utils_js_1 = require("../utils.js");
|
|
6
7
|
const buildGetters = (globalThis.__vike_buildGetters = globalThis.__vike_buildGetters || {
|
|
@@ -9,7 +10,6 @@ const buildGetters = (globalThis.__vike_buildGetters = globalThis.__vike_buildGe
|
|
|
9
10
|
function setImportBuildGetters(getters) {
|
|
10
11
|
buildGetters.getters = getters;
|
|
11
12
|
}
|
|
12
|
-
exports.setImportBuildGetters = setImportBuildGetters;
|
|
13
13
|
async function loadImportBuild(outDir) {
|
|
14
14
|
if (!buildGetters.getters) {
|
|
15
15
|
await (0, runtime_1.importServerEntry)(outDir);
|
|
@@ -23,4 +23,3 @@ async function loadImportBuild(outDir) {
|
|
|
23
23
|
const buildEntries = { pageFiles, assetsManifest, pluginManifest };
|
|
24
24
|
return buildEntries;
|
|
25
25
|
}
|
|
26
|
-
exports.loadImportBuild = loadImportBuild;
|
|
@@ -3,7 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getGlobalContextSync = getGlobalContextSync;
|
|
7
|
+
exports.getGlobalContextAsync = getGlobalContextAsync;
|
|
8
|
+
exports.getGlobalContext = getGlobalContext;
|
|
9
|
+
exports.getViteDevServer = getViteDevServer;
|
|
10
|
+
exports.getViteConfig = getViteConfig;
|
|
11
|
+
exports.getRuntimeManifest = getRuntimeManifest;
|
|
12
|
+
exports.initGlobalContext_renderPage = initGlobalContext_renderPage;
|
|
13
|
+
exports.initGlobalContext_runPrerender = initGlobalContext_runPrerender;
|
|
14
|
+
exports.initGlobalContext_getGlobalContextAsync = initGlobalContext_getGlobalContextAsync;
|
|
15
|
+
exports.setGlobalContext_viteDevServer = setGlobalContext_viteDevServer;
|
|
16
|
+
exports.setGlobalContext_viteConfig = setGlobalContext_viteConfig;
|
|
17
|
+
exports.setGlobalContext_isDev = setGlobalContext_isDev;
|
|
18
|
+
exports.setGlobalContext_isPrerendering = setGlobalContext_isPrerendering;
|
|
7
19
|
const utils_js_1 = require("./utils.js");
|
|
8
20
|
const loadImportBuild_js_1 = require("./globalContext/loadImportBuild.js");
|
|
9
21
|
const getPageFiles_js_1 = require("../../shared/getPageFiles.js");
|
|
@@ -23,13 +35,11 @@ function getGlobalContext() {
|
|
|
23
35
|
(0, utils_js_1.assert)(globalObject.globalContext);
|
|
24
36
|
return globalObject.globalContext;
|
|
25
37
|
}
|
|
26
|
-
exports.getGlobalContext = getGlobalContext;
|
|
27
38
|
/** @experimental https://vike.dev/getGlobalContext */
|
|
28
39
|
function getGlobalContextSync() {
|
|
29
40
|
(0, utils_js_1.assertUsage)(globalObject.globalContext, "The global context isn't set yet, call getGlobalContextSync() later or use getGlobalContextAsync() instead.");
|
|
30
41
|
return makePublic(globalObject.globalContext);
|
|
31
42
|
}
|
|
32
|
-
exports.getGlobalContextSync = getGlobalContextSync;
|
|
33
43
|
/** @experimental https://vike.dev/getGlobalContext */
|
|
34
44
|
async function getGlobalContextAsync(isProduction) {
|
|
35
45
|
(0, utils_js_1.assertUsage)(typeof isProduction === 'boolean', `[getGlobalContextAsync(isProduction)] Argument ${picocolors_1.default.cyan('isProduction')} ${isProduction === undefined ? 'is missing' : `should be ${picocolors_1.default.cyan('true')} or ${picocolors_1.default.cyan('false')}`}`);
|
|
@@ -38,7 +48,6 @@ async function getGlobalContextAsync(isProduction) {
|
|
|
38
48
|
(0, utils_js_1.assert)(globalContext);
|
|
39
49
|
return makePublic(globalContext);
|
|
40
50
|
}
|
|
41
|
-
exports.getGlobalContextAsync = getGlobalContextAsync;
|
|
42
51
|
function makePublic(globalContext) {
|
|
43
52
|
const globalContextPublic = {
|
|
44
53
|
assetsManifest: globalContext.assetsManifest
|
|
@@ -72,7 +81,6 @@ function setGlobalContext_viteDevServer(viteDevServer) {
|
|
|
72
81
|
globalObject.viteDevServerPromiseResolve(viteDevServer);
|
|
73
82
|
eagerlyLoadUserFiles();
|
|
74
83
|
}
|
|
75
|
-
exports.setGlobalContext_viteDevServer = setGlobalContext_viteDevServer;
|
|
76
84
|
function setGlobalContext_viteConfig(viteConfig, outDirRoot) {
|
|
77
85
|
if (globalObject.viteConfig)
|
|
78
86
|
return;
|
|
@@ -80,7 +88,6 @@ function setGlobalContext_viteConfig(viteConfig, outDirRoot) {
|
|
|
80
88
|
globalObject.viteConfig = viteConfig;
|
|
81
89
|
globalObject.outDirRoot = outDirRoot;
|
|
82
90
|
}
|
|
83
|
-
exports.setGlobalContext_viteConfig = setGlobalContext_viteConfig;
|
|
84
91
|
function assertIsNotInitilizedYet() {
|
|
85
92
|
// In develpoment, globalObject.viteDevServer always needs to be awaited for before initializing globalObject.globalContext
|
|
86
93
|
(0, utils_js_1.assert)(!globalObject.globalContext);
|
|
@@ -88,23 +95,18 @@ function assertIsNotInitilizedYet() {
|
|
|
88
95
|
function setGlobalContext_isDev(isDev) {
|
|
89
96
|
globalObject.isDev = isDev;
|
|
90
97
|
}
|
|
91
|
-
exports.setGlobalContext_isDev = setGlobalContext_isDev;
|
|
92
98
|
function setGlobalContext_isPrerendering() {
|
|
93
99
|
globalObject.isPrerendering = true;
|
|
94
100
|
}
|
|
95
|
-
exports.setGlobalContext_isPrerendering = setGlobalContext_isPrerendering;
|
|
96
101
|
function getViteDevServer() {
|
|
97
102
|
return globalObject.viteDevServer ?? null;
|
|
98
103
|
}
|
|
99
|
-
exports.getViteDevServer = getViteDevServer;
|
|
100
104
|
function getViteConfig() {
|
|
101
105
|
return globalObject.viteConfig ?? null;
|
|
102
106
|
}
|
|
103
|
-
exports.getViteConfig = getViteConfig;
|
|
104
107
|
async function initGlobalContext_renderPage() {
|
|
105
108
|
await initGlobalContext(!globalObject.isDev);
|
|
106
109
|
}
|
|
107
|
-
exports.initGlobalContext_renderPage = initGlobalContext_renderPage;
|
|
108
110
|
async function initGlobalContext_runPrerender() {
|
|
109
111
|
if (globalObject.initGlobalContext_runPrerender_alreadyCalled)
|
|
110
112
|
return;
|
|
@@ -118,7 +120,6 @@ async function initGlobalContext_runPrerender() {
|
|
|
118
120
|
(0, utils_js_1.assert)(!globalObject.globalContext);
|
|
119
121
|
await initGlobalContext(true);
|
|
120
122
|
}
|
|
121
|
-
exports.initGlobalContext_runPrerender = initGlobalContext_runPrerender;
|
|
122
123
|
async function initGlobalContext_getGlobalContextAsync(isProduction) {
|
|
123
124
|
if (!isProduction) {
|
|
124
125
|
const waitFor = 20;
|
|
@@ -133,7 +134,6 @@ async function initGlobalContext_getGlobalContextAsync(isProduction) {
|
|
|
133
134
|
}
|
|
134
135
|
await initGlobalContext(isProduction);
|
|
135
136
|
}
|
|
136
|
-
exports.initGlobalContext_getGlobalContextAsync = initGlobalContext_getGlobalContextAsync;
|
|
137
137
|
async function initGlobalContext(isProduction) {
|
|
138
138
|
if (globalObject.globalContext) {
|
|
139
139
|
(0, utils_js_1.assert)(globalObject.globalContext.isProduction === isProduction);
|
|
@@ -215,7 +215,6 @@ function getRuntimeManifest(configVike) {
|
|
|
215
215
|
(0, assertRuntimeManifest_js_1.assertRuntimeManifest)(manifest);
|
|
216
216
|
return manifest;
|
|
217
217
|
}
|
|
218
|
-
exports.getRuntimeManifest = getRuntimeManifest;
|
|
219
218
|
function assertBuildEntries(buildEntries, isPreRendering) {
|
|
220
219
|
const errMsg = [
|
|
221
220
|
`You are tyring to run`,
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getHtmlTags =
|
|
6
|
+
exports.getHtmlTags = getHtmlTags;
|
|
7
7
|
const utils_js_1 = require("../../utils.js");
|
|
8
8
|
const serializePageContextClientSide_js_1 = require("../serializePageContextClientSide.js");
|
|
9
9
|
const sanitizeJson_js_1 = require("./sanitizeJson.js");
|
|
@@ -151,7 +151,6 @@ function getHtmlTags(pageContext, streamFromReactStreamingPackage, injectFilter,
|
|
|
151
151
|
});
|
|
152
152
|
return htmlTags;
|
|
153
153
|
}
|
|
154
|
-
exports.getHtmlTags = getHtmlTags;
|
|
155
154
|
function mergeScriptEntries(pageAssets, viteDevScript) {
|
|
156
155
|
const scriptEntries = pageAssets.filter((pageAsset) => pageAsset.isEntry && pageAsset.assetType === 'script');
|
|
157
156
|
const scriptTagsHtml = `${viteDevScript}${scriptEntries.map((asset) => (0, inferHtmlTags_js_1.inferAssetTag)(asset)).join('')}`;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getViteDevScript =
|
|
6
|
+
exports.getViteDevScript = getViteDevScript;
|
|
7
7
|
const globalContext_js_1 = require("../../globalContext.js");
|
|
8
8
|
const utils_js_1 = require("../../utils.js");
|
|
9
9
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
@@ -26,4 +26,3 @@ async function getViteDevScript() {
|
|
|
26
26
|
const viteDevScript = viteInjection;
|
|
27
27
|
return viteDevScript;
|
|
28
28
|
}
|
|
29
|
-
exports.getViteDevScript = getViteDevScript;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.scriptAttrs =
|
|
3
|
+
exports.scriptAttrs = void 0;
|
|
4
|
+
exports.inferAssetTag = inferAssetTag;
|
|
5
|
+
exports.inferPreloadTag = inferPreloadTag;
|
|
6
|
+
exports.inferEarlyHintLink = inferEarlyHintLink;
|
|
4
7
|
const utils_js_1 = require("../../utils.js");
|
|
5
8
|
// We can't use `defer` here. With `defer`, the entry script won't start before `</body>` has been parsed, preventing progressive hydration during SSR streaming, see https://github.com/vikejs/vike/pull/1271
|
|
6
9
|
const scriptAttrs = 'type="module" async';
|
|
@@ -20,7 +23,6 @@ function inferPreloadTag(pageAsset) {
|
|
|
20
23
|
.join(' ');
|
|
21
24
|
return `<link ${attributes}>`;
|
|
22
25
|
}
|
|
23
|
-
exports.inferPreloadTag = inferPreloadTag;
|
|
24
26
|
function inferAssetTag(pageAsset) {
|
|
25
27
|
const { src, assetType, mediaType } = pageAsset;
|
|
26
28
|
if (assetType === 'script') {
|
|
@@ -33,14 +35,12 @@ function inferAssetTag(pageAsset) {
|
|
|
33
35
|
}
|
|
34
36
|
(0, utils_js_1.assert)(false, { pageAsset });
|
|
35
37
|
}
|
|
36
|
-
exports.inferAssetTag = inferAssetTag;
|
|
37
38
|
// We ignore crossorigin, it seems like Early Hints doesn't have a "crossorigin" property: https://github.com/vikejs/vike/issues/618#issuecomment-1415752222
|
|
38
39
|
function inferEarlyHintLink(pageAsset) {
|
|
39
40
|
const { src, assetType } = pageAsset;
|
|
40
41
|
const rel = getRel(pageAsset);
|
|
41
42
|
return [`<${src}>`, `rel=${rel}`, !assetType ? null : `as=${assetType}`].filter(Boolean).join('; ');
|
|
42
43
|
}
|
|
43
|
-
exports.inferEarlyHintLink = inferEarlyHintLink;
|
|
44
44
|
function getRel({ assetType }) {
|
|
45
45
|
if (assetType === 'script') {
|
|
46
46
|
// Vite transpiles all browser-side JavaScript to ESM
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.injectAssets__public =
|
|
3
|
+
exports.injectAssets__public = injectAssets__public;
|
|
4
4
|
const utils_js_1 = require("../../utils.js");
|
|
5
5
|
const injectAssets_js_1 = require("../injectAssets.js");
|
|
6
6
|
// TODO/v1-release: remove
|
|
@@ -29,4 +29,3 @@ async function injectAssets__public(htmlString, pageContext) {
|
|
|
29
29
|
htmlString = await (0, injectAssets_js_1.injectHtmlTagsToString)([htmlString], pageContext, null);
|
|
30
30
|
return htmlString;
|
|
31
31
|
}
|
|
32
|
-
exports.injectAssets__public = injectAssets__public;
|