@lwrjs/module-registry 0.8.0-alpha.5 → 0.8.0-alpha.8
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/signature.cjs +14 -3
- package/build/es/signature.js +19 -5
- package/package.json +5 -5
package/build/cjs/signature.cjs
CHANGED
|
@@ -60,7 +60,18 @@ async function getBundleSignature(moduleId, registry, exclude) {
|
|
|
60
60
|
return hash.digest("hex");
|
|
61
61
|
}
|
|
62
62
|
function getLWCVersion() {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
let lwcVersion;
|
|
64
|
+
try {
|
|
65
|
+
if (LWR?.LWC_VERSION) {
|
|
66
|
+
lwcVersion = LWR.LWC_VERSION;
|
|
67
|
+
}
|
|
68
|
+
} catch (err) {
|
|
69
|
+
}
|
|
70
|
+
if (!lwcVersion) {
|
|
71
|
+
const require2 = (0, import_module.createRequire)(import_path.default.join((0, import_process.cwd)(), "./env-config.js"));
|
|
72
|
+
const {version} = require2("lwc/package.json");
|
|
73
|
+
lwcVersion = version;
|
|
74
|
+
}
|
|
75
|
+
import_shared_utils.logger.debug(`Signature LWC Version: ${lwcVersion}`);
|
|
76
|
+
return lwcVersion;
|
|
66
77
|
}
|
package/build/es/signature.js
CHANGED
|
@@ -2,7 +2,7 @@ import crypto from 'crypto';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { cwd } from 'process';
|
|
4
4
|
import { createRequire } from 'module';
|
|
5
|
-
import { getFeatureFlags, getSpecifier } from '@lwrjs/shared-utils';
|
|
5
|
+
import { getFeatureFlags, getSpecifier, logger } from '@lwrjs/shared-utils';
|
|
6
6
|
const LWC_VERSION = getLWCVersion();
|
|
7
7
|
const ENABLED_FINGERPRINTS = !getFeatureFlags().LEGACY_LOADER;
|
|
8
8
|
const ENV_KEY = `LWC:${LWC_VERSION},FINGERPRINTS:${ENABLED_FINGERPRINTS}`;
|
|
@@ -60,9 +60,23 @@ export async function getBundleSignature(moduleId, registry, exclude) {
|
|
|
60
60
|
* Get the configured LWC version
|
|
61
61
|
*/
|
|
62
62
|
function getLWCVersion() {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
let lwcVersion;
|
|
64
|
+
try {
|
|
65
|
+
// check if it is set on the global shim
|
|
66
|
+
if (LWR?.LWC_VERSION) {
|
|
67
|
+
lwcVersion = LWR.LWC_VERSION;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
// No-op throws an error in cli when LWR versison not set in global
|
|
72
|
+
}
|
|
73
|
+
if (!lwcVersion) {
|
|
74
|
+
const require = createRequire(path.join(cwd(), './env-config.js'));
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
76
|
+
const { version } = require('lwc/package.json');
|
|
77
|
+
lwcVersion = version;
|
|
78
|
+
}
|
|
79
|
+
logger.debug(`Signature LWC Version: ${lwcVersion}`);
|
|
80
|
+
return lwcVersion;
|
|
67
81
|
}
|
|
68
82
|
//# sourceMappingURL=signature.js.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.8.0-alpha.
|
|
7
|
+
"version": "0.8.0-alpha.8",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -30,18 +30,18 @@
|
|
|
30
30
|
"build/**/*.d.ts"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@lwrjs/diagnostics": "0.8.0-alpha.
|
|
34
|
-
"@lwrjs/shared-utils": "0.8.0-alpha.
|
|
33
|
+
"@lwrjs/diagnostics": "0.8.0-alpha.8",
|
|
34
|
+
"@lwrjs/shared-utils": "0.8.0-alpha.8",
|
|
35
35
|
"es-module-lexer": "^0.3.18",
|
|
36
36
|
"ws": "^7.2.5"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@lwrjs/types": "0.8.0-alpha.
|
|
39
|
+
"@lwrjs/types": "0.8.0-alpha.8",
|
|
40
40
|
"@types/es-module-lexer": "^0.3.0",
|
|
41
41
|
"@types/ws": "^7.2.4"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": ">=14.15.4 <19"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "345e7545d2d1d1f587567aacf0a072473c746d9e"
|
|
47
47
|
}
|