vike 0.4.259-commit-a91659b → 0.4.259-commit-aa6fa94
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/node/vite/shared/resolveVikeConfigInternal/assertExtensions.d.ts +2 -2
- package/dist/node/vite/shared/resolveVikeConfigInternal/assertExtensions.js +6 -7
- package/dist/node/vite/shared/resolveVikeConfigInternal.js +2 -2
- package/dist/server/runtime/renderPageServer.js +3 -1
- package/dist/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/utils/PROJECT_VERSION.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { assertExtensionsConventions };
|
|
2
2
|
export { assertExtensionsRequire };
|
|
3
|
-
export {
|
|
3
|
+
export { getExtensionName };
|
|
4
4
|
import type { PlusFile } from './getPlusFilesByLocationId.js';
|
|
5
5
|
import '../../assertEnvVite.js';
|
|
6
6
|
declare function assertExtensionsConventions(plusFile: PlusFile): void;
|
|
7
7
|
declare function assertExtensionsRequire(plusFiles: PlusFile[]): void;
|
|
8
|
-
declare function
|
|
8
|
+
declare function getExtensionName(plusFile: PlusFile): null | string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { assertExtensionsConventions };
|
|
2
2
|
export { assertExtensionsRequire };
|
|
3
|
-
|
|
4
|
-
export { getNameValue };
|
|
3
|
+
export { getExtensionName };
|
|
5
4
|
import pc from '@brillout/picocolors';
|
|
6
5
|
import { PROJECT_VERSION } from '../../../../utils/PROJECT_VERSION.js';
|
|
7
6
|
import { assert, assertUsage, assertWarning } from '../../../../utils/assert.js';
|
|
@@ -23,14 +22,14 @@ function assertConfigExportPath(plusFile) {
|
|
|
23
22
|
assert(!p.includes('node_modules'));
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
26
|
-
const name =
|
|
25
|
+
const name = getExtensionName(plusFile);
|
|
27
26
|
assert(name); // already asserted in assertExtensionName()
|
|
28
27
|
const importPathAbsoluteExpected = `${name}/config`;
|
|
29
28
|
assertWarning(importPathAbsolute === importPathAbsoluteExpected, `The Vike configuration of ${pc.bold(name)} is exported at ${pc.bold(importPathAbsolute)}, but it should be exported at ${pc.bold(importPathAbsoluteExpected)} instead.`, { onlyOnce: true });
|
|
30
29
|
}
|
|
31
30
|
function assertExtensionName(plusFile) {
|
|
32
31
|
const filePathToShowToUser = getFilePathToShowToUser(plusFile);
|
|
33
|
-
const name =
|
|
32
|
+
const name = getExtensionName(plusFile);
|
|
34
33
|
assertUsage(name, `Vike extension name missing: the config ${filePathToShowToUser} must define the setting ${pc.cyan('name')}`);
|
|
35
34
|
}
|
|
36
35
|
function assertExtensionsRequire(plusFiles) {
|
|
@@ -38,7 +37,7 @@ function assertExtensionsRequire(plusFiles) {
|
|
|
38
37
|
// Collect extensions
|
|
39
38
|
const extensions = {};
|
|
40
39
|
plusFilesRelevantList.forEach((plusFile) => {
|
|
41
|
-
const name =
|
|
40
|
+
const name = getExtensionName(plusFile);
|
|
42
41
|
if (name) {
|
|
43
42
|
const version = getExtensionVersion(name, plusFile);
|
|
44
43
|
extensions[name] = version;
|
|
@@ -49,7 +48,7 @@ function assertExtensionsRequire(plusFiles) {
|
|
|
49
48
|
const require = resolveRequireSetting(plusFile);
|
|
50
49
|
if (!require)
|
|
51
50
|
return;
|
|
52
|
-
const name =
|
|
51
|
+
const name = getExtensionName(plusFile);
|
|
53
52
|
const filePathToShowToUser = getFilePathToShowToUser(plusFile);
|
|
54
53
|
assertUsage(name, `Setting ${pc.bold('name')} is required for being able to use setting ${pc.bold('require')} in ${filePathToShowToUser}.`);
|
|
55
54
|
Object.entries(require).forEach(([reqName, req]) => {
|
|
@@ -98,7 +97,7 @@ function resolveRequireSetting(plusFile) {
|
|
|
98
97
|
});
|
|
99
98
|
return requireSetting;
|
|
100
99
|
}
|
|
101
|
-
function
|
|
100
|
+
function getExtensionName(plusFile) {
|
|
102
101
|
const confVal = getConfVal(plusFile, 'name');
|
|
103
102
|
if (!confVal)
|
|
104
103
|
return null;
|
|
@@ -45,7 +45,7 @@ import { getConfigValueBuildTime } from '../../../shared-server-client/page-conf
|
|
|
45
45
|
import { resolveGlobalConfigPublic, } from '../../../shared-server-client/page-configs/resolveVikeConfigPublic.js';
|
|
46
46
|
import { getConfigValuesBase, isJsonValue, } from '../../../shared-server-client/page-configs/serialize/serializeConfigValues.js';
|
|
47
47
|
import { getPlusFilesByLocationId, } from './resolveVikeConfigInternal/getPlusFilesByLocationId.js';
|
|
48
|
-
import {
|
|
48
|
+
import { getExtensionName } from './resolveVikeConfigInternal/assertExtensions.js';
|
|
49
49
|
import { getEnvVarObject } from './getEnvVarObject.js';
|
|
50
50
|
import { getVikeApiOperation } from '../../../shared-server-node/api-context.js';
|
|
51
51
|
import { getCliOptions } from '../../cli/context.js';
|
|
@@ -679,7 +679,7 @@ function dedupeExtensions(plusFiles) {
|
|
|
679
679
|
return plusFiles.filter((plusFile) => {
|
|
680
680
|
if (!plusFile.isConfigFile || !plusFile.isExtensionConfig)
|
|
681
681
|
return true;
|
|
682
|
-
const name =
|
|
682
|
+
const name = getExtensionName(plusFile);
|
|
683
683
|
// The extension's `name` is guaranteed by assertExtensionsConventions()
|
|
684
684
|
assert(name);
|
|
685
685
|
if (seen.has(name))
|
|
@@ -319,7 +319,9 @@ function logHttpResponse(urlOriginalPretty, pageContextReturn) {
|
|
|
319
319
|
const headerRedirect = pageContextReturn.httpResponse.headers
|
|
320
320
|
.slice()
|
|
321
321
|
.reverse()
|
|
322
|
-
|
|
322
|
+
// Case-insensitive: a redirect returned by a +middleware comes from a Web Response whose
|
|
323
|
+
// Headers object lower-cases header names (`location`), while Vike's own redirect() uses `Location`.
|
|
324
|
+
.find((header) => header[0].toLowerCase() === 'location');
|
|
323
325
|
assert(headerRedirect);
|
|
324
326
|
const urlRedirect = headerRedirect[1];
|
|
325
327
|
urlOriginalPretty = urlRedirect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.259-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.259-commit-aa6fa94";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.259-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.259-commit-aa6fa94';
|