@lwrjs/shared-utils 0.13.0-alpha.26 → 0.13.0-alpha.28
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 +9 -0
- package/build/es/identity.d.ts +1 -0
- package/build/es/identity.js +8 -0
- package/package.json +4 -4
package/build/cjs/identity.cjs
CHANGED
|
@@ -39,6 +39,7 @@ __export(exports, {
|
|
|
39
39
|
explodeSpecifier: () => explodeSpecifier,
|
|
40
40
|
explodeSpecifiers: () => explodeSpecifiers,
|
|
41
41
|
getCacheKeyFromJson: () => import_fast_json_stable_stringify.default,
|
|
42
|
+
getLocalDevOverrideUrl: () => getLocalDevOverrideUrl,
|
|
42
43
|
getMappingUriPrefix: () => getMappingUriPrefix,
|
|
43
44
|
getModuleUriPrefix: () => getModuleUriPrefix,
|
|
44
45
|
getPropFromAttrName: () => getPropFromAttrName,
|
|
@@ -57,6 +58,7 @@ __export(exports, {
|
|
|
57
58
|
slugify: () => slugify,
|
|
58
59
|
stringToVariableName: () => stringToVariableName
|
|
59
60
|
});
|
|
61
|
+
var import_path = __toModule(require("path"));
|
|
60
62
|
var import_slugify = __toModule(require("slugify"));
|
|
61
63
|
var import_fast_json_stable_stringify = __toModule(require("fast-json-stable-stringify"));
|
|
62
64
|
var VERSION_SIGIL = "v";
|
|
@@ -210,3 +212,10 @@ function stringToVariableName(inputString) {
|
|
|
210
212
|
}
|
|
211
213
|
return cleanedString;
|
|
212
214
|
}
|
|
215
|
+
function getLocalDevOverrideUrl(cacheDir, specifier, filepath) {
|
|
216
|
+
if (!specifier.startsWith("@view"))
|
|
217
|
+
return filepath;
|
|
218
|
+
const dirname = import_path.default.basename(import_path.default.dirname(filepath));
|
|
219
|
+
const fileName = specifier.split("@view/")[1] + "_view.js";
|
|
220
|
+
return import_path.default.join(cacheDir, "overrides", dirname, fileName);
|
|
221
|
+
}
|
package/build/es/identity.d.ts
CHANGED
|
@@ -147,4 +147,5 @@ export declare function isBundleDefinition(definition: ModuleDefinition | Bundle
|
|
|
147
147
|
* @param name - Proposed name
|
|
148
148
|
*/
|
|
149
149
|
export declare function stringToVariableName(inputString: string): string;
|
|
150
|
+
export declare function getLocalDevOverrideUrl(cacheDir: string, specifier: string, filepath: string): string;
|
|
150
151
|
//# sourceMappingURL=identity.d.ts.map
|
package/build/es/identity.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import path from 'path';
|
|
1
2
|
import slugifyText from 'slugify';
|
|
2
3
|
import getCacheKeyFromJson from 'fast-json-stable-stringify';
|
|
3
4
|
export const VERSION_SIGIL = 'v';
|
|
@@ -269,4 +270,11 @@ export function stringToVariableName(inputString) {
|
|
|
269
270
|
}
|
|
270
271
|
return cleanedString;
|
|
271
272
|
}
|
|
273
|
+
export function getLocalDevOverrideUrl(cacheDir, specifier, filepath) {
|
|
274
|
+
if (!specifier.startsWith('@view'))
|
|
275
|
+
return filepath; // only @view modules get overridden
|
|
276
|
+
const dirname = path.basename(path.dirname(filepath));
|
|
277
|
+
const fileName = specifier.split('@view/')[1] + '_view.js';
|
|
278
|
+
return path.join(cacheDir, 'overrides', dirname, fileName);
|
|
279
|
+
}
|
|
272
280
|
//# sourceMappingURL=identity.js.map
|
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.28",
|
|
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.28",
|
|
41
41
|
"es-module-lexer": "^1.5.3",
|
|
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.28",
|
|
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": "3c8caa1fd5ce8c2360cd63049865aac499e30881"
|
|
61
61
|
}
|