vike 0.4.166 → 0.4.167
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/node/plugin/plugins/buildConfig.js +11 -6
- package/dist/cjs/node/plugin/plugins/commonConfig/assertResolveAlias.js +2 -1
- package/dist/cjs/node/plugin/plugins/devConfig/determineOptimizeDeps.js +17 -22
- package/dist/cjs/node/plugin/plugins/envVars.js +3 -2
- package/dist/cjs/node/plugin/plugins/extractAssetsPlugin.js +11 -13
- package/dist/cjs/node/plugin/plugins/extractExportNamesPlugin.js +2 -4
- package/dist/cjs/node/plugin/plugins/fileEnv.js +6 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/index.js +6 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getConfigFileExport.js +3 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.js +5 -1
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolveImportPath.js +21 -17
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +12 -11
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +6 -2
- package/dist/cjs/node/plugin/shared/getFilePath.js +83 -29
- package/dist/cjs/node/plugin/shared/isErrorDebug.js +1 -1
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet.js +3 -8
- package/dist/cjs/node/plugin/shared/loggerNotProd.js +2 -1
- package/dist/cjs/node/plugin/utils.js +1 -1
- package/dist/cjs/node/prerender/runPrerender.js +6 -7
- package/dist/cjs/node/prerender/utils.js +2 -1
- package/dist/cjs/node/runtime/html/stream.js +5 -5
- package/dist/cjs/node/runtime/renderPage/executeOnBeforeRenderAndDataHooks.js +3 -3
- package/dist/cjs/node/runtime/renderPage/executeOnRenderHtmlHook.js +2 -1
- package/dist/cjs/node/runtime/renderPage/getPageAssets/getManifestEntry.js +5 -9
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +9 -8
- package/dist/cjs/node/runtime/renderPage/getPageAssets.js +6 -12
- package/dist/cjs/node/runtime/utils.js +0 -1
- package/dist/cjs/shared/page-configs/assertPlusFileExport.js +1 -3
- package/dist/cjs/shared/route/abort.js +2 -1
- package/dist/cjs/shared/route/executeGuardHook.js +2 -1
- package/dist/cjs/shared/route/executeOnBeforeRouteHook.js +2 -1
- package/dist/cjs/shared/route/index.js +2 -3
- package/dist/cjs/shared/route/utils.js +0 -1
- package/dist/cjs/utils/assertIsNotProductionRuntime.js +5 -5
- package/dist/cjs/utils/assertPathIsFilesystemAbsolute.js +1 -0
- package/dist/cjs/utils/debug.js +48 -14
- package/dist/cjs/utils/isNpmPackage.js +11 -2
- package/dist/cjs/utils/projectInfo.js +1 -1
- package/dist/cjs/utils/trackLogs.js +1 -1
- package/dist/esm/client/client-routing-runtime/renderPageClientSide.js +31 -24
- package/dist/esm/node/plugin/plugins/buildConfig.js +12 -7
- package/dist/esm/node/plugin/plugins/commonConfig/assertResolveAlias.js +2 -1
- package/dist/esm/node/plugin/plugins/devConfig/determineOptimizeDeps.js +18 -23
- package/dist/esm/node/plugin/plugins/envVars.js +4 -3
- package/dist/esm/node/plugin/plugins/extractAssetsPlugin.js +12 -14
- package/dist/esm/node/plugin/plugins/extractExportNamesPlugin.js +3 -5
- package/dist/esm/node/plugin/plugins/fileEnv.js +7 -4
- package/dist/esm/node/plugin/plugins/importUserCode/index.js +7 -3
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/debug.d.ts +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getConfigFileExport.js +4 -4
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.js +5 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolveImportPath.js +21 -17
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +12 -11
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +6 -2
- package/dist/esm/node/plugin/shared/getFilePath.d.ts +10 -9
- package/dist/esm/node/plugin/shared/getFilePath.js +83 -29
- package/dist/esm/node/plugin/shared/isErrorDebug.js +2 -2
- package/dist/esm/node/plugin/shared/loggerNotProd/errorWithCodeSnippet.js +4 -9
- package/dist/esm/node/plugin/shared/loggerNotProd.js +2 -1
- package/dist/esm/node/plugin/utils.d.ts +1 -1
- package/dist/esm/node/plugin/utils.js +1 -1
- package/dist/esm/node/prerender/runPrerender.js +2 -3
- package/dist/esm/node/prerender/utils.d.ts +2 -1
- package/dist/esm/node/prerender/utils.js +2 -1
- package/dist/esm/node/runtime/html/stream.js +5 -5
- package/dist/esm/node/runtime/renderPage/executeOnBeforeRenderAndDataHooks.js +1 -1
- package/dist/esm/node/runtime/renderPage/executeOnRenderHtmlHook.js +2 -1
- package/dist/esm/node/runtime/renderPage/getPageAssets/getManifestEntry.js +6 -10
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +9 -8
- package/dist/esm/node/runtime/renderPage/getPageAssets.js +7 -13
- package/dist/esm/node/runtime/utils.d.ts +0 -1
- package/dist/esm/node/runtime/utils.js +0 -1
- package/dist/esm/shared/page-configs/FilePath.d.ts +41 -29
- package/dist/esm/shared/page-configs/assertPlusFileExport.js +1 -3
- package/dist/esm/shared/route/abort.js +2 -1
- package/dist/esm/shared/route/executeGuardHook.js +2 -1
- package/dist/esm/shared/route/executeOnBeforeRouteHook.js +2 -1
- package/dist/esm/shared/route/index.js +2 -3
- package/dist/esm/shared/route/utils.d.ts +0 -1
- package/dist/esm/shared/route/utils.js +0 -1
- package/dist/esm/utils/assertIsNotProductionRuntime.js +5 -5
- package/dist/esm/utils/assertPathIsFilesystemAbsolute.js +1 -0
- package/dist/esm/utils/debug.d.ts +5 -4
- package/dist/esm/utils/debug.js +45 -14
- package/dist/esm/utils/debugGlob.d.ts +1 -1
- package/dist/esm/utils/isNpmPackage.d.ts +5 -1
- package/dist/esm/utils/isNpmPackage.js +10 -1
- package/dist/esm/utils/projectInfo.d.ts +2 -2
- package/dist/esm/utils/projectInfo.js +1 -1
- package/dist/esm/utils/trackLogs.js +2 -2
- package/package.json +1 -1
- package/dist/cjs/node/runtime/renderPage/getPageAssets/assertClientEntryId.js +0 -19
- package/dist/cjs/utils/getFilePathAbsolute.js +0 -70
- package/dist/esm/node/runtime/renderPage/getPageAssets/assertClientEntryId.d.ts +0 -2
- package/dist/esm/node/runtime/renderPage/getPageAssets/assertClientEntryId.js +0 -16
- package/dist/esm/utils/getFilePathAbsolute.d.ts +0 -5
- package/dist/esm/utils/getFilePathAbsolute.js +0 -64
|
@@ -7,7 +7,7 @@ const debug_js_1 = require("./debug.js");
|
|
|
7
7
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
8
8
|
const assertIsNotBrowser_js_1 = require("./assertIsNotBrowser.js");
|
|
9
9
|
(0, assertIsNotBrowser_js_1.assertIsNotBrowser)();
|
|
10
|
-
if ((0, debug_js_1.
|
|
10
|
+
if ((0, debug_js_1.isDebugActivated)('vike:log')) {
|
|
11
11
|
trackLogs();
|
|
12
12
|
}
|
|
13
13
|
// https://stackoverflow.com/questions/45395369/how-to-get-console-log-line-numbers-shown-in-nodejs/75109905#75109905
|
|
@@ -22,7 +22,7 @@ async function renderPageClientSide(renderArgs) {
|
|
|
22
22
|
const { scrollTarget, urlOriginal = getCurrentUrl(), overwriteLastHistoryEntry = false, isBackwardNavigation, pageContextsFromRewrite = [], redirectCount = 0, isUserLandPushStateNavigation, isClientSideNavigation = true } = renderArgs;
|
|
23
23
|
// isHydrationRender <=> the first render attempt
|
|
24
24
|
const { isRenderOutdated, setHydrationCanBeAborted, isHydrationRender } = getIsRenderOutdated();
|
|
25
|
-
assert(isClientSideNavigation === !isHydrationRender);
|
|
25
|
+
assert(isClientSideNavigation === !isHydrationRender); // isHydrationRender === (renderNumber === 1)
|
|
26
26
|
assertNoInfiniteAbortLoop(pageContextsFromRewrite.length, redirectCount);
|
|
27
27
|
if (globalObject.clientRoutingIsDisabled) {
|
|
28
28
|
serverSideRouteTo(urlOriginal);
|
|
@@ -37,6 +37,31 @@ async function renderPageClientSide(renderArgs) {
|
|
|
37
37
|
const pageContext = await getPageContextBegin();
|
|
38
38
|
if (isRenderOutdated())
|
|
39
39
|
return;
|
|
40
|
+
// onPageTransitionStart()
|
|
41
|
+
if (globalObject.isFirstRenderDone) {
|
|
42
|
+
const { previousPageContext } = globalObject;
|
|
43
|
+
assert(previousPageContext);
|
|
44
|
+
// We use the hook of the previous page in order to be able to call onPageTransitionStart() before fetching the files of the next page.
|
|
45
|
+
// https://github.com/vikejs/vike/issues/1560
|
|
46
|
+
assertHook(previousPageContext, 'onPageTransitionStart');
|
|
47
|
+
if (!globalObject.isTransitioning) {
|
|
48
|
+
globalObject.isTransitioning = true;
|
|
49
|
+
const onPageTransitionStartHook = getHook(previousPageContext, 'onPageTransitionStart');
|
|
50
|
+
if (onPageTransitionStartHook) {
|
|
51
|
+
const hook = onPageTransitionStartHook;
|
|
52
|
+
const { hookFn } = hook;
|
|
53
|
+
try {
|
|
54
|
+
await executeHook(() => hookFn(pageContext), hook);
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
await onError(err);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (isRenderOutdated())
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
40
65
|
// Route
|
|
41
66
|
let pageContextRouted;
|
|
42
67
|
if (isHydrationRender) {
|
|
@@ -104,27 +129,6 @@ async function renderPageClientSide(renderArgs) {
|
|
|
104
129
|
// There wasn't any `await` but result may change because we just called setHydrationCanBeAborted()
|
|
105
130
|
if (isRenderOutdated())
|
|
106
131
|
return;
|
|
107
|
-
// onPageTransitionStart()
|
|
108
|
-
if (!isHydrationRender) {
|
|
109
|
-
assertHook(pageContext, 'onPageTransitionStart');
|
|
110
|
-
if (!globalObject.isTransitioning) {
|
|
111
|
-
globalObject.isTransitioning = true;
|
|
112
|
-
const onPageTransitionStartHook = getHook(pageContext, 'onPageTransitionStart');
|
|
113
|
-
if (onPageTransitionStartHook) {
|
|
114
|
-
const hook = onPageTransitionStartHook;
|
|
115
|
-
const { hookFn } = hook;
|
|
116
|
-
try {
|
|
117
|
-
await executeHook(() => hookFn(pageContext), hook);
|
|
118
|
-
}
|
|
119
|
-
catch (err) {
|
|
120
|
-
await onError(err);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
if (isRenderOutdated())
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
132
|
// Get pageContext from hooks (fetched from server, and/or directly called on the client-side)
|
|
129
133
|
if (isHydrationRender) {
|
|
130
134
|
assert(hasProp(pageContext, '_hasPageContextFromServer', 'true'));
|
|
@@ -328,6 +332,7 @@ async function renderPageClientSide(renderArgs) {
|
|
|
328
332
|
onRenderClientError = err;
|
|
329
333
|
}
|
|
330
334
|
globalObject.onRenderClientPromise = undefined;
|
|
335
|
+
globalObject.isFirstRenderDone = true;
|
|
331
336
|
return onRenderClientError;
|
|
332
337
|
})();
|
|
333
338
|
const onRenderClientError = await globalObject.onRenderClientPromise;
|
|
@@ -365,8 +370,10 @@ async function renderPageClientSide(renderArgs) {
|
|
|
365
370
|
// onPageTransitionEnd()
|
|
366
371
|
if (globalObject.isTransitioning) {
|
|
367
372
|
globalObject.isTransitioning = undefined;
|
|
368
|
-
|
|
369
|
-
|
|
373
|
+
const { previousPageContext } = globalObject;
|
|
374
|
+
assert(previousPageContext);
|
|
375
|
+
assertHook(previousPageContext, 'onPageTransitionEnd');
|
|
376
|
+
const hook = getHook(previousPageContext, 'onPageTransitionEnd');
|
|
370
377
|
if (hook) {
|
|
371
378
|
const { hookFn } = hook;
|
|
372
379
|
try {
|
|
@@ -2,7 +2,7 @@ export { buildConfig };
|
|
|
2
2
|
export { assertRollupInput };
|
|
3
3
|
export { analyzeClientEntries };
|
|
4
4
|
export { manifestTempFile };
|
|
5
|
-
import { assert, resolveOutDir, viteIsSSR,
|
|
5
|
+
import { assert, resolveOutDir, viteIsSSR, addOnBeforeLogHook, removeFileExtention, unique, assertUsage, injectRollupInputs, normalizeRollupInput, getOutDirs, assertNodeEnv_build, assertIsNpmPackageImport } from '../utils.js';
|
|
6
6
|
import { getVikeConfig, isV1Design } from './importUserCode/v1-design/getVikeConfig.js';
|
|
7
7
|
import { getConfigValue } from '../../../shared/page-configs/helpers.js';
|
|
8
8
|
import { findPageFiles } from '../shared/findPageFiles.js';
|
|
@@ -16,6 +16,7 @@ import path from 'path';
|
|
|
16
16
|
import { fixServerAssets, fixServerAssets_isEnabled } from './buildConfig/fixServerAssets.js';
|
|
17
17
|
import { set_constant_ASSETS_MAP } from './importBuild/index.js';
|
|
18
18
|
import { prependEntriesDir } from '../../shared/prependEntriesDir.js';
|
|
19
|
+
import { getFilePathResolved } from '../shared/getFilePath.js';
|
|
19
20
|
// @ts-ignore Shimmed by dist-cjs-fixup.js for CJS build.
|
|
20
21
|
const importMetaUrl = import.meta.url;
|
|
21
22
|
const require_ = createRequire(importMetaUrl);
|
|
@@ -200,18 +201,22 @@ async function getPageFileEntries(config, includeAssetsImportedByServer) {
|
|
|
200
201
|
return pageFileEntries;
|
|
201
202
|
}
|
|
202
203
|
function getEntryFromClientEntry(clientEntry, config, addExtractAssetsQuery) {
|
|
203
|
-
if (
|
|
204
|
+
if (!clientEntry.startsWith('/')) {
|
|
205
|
+
assertIsNpmPackageImport(clientEntry);
|
|
204
206
|
const entryTarget = clientEntry;
|
|
205
207
|
const entryName = prependEntriesDir(clientEntry);
|
|
206
208
|
return { entryName, entryTarget };
|
|
207
209
|
}
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
const filePathAbsoluteUserRootDir = clientEntry;
|
|
211
|
+
assert(filePathAbsoluteUserRootDir.startsWith('/'));
|
|
212
|
+
const filePath = getFilePathResolved({
|
|
213
|
+
filePathAbsoluteUserRootDir,
|
|
214
|
+
userRootDir: config.root
|
|
215
|
+
});
|
|
216
|
+
let entryTarget = filePath.filePathAbsoluteFilesystem;
|
|
212
217
|
if (addExtractAssetsQuery)
|
|
213
218
|
entryTarget = extractAssetsAddQuery(entryTarget);
|
|
214
|
-
let entryName =
|
|
219
|
+
let entryName = filePathAbsoluteUserRootDir;
|
|
215
220
|
if (addExtractAssetsQuery)
|
|
216
221
|
entryName = extractAssetsAddQuery(entryName);
|
|
217
222
|
entryName = removeFileExtention(entryName);
|
|
@@ -13,8 +13,9 @@ import pc from '@brillout/picocolors';
|
|
|
13
13
|
// - Aliases react imports
|
|
14
14
|
// - @vitejs/plugin-vue2
|
|
15
15
|
// - https://github.com/vikejs/vike/issues/1329
|
|
16
|
-
// TODO/v1-release: replace assertWarning() with assertUsage()
|
|
17
16
|
function assertResolveAlias(config) {
|
|
17
|
+
// TODO: re-implement warning https://github.com/vikejs/vike/issues/1567
|
|
18
|
+
return;
|
|
18
19
|
const aliases = getAliases(config);
|
|
19
20
|
const errPrefix = config.configFile || 'Your Vite configuration';
|
|
20
21
|
const errSuffix1 = 'see https://vike.dev/path-aliases#vite';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { determineOptimizeDeps };
|
|
2
2
|
import { findPageFiles } from '../../shared/findPageFiles.js';
|
|
3
|
-
import { assert,
|
|
3
|
+
import { assert, assertIsNpmPackageImport, createDebugger, unique } from '../../utils.js';
|
|
4
4
|
import { getVikeConfig } from '../importUserCode/v1-design/getVikeConfig.js';
|
|
5
5
|
import { getConfigValueSourcesNotOverriden } from '../../shared/getConfigValueSourcesNotOverriden.js';
|
|
6
6
|
import { analyzeClientEntries } from '../buildConfig.js';
|
|
7
7
|
import { virtualFileIdImportUserCodeClientCR, virtualFileIdImportUserCodeClientSR } from '../../../shared/virtual-files/virtualFileImportUserCode.js';
|
|
8
|
+
import { getFilePathResolved } from '../../shared/getFilePath.js';
|
|
9
|
+
const debug = createDebugger('vike:optimizeDeps');
|
|
8
10
|
async function determineOptimizeDeps(config, isDev) {
|
|
9
11
|
const { pageConfigs } = await getVikeConfig(config, isDev);
|
|
10
12
|
const { entries, include } = await getPageDeps(config, pageConfigs, isDev);
|
|
@@ -21,7 +23,11 @@ async function determineOptimizeDeps(config, isDev) {
|
|
|
21
23
|
*/
|
|
22
24
|
config.optimizeDeps.include = [...include, ...normalizeInclude(config.optimizeDeps.include)];
|
|
23
25
|
config.optimizeDeps.entries = [...entries, ...normalizeEntries(config.optimizeDeps.entries)];
|
|
24
|
-
|
|
26
|
+
if (debug.isActivated)
|
|
27
|
+
debug('config.optimizeDeps', {
|
|
28
|
+
'config.optimizeDeps.entries': config.optimizeDeps.entries,
|
|
29
|
+
'config.optimizeDeps.include': config.optimizeDeps.include
|
|
30
|
+
});
|
|
25
31
|
}
|
|
26
32
|
async function getPageDeps(config, pageConfigs, isDev) {
|
|
27
33
|
let entries = [];
|
|
@@ -44,24 +50,10 @@ async function getPageDeps(config, pageConfigs, isDev) {
|
|
|
44
50
|
else {
|
|
45
51
|
// Adding definedAt.filePathAbsoluteFilesystem doesn't work for npm packages, I guess because of Vite's config.server.fs.allow
|
|
46
52
|
const { importPathAbsolute } = definedAt;
|
|
47
|
-
assert(importPathAbsolute);
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (isNpmPackageImport(importPathAbsolute)) {
|
|
52
|
-
// isNpmPackageImport() returns false for a path alias like #root/renderer/onRenderClient
|
|
53
|
-
assert(!importPathAbsolute.startsWith('#'));
|
|
54
|
-
include.push(importPathAbsolute);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
/* Path aliases, e.g.:
|
|
58
|
-
* ```js
|
|
59
|
-
* // /renderer/+config.js
|
|
60
|
-
* import onRenderClient from '#root/renderer/onRenderClient'
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
entries.push(importPathAbsolute);
|
|
64
|
-
}
|
|
53
|
+
assert(importPathAbsolute); // Help TS
|
|
54
|
+
// Shouldn't be a path alias, as path aliases would need to be added to config.optimizeDeps.entries instead of config.optimizeDeps.include
|
|
55
|
+
assertIsNpmPackageImport(importPathAbsolute);
|
|
56
|
+
include.push(importPathAbsolute);
|
|
65
57
|
}
|
|
66
58
|
});
|
|
67
59
|
});
|
|
@@ -69,9 +61,12 @@ async function getPageDeps(config, pageConfigs, isDev) {
|
|
|
69
61
|
// V0.4 design
|
|
70
62
|
{
|
|
71
63
|
const pageFiles = await findPageFiles(config, ['.page', '.page.client'], isDev);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
const userRootDir = config.root;
|
|
65
|
+
pageFiles.forEach((filePathAbsoluteUserRootDir) => {
|
|
66
|
+
const entry = getFilePathResolved({ filePathAbsoluteUserRootDir, userRootDir });
|
|
67
|
+
const { filePathAbsoluteFilesystem } = entry;
|
|
68
|
+
assert(filePathAbsoluteFilesystem);
|
|
69
|
+
entries.push(filePathAbsoluteFilesystem);
|
|
75
70
|
});
|
|
76
71
|
}
|
|
77
72
|
entries = unique(entries);
|
|
@@ -2,8 +2,9 @@ export { envVarsPlugin };
|
|
|
2
2
|
// For ./envVars.spec.ts
|
|
3
3
|
export { applyEnvVar };
|
|
4
4
|
import { loadEnv } from 'vite';
|
|
5
|
-
import { assert, assertPosixPath, assertUsage, assertWarning, escapeRegex,
|
|
5
|
+
import { assert, assertPosixPath, assertUsage, assertWarning, escapeRegex, lowerFirst } from '../utils.js';
|
|
6
6
|
import { sourceMapPassthrough } from '../shared/rollupSourceMap.js';
|
|
7
|
+
import { getModuleFilePath } from '../shared/getFilePath.js';
|
|
7
8
|
function envVarsPlugin() {
|
|
8
9
|
let envsAll;
|
|
9
10
|
let config;
|
|
@@ -45,10 +46,10 @@ function envVarsPlugin() {
|
|
|
45
46
|
if (isPrivate && isClientSide) {
|
|
46
47
|
if (!code.includes(envStatement))
|
|
47
48
|
return;
|
|
48
|
-
const
|
|
49
|
+
const modulePath = getModuleFilePath(id, config);
|
|
49
50
|
const errMsgAddendum = isBuild ? '' : ' (Vike will prevent your app from building for production)';
|
|
50
51
|
const keyPublic = `${publicPrefix}${envName}`;
|
|
51
|
-
const errMsg = `${envStatement} is used in client-side file ${
|
|
52
|
+
const errMsg = `${envStatement} is used in client-side file ${modulePath} which means that the environment variable ${envName} will be included in client-side bundles and, therefore, ${envName} will be publicly exposed which can be a security leak${errMsgAddendum}. Use ${envStatement} only in server-side files, or rename ${envName} to ${keyPublic}, see https://vike.dev/env`;
|
|
52
53
|
if (isBuild) {
|
|
53
54
|
assertUsage(false, errMsg);
|
|
54
55
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// - This appraoch supports import path aliases `vite.config.js#resolve.alias` https://vitejs.dev/config/#resolve-alias
|
|
7
7
|
export { extractAssetsPlugin };
|
|
8
8
|
export { extractAssetsRE };
|
|
9
|
-
import { viteIsSSR_options, assert, assertPosixPath, styleFileRE, createDebugger,
|
|
9
|
+
import { viteIsSSR_options, assert, assertPosixPath, styleFileRE, createDebugger, isScriptFile, resolveVirtualFileId, isVirtualFileId, getVirtualFileId, assertUsage } from '../utils.js';
|
|
10
10
|
import { extractAssetsAddQuery } from '../../shared/extractAssetsQuery.js';
|
|
11
11
|
import { getConfigVike } from '../../shared/getConfigVike.js';
|
|
12
12
|
import { isAsset } from '../shared/isAsset.js';
|
|
@@ -20,9 +20,7 @@ const extractAssetsRE = /(\?|&)extractAssets(?:&|$)/;
|
|
|
20
20
|
const rawRE = /(\?|&)raw(?:&|$)/;
|
|
21
21
|
const urlRE = /(\?|&)url(?:&|$)/;
|
|
22
22
|
const EMPTY_MODULE_ID = 'virtual:vike:empty-module';
|
|
23
|
-
const
|
|
24
|
-
const debug = createDebugger(debugNamespace);
|
|
25
|
-
const debugEnabled = isDebugEnabled(debugNamespace);
|
|
23
|
+
const debug = createDebugger('vike:extractAssets');
|
|
26
24
|
function extractAssetsPlugin() {
|
|
27
25
|
let config;
|
|
28
26
|
let configVike;
|
|
@@ -119,12 +117,6 @@ function extractAssetsPlugin() {
|
|
|
119
117
|
{
|
|
120
118
|
name: 'vike:extractAssets-3',
|
|
121
119
|
apply: 'build',
|
|
122
|
-
async configResolved(config_) {
|
|
123
|
-
configVike = await getConfigVike(config_);
|
|
124
|
-
config = config_;
|
|
125
|
-
vikeConfig = await getVikeConfig(config, false);
|
|
126
|
-
isServerAssetsFixEnabled = fixServerAssets_isEnabled() && (await isV1Design(config, false));
|
|
127
|
-
},
|
|
128
120
|
load(id) {
|
|
129
121
|
if (!isVirtualFileId(id))
|
|
130
122
|
return undefined;
|
|
@@ -134,16 +126,22 @@ function extractAssetsPlugin() {
|
|
|
134
126
|
}
|
|
135
127
|
},
|
|
136
128
|
config() {
|
|
137
|
-
if (
|
|
129
|
+
if (debug.isActivated) {
|
|
138
130
|
return { logLevel: 'silent' };
|
|
139
131
|
}
|
|
140
132
|
}
|
|
141
133
|
},
|
|
142
134
|
{
|
|
143
135
|
name: 'vike:extractAssets-4',
|
|
144
|
-
configResolved(
|
|
145
|
-
|
|
146
|
-
|
|
136
|
+
async configResolved(config_) {
|
|
137
|
+
configVike = await getConfigVike(config_);
|
|
138
|
+
config = config_;
|
|
139
|
+
vikeConfig = await getVikeConfig(config, false);
|
|
140
|
+
isServerAssetsFixEnabled = fixServerAssets_isEnabled() && (await isV1Design(config, false));
|
|
141
|
+
if (!isServerAssetsFixEnabled) {
|
|
142
|
+
// https://github.com/vikejs/vike/issues/1060
|
|
143
|
+
assertUsage(!config.plugins.find((p) => p.name === 'vite-tsconfig-paths'), 'vite-tsconfig-paths not supported, remove it and use vite.config.js#resolve.alias instead');
|
|
144
|
+
}
|
|
147
145
|
}
|
|
148
146
|
}
|
|
149
147
|
];
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
export { extractExportNamesPlugin };
|
|
2
2
|
export { isUsingClientRouter };
|
|
3
3
|
export { extractExportNamesRE };
|
|
4
|
-
import { assert, getFileExtension, viteIsSSR_options, createDebugger,
|
|
4
|
+
import { assert, getFileExtension, viteIsSSR_options, createDebugger, getGlobalObject, assertUsage } from '../utils.js';
|
|
5
5
|
import { getExportNames } from '../shared/parseEsModule.js';
|
|
6
6
|
import { sourceMapRemove } from '../shared/rollupSourceMap.js';
|
|
7
7
|
const extractExportNamesRE = /(\?|&)extractExportNames(?:&|$)/;
|
|
8
|
-
const
|
|
9
|
-
const debug = createDebugger(debugNamespace);
|
|
10
|
-
const debugEnabled = isDebugEnabled(debugNamespace);
|
|
8
|
+
const debug = createDebugger('vike:extractExportNames');
|
|
11
9
|
const globalObject = getGlobalObject('extractExportNamesPlugin.ts', {});
|
|
12
10
|
function extractExportNamesPlugin() {
|
|
13
11
|
let isDev = false;
|
|
@@ -26,7 +24,7 @@ function extractExportNamesPlugin() {
|
|
|
26
24
|
isDev = true;
|
|
27
25
|
},
|
|
28
26
|
config() {
|
|
29
|
-
if (
|
|
27
|
+
if (debug.isActivated) {
|
|
30
28
|
return { logLevel: 'silent' };
|
|
31
29
|
}
|
|
32
30
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { fileEnv };
|
|
2
|
-
import { assert, assertUsage, assertWarning, capitalizeFirstLetter
|
|
2
|
+
import { assert, assertUsage, assertWarning, capitalizeFirstLetter } from '../utils.js';
|
|
3
3
|
import { extractAssetsRE } from './extractAssetsPlugin.js';
|
|
4
4
|
import { extractExportNamesRE } from './extractExportNamesPlugin.js';
|
|
5
5
|
import pc from '@brillout/picocolors';
|
|
6
|
+
import { getModuleFilePath } from '../shared/getFilePath.js';
|
|
6
7
|
function fileEnv() {
|
|
7
8
|
let config;
|
|
8
9
|
let isDev = false;
|
|
@@ -39,11 +40,13 @@ function fileEnv() {
|
|
|
39
40
|
// resolved is null when import path is erroneous and doesn't actually point to a file
|
|
40
41
|
if (!resolved)
|
|
41
42
|
return;
|
|
42
|
-
const
|
|
43
|
+
const moduleId = resolved.id;
|
|
44
|
+
const modulePath = moduleId.split('?')[0];
|
|
43
45
|
// `.server.js` and `.client.js` should only apply to user files
|
|
44
46
|
if (modulePath.includes('/node_modules/'))
|
|
45
47
|
return;
|
|
46
48
|
// TODO/v1-release: remove
|
|
49
|
+
// - I don't remember exactly, but I think I've added `TODO/v1-release: remove` because I vaguely remember that we can remove this after we remove the 0.4 design.
|
|
47
50
|
if (modulePath.endsWith('.css'))
|
|
48
51
|
return;
|
|
49
52
|
const isServerSide = options?.ssr;
|
|
@@ -55,7 +58,7 @@ function fileEnv() {
|
|
|
55
58
|
return;
|
|
56
59
|
// Show error message
|
|
57
60
|
let errMsg;
|
|
58
|
-
let modulePathPretty =
|
|
61
|
+
let modulePathPretty = getModuleFilePath(moduleId, config);
|
|
59
62
|
modulePathPretty = modulePathPretty.replaceAll(suffix, pc.bold(suffix));
|
|
60
63
|
errMsg = `${capitalizeFirstLetter(envExpect)}-only module ${modulePathPretty} (https://vike.dev/file-env) imported on the ${envActual}-side`;
|
|
61
64
|
if (importer &&
|
|
@@ -63,7 +66,7 @@ function fileEnv() {
|
|
|
63
66
|
!importer.includes('virtual:vike:') &&
|
|
64
67
|
// I don't know why and who sets importer to '<stdin>' (I guess Vite?)
|
|
65
68
|
importer !== '<stdin>') {
|
|
66
|
-
const importerPath =
|
|
69
|
+
const importerPath = getModuleFilePath(importer, config);
|
|
67
70
|
errMsg += ` by ${importerPath}`;
|
|
68
71
|
}
|
|
69
72
|
if (isDev) {
|
|
@@ -3,12 +3,13 @@ import { normalizePath } from 'vite';
|
|
|
3
3
|
import { getConfigVike } from '../../../shared/getConfigVike.js';
|
|
4
4
|
import { getVirtualFilePageConfigValuesAll } from './v1-design/getVirtualFilePageConfigValuesAll.js';
|
|
5
5
|
import { getVirtualFileImportUserCode } from './getVirtualFileImportUserCode.js';
|
|
6
|
-
import { assert, assertPosixPath,
|
|
6
|
+
import { assert, assertPosixPath, getOutDirs, getVirtualFileId, isDev1, isDev1_onConfigureServer, isVirtualFileId, resolveVirtualFileId } from '../../utils.js';
|
|
7
7
|
import { isVirtualFileIdPageConfigValuesAll } from '../../../shared/virtual-files/virtualFilePageConfigValuesAll.js';
|
|
8
8
|
import { isVirtualFileIdImportUserCode } from '../../../shared/virtual-files/virtualFileImportUserCode.js';
|
|
9
9
|
import { vikeConfigDependencies, reloadVikeConfig, isVikeConfigFile } from './v1-design/getVikeConfig.js';
|
|
10
10
|
import pc from '@brillout/picocolors';
|
|
11
11
|
import { logConfigInfo, clearLogs } from '../../shared/loggerNotProd.js';
|
|
12
|
+
import { getFilePathResolved } from '../../shared/getFilePath.js';
|
|
12
13
|
function importUserCode() {
|
|
13
14
|
let config;
|
|
14
15
|
let configVike;
|
|
@@ -118,8 +119,11 @@ function isVikeConfigModule(filePathAbsoluteFilesystem) {
|
|
|
118
119
|
}
|
|
119
120
|
function reloadConfig(filePath, config, op) {
|
|
120
121
|
{
|
|
121
|
-
const
|
|
122
|
-
|
|
122
|
+
const { filePathToShowToUserResolved } = getFilePathResolved({
|
|
123
|
+
filePathAbsoluteFilesystem: filePath,
|
|
124
|
+
userRootDir: config.root
|
|
125
|
+
});
|
|
126
|
+
const msg = `${op} ${pc.dim(filePathToShowToUserResolved)}`;
|
|
123
127
|
logConfigInfo(msg, 'info');
|
|
124
128
|
}
|
|
125
129
|
reloadVikeConfig(config.root, getOutDirs(config).outDirRoot);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { getConfigFileExport };
|
|
2
2
|
import pc from '@brillout/picocolors';
|
|
3
3
|
import { assertPlusFileExport } from '../../../../../shared/page-configs/assertPlusFileExport.js';
|
|
4
|
-
import {
|
|
4
|
+
import { assertUsage, isObject } from '../../../utils.js';
|
|
5
5
|
function getConfigFileExport(fileExports, filePathToShowToUser) {
|
|
6
6
|
assertPlusFileExport(fileExports, filePathToShowToUser, 'config');
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const exportName = pc.cyan(
|
|
7
|
+
const usesNamedExport = !!fileExports.config;
|
|
8
|
+
const fileExport = usesNamedExport ? fileExports.config : fileExports.default;
|
|
9
|
+
const exportName = pc.cyan(usesNamedExport ? 'export { config }' : 'export default');
|
|
10
10
|
assertUsage(isObject(fileExport), `The ${exportName} of ${filePathToShowToUser} should be an object (but it's ${pc.cyan(`typeof exportedValue === ${JSON.stringify(typeof fileExport)}`)} instead)`);
|
|
11
11
|
return fileExport;
|
|
12
12
|
}
|
package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.js
CHANGED
|
@@ -76,7 +76,11 @@ async function loadExtendsConfigs(configFileExports, configFilePath, userRootDir
|
|
|
76
76
|
return { extendsConfigs, extendsFilePaths };
|
|
77
77
|
}
|
|
78
78
|
function warnUserLandExtension(importPath, configFilePath) {
|
|
79
|
-
|
|
79
|
+
// We preserve this feature because we may need it for eject
|
|
80
|
+
assertWarning(isNpmPackageImport(importPath, {
|
|
81
|
+
// Vike config files don't support path aliases. (If they do one day, then Vike will/should be able to resolve path aliases.)
|
|
82
|
+
cannotBePathAlias: true
|
|
83
|
+
}) || importPath.includes('/node_modules/'), `${configFilePath.filePathToShowToUser} uses ${pc.cyan('extends')} to inherit from ${pc.cyan(importPath)} which is a user-land file: this is experimental and may be remove at any time. Reach out to a maintainer if you need this.`, { onlyOnce: true });
|
|
80
84
|
}
|
|
81
85
|
function getExtendsImportData(configFileExports, configFilePath) {
|
|
82
86
|
const { filePathToShowToUser } = configFilePath;
|
package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolveImportPath.js
CHANGED
|
@@ -18,6 +18,7 @@ function resolveImport(configValue, importerFilePath, userRootDir, configEnv, co
|
|
|
18
18
|
const filePathAbsoluteFilesystem = resolveImportPath(importData, importerFilePath);
|
|
19
19
|
assertFileEnv(filePathAbsoluteFilesystem ?? importPath, configEnv, configName);
|
|
20
20
|
const fileExportPathToShowToUser = exportName === 'default' || exportName === configName ? [] : [exportName];
|
|
21
|
+
let filePath;
|
|
21
22
|
if (importPath.startsWith('.')) {
|
|
22
23
|
// We need to resolve relative paths into absolute paths. Because the import paths are included in virtual files:
|
|
23
24
|
// ```
|
|
@@ -25,28 +26,30 @@ function resolveImport(configValue, importerFilePath, userRootDir, configEnv, co
|
|
|
25
26
|
// ```
|
|
26
27
|
assertImportPath(filePathAbsoluteFilesystem, importData, importerFilePath);
|
|
27
28
|
const filePathAbsoluteUserRootDir = resolveImportPath_absoluteUserRootDir(filePathAbsoluteFilesystem, importData, importerFilePath, userRootDir);
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
...filePath,
|
|
31
|
-
fileExportName: exportName,
|
|
32
|
-
fileExportPathToShowToUser
|
|
33
|
-
};
|
|
29
|
+
filePath = getFilePathResolved({ filePathAbsoluteUserRootDir, userRootDir });
|
|
34
30
|
}
|
|
35
31
|
else {
|
|
36
32
|
// importPath can be:
|
|
37
33
|
// - an npm package import
|
|
38
34
|
// - a path alias
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
if (filePathAbsoluteFilesystem) {
|
|
36
|
+
filePath = getFilePathResolved({
|
|
37
|
+
userRootDir,
|
|
38
|
+
filePathAbsoluteFilesystem,
|
|
39
|
+
importPathAbsolute: importPath
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
filePath = getFilePathUnresolved({
|
|
44
|
+
importPathAbsolute: importPath
|
|
45
|
+
});
|
|
46
|
+
}
|
|
49
47
|
}
|
|
48
|
+
return {
|
|
49
|
+
...filePath,
|
|
50
|
+
fileExportName: exportName,
|
|
51
|
+
fileExportPathToShowToUser
|
|
52
|
+
};
|
|
50
53
|
}
|
|
51
54
|
function resolveImportPath_absoluteUserRootDir(filePathAbsoluteFilesystem, importData, configFilePath, userRootDir) {
|
|
52
55
|
assertPosixPath(userRootDir);
|
|
@@ -74,7 +77,8 @@ function resolveImportPath(importData, importerFilePath) {
|
|
|
74
77
|
const importerFilePathAbsolute = importerFilePath.filePathAbsoluteFilesystem;
|
|
75
78
|
assertPosixPath(importerFilePathAbsolute);
|
|
76
79
|
const cwd = path.posix.dirname(importerFilePathAbsolute);
|
|
77
|
-
// We can't use import.meta.resolve() as of Junary 2023 (and probably for a lot longer)
|
|
80
|
+
// We can't use import.meta.resolve() as of Junary 2023 (and probably for a lot longer)
|
|
81
|
+
// https://stackoverflow.com/questions/54977743/do-require-resolve-for-es-modules#comment137174954_62272600:~:text=But%20the%20argument%20parent%20(aka%20cwd)%20still%20requires%20a%20flag
|
|
78
82
|
// filePathAbsoluteFilesystem is expected to be null when importData.importPath is a Vite path alias
|
|
79
83
|
const filePathAbsoluteFilesystem = requireResolve(importData.importPath, cwd);
|
|
80
84
|
return filePathAbsoluteFilesystem;
|
|
@@ -37,10 +37,10 @@ async function transpileFile(filePath, transformImports, userRootDir) {
|
|
|
37
37
|
const { filePathAbsoluteFilesystem, filePathToShowToUserResolved } = filePath;
|
|
38
38
|
assertPosixPath(filePathAbsoluteFilesystem);
|
|
39
39
|
vikeConfigDependencies.add(filePathAbsoluteFilesystem);
|
|
40
|
-
if (debug.
|
|
40
|
+
if (debug.isActivated)
|
|
41
41
|
debug('transpile', filePathToShowToUserResolved);
|
|
42
42
|
let { code, pointerImports } = await transpileWithEsbuild(filePath, userRootDir, transformImports);
|
|
43
|
-
if (debug.
|
|
43
|
+
if (debug.isActivated)
|
|
44
44
|
debug(`code, post esbuild (${filePathToShowToUserResolved})`, code);
|
|
45
45
|
let isImportTransformed = false;
|
|
46
46
|
if (transformImports) {
|
|
@@ -48,12 +48,12 @@ async function transpileFile(filePath, transformImports, userRootDir) {
|
|
|
48
48
|
if (codeMod) {
|
|
49
49
|
code = codeMod;
|
|
50
50
|
isImportTransformed = true;
|
|
51
|
-
if (debug.
|
|
51
|
+
if (debug.isActivated)
|
|
52
52
|
debug(`code, post transformImports() (${filePathToShowToUserResolved})`, code);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
if (!isImportTransformed) {
|
|
56
|
-
if (debug.
|
|
56
|
+
if (debug.isActivated)
|
|
57
57
|
debug(`code, no transformImports() (${filePathToShowToUserResolved})`);
|
|
58
58
|
}
|
|
59
59
|
return code;
|
|
@@ -70,7 +70,7 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports) {
|
|
|
70
70
|
outfile: path.posix.join(
|
|
71
71
|
// Needed for correct inline source map
|
|
72
72
|
entryFileDir,
|
|
73
|
-
// `write: false` => no file is actually
|
|
73
|
+
// `write: false` => no file is actually emitted
|
|
74
74
|
'NEVER_EMITTED.js'),
|
|
75
75
|
logLevel: 'silent',
|
|
76
76
|
format: 'esm',
|
|
@@ -102,10 +102,10 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports) {
|
|
|
102
102
|
return;
|
|
103
103
|
if (args.pluginData?.[useEsbuildResolver])
|
|
104
104
|
return;
|
|
105
|
-
const isImportAbsolute = !args.path.startsWith('.');
|
|
106
105
|
const { path, ...opts } = args;
|
|
107
106
|
opts.pluginData = { [useEsbuildResolver]: true };
|
|
108
107
|
const resolved = await build.resolve(path, opts);
|
|
108
|
+
resolved.path = toPosixPath(resolved.path);
|
|
109
109
|
// vike-{react,vue,solid} follow the convention that their config export resolves to a file named +config.js
|
|
110
110
|
// - This is temporary, see comment below.
|
|
111
111
|
const isVikeExtensionConfigImport = resolved.path.endsWith('+config.js');
|
|
@@ -120,14 +120,15 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports) {
|
|
|
120
120
|
// - For example if esbuild cannot resolve a path alias while Vite can.
|
|
121
121
|
// - When tsconfig.js#compilerOptions.paths is set, then esbuild is able to resolve the path alias.
|
|
122
122
|
resolved.errors.length > 0;
|
|
123
|
-
pointerImports_[
|
|
123
|
+
pointerImports_[resolved.path] = isPointerImport;
|
|
124
|
+
assertPosixPath(resolved.path);
|
|
124
125
|
const isExternal = isPointerImport ||
|
|
125
|
-
// npm package imports that aren't pointer imports (e.g. Vite plugin
|
|
126
|
-
|
|
127
|
-
if (debug.
|
|
126
|
+
// npm package imports that aren't pointer imports (e.g. importing a Vite plugin)
|
|
127
|
+
resolved.path.includes('/node_modules/');
|
|
128
|
+
if (debug.isActivated)
|
|
128
129
|
debug('onResolved()', { args, resolved, isPointerImport, isExternal });
|
|
129
130
|
if (isExternal) {
|
|
130
|
-
return { external: true, path:
|
|
131
|
+
return { external: true, path: resolved.path };
|
|
131
132
|
}
|
|
132
133
|
else {
|
|
133
134
|
return resolved;
|
|
@@ -740,7 +740,7 @@ function getComputed(configValueSources, configDefinitions) {
|
|
|
740
740
|
}
|
|
741
741
|
async function findPlusFiles(userRootDir, outDirRoot, isDev) {
|
|
742
742
|
const files = await crawlPlusFiles(userRootDir, outDirRoot, isDev);
|
|
743
|
-
const plusFiles = files.map(({ filePathAbsoluteUserRootDir }) => getFilePathResolved({ filePathAbsoluteUserRootDir, userRootDir
|
|
743
|
+
const plusFiles = files.map(({ filePathAbsoluteUserRootDir }) => getFilePathResolved({ filePathAbsoluteUserRootDir, userRootDir }));
|
|
744
744
|
return plusFiles;
|
|
745
745
|
}
|
|
746
746
|
function getConfigName(filePath) {
|
|
@@ -1007,7 +1007,11 @@ function sortConfigValueSources(configValueSources, locationIdPage) {
|
|
|
1007
1007
|
// Sort after whether the config value was defined by an npm package
|
|
1008
1008
|
.sort(makeFirst(([, [source]]) => {
|
|
1009
1009
|
const { importPathAbsolute } = source.definedAt;
|
|
1010
|
-
return !!importPathAbsolute &&
|
|
1010
|
+
return (!!importPathAbsolute &&
|
|
1011
|
+
isNpmPackageImport(importPathAbsolute, {
|
|
1012
|
+
// Vike config files don't support path aliases. (If they do one day, then Vike will/should be able to resolve path aliases.)
|
|
1013
|
+
cannotBePathAlias: true
|
|
1014
|
+
}));
|
|
1011
1015
|
}))
|
|
1012
1016
|
// Sort after the filesystem inheritance of the config value
|
|
1013
1017
|
.sort(([, [source1]], [, [source2]]) => reverse(sortAfterInheritanceOrder(source1.locationId, source2.locationId, locationIdPage))));
|