@lwrjs/lwc-module-provider 0.11.3 → 0.11.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.
- package/build/cjs/compiler.cjs +30 -6
- package/build/cjs/index.cjs +62 -28
- package/build/cjs/utils.cjs +15 -4
- package/build/es/compiler.js +30 -6
- package/build/es/index.js +62 -28
- package/build/es/utils.js +16 -5
- package/package.json +7 -7
package/build/cjs/compiler.cjs
CHANGED
|
@@ -54,17 +54,33 @@ var LwcCompiler = class {
|
|
|
54
54
|
presets: [["@babel/preset-typescript", {onlyRemoveTypeImports: false}]],
|
|
55
55
|
filename
|
|
56
56
|
};
|
|
57
|
-
import_diagnostics.logger.debug(
|
|
57
|
+
import_diagnostics.logger.debug({
|
|
58
|
+
label: "LwcCompiler",
|
|
59
|
+
message: "babelTransform",
|
|
60
|
+
additionalInfo: {babelConfig}
|
|
61
|
+
});
|
|
58
62
|
let result;
|
|
59
63
|
try {
|
|
60
64
|
result = (0, import_core.transformSync)(source, babelConfig);
|
|
61
65
|
} catch (error) {
|
|
62
|
-
import_diagnostics.logger.debug(
|
|
66
|
+
import_diagnostics.logger.debug({
|
|
67
|
+
label: "LwcCompiler",
|
|
68
|
+
message: "babelTransform error",
|
|
69
|
+
additionalInfo: error
|
|
70
|
+
});
|
|
63
71
|
throw error;
|
|
64
72
|
}
|
|
65
|
-
import_diagnostics.logger.verbose(
|
|
73
|
+
import_diagnostics.logger.verbose({
|
|
74
|
+
label: "LwcCompiler",
|
|
75
|
+
message: "babelTransform result",
|
|
76
|
+
additionalInfo: {result}
|
|
77
|
+
});
|
|
66
78
|
if (!result || !result.code) {
|
|
67
|
-
import_diagnostics.logger.debug(
|
|
79
|
+
import_diagnostics.logger.debug({
|
|
80
|
+
label: "LwcCompiler",
|
|
81
|
+
message: "babelTransform invalid result",
|
|
82
|
+
additionalInfo: {result}
|
|
83
|
+
});
|
|
68
84
|
throw new Error(`Error TS compiling ${filename}`);
|
|
69
85
|
}
|
|
70
86
|
source = result.code;
|
|
@@ -87,9 +103,17 @@ var LwcCompiler = class {
|
|
|
87
103
|
enableLightningWebSecurityTransforms,
|
|
88
104
|
enableScopedSlots: true
|
|
89
105
|
};
|
|
90
|
-
import_diagnostics.logger.debug(
|
|
106
|
+
import_diagnostics.logger.debug({
|
|
107
|
+
label: "LwcCompiler",
|
|
108
|
+
message: "transformSync",
|
|
109
|
+
additionalInfo: {filename, transformConfig}
|
|
110
|
+
});
|
|
91
111
|
const compilerResult = (0, import_compiler.transformSync)(source, filename, transformConfig);
|
|
92
|
-
import_diagnostics.logger.verbose(
|
|
112
|
+
import_diagnostics.logger.verbose({
|
|
113
|
+
label: "LwcCompiler",
|
|
114
|
+
message: "transformSync result",
|
|
115
|
+
additionalInfo: {compilerResult}
|
|
116
|
+
});
|
|
93
117
|
return {
|
|
94
118
|
code: compilerResult.code,
|
|
95
119
|
map: null,
|
package/build/cjs/index.cjs
CHANGED
|
@@ -78,14 +78,18 @@ var LwcModuleProvider = class {
|
|
|
78
78
|
}
|
|
79
79
|
async getModule(moduleId) {
|
|
80
80
|
const id = (0, import_shared_utils.getSpecifier)(moduleId);
|
|
81
|
-
import_diagnostics.logger.debug(
|
|
81
|
+
import_diagnostics.logger.debug({label: `${this.name}`, message: `getModule ${id}`});
|
|
82
82
|
return this.inflightGetModuleJobs.execute(id, () => {
|
|
83
83
|
return this.createGetModuleJob(moduleId);
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
async createGetModuleJob(moduleId) {
|
|
87
87
|
const {watcher, watchedModuleContextMap, lwcCacheDir, lwcCacheIndex, moduleFsCacheEnabled} = this;
|
|
88
|
-
import_diagnostics.logger.debug(
|
|
88
|
+
import_diagnostics.logger.debug({
|
|
89
|
+
label: `${this.name}`,
|
|
90
|
+
message: "fetch module",
|
|
91
|
+
additionalInfo: {moduleId, moduleFsCacheEnabled}
|
|
92
|
+
});
|
|
89
93
|
const moduleEntry = await this.getModuleEntry(moduleId);
|
|
90
94
|
if (!moduleEntry) {
|
|
91
95
|
return;
|
|
@@ -94,19 +98,27 @@ var LwcModuleProvider = class {
|
|
|
94
98
|
const {id, namespace, name: rawName, originalSource} = moduleSource;
|
|
95
99
|
const cacheConfig = {lwcCacheDir, lwcCacheIndex};
|
|
96
100
|
let compiledModule = moduleFsCacheEnabled && (0, import_cache.getCompiledModuleCacheEntry)(moduleSource, cacheConfig);
|
|
97
|
-
import_diagnostics.logger.debug(
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
import_diagnostics.logger.debug({
|
|
102
|
+
label: `${this.name}`,
|
|
103
|
+
message: "module source",
|
|
104
|
+
additionalInfo: {
|
|
105
|
+
moduleId,
|
|
106
|
+
isPreCompiled: compiledModule != void 0
|
|
107
|
+
}
|
|
100
108
|
});
|
|
101
109
|
if (!compiledModule) {
|
|
102
110
|
const [name] = rawName.split("#");
|
|
103
111
|
const enableLightningWebSecurityTransforms = !!this.locker?.enabled && !this.locker?.clientOnly;
|
|
104
112
|
const scopedStyles = moduleEntry.entry.endsWith(".css") && moduleEntry.specifier.endsWith("?scoped=true");
|
|
105
|
-
import_diagnostics.logger.debug(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
import_diagnostics.logger.debug({
|
|
114
|
+
label: `${this.name}`,
|
|
115
|
+
message: "compile",
|
|
116
|
+
additionalInfo: {
|
|
117
|
+
namespace,
|
|
118
|
+
name,
|
|
119
|
+
filename: moduleEntry.entry,
|
|
120
|
+
scopedStyles
|
|
121
|
+
}
|
|
110
122
|
});
|
|
111
123
|
compiledModule = await this.lwcCompiler.compileFile(originalSource, {
|
|
112
124
|
namespace,
|
|
@@ -115,11 +127,15 @@ var LwcModuleProvider = class {
|
|
|
115
127
|
enableLightningWebSecurityTransforms,
|
|
116
128
|
scopedStyles
|
|
117
129
|
});
|
|
118
|
-
import_diagnostics.logger.verbose(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
130
|
+
import_diagnostics.logger.verbose({
|
|
131
|
+
label: `${this.name}`,
|
|
132
|
+
message: "createGetModuleJob:compile compiledModule",
|
|
133
|
+
additionalInfo: {
|
|
134
|
+
namespace,
|
|
135
|
+
name,
|
|
136
|
+
filename: moduleEntry.entry,
|
|
137
|
+
scopedStyles
|
|
138
|
+
}
|
|
123
139
|
});
|
|
124
140
|
if (moduleFsCacheEnabled) {
|
|
125
141
|
(0, import_cache.addCompiledModuleCacheEntry)(moduleSource, compiledModule, cacheConfig);
|
|
@@ -162,7 +178,10 @@ var LwcModuleProvider = class {
|
|
|
162
178
|
importer,
|
|
163
179
|
version
|
|
164
180
|
}) {
|
|
165
|
-
import_diagnostics.logger.debug(
|
|
181
|
+
import_diagnostics.logger.debug({
|
|
182
|
+
label: `${this.name}`,
|
|
183
|
+
message: `getModuleEntry ${specifier}@${version}@${importer}`
|
|
184
|
+
});
|
|
166
185
|
const versionId = version || importer;
|
|
167
186
|
if (versionId) {
|
|
168
187
|
const cacheKey2 = getModuleEntryCacheKey(specifier, versionId);
|
|
@@ -180,11 +199,15 @@ var LwcModuleProvider = class {
|
|
|
180
199
|
importer,
|
|
181
200
|
version
|
|
182
201
|
}) {
|
|
183
|
-
import_diagnostics.logger.debug(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
202
|
+
import_diagnostics.logger.debug({
|
|
203
|
+
label: `${this.name}`,
|
|
204
|
+
message: "createModuleEntry",
|
|
205
|
+
additionalInfo: {
|
|
206
|
+
specifier,
|
|
207
|
+
importer,
|
|
208
|
+
rootDir: this.rootDir,
|
|
209
|
+
version
|
|
210
|
+
}
|
|
188
211
|
});
|
|
189
212
|
const [baseSpecifier, fileRelativePathRaw] = specifier.split("#");
|
|
190
213
|
const fileRelativePath = fileRelativePathRaw?.split("?")[0];
|
|
@@ -195,14 +218,22 @@ var LwcModuleProvider = class {
|
|
|
195
218
|
}
|
|
196
219
|
if (!moduleEntry) {
|
|
197
220
|
try {
|
|
198
|
-
import_diagnostics.logger.debug(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
221
|
+
import_diagnostics.logger.debug({
|
|
222
|
+
label: `${this.name}`,
|
|
223
|
+
message: "createModuleEntry:resolveModuleSpecifier",
|
|
224
|
+
additionalInfo: {
|
|
225
|
+
baseSpecifier,
|
|
226
|
+
importer,
|
|
227
|
+
rootDir: this.rootDir,
|
|
228
|
+
modules: this.modules
|
|
229
|
+
}
|
|
203
230
|
});
|
|
204
231
|
const registryEntry = (0, import_utils.resolveModuleSpecifier)(baseSpecifier, importer || this.rootDir, this.modules, this.packageVersionCache);
|
|
205
|
-
import_diagnostics.logger.debug(
|
|
232
|
+
import_diagnostics.logger.debug({
|
|
233
|
+
label: `${this.name}`,
|
|
234
|
+
message: "createModuleEntry:registryEntry",
|
|
235
|
+
additionalInfo: {registryEntry}
|
|
236
|
+
});
|
|
206
237
|
moduleEntry = {
|
|
207
238
|
id: getModuleEntryCacheKey(registryEntry.specifier, registryEntry.version),
|
|
208
239
|
...registryEntry
|
|
@@ -217,7 +248,10 @@ var LwcModuleProvider = class {
|
|
|
217
248
|
if (e.code !== "NO_LWC_MODULE_FOUND") {
|
|
218
249
|
throw e;
|
|
219
250
|
} else {
|
|
220
|
-
import_diagnostics.logger.verbose(
|
|
251
|
+
import_diagnostics.logger.verbose({
|
|
252
|
+
label: `${this.name}`,
|
|
253
|
+
message: `LWC provider could not find the module ${specifier}`
|
|
254
|
+
});
|
|
221
255
|
}
|
|
222
256
|
}
|
|
223
257
|
}
|
package/build/cjs/utils.cjs
CHANGED
|
@@ -38,18 +38,29 @@ var import_module_resolver = __toModule(require("@lwc/module-resolver"));
|
|
|
38
38
|
var EXPLICIT_CONSTANT = "/* _implicit_dependency_ */";
|
|
39
39
|
var DEFAULT_IMPLICIT_DEP = `${EXPLICIT_CONSTANT} export default void 0`;
|
|
40
40
|
function resolveModuleSpecifier(specifier, importer, modules = [], packageVersionCache) {
|
|
41
|
-
import_diagnostics.logger.debug(
|
|
41
|
+
import_diagnostics.logger.debug({
|
|
42
|
+
label: `lwc-module-provider`,
|
|
43
|
+
message: "resolveModuleSpecifier",
|
|
44
|
+
additionalInfo: {specifier, importer, modules}
|
|
45
|
+
});
|
|
42
46
|
let resolvedModule;
|
|
43
47
|
try {
|
|
44
48
|
resolvedModule = (0, import_module_resolver.resolveModule)(specifier, importer, {modules});
|
|
45
49
|
} catch (error) {
|
|
46
50
|
if (import_diagnostics.logger.isDebugEnabled()) {
|
|
47
|
-
import_diagnostics.logger.debug(
|
|
51
|
+
import_diagnostics.logger.debug({
|
|
52
|
+
label: `lwc-module-provider`,
|
|
53
|
+
message: `@lwc/module-resolver/resolveModule ${specifier}`
|
|
54
|
+
});
|
|
48
55
|
import_diagnostics.logger.error(error);
|
|
49
56
|
}
|
|
50
57
|
throw error;
|
|
51
58
|
}
|
|
52
|
-
import_diagnostics.logger.debug(
|
|
59
|
+
import_diagnostics.logger.debug({
|
|
60
|
+
label: `lwc-module-provider`,
|
|
61
|
+
message: "resolveModuleSpecifier:resolvedModule",
|
|
62
|
+
additionalInfo: {resolvedModule}
|
|
63
|
+
});
|
|
53
64
|
const moduleScope = resolvedModule.scope;
|
|
54
65
|
let version;
|
|
55
66
|
if (packageVersionCache.has(moduleScope)) {
|
|
@@ -93,6 +104,6 @@ function setUpWatcher(watcherFactory, onModuleChange) {
|
|
|
93
104
|
const watcher = watcherFactory.createFileWatcher();
|
|
94
105
|
watcher.on("change", (0, import_shared_utils.debounce)((file) => onModuleChange(file), 500));
|
|
95
106
|
watcher.on("unlink", (0, import_shared_utils.debounce)((file) => onModuleChange(file), 500));
|
|
96
|
-
watcher.on("add", (file) => import_diagnostics.logger.info(`Watching: ${file}`));
|
|
107
|
+
watcher.on("add", (file) => import_diagnostics.logger.info({label: `lwc-module-provider`, message: `Watching: ${file}`}));
|
|
97
108
|
return watcher;
|
|
98
109
|
}
|
package/build/es/compiler.js
CHANGED
|
@@ -27,18 +27,34 @@ export class LwcCompiler {
|
|
|
27
27
|
presets: [['@babel/preset-typescript', { onlyRemoveTypeImports: false }]],
|
|
28
28
|
filename,
|
|
29
29
|
};
|
|
30
|
-
logger.debug(
|
|
30
|
+
logger.debug({
|
|
31
|
+
label: 'LwcCompiler',
|
|
32
|
+
message: 'babelTransform',
|
|
33
|
+
additionalInfo: { babelConfig },
|
|
34
|
+
});
|
|
31
35
|
let result;
|
|
32
36
|
try {
|
|
33
37
|
result = babelTransform(source, babelConfig);
|
|
34
38
|
}
|
|
35
39
|
catch (error) {
|
|
36
|
-
logger.debug(
|
|
40
|
+
logger.debug({
|
|
41
|
+
label: 'LwcCompiler',
|
|
42
|
+
message: 'babelTransform error',
|
|
43
|
+
additionalInfo: error,
|
|
44
|
+
});
|
|
37
45
|
throw error;
|
|
38
46
|
}
|
|
39
|
-
logger.verbose(
|
|
47
|
+
logger.verbose({
|
|
48
|
+
label: 'LwcCompiler',
|
|
49
|
+
message: 'babelTransform result',
|
|
50
|
+
additionalInfo: { result },
|
|
51
|
+
});
|
|
40
52
|
if (!result || !result.code) {
|
|
41
|
-
logger.debug(
|
|
53
|
+
logger.debug({
|
|
54
|
+
label: 'LwcCompiler',
|
|
55
|
+
message: 'babelTransform invalid result',
|
|
56
|
+
additionalInfo: { result },
|
|
57
|
+
});
|
|
42
58
|
throw new Error(`Error TS compiling ${filename}`);
|
|
43
59
|
}
|
|
44
60
|
source = result.code;
|
|
@@ -62,9 +78,17 @@ export class LwcCompiler {
|
|
|
62
78
|
enableLightningWebSecurityTransforms,
|
|
63
79
|
enableScopedSlots: true, // this flag turns on an additive feature and is backwards compatible
|
|
64
80
|
};
|
|
65
|
-
logger.debug(
|
|
81
|
+
logger.debug({
|
|
82
|
+
label: 'LwcCompiler',
|
|
83
|
+
message: 'transformSync',
|
|
84
|
+
additionalInfo: { filename, transformConfig },
|
|
85
|
+
});
|
|
66
86
|
const compilerResult = transformSync(source, filename, transformConfig);
|
|
67
|
-
logger.verbose(
|
|
87
|
+
logger.verbose({
|
|
88
|
+
label: 'LwcCompiler',
|
|
89
|
+
message: 'transformSync result',
|
|
90
|
+
additionalInfo: { compilerResult },
|
|
91
|
+
});
|
|
68
92
|
return {
|
|
69
93
|
code: compilerResult.code,
|
|
70
94
|
map: null,
|
package/build/es/index.js
CHANGED
|
@@ -49,7 +49,7 @@ export default class LwcModuleProvider {
|
|
|
49
49
|
}
|
|
50
50
|
async getModule(moduleId) {
|
|
51
51
|
const id = getSpecifier(moduleId);
|
|
52
|
-
logger.debug(
|
|
52
|
+
logger.debug({ label: `${this.name}`, message: `getModule ${id}` });
|
|
53
53
|
return this.inflightGetModuleJobs.execute(id, () => {
|
|
54
54
|
return this.createGetModuleJob(moduleId);
|
|
55
55
|
});
|
|
@@ -61,7 +61,11 @@ export default class LwcModuleProvider {
|
|
|
61
61
|
*/
|
|
62
62
|
async createGetModuleJob(moduleId) {
|
|
63
63
|
const { watcher, watchedModuleContextMap, lwcCacheDir, lwcCacheIndex, moduleFsCacheEnabled } = this;
|
|
64
|
-
logger.debug(
|
|
64
|
+
logger.debug({
|
|
65
|
+
label: `${this.name}`,
|
|
66
|
+
message: 'fetch module',
|
|
67
|
+
additionalInfo: { moduleId, moduleFsCacheEnabled },
|
|
68
|
+
});
|
|
65
69
|
const moduleEntry = await this.getModuleEntry(moduleId);
|
|
66
70
|
if (!moduleEntry) {
|
|
67
71
|
return;
|
|
@@ -70,19 +74,27 @@ export default class LwcModuleProvider {
|
|
|
70
74
|
const { id, namespace, name: rawName, originalSource } = moduleSource;
|
|
71
75
|
const cacheConfig = { lwcCacheDir, lwcCacheIndex };
|
|
72
76
|
let compiledModule = moduleFsCacheEnabled && getCompiledModuleCacheEntry(moduleSource, cacheConfig);
|
|
73
|
-
logger.debug(
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
logger.debug({
|
|
78
|
+
label: `${this.name}`,
|
|
79
|
+
message: 'module source',
|
|
80
|
+
additionalInfo: {
|
|
81
|
+
moduleId,
|
|
82
|
+
isPreCompiled: compiledModule != undefined,
|
|
83
|
+
},
|
|
76
84
|
});
|
|
77
85
|
if (!compiledModule) {
|
|
78
86
|
const [name] = rawName.split('#');
|
|
79
87
|
const enableLightningWebSecurityTransforms = !!this.locker?.enabled && !this.locker?.clientOnly;
|
|
80
88
|
const scopedStyles = moduleEntry.entry.endsWith('.css') && moduleEntry.specifier.endsWith('?scoped=true');
|
|
81
|
-
logger.debug(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
logger.debug({
|
|
90
|
+
label: `${this.name}`,
|
|
91
|
+
message: 'compile',
|
|
92
|
+
additionalInfo: {
|
|
93
|
+
namespace,
|
|
94
|
+
name,
|
|
95
|
+
filename: moduleEntry.entry,
|
|
96
|
+
scopedStyles,
|
|
97
|
+
},
|
|
86
98
|
});
|
|
87
99
|
// We need to convert anything (html, css, javascript) into a canonical ES6 module
|
|
88
100
|
compiledModule = await this.lwcCompiler.compileFile(originalSource, {
|
|
@@ -92,11 +104,15 @@ export default class LwcModuleProvider {
|
|
|
92
104
|
enableLightningWebSecurityTransforms,
|
|
93
105
|
scopedStyles,
|
|
94
106
|
});
|
|
95
|
-
logger.verbose(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
107
|
+
logger.verbose({
|
|
108
|
+
label: `${this.name}`,
|
|
109
|
+
message: 'createGetModuleJob:compile compiledModule',
|
|
110
|
+
additionalInfo: {
|
|
111
|
+
namespace,
|
|
112
|
+
name,
|
|
113
|
+
filename: moduleEntry.entry,
|
|
114
|
+
scopedStyles,
|
|
115
|
+
},
|
|
100
116
|
});
|
|
101
117
|
if (moduleFsCacheEnabled) {
|
|
102
118
|
addCompiledModuleCacheEntry(moduleSource, compiledModule, cacheConfig);
|
|
@@ -135,7 +151,10 @@ export default class LwcModuleProvider {
|
|
|
135
151
|
return moduleSource;
|
|
136
152
|
}
|
|
137
153
|
async getModuleEntry({ specifier, importer, version, }) {
|
|
138
|
-
logger.debug(
|
|
154
|
+
logger.debug({
|
|
155
|
+
label: `${this.name}`,
|
|
156
|
+
message: `getModuleEntry ${specifier}@${version}@${importer}`,
|
|
157
|
+
});
|
|
139
158
|
// Check cache
|
|
140
159
|
const versionId = version || importer;
|
|
141
160
|
if (versionId) {
|
|
@@ -150,11 +169,15 @@ export default class LwcModuleProvider {
|
|
|
150
169
|
});
|
|
151
170
|
}
|
|
152
171
|
async createModuleEntry({ specifier, importer, version, }) {
|
|
153
|
-
logger.debug(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
172
|
+
logger.debug({
|
|
173
|
+
label: `${this.name}`,
|
|
174
|
+
message: 'createModuleEntry',
|
|
175
|
+
additionalInfo: {
|
|
176
|
+
specifier,
|
|
177
|
+
importer,
|
|
178
|
+
rootDir: this.rootDir,
|
|
179
|
+
version,
|
|
180
|
+
},
|
|
158
181
|
});
|
|
159
182
|
// Strip any filenames out of the specifier
|
|
160
183
|
// eg: 'c/myApp#myApp.css' => 'c/myApp' and 'myApp.css'
|
|
@@ -170,14 +193,22 @@ export default class LwcModuleProvider {
|
|
|
170
193
|
// Nothing from cache, let's try to resolve it first from lwc then from npm
|
|
171
194
|
if (!moduleEntry) {
|
|
172
195
|
try {
|
|
173
|
-
logger.debug(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
196
|
+
logger.debug({
|
|
197
|
+
label: `${this.name}`,
|
|
198
|
+
message: 'createModuleEntry:resolveModuleSpecifier',
|
|
199
|
+
additionalInfo: {
|
|
200
|
+
baseSpecifier,
|
|
201
|
+
importer,
|
|
202
|
+
rootDir: this.rootDir,
|
|
203
|
+
modules: this.modules,
|
|
204
|
+
},
|
|
178
205
|
});
|
|
179
206
|
const registryEntry = resolveModuleSpecifier(baseSpecifier, importer || this.rootDir, this.modules, this.packageVersionCache);
|
|
180
|
-
logger.debug(
|
|
207
|
+
logger.debug({
|
|
208
|
+
label: `${this.name}`,
|
|
209
|
+
message: 'createModuleEntry:registryEntry',
|
|
210
|
+
additionalInfo: { registryEntry },
|
|
211
|
+
});
|
|
181
212
|
moduleEntry = {
|
|
182
213
|
id: getModuleEntryCacheKey(registryEntry.specifier, registryEntry.version),
|
|
183
214
|
...registryEntry,
|
|
@@ -196,7 +227,10 @@ export default class LwcModuleProvider {
|
|
|
196
227
|
}
|
|
197
228
|
else {
|
|
198
229
|
// in verbose log the lwc provider miss
|
|
199
|
-
logger.verbose(
|
|
230
|
+
logger.verbose({
|
|
231
|
+
label: `${this.name}`,
|
|
232
|
+
message: `LWC provider could not find the module ${specifier}`,
|
|
233
|
+
});
|
|
200
234
|
}
|
|
201
235
|
}
|
|
202
236
|
}
|
package/build/es/utils.js
CHANGED
|
@@ -6,20 +6,31 @@ import { resolveModule } from '@lwc/module-resolver';
|
|
|
6
6
|
export const EXPLICIT_CONSTANT = '/* _implicit_dependency_ */';
|
|
7
7
|
export const DEFAULT_IMPLICIT_DEP = `${EXPLICIT_CONSTANT} export default void 0`;
|
|
8
8
|
export function resolveModuleSpecifier(specifier, importer, modules = [], packageVersionCache) {
|
|
9
|
-
logger.debug(
|
|
9
|
+
logger.debug({
|
|
10
|
+
label: `lwc-module-provider`,
|
|
11
|
+
message: 'resolveModuleSpecifier',
|
|
12
|
+
additionalInfo: { specifier, importer, modules },
|
|
13
|
+
});
|
|
10
14
|
let resolvedModule;
|
|
11
15
|
try {
|
|
12
16
|
resolvedModule = resolveModule(specifier, importer, { modules });
|
|
13
17
|
}
|
|
14
18
|
catch (error) {
|
|
15
19
|
if (logger.isDebugEnabled()) {
|
|
16
|
-
// If log level is debug or greater. Otherwise error will be
|
|
17
|
-
logger.debug(
|
|
20
|
+
// If log level is debug or greater. Otherwise error will be swallowed and resolved by npm-resolver
|
|
21
|
+
logger.debug({
|
|
22
|
+
label: `lwc-module-provider`,
|
|
23
|
+
message: `@lwc/module-resolver/resolveModule ${specifier}`,
|
|
24
|
+
});
|
|
18
25
|
logger.error(error);
|
|
19
26
|
}
|
|
20
27
|
throw error;
|
|
21
28
|
}
|
|
22
|
-
logger.debug(
|
|
29
|
+
logger.debug({
|
|
30
|
+
label: `lwc-module-provider`,
|
|
31
|
+
message: 'resolveModuleSpecifier:resolvedModule',
|
|
32
|
+
additionalInfo: { resolvedModule },
|
|
33
|
+
});
|
|
23
34
|
const moduleScope = resolvedModule.scope;
|
|
24
35
|
let version;
|
|
25
36
|
if (packageVersionCache.has(moduleScope)) {
|
|
@@ -77,7 +88,7 @@ export function setUpWatcher(watcherFactory, onModuleChange) {
|
|
|
77
88
|
const watcher = watcherFactory.createFileWatcher();
|
|
78
89
|
watcher.on('change', debounce((file) => onModuleChange(file), 500));
|
|
79
90
|
watcher.on('unlink', debounce((file) => onModuleChange(file), 500));
|
|
80
|
-
watcher.on('add', (file) => logger.info(`Watching: ${file}`));
|
|
91
|
+
watcher.on('add', (file) => logger.info({ label: `lwc-module-provider`, message: `Watching: ${file}` }));
|
|
81
92
|
return watcher;
|
|
82
93
|
}
|
|
83
94
|
//# sourceMappingURL=utils.js.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.5",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"build/**/*.d.ts"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@babel/preset-typescript": "^7.23.
|
|
34
|
-
"@lwrjs/diagnostics": "0.11.
|
|
35
|
-
"@lwrjs/fs-watch": "0.11.
|
|
36
|
-
"@lwrjs/shared-utils": "0.11.
|
|
33
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
34
|
+
"@lwrjs/diagnostics": "0.11.5",
|
|
35
|
+
"@lwrjs/fs-watch": "0.11.5",
|
|
36
|
+
"@lwrjs/shared-utils": "0.11.5"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@lwrjs/types": "0.11.
|
|
39
|
+
"@lwrjs/types": "0.11.5",
|
|
40
40
|
"typescript": "^4.9.5"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=16.0.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "b1a54889dd55baed1bf61ceb497d251958415595"
|
|
50
50
|
}
|