vike 0.4.228-commit-4bed128 → 0.4.228-commit-0e9e0f2
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/client/shared/createGetGlobalContext.js +8 -1
- package/dist/cjs/node/plugin/plugins/baseUrls.js +1 -1
- package/dist/cjs/node/plugin/plugins/build/handleAssetsManifest.js +1 -1
- package/dist/cjs/node/plugin/plugins/build/pluginBuildApp.js +1 -1
- package/dist/cjs/node/plugin/plugins/build/pluginBuildConfig.js +3 -10
- package/dist/cjs/node/plugin/plugins/build/pluginBuildEntry.js +1 -4
- package/dist/cjs/node/plugin/plugins/commonConfig/assertResolveAlias.js +1 -1
- package/dist/cjs/node/plugin/plugins/commonConfig.js +11 -3
- package/dist/cjs/node/plugin/plugins/devConfig/determineFsAllowList.js +2 -7
- package/dist/cjs/node/plugin/plugins/devConfig/determineOptimizeDeps.js +1 -1
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.js +2 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/{transformPointerImports.js → pointerImports.js} +13 -0
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolvePointerImport.js +20 -19
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +14 -10
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +1 -1
- package/dist/cjs/node/plugin/shared/getFilePath.js +2 -2
- package/dist/cjs/node/plugin/shared/resolveClientEntriesDev.js +7 -19
- package/dist/cjs/node/plugin/utils.js +1 -0
- package/dist/cjs/node/prerender/runPrerender.js +1 -1
- package/dist/cjs/node/runtime/globalContext.js +11 -1
- package/dist/cjs/node/runtime/renderPage/getPageAssets/getManifestEntry.js +1 -1
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +1 -1
- package/dist/cjs/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.js +1 -1
- package/dist/cjs/node/runtime/utils.js +1 -1
- package/dist/cjs/shared/assertPageContextProvidedByUser.js +1 -1
- package/dist/cjs/shared/createGlobalContextShared.js +6 -0
- package/dist/cjs/shared/createPageContextShared.js +1 -1
- package/dist/cjs/shared/getPageFiles/fileTypes.js +1 -1
- package/dist/cjs/shared/page-configs/serialize/serializeConfigValues.js +3 -7
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/isImportPath.js +21 -0
- package/dist/cjs/utils/objectAssign.js +1 -1
- package/dist/cjs/utils/{isNpmPackage.js → parseNpmPackage.js} +23 -23
- package/dist/cjs/utils/path.js +12 -2
- package/dist/cjs/utils/requireResolve.js +134 -53
- package/dist/esm/client/client-routing-runtime/createPageContext.d.ts +5 -2
- package/dist/esm/client/client-routing-runtime/globalContext.d.ts +6 -2
- package/dist/esm/client/server-routing-runtime/createPageContextClientSide.d.ts +4 -1
- package/dist/esm/client/server-routing-runtime/globalContext.d.ts +3 -0
- package/dist/esm/client/shared/createGetGlobalContext.d.ts +9 -1
- package/dist/esm/client/shared/createGetGlobalContext.js +8 -1
- package/dist/esm/node/plugin/plugins/baseUrls.js +2 -2
- package/dist/esm/node/plugin/plugins/build/handleAssetsManifest.js +2 -2
- package/dist/esm/node/plugin/plugins/build/pluginBuildApp.js +2 -2
- package/dist/esm/node/plugin/plugins/build/pluginBuildConfig.js +4 -11
- package/dist/esm/node/plugin/plugins/build/pluginBuildEntry.js +2 -5
- package/dist/esm/node/plugin/plugins/commonConfig/assertResolveAlias.js +2 -2
- package/dist/esm/node/plugin/plugins/commonConfig.d.ts +2 -0
- package/dist/esm/node/plugin/plugins/commonConfig.js +12 -4
- package/dist/esm/node/plugin/plugins/devConfig/determineFsAllowList.js +3 -8
- package/dist/esm/node/plugin/plugins/devConfig/determineOptimizeDeps.js +2 -2
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.js +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/{transformPointerImports.d.ts → pointerImports.d.ts} +2 -0
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/{transformPointerImports.js → pointerImports.js} +14 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolvePointerImport.d.ts +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolvePointerImport.js +20 -19
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +14 -10
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +1 -1
- package/dist/esm/node/plugin/shared/getFilePath.js +3 -3
- package/dist/esm/node/plugin/shared/resolveClientEntriesDev.js +8 -20
- package/dist/esm/node/plugin/utils.d.ts +1 -0
- package/dist/esm/node/plugin/utils.js +1 -0
- package/dist/esm/node/prerender/runPrerender.d.ts +16 -2
- package/dist/esm/node/prerender/runPrerender.js +2 -2
- package/dist/esm/node/runtime/globalContext.d.ts +32 -2
- package/dist/esm/node/runtime/globalContext.js +11 -1
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.d.ts +8 -1
- package/dist/esm/node/runtime/renderPage/getPageAssets/getManifestEntry.js +2 -2
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +2 -2
- package/dist/esm/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.js +1 -1
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +16 -2
- package/dist/esm/node/runtime/renderPage.d.ts +8 -1
- package/dist/esm/node/runtime/utils.d.ts +1 -1
- package/dist/esm/node/runtime/utils.js +1 -1
- package/dist/esm/shared/assertPageContextProvidedByUser.js +1 -1
- package/dist/esm/shared/createGlobalContextShared.d.ts +13 -1
- package/dist/esm/shared/createGlobalContextShared.js +6 -0
- package/dist/esm/shared/createPageContextShared.d.ts +1 -1
- package/dist/esm/shared/createPageContextShared.js +1 -1
- package/dist/esm/shared/getPageFiles/fileTypes.js +1 -1
- package/dist/esm/shared/page-configs/serialize/serializeConfigValues.js +3 -7
- package/dist/esm/shared/types.d.ts +8 -2
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/isImportPath.d.ts +4 -0
- package/dist/esm/utils/isImportPath.js +19 -0
- package/dist/esm/utils/objectAssign.js +1 -1
- package/dist/esm/utils/parseNpmPackage.d.ts +17 -0
- package/dist/esm/utils/{isNpmPackage.js → parseNpmPackage.js} +23 -23
- package/dist/esm/utils/path.d.ts +1 -1
- package/dist/esm/utils/path.js +12 -2
- package/dist/esm/utils/requireResolve.d.ts +20 -7
- package/dist/esm/utils/requireResolve.js +134 -53
- package/package.json +3 -3
- package/dist/esm/utils/isNpmPackage.d.ts +0 -17
|
@@ -2,7 +2,7 @@ export { pluginBuildConfig };
|
|
|
2
2
|
export { assertRollupInput };
|
|
3
3
|
export { analyzeClientEntries };
|
|
4
4
|
export { manifestTempFile };
|
|
5
|
-
import { assert, addOnBeforeLogHook, removeFileExtention, unique, assertUsage, injectRollupInputs, normalizeRollupInput, onSetupBuild,
|
|
5
|
+
import { assert, addOnBeforeLogHook, removeFileExtention, unique, assertUsage, injectRollupInputs, normalizeRollupInput, onSetupBuild, assertIsImportPathNpmPackage, requireResolveVikeDistFile } from '../../utils.js';
|
|
6
6
|
import { getVikeConfig } from '../importUserCode/v1-design/getVikeConfig.js';
|
|
7
7
|
import { findPageFiles } from '../../shared/findPageFiles.js';
|
|
8
8
|
import { getVirtualFileIdPageConfigValuesAll } from '../../../shared/virtual-files/virtualFilePageConfigValuesAll.js';
|
|
@@ -13,8 +13,6 @@ import { getConfigValueBuildTime } from '../../../../shared/page-configs/getConf
|
|
|
13
13
|
import { isViteServerBuild } from '../../shared/isViteServerBuild.js';
|
|
14
14
|
import { resolveOutDir } from '../../shared/getOutDirs.js';
|
|
15
15
|
import { handleAssetsManifest_assertUsageCssCodeSplit, handleAssetsManifest_getBuildConfig } from './handleAssetsManifest.js';
|
|
16
|
-
// @ts-ignore import.meta.url is shimmed at dist/cjs by dist-cjs-fixup.js.
|
|
17
|
-
const importMetaUrl = import.meta.url;
|
|
18
16
|
const manifestTempFile = '_temp_manifest.json';
|
|
19
17
|
function pluginBuildConfig() {
|
|
20
18
|
let config;
|
|
@@ -81,8 +79,8 @@ async function getEntries(config) {
|
|
|
81
79
|
...clientEntries,
|
|
82
80
|
...pageFileEntries
|
|
83
81
|
};
|
|
84
|
-
const clientRoutingEntry =
|
|
85
|
-
const serverRoutingEntry =
|
|
82
|
+
const clientRoutingEntry = requireResolveVikeDistFile('dist/esm/client/client-routing-runtime/entry.js');
|
|
83
|
+
const serverRoutingEntry = requireResolveVikeDistFile('dist/esm/client/server-routing-runtime/entry.js');
|
|
86
84
|
if (hasClientRouting) {
|
|
87
85
|
entries['entries/entry-client-routing'] = clientRoutingEntry;
|
|
88
86
|
}
|
|
@@ -156,7 +154,7 @@ async function getPageFileEntries(config, includeAssetsImportedByServer) {
|
|
|
156
154
|
}
|
|
157
155
|
function getEntryFromClientEntry(clientEntry, config, addExtractAssetsQuery) {
|
|
158
156
|
if (!clientEntry.startsWith('/')) {
|
|
159
|
-
|
|
157
|
+
assertIsImportPathNpmPackage(clientEntry);
|
|
160
158
|
const entryTarget = clientEntry;
|
|
161
159
|
const entryName = prependEntriesDir(clientEntry);
|
|
162
160
|
return { entryName, entryTarget };
|
|
@@ -192,11 +190,6 @@ function getEntryFromPageConfig(pageConfig, isForClientSide) {
|
|
|
192
190
|
assert(!entryName.endsWith('/'));
|
|
193
191
|
return { entryName, entryTarget };
|
|
194
192
|
}
|
|
195
|
-
function resolve(filePath) {
|
|
196
|
-
assert(filePath.startsWith('dist/'));
|
|
197
|
-
// [RELATIVE_PATH_FROM_DIST] Current directory: node_modules/vike/dist/esm/node/plugin/plugins/build/
|
|
198
|
-
return requireResolveNonUserFile(`../../../../../../${filePath}`, importMetaUrl);
|
|
199
|
-
}
|
|
200
193
|
function addLogHook() {
|
|
201
194
|
const tty = process.stdout.isTTY && !process.env.CI; // Equals https://github.com/vitejs/vite/blob/193d55c7b9cbfec5b79ebfca276d4a721e7de14d/packages/vite/src/node/plugins/reporter.ts#L27
|
|
202
195
|
if (!tty)
|
|
@@ -2,11 +2,9 @@ export { pluginBuildEntry };
|
|
|
2
2
|
export { set_macro_ASSETS_MANIFEST };
|
|
3
3
|
import { serverProductionEntryPlugin } from '@brillout/vite-plugin-server-entry/plugin';
|
|
4
4
|
import { virtualFileIdImportUserCodeServer } from '../../../shared/virtual-files/virtualFileImportUserCode.js';
|
|
5
|
-
import { assert, PROJECT_VERSION,
|
|
5
|
+
import { assert, PROJECT_VERSION, requireResolveVikeDistFile } from '../../utils.js';
|
|
6
6
|
import fs from 'fs/promises';
|
|
7
7
|
import path from 'path';
|
|
8
|
-
// @ts-ignore import.meta.url is shimmed at dist/cjs by dist-cjs-fixup.js.
|
|
9
|
-
const importMetaUrl = import.meta.url;
|
|
10
8
|
import { isUsingClientRouter } from '../extractExportNamesPlugin.js';
|
|
11
9
|
import { assertBuildInfo } from '../../../runtime/globalContext.js';
|
|
12
10
|
import { getOutDirs } from '../../shared/getOutDirs.js';
|
|
@@ -93,8 +91,7 @@ function find_ASSETS_MANIFEST(bundle) {
|
|
|
93
91
|
}
|
|
94
92
|
function getImportPath(config) {
|
|
95
93
|
// We resolve filePathAbsolute even if we don't use it: we use require.resolve() as an assertion that the relative path is correct
|
|
96
|
-
|
|
97
|
-
const filePathAbsolute = requireResolveNonUserFile(`../../../../../../dist/esm/__internal/index.js`, importMetaUrl);
|
|
94
|
+
const filePathAbsolute = requireResolveVikeDistFile('dist/esm/__internal/index.js');
|
|
98
95
|
if (
|
|
99
96
|
// Let's implement a new config if a user needs the import to be a relative path instead of 'vike/__internal' (AFAIK a relative path is needed only if a framework has npm package 'vike' as direct dependency instead of a peer dependency and if the user of that framework uses pnpm)
|
|
100
97
|
true) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { assertResolveAlias };
|
|
2
|
-
import { assert, assertUsage, assertWarning, isArray,
|
|
2
|
+
import { assert, assertUsage, assertWarning, isArray, isPathAliasRecommended } from '../../utils.js';
|
|
3
3
|
import pc from '@brillout/picocolors';
|
|
4
4
|
// Recommend users to avoid un-distinguishable path aliases.
|
|
5
5
|
// There are a lot of libraries that don't or cannot follow that recommendation, for example:
|
|
@@ -59,7 +59,7 @@ function assertResolveAlias(config) {
|
|
|
59
59
|
// - determineOptimizeDeps()
|
|
60
60
|
// - extractAssets
|
|
61
61
|
// - in general: using un-distinguishable path aliases is asking for trouble
|
|
62
|
-
if (!
|
|
62
|
+
if (!isPathAliasRecommended(find)) {
|
|
63
63
|
if (find.startsWith('@')) {
|
|
64
64
|
const msg = `${errPrefix} defines an invalid resolve.alias ${deprecation}: a path alias cannot start with ${pc.cyan('@')}, ${errSuffix1}`;
|
|
65
65
|
assertWarning(false, msg, { onlyOnce: true });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { commonConfig };
|
|
2
2
|
export { getVikeConfigPublic };
|
|
3
|
+
export { getVikeConfigInternal };
|
|
3
4
|
export type { VikeConfigPublic };
|
|
4
5
|
import { type InlineConfig, type Plugin, type ResolvedConfig, type UserConfig } from 'vite';
|
|
5
6
|
import { type VikeConfigObject } from './importUserCode/v1-design/getVikeConfig.js';
|
|
@@ -34,4 +35,5 @@ declare function commonConfig(vikeVitePluginOptions: unknown): Plugin[];
|
|
|
34
35
|
*
|
|
35
36
|
* https://vike.dev/getVikeConfig
|
|
36
37
|
*/
|
|
38
|
+
declare function getVikeConfigInternal(config: ResolvedConfig | UserConfig): VikeConfigPublic;
|
|
37
39
|
declare function getVikeConfigPublic(config: ResolvedConfig | UserConfig): VikeConfigPublic;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { commonConfig };
|
|
2
2
|
export { getVikeConfigPublic };
|
|
3
|
-
|
|
3
|
+
export { getVikeConfigInternal };
|
|
4
|
+
import { assert, assertUsage, assertWarning, findPackageJson, hasProp, isDevCheck, isDocker, isObject, isVitest } from '../utils.js';
|
|
4
5
|
import { assertRollupInput } from './build/pluginBuildConfig.js';
|
|
5
6
|
import { installRequireShim_setUserRootDir } from '@brillout/require-shim';
|
|
6
7
|
import pc from '@brillout/picocolors';
|
|
@@ -85,7 +86,7 @@ function commonConfig(vikeVitePluginOptions) {
|
|
|
85
86
|
order: 'post',
|
|
86
87
|
handler(configFromUser) {
|
|
87
88
|
let configFromVike = { server: {}, preview: {} };
|
|
88
|
-
const vike =
|
|
89
|
+
const vike = getVikeConfigInternal(configFromUser);
|
|
89
90
|
if (vike.config.port !== undefined) {
|
|
90
91
|
// https://vike.dev/port
|
|
91
92
|
setDefault('port', vike.config.port, configFromUser, configFromVike);
|
|
@@ -152,6 +153,8 @@ function assertSingleInstance(config) {
|
|
|
152
153
|
function assertVikeCliOrApi(config) {
|
|
153
154
|
if (isVikeCliOrApi())
|
|
154
155
|
return;
|
|
156
|
+
if (isVitest())
|
|
157
|
+
return;
|
|
155
158
|
if (isViteCliCall()) {
|
|
156
159
|
assertWarning(false, `Vite's CLI is deprecated ${pc.underline('https://vike.dev/migration/cli')}`, {
|
|
157
160
|
onlyOnce: true
|
|
@@ -191,7 +194,7 @@ function temp_supportOldInterface(config) {
|
|
|
191
194
|
}
|
|
192
195
|
// TODO/soon rename:
|
|
193
196
|
// - `getVikeConfig()` => `resolveVikeConfig()` ?
|
|
194
|
-
// - `
|
|
197
|
+
// - `getVikeConfigInternal()` => `getVikeConfig()`
|
|
195
198
|
// - `VikeConfigPublic` => `VikeConfig` ?
|
|
196
199
|
// - `VikeConfigObject` => `VikeConfigInternal` ?
|
|
197
200
|
/**
|
|
@@ -199,11 +202,16 @@ function temp_supportOldInterface(config) {
|
|
|
199
202
|
*
|
|
200
203
|
* https://vike.dev/getVikeConfig
|
|
201
204
|
*/
|
|
202
|
-
function
|
|
205
|
+
function getVikeConfigInternal(config) {
|
|
203
206
|
const vikeConfig = config._vike;
|
|
204
207
|
assert(vikeConfig);
|
|
205
208
|
return vikeConfig;
|
|
206
209
|
}
|
|
210
|
+
function getVikeConfigPublic(config) {
|
|
211
|
+
const vikeConfig = config._vike;
|
|
212
|
+
assertUsage(vikeConfig, "getVikeConfig() can only be used when Vite is running with Vike's Vite plugin");
|
|
213
|
+
return vikeConfig;
|
|
214
|
+
}
|
|
207
215
|
// Only emit dist/server/entry.mjs if necessary
|
|
208
216
|
function emitServerEntryOnlyIfNeeded(config) {
|
|
209
217
|
if (config.vitePluginServerEntry?.inject &&
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { determineFsAllowList };
|
|
2
2
|
import { searchForWorkspaceRoot } from 'vite';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import { assert, assertPosixPath,
|
|
4
|
+
import { assert, assertPosixPath, getVikeNodeModulesRoot } from '../../utils.js';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
// @ts-ignore import.meta.url is shimmed at dist/cjs by dist-cjs-fixup.js.
|
|
7
7
|
const importMetaUrl = import.meta.url;
|
|
@@ -18,11 +18,6 @@ async function determineFsAllowList(config) {
|
|
|
18
18
|
// We add it again just to be sure.
|
|
19
19
|
fsAllow.push(searchForWorkspaceRoot(process.cwd()));
|
|
20
20
|
// Add node_modules/vike/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const vikeRoot = path.posix.join(__dirname_, '../../../../../../');
|
|
24
|
-
// Assert that `vikeRoot` is indeed pointing to `node_modules/vike/`
|
|
25
|
-
requireResolveNonUserFile(`${vikeRoot}/dist/esm/node/plugin/plugins/devConfig/index.js`, importMetaUrl);
|
|
26
|
-
fsAllow.push(vikeRoot);
|
|
27
|
-
}
|
|
21
|
+
const vikeNodeModulesRoot = getVikeNodeModulesRoot();
|
|
22
|
+
fsAllow.push(vikeNodeModulesRoot);
|
|
28
23
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { determineOptimizeDeps };
|
|
2
2
|
import { findPageFiles } from '../../shared/findPageFiles.js';
|
|
3
|
-
import { assert,
|
|
3
|
+
import { assert, assertIsImportPathNpmPackage, createDebugger, isArray, unique } from '../../utils.js';
|
|
4
4
|
import { getVikeConfig, isOverriden } from '../importUserCode/v1-design/getVikeConfig.js';
|
|
5
5
|
import { analyzeClientEntries } from '../build/pluginBuildConfig.js';
|
|
6
6
|
import { virtualFileIdImportUserCodeClientCR, virtualFileIdImportUserCodeClientSR } from '../../../shared/virtual-files/virtualFileImportUserCode.js';
|
|
@@ -38,7 +38,7 @@ async function getPageDeps(config, pageConfigs) {
|
|
|
38
38
|
const addInclude = (e) => {
|
|
39
39
|
assert(e);
|
|
40
40
|
// Shouldn't be a path alias, as path aliases would need to be added to config.optimizeDeps.entries instead of config.optimizeDeps.include
|
|
41
|
-
|
|
41
|
+
assertIsImportPathNpmPackage(e);
|
|
42
42
|
include.push(e);
|
|
43
43
|
};
|
|
44
44
|
// V1 design
|
package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.js
CHANGED
|
@@ -7,7 +7,7 @@ import { transpileAndExecuteFile } from './transpileAndExecuteFile.js';
|
|
|
7
7
|
import { getConfigDefinitionOptional } from '../getVikeConfig.js';
|
|
8
8
|
import { assertPlusFileExport } from '../../../../../../shared/page-configs/assertPlusFileExport.js';
|
|
9
9
|
import pc from '@brillout/picocolors';
|
|
10
|
-
import { parsePointerImportData } from './
|
|
10
|
+
import { parsePointerImportData } from './pointerImports.js';
|
|
11
11
|
import { getConfigFileExport } from './getConfigFileExport.js';
|
|
12
12
|
import { resolvePointerImportData } from './resolvePointerImport.js';
|
|
13
13
|
import { getConfigDefinedAt } from '../../../../../../shared/page-configs/getConfigDefinedAt.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { transformPointerImports };
|
|
2
2
|
export { parsePointerImportData };
|
|
3
3
|
export { isPointerImportData };
|
|
4
|
+
export { assertPointerImportPath };
|
|
4
5
|
export type { PointerImportData };
|
|
5
6
|
declare function transformPointerImports(code: string, filePathToShowToUser2: string, pointerImports: Record<string, boolean> | 'all', skipWarnings?: true): string | null;
|
|
6
7
|
/**
|
|
@@ -23,6 +24,7 @@ type PointerImportData = {
|
|
|
23
24
|
};
|
|
24
25
|
declare function isPointerImportData(str: string): boolean;
|
|
25
26
|
declare function parsePointerImportData(importString: string): null | PointerImportData;
|
|
27
|
+
declare function assertPointerImportPath(importPath: string): boolean;
|
|
26
28
|
declare module 'estree' {
|
|
27
29
|
interface BaseNodeWithoutComments {
|
|
28
30
|
start: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { transformPointerImports };
|
|
2
2
|
export { parsePointerImportData };
|
|
3
3
|
export { isPointerImportData };
|
|
4
|
+
export { assertPointerImportPath };
|
|
4
5
|
// Playground: https://github.com/brillout/acorn-playground
|
|
5
6
|
// Notes about `with { type: 'pointer' }`
|
|
6
7
|
// - It works well with TypeScript: it doesn't complain upon `with { type: 'unknown-to-typescript' }` and go-to-definition & types are preserved: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-3.html#import-attributes
|
|
@@ -17,7 +18,7 @@ export { isPointerImportData };
|
|
|
17
18
|
// - Esbuild removes comments: https://github.com/evanw/esbuild/issues/1439#issuecomment-877656182
|
|
18
19
|
// - Using source maps to track these magic comments is brittle (source maps can easily break)
|
|
19
20
|
import { parse } from 'acorn';
|
|
20
|
-
import { assert, assertUsage, assertWarning, styleFileRE } from '../../../../utils.js';
|
|
21
|
+
import { assert, assertUsage, assertWarning, isFilePathAbsolute, isImportPath, styleFileRE } from '../../../../utils.js';
|
|
21
22
|
import pc from '@brillout/picocolors';
|
|
22
23
|
function transformPointerImports(code, filePathToShowToUser2, pointerImports,
|
|
23
24
|
// For ./transformPointerImports.spec.ts
|
|
@@ -144,8 +145,20 @@ function parsePointerImportData(importString) {
|
|
|
144
145
|
assert(parts.length >= 2);
|
|
145
146
|
const exportName = parts[parts.length - 1];
|
|
146
147
|
const importPath = parts.slice(0, -1).join(SEP);
|
|
148
|
+
if (importPath.startsWith('.') && !(importPath.startsWith('./') || importPath.startsWith('../'))) {
|
|
149
|
+
assert(!importStringWasGenerated);
|
|
150
|
+
assertUsage(false, `Invalid relative import path ${pc.code(importPath)} defined by ${pc.code(JSON.stringify(importString))} because it should start with ${pc.code('./')} or ${pc.code('../')}, or use an npm package import instead.`);
|
|
151
|
+
}
|
|
152
|
+
assertPointerImportPath(importPath);
|
|
147
153
|
return { importPath, exportName, importStringWasGenerated, importString };
|
|
148
154
|
}
|
|
155
|
+
// `importPath` is one of the following:
|
|
156
|
+
// - A relative import path
|
|
157
|
+
// - An npm package import
|
|
158
|
+
// - A filesystem absolute path, see transpileWithEsbuild()
|
|
159
|
+
function assertPointerImportPath(importPath) {
|
|
160
|
+
return isImportPath(importPath) || isFilePathAbsolute(importPath);
|
|
161
|
+
}
|
|
149
162
|
function spliceMany(str, operations) {
|
|
150
163
|
let strMod = '';
|
|
151
164
|
let endPrev;
|
|
@@ -2,7 +2,7 @@ export { resolvePointerImport };
|
|
|
2
2
|
export { resolvePointerImportData };
|
|
3
3
|
export type { PointerImport };
|
|
4
4
|
import type { DefinedAtFilePath } from '../../../../../../shared/page-configs/PageConfig.js';
|
|
5
|
-
import { type PointerImportData } from './
|
|
5
|
+
import { type PointerImportData } from './pointerImports.js';
|
|
6
6
|
import type { FilePath, FilePathResolved } from '../../../../../../shared/page-configs/FilePath.js';
|
|
7
7
|
type PointerImport = {
|
|
8
8
|
fileExportPath: FileExportPath;
|
package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolvePointerImport.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export { resolvePointerImport };
|
|
2
2
|
export { resolvePointerImportData };
|
|
3
3
|
import pc from '@brillout/picocolors';
|
|
4
|
-
import { assert, assertPosixPath, assertUsage, isFilePathAbsolute,
|
|
5
|
-
import { parsePointerImportData } from './
|
|
6
|
-
import path from 'path';
|
|
4
|
+
import { assert, assertPosixPath, assertUsage, isFilePathAbsolute, isImportPathRelative, isImportPathNpmPackageOrPathAlias, requireResolveOptional } from '../../../../utils.js';
|
|
5
|
+
import { assertPointerImportPath, parsePointerImportData } from './pointerImports.js';
|
|
7
6
|
import { getFilePathAbsoluteUserRootDir, getFilePathResolved, getFilePathUnresolved } from '../../../../shared/getFilePath.js';
|
|
8
7
|
function resolvePointerImport(configValue, importerFilePath, userRootDir, configName) {
|
|
9
8
|
if (typeof configValue !== 'string')
|
|
@@ -22,24 +21,18 @@ function resolvePointerImport(configValue, importerFilePath, userRootDir, config
|
|
|
22
21
|
return { fileExportPath };
|
|
23
22
|
}
|
|
24
23
|
function resolvePointerImportData(pointerImportData, importerFilePath, userRootDir) {
|
|
25
|
-
// `importPath` should be one of the following:
|
|
26
|
-
// - A relative import path
|
|
27
|
-
// - A filesystem absolute path
|
|
28
|
-
// - An npm package import
|
|
29
24
|
const { importPath } = pointerImportData;
|
|
30
|
-
|
|
25
|
+
assertPointerImportPath(importPath);
|
|
26
|
+
const filePathAbsoluteFilesystem = resolveImportPathWithNode(pointerImportData, importerFilePath, userRootDir);
|
|
31
27
|
let filePath;
|
|
32
28
|
assertPosixPath(importPath);
|
|
33
|
-
if (importPath
|
|
34
|
-
if (importPath.startsWith('.')) {
|
|
35
|
-
assertUsage(pathIsRelative(importPath), `Invalid relative import path ${pc.code(importPath)} defined by ${importerFilePath.filePathToShowToUser} because it should start with ${pc.code('./')} or ${pc.code('../')}, or use an npm package import instead.`);
|
|
36
|
-
}
|
|
29
|
+
if (isImportPathRelative(importPath) || isFilePathAbsolute(importPath)) {
|
|
37
30
|
// Pointer imports are included in virtual files, thus relative imports need to be resolved. (Virtual modules cannot contain relative imports.)
|
|
38
31
|
assertUsageResolutionSuccess(filePathAbsoluteFilesystem, pointerImportData, importerFilePath);
|
|
39
32
|
// Pointer imports are included in virtual files, and we need filePathAbsoluteUserRootDir because we didn't find a way to have filesystem absolute import paths in virtual files: https://gist.github.com/brillout/2315231c9a8164f950c64b4b4a7bbd39
|
|
40
33
|
const errSuffix = `outside of the ${userRootDir} directory which is forbidden: make sure your import paths resolve inside the ${userRootDir} directory, or import from an npm package.`;
|
|
41
34
|
const filePathAbsoluteUserRootDir = getFilePathAbsoluteUserRootDir({ filePathAbsoluteFilesystem, userRootDir });
|
|
42
|
-
if (importPath
|
|
35
|
+
if (isImportPathRelative(importPath)) {
|
|
43
36
|
assertUsage(filePathAbsoluteUserRootDir, `The relative import ${pc.cyan(importPath)} defined by ${importerFilePath.filePathToShowToUser} resolves to ${filePathAbsoluteFilesystem} ${errSuffix}`);
|
|
44
37
|
}
|
|
45
38
|
else {
|
|
@@ -51,6 +44,7 @@ function resolvePointerImportData(pointerImportData, importerFilePath, userRootD
|
|
|
51
44
|
filePath = getFilePathResolved({ filePathAbsoluteUserRootDir, userRootDir });
|
|
52
45
|
}
|
|
53
46
|
else {
|
|
47
|
+
assert(isImportPathNpmPackageOrPathAlias(importPath));
|
|
54
48
|
const importPathAbsolute = importPath;
|
|
55
49
|
if (filePathAbsoluteFilesystem) {
|
|
56
50
|
filePath = getFilePathResolved({
|
|
@@ -68,12 +62,20 @@ function resolvePointerImportData(pointerImportData, importerFilePath, userRootD
|
|
|
68
62
|
}
|
|
69
63
|
return filePath;
|
|
70
64
|
}
|
|
71
|
-
function resolveImportPathWithNode(pointerImportData, importerFilePath) {
|
|
65
|
+
function resolveImportPathWithNode(pointerImportData, importerFilePath, userRootDir) {
|
|
72
66
|
const importerFilePathAbsolute = importerFilePath.filePathAbsoluteFilesystem;
|
|
73
67
|
assertPosixPath(importerFilePathAbsolute);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
// filePathAbsoluteFilesystem is null when pointerImportData.importPath is a path alias that Node.js doesn't know about
|
|
69
|
+
const filePathAbsoluteFilesystem = requireResolveOptional({
|
|
70
|
+
importPath: pointerImportData.importPath,
|
|
71
|
+
importerFilePath: importerFilePathAbsolute,
|
|
72
|
+
userRootDir
|
|
73
|
+
});
|
|
74
|
+
if (!filePathAbsoluteFilesystem) {
|
|
75
|
+
assert(!isImportPathRelative(pointerImportData.importPath));
|
|
76
|
+
// Libraries don't use path aliases => filePathAbsoluteFilesystem should be defined
|
|
77
|
+
assert(!importerFilePathAbsolute.includes('node_modules'));
|
|
78
|
+
}
|
|
77
79
|
return filePathAbsoluteFilesystem;
|
|
78
80
|
}
|
|
79
81
|
function assertUsageResolutionSuccess(filePathAbsoluteFilesystem, pointerImportData, importerFilePath) {
|
|
@@ -85,8 +87,7 @@ function assertUsageResolutionSuccess(filePathAbsoluteFilesystem, pointerImportD
|
|
|
85
87
|
? `The import path ${importPathString} in ${filePathToShowToUser}`
|
|
86
88
|
: `The import ${pc.code(importString)} defined by ${filePathToShowToUser}`;
|
|
87
89
|
const errIntro2 = `${errIntro} couldn't be resolved: does ${importPathString}`;
|
|
88
|
-
if (importPath
|
|
89
|
-
assert(pathIsRelative(importPath));
|
|
90
|
+
if (isImportPathRelative(importPath)) {
|
|
90
91
|
assertUsage(false, `${errIntro2} point to an existing file?`);
|
|
91
92
|
}
|
|
92
93
|
else {
|
|
@@ -7,8 +7,8 @@ import fs from 'fs';
|
|
|
7
7
|
import path from 'path';
|
|
8
8
|
import pc from '@brillout/picocolors';
|
|
9
9
|
import { import_ } from '@brillout/import';
|
|
10
|
-
import { assertPosixPath, getRandomId, assertIsNotProductionRuntime, assert, assertWarning, isObject, toPosixPath, assertUsage, isPlainJavaScriptFile, createDebugger, assertFilePathAbsoluteFilesystem,
|
|
11
|
-
import { transformPointerImports } from './
|
|
10
|
+
import { assertPosixPath, getRandomId, assertIsNotProductionRuntime, assert, assertWarning, isObject, toPosixPath, assertUsage, isPlainJavaScriptFile, createDebugger, assertFilePathAbsoluteFilesystem, assertIsImportPathNpmPackage, genPromise, isVitest, isImportPathNpmPackageOrPathAlias, isImportPathRelative, requireResolveOptionalDir } from '../../../../utils.js';
|
|
11
|
+
import { transformPointerImports } from './pointerImports.js';
|
|
12
12
|
import sourceMapSupport from 'source-map-support';
|
|
13
13
|
import { getFilePathAbsoluteUserRootDir } from '../../../../shared/getFilePath.js';
|
|
14
14
|
assertIsNotProductionRuntime();
|
|
@@ -121,7 +121,11 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
|
|
|
121
121
|
// - Sitll required for esbuild@0.24.0 (November 2024).
|
|
122
122
|
// - Let's try to remove this workaround again later.
|
|
123
123
|
if (resolved.errors.length > 0) {
|
|
124
|
-
const resolvedWithNode =
|
|
124
|
+
const resolvedWithNode = requireResolveOptionalDir({
|
|
125
|
+
importPath: path,
|
|
126
|
+
importerDir: toPosixPath(args.resolveDir),
|
|
127
|
+
userRootDir
|
|
128
|
+
});
|
|
125
129
|
if (debugEsbuildResolve.isActivated)
|
|
126
130
|
debugEsbuildResolve('resolvedWithNode', resolvedWithNode);
|
|
127
131
|
if (resolvedWithNode)
|
|
@@ -141,8 +145,8 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
|
|
|
141
145
|
const importPathOriginal = args.path;
|
|
142
146
|
// Esbuild resolves path aliases.
|
|
143
147
|
// - Enabling us to use:
|
|
144
|
-
// -
|
|
145
|
-
// -
|
|
148
|
+
// - assertIsImportPathNpmPackage()
|
|
149
|
+
// - isImportPathNpmPackage(str, { cannotBePathAlias: true })
|
|
146
150
|
assertFilePathAbsoluteFilesystem(importPathResolved);
|
|
147
151
|
// Should be remove this? See comment below.
|
|
148
152
|
const isVikeExtensionImport = (path.startsWith('vike-') && path.endsWith('/config')) || importPathResolved.endsWith('+config.js');
|
|
@@ -160,7 +164,7 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
|
|
|
160
164
|
const isNpmPkgImport = (() => {
|
|
161
165
|
if (importPathResolved.includes('/node_modules/')) {
|
|
162
166
|
// So far I can't think of a use case where this assertion would fail, but let's eventually remove it to avoid artificially restricting the user.
|
|
163
|
-
assert(
|
|
167
|
+
assert(isImportPathNpmPackageOrPathAlias(importPathOriginal));
|
|
164
168
|
return true;
|
|
165
169
|
}
|
|
166
170
|
// Linked npm packages
|
|
@@ -169,7 +173,7 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
|
|
|
169
173
|
// - This isn't always the case: https://github.com/vikejs/vike/issues/2326
|
|
170
174
|
!importPathResolved.startsWith(userRootDir) &&
|
|
171
175
|
// False positive if `importPathOriginal` is a path alias that a) looks like an npm package import and b) resolves outside of `userRootDir` => we then we wrongfully assume that `importPathOriginal` is an npm package import.
|
|
172
|
-
|
|
176
|
+
isImportPathNpmPackageOrPathAlias(importPathOriginal)) {
|
|
173
177
|
return true;
|
|
174
178
|
}
|
|
175
179
|
return false;
|
|
@@ -186,7 +190,7 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
|
|
|
186
190
|
}
|
|
187
191
|
let importPathTranspiled;
|
|
188
192
|
assertPosixPath(importPathOriginal);
|
|
189
|
-
if (
|
|
193
|
+
if (isImportPathRelative(importPathOriginal)) {
|
|
190
194
|
importPathTranspiled = importPathResolved;
|
|
191
195
|
}
|
|
192
196
|
else {
|
|
@@ -203,12 +207,12 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
|
|
|
203
207
|
// - Vike doesn't resolve path aliases at all.
|
|
204
208
|
// - Node.js doesn't support `tsconfig.js#compilerOptions.paths`.
|
|
205
209
|
// - Esbuild path alias resolution seems reliable, e.g. it supports `tsconfig.js#compilerOptions.paths`.
|
|
206
|
-
assert(!
|
|
210
|
+
assert(!isImportPathNpmPackageOrPathAlias(importPathOriginal));
|
|
207
211
|
importPathTranspiled = importPathResolved;
|
|
208
212
|
}
|
|
209
213
|
else {
|
|
210
214
|
// `importPathOriginal` is most likely an npm package import.
|
|
211
|
-
|
|
215
|
+
assertIsImportPathNpmPackage(importPathOriginal);
|
|
212
216
|
// For improved error messages, let the resolution be handled by Vike or Node.js.
|
|
213
217
|
importPathTranspiled = importPathOriginal;
|
|
214
218
|
}
|
|
@@ -70,7 +70,7 @@ async function handleReloadSideEffects() {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
// TODO/soon: predominantly use
|
|
73
|
+
// TODO/soon: predominantly use getVikeConfigInternal() instead of getVikeConfig() then maybe refector?
|
|
74
74
|
async function getVikeConfig(config, { doNotRestartViteOnError } = {}) {
|
|
75
75
|
const userRootDir = config.root;
|
|
76
76
|
const vikeVitePluginOptions = config._vikeVitePluginOptions;
|
|
@@ -7,7 +7,7 @@ export { getModuleFilePathRelative };
|
|
|
7
7
|
export { cleanFilePathUnkown };
|
|
8
8
|
export { assertModuleId };
|
|
9
9
|
import path from 'path';
|
|
10
|
-
import { assert,
|
|
10
|
+
import { assert, assertIsImportPathNpmPackage, assertFilePathAbsoluteFilesystem, assertPosixPath, toPosixPath } from '../utils.js';
|
|
11
11
|
function getFilePathResolved(args) {
|
|
12
12
|
const { userRootDir } = args;
|
|
13
13
|
let filePathAbsoluteFilesystem;
|
|
@@ -39,7 +39,7 @@ function getComputedProps(args) {
|
|
|
39
39
|
const importPathAbsolute = args.importPathAbsolute ?? null;
|
|
40
40
|
const { filePathAbsoluteUserRootDir } = args;
|
|
41
41
|
if (importPathAbsolute)
|
|
42
|
-
|
|
42
|
+
assertIsImportPathNpmPackage(importPathAbsolute);
|
|
43
43
|
return {
|
|
44
44
|
importPathAbsolute,
|
|
45
45
|
filePathAbsoluteUserRootDir,
|
|
@@ -53,7 +53,7 @@ function getComputedProps(args) {
|
|
|
53
53
|
}
|
|
54
54
|
function getComputedPropsImportPathAbsolute(args) {
|
|
55
55
|
const { importPathAbsolute } = args;
|
|
56
|
-
|
|
56
|
+
assertIsImportPathNpmPackage(importPathAbsolute);
|
|
57
57
|
return {
|
|
58
58
|
filePathAbsoluteUserRootDir: null,
|
|
59
59
|
importPathAbsolute,
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
export { resolveClientEntriesDev };
|
|
2
|
-
import { assert, assertPosixPath, toPosixPath, pathJoin,
|
|
3
|
-
// @ts-ignore import.meta.url is shimmed at dist/cjs by dist-cjs-fixup.js.
|
|
4
|
-
const importMetaUrl = import.meta.url;
|
|
2
|
+
import { assert, assertPosixPath, toPosixPath, pathJoin, assertIsImportPathNpmPackage, assertIsNotProductionRuntime, requireResolveNpmPackage, requireResolveVikeDistFile } from '../utils.js';
|
|
5
3
|
assertIsNotProductionRuntime();
|
|
6
4
|
async function resolveClientEntriesDev(clientEntry, viteDevServer) {
|
|
7
|
-
let
|
|
8
|
-
assert(
|
|
9
|
-
|
|
5
|
+
let userRootDir = viteDevServer.config.root;
|
|
6
|
+
assert(userRootDir);
|
|
7
|
+
userRootDir = toPosixPath(userRootDir);
|
|
10
8
|
// The `?import` suffix is needed for MDX to be transpiled:
|
|
11
9
|
// - Not transpiled: `/pages/markdown.page.mdx`
|
|
12
10
|
// - Transpiled: `/pages/markdown.page.mdx?import`
|
|
@@ -20,26 +18,16 @@ async function resolveClientEntriesDev(clientEntry, viteDevServer) {
|
|
|
20
18
|
assertPosixPath(clientEntry);
|
|
21
19
|
let filePath;
|
|
22
20
|
if (clientEntry.startsWith('/')) {
|
|
23
|
-
filePath = pathJoin(
|
|
21
|
+
filePath = pathJoin(userRootDir, clientEntry);
|
|
24
22
|
}
|
|
25
23
|
else {
|
|
26
24
|
if (clientEntry.startsWith('@@vike/')) {
|
|
27
25
|
assert(clientEntry.endsWith('.js'));
|
|
28
|
-
|
|
29
|
-
// For Vitest (which doesn't resolve vike to its dist but to its source files)
|
|
30
|
-
// [RELATIVE_PATH_FROM_DIST] Current file: node_modules/vike/node/plugin/shared/resolveClientEntriesDev.js
|
|
31
|
-
filePath_ = requireResolveOptionalNonUserFile(clientEntry.replace('@@vike/dist/esm/client/', '../../../client/').replace('.js', '.ts'), importMetaUrl);
|
|
32
|
-
if (!filePath_) {
|
|
33
|
-
// For users
|
|
34
|
-
// [RELATIVE_PATH_FROM_DIST] Current file: node_modules/vike/dist/esm/node/plugin/shared/resolveClientEntriesDev.js
|
|
35
|
-
filePath_ = requireResolveOptionalNonUserFile(clientEntry.replace('@@vike/dist/esm/client/', '../../../../../dist/esm/client/'), importMetaUrl);
|
|
36
|
-
}
|
|
37
|
-
assert(filePath_);
|
|
38
|
-
filePath = filePath_;
|
|
26
|
+
filePath = requireResolveVikeDistFile(`dist/esm/${clientEntry.replace('@@vike/dist/esm/', '')}`);
|
|
39
27
|
}
|
|
40
28
|
else {
|
|
41
|
-
|
|
42
|
-
filePath =
|
|
29
|
+
assertIsImportPathNpmPackage(clientEntry);
|
|
30
|
+
filePath = requireResolveNpmPackage({ importPathNpmPackage: clientEntry, userRootDir });
|
|
43
31
|
}
|
|
44
32
|
}
|
|
45
33
|
if (!filePath.startsWith('/')) {
|
|
@@ -75,6 +75,7 @@ declare function createPageContextPrerendering(urlOriginal: string, prerenderCon
|
|
|
75
75
|
} & {
|
|
76
76
|
globalContext: GlobalContextServer;
|
|
77
77
|
_globalContext: {
|
|
78
|
+
isGlobalContext: true;
|
|
78
79
|
_virtualFileExports: unknown;
|
|
79
80
|
_pageFilesAll: PageFile[];
|
|
80
81
|
_pageConfigs: import("../../shared/page-configs/PageConfig.js").PageConfigRuntime[];
|
|
@@ -100,8 +101,10 @@ declare function createPageContextPrerendering(urlOriginal: string, prerenderCon
|
|
|
100
101
|
};
|
|
101
102
|
baseServer: string;
|
|
102
103
|
baseAssets: string;
|
|
104
|
+
isClientSide: false;
|
|
103
105
|
_pageRoutes: import("../../shared/route/loadPageRoutes.js").PageRoutes;
|
|
104
106
|
_onBeforeRouteHook: import("../../shared/hooks/getHook.js").Hook | null;
|
|
107
|
+
isGlobalContext: true;
|
|
105
108
|
_virtualFileExports: unknown;
|
|
106
109
|
_pageFilesAll: PageFile[];
|
|
107
110
|
_pageConfigs: import("../../shared/page-configs/PageConfig.js").PageConfigRuntime[];
|
|
@@ -128,8 +131,10 @@ declare function createPageContextPrerendering(urlOriginal: string, prerenderCon
|
|
|
128
131
|
_usesClientRouter: boolean;
|
|
129
132
|
baseServer: string;
|
|
130
133
|
baseAssets: string;
|
|
134
|
+
isClientSide: false;
|
|
131
135
|
_pageRoutes: import("../../shared/route/loadPageRoutes.js").PageRoutes;
|
|
132
136
|
_onBeforeRouteHook: import("../../shared/hooks/getHook.js").Hook | null;
|
|
137
|
+
isGlobalContext: true;
|
|
133
138
|
_virtualFileExports: unknown;
|
|
134
139
|
_pageFilesAll: PageFile[];
|
|
135
140
|
_pageConfigs: import("../../shared/page-configs/PageConfig.js").PageConfigRuntime[];
|
|
@@ -156,8 +161,10 @@ declare function createPageContextPrerendering(urlOriginal: string, prerenderCon
|
|
|
156
161
|
_usesClientRouter: boolean;
|
|
157
162
|
baseServer: string;
|
|
158
163
|
baseAssets: string;
|
|
164
|
+
isClientSide: false;
|
|
159
165
|
_pageRoutes: import("../../shared/route/loadPageRoutes.js").PageRoutes;
|
|
160
166
|
_onBeforeRouteHook: import("../../shared/hooks/getHook.js").Hook | null;
|
|
167
|
+
isGlobalContext: true;
|
|
161
168
|
_virtualFileExports: unknown;
|
|
162
169
|
_pageFilesAll: PageFile[];
|
|
163
170
|
_pageConfigs: import("../../shared/page-configs/PageConfig.js").PageConfigRuntime[];
|
|
@@ -190,7 +197,7 @@ declare function createPageContextPrerendering(urlOriginal: string, prerenderCon
|
|
|
190
197
|
_source: import("../../shared/page-configs/getPageConfigUserFriendly.js").Source;
|
|
191
198
|
_sources: import("../../shared/page-configs/getPageConfigUserFriendly.js").Sources;
|
|
192
199
|
_from: import("../../shared/page-configs/getPageConfigUserFriendly.js").From;
|
|
193
|
-
|
|
200
|
+
isPageContext: true;
|
|
194
201
|
} & {
|
|
195
202
|
_urlHandler: null;
|
|
196
203
|
_httpRequestId: null;
|
|
@@ -209,6 +216,7 @@ declare function createPageContextPrerendering(urlOriginal: string, prerenderCon
|
|
|
209
216
|
} & {
|
|
210
217
|
globalContext: GlobalContextServer;
|
|
211
218
|
_globalContext: {
|
|
219
|
+
isGlobalContext: true;
|
|
212
220
|
_virtualFileExports: unknown;
|
|
213
221
|
_pageFilesAll: PageFile[];
|
|
214
222
|
_pageConfigs: import("../../shared/page-configs/PageConfig.js").PageConfigRuntime[];
|
|
@@ -234,8 +242,10 @@ declare function createPageContextPrerendering(urlOriginal: string, prerenderCon
|
|
|
234
242
|
};
|
|
235
243
|
baseServer: string;
|
|
236
244
|
baseAssets: string;
|
|
245
|
+
isClientSide: false;
|
|
237
246
|
_pageRoutes: import("../../shared/route/loadPageRoutes.js").PageRoutes;
|
|
238
247
|
_onBeforeRouteHook: import("../../shared/hooks/getHook.js").Hook | null;
|
|
248
|
+
isGlobalContext: true;
|
|
239
249
|
_virtualFileExports: unknown;
|
|
240
250
|
_pageFilesAll: PageFile[];
|
|
241
251
|
_pageConfigs: import("../../shared/page-configs/PageConfig.js").PageConfigRuntime[];
|
|
@@ -262,8 +272,10 @@ declare function createPageContextPrerendering(urlOriginal: string, prerenderCon
|
|
|
262
272
|
_usesClientRouter: boolean;
|
|
263
273
|
baseServer: string;
|
|
264
274
|
baseAssets: string;
|
|
275
|
+
isClientSide: false;
|
|
265
276
|
_pageRoutes: import("../../shared/route/loadPageRoutes.js").PageRoutes;
|
|
266
277
|
_onBeforeRouteHook: import("../../shared/hooks/getHook.js").Hook | null;
|
|
278
|
+
isGlobalContext: true;
|
|
267
279
|
_virtualFileExports: unknown;
|
|
268
280
|
_pageFilesAll: PageFile[];
|
|
269
281
|
_pageConfigs: import("../../shared/page-configs/PageConfig.js").PageConfigRuntime[];
|
|
@@ -290,8 +302,10 @@ declare function createPageContextPrerendering(urlOriginal: string, prerenderCon
|
|
|
290
302
|
_usesClientRouter: boolean;
|
|
291
303
|
baseServer: string;
|
|
292
304
|
baseAssets: string;
|
|
305
|
+
isClientSide: false;
|
|
293
306
|
_pageRoutes: import("../../shared/route/loadPageRoutes.js").PageRoutes;
|
|
294
307
|
_onBeforeRouteHook: import("../../shared/hooks/getHook.js").Hook | null;
|
|
308
|
+
isGlobalContext: true;
|
|
295
309
|
_virtualFileExports: unknown;
|
|
296
310
|
_pageFilesAll: PageFile[];
|
|
297
311
|
_pageConfigs: import("../../shared/page-configs/PageConfig.js").PageConfigRuntime[];
|
|
@@ -324,7 +338,7 @@ declare function createPageContextPrerendering(urlOriginal: string, prerenderCon
|
|
|
324
338
|
_source: import("../../shared/page-configs/getPageConfigUserFriendly.js").Source;
|
|
325
339
|
_sources: import("../../shared/page-configs/getPageConfigUserFriendly.js").Sources;
|
|
326
340
|
_from: import("../../shared/page-configs/getPageConfigUserFriendly.js").From;
|
|
327
|
-
|
|
341
|
+
isPageContext: true;
|
|
328
342
|
} & {
|
|
329
343
|
_urlHandler: null;
|
|
330
344
|
_httpRequestId: null;
|