@lwrjs/module-registry 0.13.0-alpha.3 → 0.13.0-alpha.5
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.
|
@@ -51,11 +51,12 @@ async function resolveRelativeImport(registry, moduleSpecifier, importeeEntry, v
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
async function resolveExternalImport(registry, moduleSpecifier, importeeEntry, location, runtimeParams) {
|
|
54
|
-
const {namespace, name, specifier} = (0, import_shared_utils.explodeSpecifier)(moduleSpecifier);
|
|
54
|
+
const {namespace, name, specifier, version} = (0, import_shared_utils.explodeSpecifier)(moduleSpecifier);
|
|
55
55
|
const {entry, virtual} = importeeEntry;
|
|
56
56
|
const moduleEntryRoot = virtual ? void 0 : import_path.default.dirname(entry);
|
|
57
57
|
const dependencyModuleEntry = await registry.getModuleEntry({
|
|
58
|
-
specifier
|
|
58
|
+
specifier,
|
|
59
|
+
version,
|
|
59
60
|
importer: moduleEntryRoot
|
|
60
61
|
}, runtimeParams);
|
|
61
62
|
return {
|
|
@@ -63,7 +64,7 @@ async function resolveExternalImport(registry, moduleSpecifier, importeeEntry, l
|
|
|
63
64
|
name: name || specifier,
|
|
64
65
|
scope: dependencyModuleEntry.scope,
|
|
65
66
|
sourceSpecifier: moduleSpecifier,
|
|
66
|
-
specifier
|
|
67
|
+
specifier,
|
|
67
68
|
version: dependencyModuleEntry.version,
|
|
68
69
|
locations: [location],
|
|
69
70
|
interchangeable: dependencyModuleEntry.interchangeable
|
|
@@ -111,13 +112,14 @@ async function getModuleRecord(compiledModule, registry, runtimeParams) {
|
|
|
111
112
|
importLocation,
|
|
112
113
|
moduleNameType
|
|
113
114
|
} of compiledMetadata.dynamicImports) {
|
|
115
|
+
const {specifier, version: version2 = ""} = (0, import_shared_utils.explodeSpecifier)(moduleSpecifier);
|
|
114
116
|
if (!visitedDynamicImports.has(moduleSpecifier)) {
|
|
115
117
|
visitedDynamicImports.add(moduleSpecifier);
|
|
116
118
|
if (moduleNameType === import_shared_utils.ModuleNameType.unresolved) {
|
|
117
119
|
dynamicImports.push({
|
|
118
|
-
specifier
|
|
120
|
+
specifier,
|
|
119
121
|
sourceSpecifier: moduleSpecifier,
|
|
120
|
-
version:
|
|
122
|
+
version: version2,
|
|
121
123
|
name: moduleNameType,
|
|
122
124
|
moduleNameType,
|
|
123
125
|
locations: [
|
|
@@ -128,7 +130,7 @@ async function getModuleRecord(compiledModule, registry, runtimeParams) {
|
|
|
128
130
|
]
|
|
129
131
|
});
|
|
130
132
|
} else if (moduleSpecifier.startsWith(".")) {
|
|
131
|
-
const {locations, ...resolvedImport} = await resolveRelativeImport(registry, moduleSpecifier, moduleEntry,
|
|
133
|
+
const {locations, ...resolvedImport} = await resolveRelativeImport(registry, moduleSpecifier, moduleEntry, version2, location, runtimeParams);
|
|
132
134
|
dynamicImports.push({
|
|
133
135
|
...resolvedImport,
|
|
134
136
|
moduleNameType: import_shared_utils.ModuleNameType.string,
|
|
@@ -33,11 +33,12 @@ async function resolveRelativeImport(registry, moduleSpecifier, importeeEntry, v
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
async function resolveExternalImport(registry, moduleSpecifier, importeeEntry, location, runtimeParams) {
|
|
36
|
-
const { namespace, name, specifier } = explodeSpecifier(moduleSpecifier);
|
|
36
|
+
const { namespace, name, specifier, version } = explodeSpecifier(moduleSpecifier);
|
|
37
37
|
const { entry, virtual } = importeeEntry;
|
|
38
38
|
const moduleEntryRoot = virtual ? undefined : path.dirname(entry);
|
|
39
39
|
const dependencyModuleEntry = await registry.getModuleEntry({
|
|
40
|
-
specifier
|
|
40
|
+
specifier,
|
|
41
|
+
version,
|
|
41
42
|
importer: moduleEntryRoot,
|
|
42
43
|
}, runtimeParams);
|
|
43
44
|
return {
|
|
@@ -45,7 +46,7 @@ async function resolveExternalImport(registry, moduleSpecifier, importeeEntry, l
|
|
|
45
46
|
name: name || specifier,
|
|
46
47
|
scope: dependencyModuleEntry.scope,
|
|
47
48
|
sourceSpecifier: moduleSpecifier,
|
|
48
|
-
specifier:
|
|
49
|
+
specifier: specifier,
|
|
49
50
|
version: dependencyModuleEntry.version,
|
|
50
51
|
locations: [location],
|
|
51
52
|
interchangeable: dependencyModuleEntry.interchangeable,
|
|
@@ -93,15 +94,16 @@ export async function getModuleRecord(compiledModule, registry, runtimeParams) {
|
|
|
93
94
|
if (compiledMetadata && compiledMetadata.dynamicImports && compiledMetadata.dynamicImports.length > 0) {
|
|
94
95
|
const visitedDynamicImports = new Set(); // Avoids multiple imports to the same specifier
|
|
95
96
|
for (const { moduleSpecifier, location, importLocation, moduleNameType, } of compiledMetadata.dynamicImports) {
|
|
97
|
+
const { specifier, version = '' } = explodeSpecifier(moduleSpecifier);
|
|
96
98
|
// Check for dupes first
|
|
97
99
|
if (!visitedDynamicImports.has(moduleSpecifier)) {
|
|
98
100
|
visitedDynamicImports.add(moduleSpecifier);
|
|
99
101
|
if (moduleNameType === ModuleNameType.unresolved) {
|
|
100
102
|
// mark variable dynamic imports
|
|
101
103
|
dynamicImports.push({
|
|
102
|
-
specifier
|
|
104
|
+
specifier,
|
|
103
105
|
sourceSpecifier: moduleSpecifier,
|
|
104
|
-
version
|
|
106
|
+
version,
|
|
105
107
|
name: moduleNameType,
|
|
106
108
|
moduleNameType,
|
|
107
109
|
locations: [
|
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.5",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
"build/**/*.d.ts"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@lwrjs/config": "0.13.0-alpha.
|
|
38
|
-
"@lwrjs/diagnostics": "0.13.0-alpha.
|
|
39
|
-
"@lwrjs/shared-utils": "0.13.0-alpha.
|
|
37
|
+
"@lwrjs/config": "0.13.0-alpha.5",
|
|
38
|
+
"@lwrjs/diagnostics": "0.13.0-alpha.5",
|
|
39
|
+
"@lwrjs/shared-utils": "0.13.0-alpha.5",
|
|
40
40
|
"fs-extra": "^11.1.1",
|
|
41
41
|
"rollup": "^2.78.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@lwrjs/types": "0.13.0-alpha.
|
|
44
|
+
"@lwrjs/types": "0.13.0-alpha.5"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=18.0.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "228fe607cb3f377a11efe53dd800c4f53a4eab66"
|
|
50
50
|
}
|