@lwrjs/shared-utils 0.13.0-alpha.6 → 0.13.0-alpha.7

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.
@@ -35,6 +35,7 @@ __export(exports, {
35
35
  LATEST_SIGNATURE: () => LATEST_SIGNATURE,
36
36
  LOCALE_SIGIL: () => LOCALE_SIGIL,
37
37
  VERSION_NOT_PROVIDED: () => VERSION_NOT_PROVIDED,
38
+ VERSION_PREFIX: () => VERSION_PREFIX,
38
39
  VERSION_SIGIL: () => VERSION_SIGIL,
39
40
  explodeSpecifier: () => explodeSpecifier,
40
41
  explodeSpecifiers: () => explodeSpecifiers,
@@ -59,7 +60,8 @@ __export(exports, {
59
60
  });
60
61
  var import_slugify = __toModule(require("slugify"));
61
62
  var import_fast_json_stable_stringify = __toModule(require("fast-json-stable-stringify"));
62
- var VERSION_SIGIL = "/v/";
63
+ var VERSION_SIGIL = "v";
64
+ var VERSION_PREFIX = `/${VERSION_SIGIL}/`;
63
65
  var LOCALE_SIGIL = "l";
64
66
  var ENVIRONMENT_SIGIL = "e";
65
67
  var BUNDLE_SIGIL = "bi";
@@ -122,10 +124,10 @@ function getSpecifier({specifier, namespace, name = "", version}) {
122
124
  if (specifier) {
123
125
  const versionMatch = specifier.match(/(.+)\/v\/[a-zA-Z0-9-_.]+$/);
124
126
  specifier = versionMatch ? versionMatch[1] : specifier;
125
- return version && version !== VERSION_NOT_PROVIDED ? `${specifier}${VERSION_SIGIL}${normalizeVersionToUri(version)}` : specifier;
127
+ return version && version !== VERSION_NOT_PROVIDED ? `${specifier}${VERSION_PREFIX}${normalizeVersionToUri(version)}` : specifier;
126
128
  }
127
129
  const bareSpecifier = namespace ? `${namespace}/${name}` : name;
128
- return version && version !== VERSION_NOT_PROVIDED ? `${bareSpecifier}${VERSION_SIGIL}${normalizeVersionToUri(version)}` : bareSpecifier;
130
+ return version && version !== VERSION_NOT_PROVIDED ? `${bareSpecifier}${VERSION_PREFIX}${normalizeVersionToUri(version)}` : bareSpecifier;
129
131
  }
130
132
  async function getVersionedModuleId(rawSpecifier, moduleRegistry, runtimeParams) {
131
133
  const moduleId = explodeSpecifier(rawSpecifier);
@@ -1,6 +1,7 @@
1
1
  import getCacheKeyFromJson from 'fast-json-stable-stringify';
2
2
  import type { AbstractModuleId, AssetSource, BundleDefinition, ModuleDefinition, NormalizedLwrAppBootstrapConfig, PublicModuleRegistry, RuntimeEnvironment, RuntimeParams } from '@lwrjs/types';
3
- export declare const VERSION_SIGIL = "/v/";
3
+ export declare const VERSION_SIGIL = "v";
4
+ export declare const VERSION_PREFIX: string;
4
5
  export declare const LOCALE_SIGIL = "l";
5
6
  export declare const ENVIRONMENT_SIGIL = "e";
6
7
  export declare const BUNDLE_SIGIL = "bi";
@@ -1,6 +1,7 @@
1
1
  import slugifyText from 'slugify';
2
2
  import getCacheKeyFromJson from 'fast-json-stable-stringify';
3
- export const VERSION_SIGIL = '/v/';
3
+ export const VERSION_SIGIL = 'v';
4
+ export const VERSION_PREFIX = `/${VERSION_SIGIL}/`;
4
5
  export const LOCALE_SIGIL = 'l';
5
6
  export const ENVIRONMENT_SIGIL = 'e';
6
7
  export const BUNDLE_SIGIL = 'bi';
@@ -99,13 +100,13 @@ export function getSpecifier({ specifier, namespace, name = '', version }) {
99
100
  specifier = versionMatch ? versionMatch[1] : specifier;
100
101
  // If a module has an explicit 'version-not-provided' version this will not be reflected in the specifier
101
102
  return version && version !== VERSION_NOT_PROVIDED
102
- ? `${specifier}${VERSION_SIGIL}${normalizeVersionToUri(version)}`
103
+ ? `${specifier}${VERSION_PREFIX}${normalizeVersionToUri(version)}`
103
104
  : specifier;
104
105
  }
105
106
  const bareSpecifier = namespace ? `${namespace}/${name}` : name;
106
107
  // If a module has an explicit 'version-not-provided' version this will not be reflected in the specifier
107
108
  return version && version !== VERSION_NOT_PROVIDED
108
- ? `${bareSpecifier}${VERSION_SIGIL}${normalizeVersionToUri(version)}`
109
+ ? `${bareSpecifier}${VERSION_PREFIX}${normalizeVersionToUri(version)}`
109
110
  : bareSpecifier;
110
111
  }
111
112
  /**
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.13.0-alpha.6",
7
+ "version": "0.13.0-alpha.7",
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.13.0-alpha.6",
40
+ "@lwrjs/diagnostics": "0.13.0-alpha.7",
41
41
  "es-module-lexer": "^1.5.2",
42
42
  "fast-json-stable-stringify": "^2.1.0",
43
43
  "magic-string": "^0.30.9",
@@ -50,12 +50,12 @@
50
50
  "slugify": "^1.4.5"
51
51
  },
52
52
  "devDependencies": {
53
- "@lwrjs/types": "0.13.0-alpha.6",
53
+ "@lwrjs/types": "0.13.0-alpha.7",
54
54
  "@types/mime-types": "2.1.4",
55
55
  "@types/path-to-regexp": "^1.7.0"
56
56
  },
57
57
  "engines": {
58
58
  "node": ">=18.0.0"
59
59
  },
60
- "gitHead": "88d503249ff6b135416208763fae8a33b5e874de"
60
+ "gitHead": "4b77dea6ac8d473a4113ad7b345b3a37b0b8a3f8"
61
61
  }