@lwrjs/server 0.11.0-alpha.14 → 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, i18n) {
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 locale = localeParam || this.locale || defaultRuntimeEnvironment.defaultLocale;
84
- const uiBasePath = i18n.uriPattern === "path-prefix" && i18n.defaultLocale !== locale ? `${basePath}/${locale}` : `${basePath}`;
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, I18NConfig } from '@lwrjs/types';
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, i18n: I18NConfig): RuntimeContext;
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, i18n) {
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 locale = localeParam || this.locale || defaultRuntimeEnvironment.defaultLocale;
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' && i18n.defaultLocale !== locale
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.14",
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.14",
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.14",
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": "d082cc49d9e2b5024d17a3da2c5c2bf585f811fe"
54
+ "gitHead": "3c6c6d17b2f57a5b67d32e40a1e574abb7d9afea"
55
55
  }