@lwrjs/shared-utils 0.6.2 → 0.7.0-alpha.1

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
@@ -8,10 +8,10 @@ var __export = (target, all) => {
8
8
  // packages/@lwrjs/shared-utils/src/env.ts
9
9
  __markAsModule(exports);
10
10
  __export(exports, {
11
- getExperimentalFeatures: () => getExperimentalFeatures
11
+ getFeatureFlags: () => getFeatureFlags
12
12
  });
13
- function getExperimentalFeatures() {
13
+ function getFeatureFlags() {
14
14
  return {
15
- ENABLE_FINGERPRINTS: process.env.ENABLE_FINGERPRINTS !== void 0 && process.env.ENABLE_FINGERPRINTS === "true" ? true : false
15
+ LEGACY_LOADER: process.env.LEGACY_LOADER !== void 0 && process.env.LEGACY_LOADER === "true" ? true : false
16
16
  };
17
17
  }
@@ -25,6 +25,7 @@ var __toModule = (module2) => {
25
25
  __markAsModule(exports);
26
26
  __export(exports, {
27
27
  ASSETS_CACHE_DIR: () => ASSETS_CACHE_DIR,
28
+ BUNDLE_SIGIL: () => BUNDLE_SIGIL,
28
29
  DEFAULT_LOCKER_TRUSTED_CMP: () => DEFAULT_LOCKER_TRUSTED_CMP,
29
30
  DEFAULT_LWR_BOOTSTRAP_CONFIG: () => DEFAULT_LWR_BOOTSTRAP_CONFIG,
30
31
  DEFAULT_LWR_LOCKER_CONFIG: () => DEFAULT_LWR_LOCKER_CONFIG,
@@ -61,6 +62,7 @@ var import_fast_json_stable_stringify = __toModule(require("fast-json-stable-str
61
62
  var VERSION_SIGIL = "/v/";
62
63
  var LOCALE_SIGIL = "l";
63
64
  var ENVIRONMENT_SIGIL = "e";
65
+ var BUNDLE_SIGIL = "bi";
64
66
  var LATEST_SIGNATURE = "latest";
65
67
  var DEFAULT_TITLE = "LWR App";
66
68
  var IMMUTABLE_ASSET_PREFIX = "/_immutable/";
@@ -188,14 +190,16 @@ function getModuleUriPrefix({apiVersion, bundle, format, compat, basePath}, {loc
188
190
  const localePart = locale ? `/${LOCALE_SIGIL}/${locale}` : "";
189
191
  const environmentPart = environment ? `/${ENVIRONMENT_SIGIL}/${environment}` : "";
190
192
  if (bundle) {
191
- return `${basePath}/${apiVersion}/bundle/${format}${localePart}${environmentPart}/bi/0/module/mi/`;
193
+ return `${basePath}/${apiVersion}/bundle/${format}${localePart}${environmentPart}/${BUNDLE_SIGIL}/0/module/mi/`;
192
194
  } else {
193
195
  return `${basePath}/${apiVersion}/module/${format}/${compat}${localePart}${environmentPart}/mi/`;
194
196
  }
195
197
  }
196
- function getMappingUriPrefix({apiVersion, format, compat, basePath}, {locale} = {}) {
198
+ function getMappingUriPrefix({apiVersion, bundle, format, compat, basePath}, {locale, environment} = {}) {
197
199
  const localePart = locale ? `/${LOCALE_SIGIL}/${locale}` : "";
198
- return `${basePath}/${apiVersion}/mapping/${format}/${compat}${localePart}/mp/`;
200
+ const environmentPart = environment ? `/${ENVIRONMENT_SIGIL}/${environment}` : "";
201
+ const bundlePart = bundle ? `/${BUNDLE_SIGIL}/0` : "";
202
+ return `${basePath}/${apiVersion}/mapping/${format}/${compat}${localePart}${environmentPart}${bundlePart}/mp/`;
199
203
  }
200
204
  var REGEX_URL_SCHEMA_PREFIX = /^(https?|\/\/)/;
201
205
  function isExternalUrl(url) {
package/build/es/env.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { ExperimentalFeatures } from '@lwrjs/types';
2
- export declare function getExperimentalFeatures(): ExperimentalFeatures;
1
+ import { FeatureFlags } from '@lwrjs/types';
2
+ export declare function getFeatureFlags(): FeatureFlags;
3
3
  //# sourceMappingURL=env.d.ts.map
package/build/es/env.js CHANGED
@@ -1,9 +1,7 @@
1
- export function getExperimentalFeatures() {
1
+ export function getFeatureFlags() {
2
2
  return {
3
- // DEFAULT ENABLE_FINGERPRINTS = false;
4
- ENABLE_FINGERPRINTS: process.env.ENABLE_FINGERPRINTS !== undefined && process.env.ENABLE_FINGERPRINTS === 'true'
5
- ? true
6
- : false,
3
+ // DEFAULT LEGACY_LOADER = false;
4
+ LEGACY_LOADER: process.env.LEGACY_LOADER !== undefined && process.env.LEGACY_LOADER === 'true' ? true : false,
7
5
  };
8
6
  }
9
7
  //# sourceMappingURL=env.js.map
@@ -3,6 +3,7 @@ import { AbstractModuleId, AssetIdentity, BundleDefinition, MappingIdentity, Mid
3
3
  export declare const VERSION_SIGIL = "/v/";
4
4
  export declare const LOCALE_SIGIL = "l";
5
5
  export declare const ENVIRONMENT_SIGIL = "e";
6
+ export declare const BUNDLE_SIGIL = "bi";
6
7
  export declare const LATEST_SIGNATURE = "latest";
7
8
  export declare const DEFAULT_TITLE = "LWR App";
8
9
  export declare const IMMUTABLE_ASSET_PREFIX = "/_immutable/";
@@ -154,7 +155,7 @@ export declare function getModuleUriPrefix({ apiVersion, bundle, format, compat,
154
155
  * @param param0 - URI props from the Runtime Environment
155
156
  * @param param1 - URI props from the Runtime Params
156
157
  */
157
- export declare function getMappingUriPrefix({ apiVersion, format, compat, basePath }: RuntimeEnvironment, { locale }?: RuntimeParams): string;
158
+ export declare function getMappingUriPrefix({ apiVersion, bundle, format, compat, basePath }: RuntimeEnvironment, { locale, environment }?: RuntimeParams): string;
158
159
  export { getCacheKeyFromJson };
159
160
  export declare function isExternalUrl(url: string): boolean;
160
161
  export declare function isBundleDefinition(definition: ModuleDefinition | BundleDefinition): definition is BundleDefinition;
@@ -3,6 +3,7 @@ import getCacheKeyFromJson from 'fast-json-stable-stringify';
3
3
  export const VERSION_SIGIL = '/v/';
4
4
  export const LOCALE_SIGIL = 'l';
5
5
  export const ENVIRONMENT_SIGIL = 'e';
6
+ export const BUNDLE_SIGIL = 'bi';
6
7
  export const LATEST_SIGNATURE = 'latest';
7
8
  export const DEFAULT_TITLE = 'LWR App';
8
9
  export const IMMUTABLE_ASSET_PREFIX = '/_immutable/';
@@ -244,7 +245,7 @@ export function getModuleUriPrefix({ apiVersion, bundle, format, compat, basePat
244
245
  const localePart = locale ? `/${LOCALE_SIGIL}/${locale}` : '';
245
246
  const environmentPart = environment ? `/${ENVIRONMENT_SIGIL}/${environment}` : '';
246
247
  if (bundle) {
247
- return `${basePath}/${apiVersion}/bundle/${format}${localePart}${environmentPart}/bi/0/module/mi/`;
248
+ return `${basePath}/${apiVersion}/bundle/${format}${localePart}${environmentPart}/${BUNDLE_SIGIL}/0/module/mi/`;
248
249
  }
249
250
  else {
250
251
  return `${basePath}/${apiVersion}/module/${format}/${compat}${localePart}${environmentPart}/mi/`;
@@ -255,9 +256,11 @@ export function getModuleUriPrefix({ apiVersion, bundle, format, compat, basePat
255
256
  * @param param0 - URI props from the Runtime Environment
256
257
  * @param param1 - URI props from the Runtime Params
257
258
  */
258
- export function getMappingUriPrefix({ apiVersion, format, compat, basePath }, { locale } = {}) {
259
+ export function getMappingUriPrefix({ apiVersion, bundle, format, compat, basePath }, { locale, environment } = {}) {
259
260
  const localePart = locale ? `/${LOCALE_SIGIL}/${locale}` : '';
260
- return `${basePath}/${apiVersion}/mapping/${format}/${compat}${localePart}/mp/`;
261
+ const environmentPart = environment ? `/${ENVIRONMENT_SIGIL}/${environment}` : '';
262
+ const bundlePart = bundle ? `/${BUNDLE_SIGIL}/0` : '';
263
+ return `${basePath}/${apiVersion}/mapping/${format}/${compat}${localePart}${environmentPart}${bundlePart}/mp/`;
261
264
  }
262
265
  export { getCacheKeyFromJson };
263
266
  const REGEX_URL_SCHEMA_PREFIX = /^(https?|\/\/)/;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.6.2",
7
+ "version": "0.7.0-alpha.1",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -43,13 +43,13 @@
43
43
  "slugify": "^1.4.5"
44
44
  },
45
45
  "devDependencies": {
46
- "@lwrjs/diagnostics": "0.6.2",
47
- "@lwrjs/types": "0.6.2",
46
+ "@lwrjs/diagnostics": "0.7.0-alpha.1",
47
+ "@lwrjs/types": "0.7.0-alpha.1",
48
48
  "@types/mime-types": "2.1.1",
49
49
  "@types/path-to-regexp": "^1.7.0"
50
50
  },
51
51
  "engines": {
52
52
  "node": ">=14.15.4 <17"
53
53
  },
54
- "gitHead": "ef85bdc48adde58b7c648561d67acbb408bbe189"
54
+ "gitHead": "24245670d6908d37e465f2316f92385df63d22aa"
55
55
  }