@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.
- package/build/cjs/identity.cjs +5 -3
- package/build/es/identity.d.ts +2 -1
- package/build/es/identity.js +4 -3
- package/package.json +4 -4
package/build/cjs/identity.cjs
CHANGED
|
@@ -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 = "
|
|
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}${
|
|
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}${
|
|
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);
|
package/build/es/identity.d.ts
CHANGED
|
@@ -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 = "
|
|
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";
|
package/build/es/identity.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import slugifyText from 'slugify';
|
|
2
2
|
import getCacheKeyFromJson from 'fast-json-stable-stringify';
|
|
3
|
-
export const VERSION_SIGIL = '
|
|
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}${
|
|
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}${
|
|
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.
|
|
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.
|
|
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.
|
|
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": "
|
|
60
|
+
"gitHead": "4b77dea6ac8d473a4113ad7b345b3a37b0b8a3f8"
|
|
61
61
|
}
|