@lwrjs/server 0.11.0-alpha.13 → 0.11.0-alpha.15
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.
|
@@ -54,7 +54,7 @@ var AbstractMiddlewareRequest = class {
|
|
|
54
54
|
const supportedEnvironments = config.environment.supported || [];
|
|
55
55
|
return !targetEnvironment || targetEnvironment === defaultEnvironment || supportedEnvironments?.includes(targetEnvironment);
|
|
56
56
|
}
|
|
57
|
-
getRuntimeContext(defaultRuntimeEnvironment
|
|
57
|
+
getRuntimeContext(defaultRuntimeEnvironment) {
|
|
58
58
|
const {
|
|
59
59
|
format,
|
|
60
60
|
apiVersion,
|
|
@@ -80,8 +80,9 @@ var AbstractMiddlewareRequest = class {
|
|
|
80
80
|
host = `${this.protocol}://${host}`;
|
|
81
81
|
}
|
|
82
82
|
const basePath = runtimeEnvironment.basePath;
|
|
83
|
-
const
|
|
84
|
-
const
|
|
83
|
+
const defaultLocale = runtimeEnvironment.i18n.defaultLocale;
|
|
84
|
+
const locale = localeParam || this.locale || defaultLocale;
|
|
85
|
+
const uiBasePath = runtimeEnvironment.i18n.uriPattern === "path-prefix" && defaultLocale !== locale ? `${basePath}/${locale}` : `${basePath}`;
|
|
85
86
|
const assetBasePath = `${runtimeEnvironment.basePath}${runtimeEnvironment.defaultAssetPath}`;
|
|
86
87
|
const runtimeParams = {
|
|
87
88
|
basePath,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RuntimeContext, RuntimeEnvironment, Headers, MiddlewareRequest, NormalizedLwrGlobalConfig
|
|
1
|
+
import type { RuntimeContext, RuntimeEnvironment, Headers, MiddlewareRequest, NormalizedLwrGlobalConfig } from '@lwrjs/types';
|
|
2
2
|
export declare abstract class AbstractMiddlewareRequest implements MiddlewareRequest {
|
|
3
3
|
isSiteGenerationRequest: boolean;
|
|
4
4
|
constructor(isSiteGenerationRequest?: boolean);
|
|
@@ -20,6 +20,6 @@ export declare abstract class AbstractMiddlewareRequest implements MiddlewareReq
|
|
|
20
20
|
isJsonRequest(): boolean;
|
|
21
21
|
validateJsonRequest(): boolean;
|
|
22
22
|
validateEnvironmentRequest(config: NormalizedLwrGlobalConfig): boolean;
|
|
23
|
-
getRuntimeContext(defaultRuntimeEnvironment: RuntimeEnvironment
|
|
23
|
+
getRuntimeContext(defaultRuntimeEnvironment: RuntimeEnvironment): RuntimeContext;
|
|
24
24
|
}
|
|
25
25
|
//# sourceMappingURL=abstract-request.d.ts.map
|
|
@@ -51,7 +51,7 @@ export class AbstractMiddlewareRequest {
|
|
|
51
51
|
targetEnvironment === defaultEnvironment ||
|
|
52
52
|
supportedEnvironments?.includes(targetEnvironment));
|
|
53
53
|
}
|
|
54
|
-
getRuntimeContext(defaultRuntimeEnvironment
|
|
54
|
+
getRuntimeContext(defaultRuntimeEnvironment) {
|
|
55
55
|
const { format, apiVersion, basePath: basePathParam, compat, locale: localeParam, environment, bundleSpecifier, } = this.params;
|
|
56
56
|
const debug = this.query.debug !== undefined;
|
|
57
57
|
const bundle = !!bundleSpecifier;
|
|
@@ -70,9 +70,10 @@ export class AbstractMiddlewareRequest {
|
|
|
70
70
|
host = `${this.protocol}://${host}`;
|
|
71
71
|
}
|
|
72
72
|
const basePath = runtimeEnvironment.basePath;
|
|
73
|
-
const
|
|
73
|
+
const defaultLocale = runtimeEnvironment.i18n.defaultLocale;
|
|
74
|
+
const locale = localeParam || this.locale || defaultLocale;
|
|
74
75
|
// Base path to be used in routing ${basePath}/locale
|
|
75
|
-
const uiBasePath = i18n.uriPattern === 'path-prefix' &&
|
|
76
|
+
const uiBasePath = runtimeEnvironment.i18n.uriPattern === 'path-prefix' && defaultLocale !== locale
|
|
76
77
|
? `${basePath}/${locale}`
|
|
77
78
|
: `${basePath}`;
|
|
78
79
|
// Path to static artifacts on MRT the is ${basePath}/mobify/build/${bundleId}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.11.0-alpha.
|
|
7
|
+
"version": "0.11.0-alpha.15",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"build/**/*.d.ts"
|
|
35
35
|
],
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@lwrjs/types": "0.11.0-alpha.
|
|
37
|
+
"@lwrjs/types": "0.11.0-alpha.15",
|
|
38
38
|
"@types/koa-compress": "^4.0.1",
|
|
39
39
|
"@types/koa__router": "^8.0.4",
|
|
40
40
|
"jest-express": "^1.12.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@koa/router": "^10.0.0",
|
|
44
|
-
"@lwrjs/shared-utils": "0.11.0-alpha.
|
|
44
|
+
"@lwrjs/shared-utils": "0.11.0-alpha.15",
|
|
45
45
|
"@types/express": "^4.17.17",
|
|
46
46
|
"@types/koa": "^2.11.7",
|
|
47
47
|
"express": "^4.18.2",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=16.0.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "3c6c6d17b2f57a5b67d32e40a1e574abb7d9afea"
|
|
55
55
|
}
|