@lwrjs/shared-utils 0.17.7 → 0.17.9

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/build/cjs/env.cjs CHANGED
@@ -25,6 +25,7 @@ __export(exports, {
25
25
  isLocalAuthEnabled: () => isLocalAuthEnabled,
26
26
  isLocalDev: () => isLocalDev,
27
27
  isLocalPreview: () => isLocalPreview,
28
+ isMrtBundle: () => isMrtBundle,
28
29
  parseRequestDepth: () => parseRequestDepth
29
30
  });
30
31
  if (getFeatureFlags().REEVALUATE_MODULES && !getFeatureFlags().LEGACY_LOADER) {
@@ -63,6 +64,9 @@ function parseTracingFlag() {
63
64
  function isLambdaEnv() {
64
65
  return process.env.AWS_LAMBDA_FUNCTION_NAME !== void 0;
65
66
  }
67
+ function isMrtBundle() {
68
+ return isLambdaEnv() || isLocalDev() || process.env.MRT_PREVIEW === "true";
69
+ }
66
70
  function isLocalDev() {
67
71
  return process.env.MRT_HMR === "true";
68
72
  }
package/build/es/env.d.ts CHANGED
@@ -6,6 +6,12 @@ export declare function getFeatureFlags(): FeatureFlags;
6
6
  * @returns true if process is running in lambda environment
7
7
  */
8
8
  export declare function isLambdaEnv(): boolean;
9
+ /**
10
+ * This function is used to determine if the current environment is running an MRT bundle.
11
+ *
12
+ * @returns true if process is running in lambda environment or local-dev or preview with target=mrt
13
+ */
14
+ export declare function isMrtBundle(): boolean;
9
15
  /**
10
16
  * This function is used to determine if lwr is running in the context of local development.
11
17
  *
package/build/es/env.js CHANGED
@@ -67,6 +67,14 @@ function parseTracingFlag() {
67
67
  export function isLambdaEnv() {
68
68
  return process.env.AWS_LAMBDA_FUNCTION_NAME !== undefined;
69
69
  }
70
+ /**
71
+ * This function is used to determine if the current environment is running an MRT bundle.
72
+ *
73
+ * @returns true if process is running in lambda environment or local-dev or preview with target=mrt
74
+ */
75
+ export function isMrtBundle() {
76
+ return isLambdaEnv() || isLocalDev() || process.env.MRT_PREVIEW === 'true';
77
+ }
70
78
  /**
71
79
  * This function is used to determine if lwr is running in the context of local development.
72
80
  *
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.17.7",
7
+ "version": "0.17.9",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -37,7 +37,7 @@
37
37
  "build/**/*.d.ts"
38
38
  ],
39
39
  "dependencies": {
40
- "@lwrjs/diagnostics": "0.17.7",
40
+ "@lwrjs/diagnostics": "0.17.9",
41
41
  "es-module-lexer": "^1.5.4",
42
42
  "fast-json-stable-stringify": "^2.1.0",
43
43
  "magic-string": "^0.30.9",
@@ -50,7 +50,7 @@
50
50
  "slugify": "^1.4.5"
51
51
  },
52
52
  "devDependencies": {
53
- "@lwrjs/types": "0.17.7",
53
+ "@lwrjs/types": "0.17.9",
54
54
  "@types/mime-types": "2.1.4",
55
55
  "@types/path-to-regexp": "^1.7.0",
56
56
  "memfs": "^4.13.0"
@@ -58,5 +58,5 @@
58
58
  "engines": {
59
59
  "node": ">=20.0.0"
60
60
  },
61
- "gitHead": "5084f815d7f7f9ac0b9e72f0250f7e9364bd9e54"
61
+ "gitHead": "6c0856bd301c9dc2645a51d6bb4f456c9b677bb6"
62
62
  }