@lwrjs/core 0.13.0-alpha.3 → 0.13.0-alpha.30
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/context/provider.cjs +1 -1
- package/build/cjs/index.cjs +1 -1
- package/build/cjs/info/route-handler.cjs +19 -2
- package/build/cjs/middleware/hmr-middleware.cjs +1 -0
- package/build/cjs/middleware/request-processor-middleware.cjs +6 -4
- package/build/cjs/middleware/resource-middleware.cjs +1 -1
- package/build/cjs/tools/static-generation.cjs +15 -9
- package/build/cjs/tools/utils/network-dispatcher.cjs +1 -1
- package/build/es/context/provider.js +1 -1
- package/build/es/index.js +2 -2
- package/build/es/info/route-handler.js +19 -2
- package/build/es/middleware/hmr-middleware.js +1 -0
- package/build/es/middleware/request-processor-middleware.js +8 -5
- package/build/es/middleware/resource-middleware.js +1 -1
- package/build/es/tools/static-generation.js +15 -11
- package/build/es/tools/utils/network-dispatcher.js +2 -2
- package/package.json +34 -34
|
@@ -55,7 +55,7 @@ function createProviderContext(serverContext) {
|
|
|
55
55
|
notifyViewSourceChanged,
|
|
56
56
|
notifyAssetSourceChanged
|
|
57
57
|
} = serverContext.appEmitter;
|
|
58
|
-
const siteMetadata = staticSiteGenerator.outputDir && import_fs.default.existsSync(staticSiteGenerator.outputDir) ? new import_site_metadata.SiteMetadataImpl({rootDir: staticSiteGenerator.outputDir}) : void 0;
|
|
58
|
+
const siteMetadata = staticSiteGenerator.outputDir && import_fs.default.existsSync(staticSiteGenerator.outputDir) ? new import_site_metadata.SiteMetadataImpl({rootDir: staticSiteGenerator.outputDir, i18n}) : void 0;
|
|
59
59
|
return {
|
|
60
60
|
appObserver: (0, import_shared_utils.deepFreeze)({onModuleDefinitionChange, onModuleSourceChange}),
|
|
61
61
|
appEmitter: {
|
package/build/cjs/index.cjs
CHANGED
|
@@ -204,7 +204,7 @@ function overrideConfigAsSrc(lwrApp) {
|
|
|
204
204
|
const routes = normalizedConfig.routes || [];
|
|
205
205
|
for (const route of routes) {
|
|
206
206
|
route.bootstrap = {
|
|
207
|
-
...
|
|
207
|
+
...import_config.DEFAULT_LWR_BOOTSTRAP_CONFIG,
|
|
208
208
|
...route.bootstrap,
|
|
209
209
|
configAsSrc: true
|
|
210
210
|
};
|
|
@@ -99,6 +99,7 @@ var baseHtml = `<!DOCTYPE html>
|
|
|
99
99
|
<h1>Site Information</h1>
|
|
100
100
|
<h2>Environment</h2>
|
|
101
101
|
{{ versionInfo }}
|
|
102
|
+
{{ mrtInfo }}
|
|
102
103
|
<h2>Metadata</h2>
|
|
103
104
|
{{ metadata }}
|
|
104
105
|
</div>
|
|
@@ -114,12 +115,27 @@ async function siteInfoHandler(_request, context) {
|
|
|
114
115
|
};
|
|
115
116
|
let versionInfoString = "<ul>";
|
|
116
117
|
for (const key in versionInfo) {
|
|
117
|
-
if (versionInfo[key] !== "
|
|
118
|
+
if (versionInfo[key] !== "not-provided") {
|
|
118
119
|
versionInfoString += `<li><span class="key">${key}:</span><span class="val">${versionInfo[key]}</span></li>
|
|
119
120
|
`;
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
versionInfoString += "</ul>";
|
|
124
|
+
let mrtInfoString = "";
|
|
125
|
+
if (process.env.MRT_ORGANIZATION_SLUG || process.env.MOBIFY_PROPERTY_ID || process.env.DEPLOY_TARGET) {
|
|
126
|
+
const mrtInfo = {
|
|
127
|
+
"MRT Tenant": process.env.MRT_ORGANIZATION_SLUG,
|
|
128
|
+
"MRT Project Id": process.env.MOBIFY_PROPERTY_ID,
|
|
129
|
+
"MRT Environment": process.env.DEPLOY_TARGET,
|
|
130
|
+
"MRT Bundle Id": process.env.BUNDLE_ID
|
|
131
|
+
};
|
|
132
|
+
mrtInfoString = "<ul>";
|
|
133
|
+
for (const key in mrtInfo) {
|
|
134
|
+
mrtInfoString += `<li><span class="key">${key}:</span><span class="val">${mrtInfo[key]}</span></li>
|
|
135
|
+
`;
|
|
136
|
+
}
|
|
137
|
+
mrtInfoString += "</ul>";
|
|
138
|
+
}
|
|
123
139
|
const providedMetadataPath = `${context.rootDir}/site/.metadata/runtime-info.json`;
|
|
124
140
|
let providedMetadata = {};
|
|
125
141
|
if (import_fs.default.existsSync(providedMetadataPath)) {
|
|
@@ -127,7 +143,7 @@ async function siteInfoHandler(_request, context) {
|
|
|
127
143
|
}
|
|
128
144
|
let providedInfoString = "<ul>";
|
|
129
145
|
for (const key in providedMetadata) {
|
|
130
|
-
if (providedMetadata[key] !== "
|
|
146
|
+
if (providedMetadata[key] !== "not-provided") {
|
|
131
147
|
const value = typeof providedMetadata[key] === "object" ? `<div class="data-container val">${JSON.stringify(providedMetadata[key], null, 2)}</div>` : `<span class="val">${providedMetadata[key]}</span>`;
|
|
132
148
|
providedInfoString += `<li><span class="key">${key}:</span>${value}</li>
|
|
133
149
|
`;
|
|
@@ -136,6 +152,7 @@ async function siteInfoHandler(_request, context) {
|
|
|
136
152
|
providedInfoString += "</ul>";
|
|
137
153
|
let infoHtml = baseHtml;
|
|
138
154
|
infoHtml = infoHtml.replace("{{ versionInfo }}", versionInfoString);
|
|
155
|
+
infoHtml = infoHtml.replace("{{ mrtInfo }}", mrtInfoString);
|
|
139
156
|
infoHtml = infoHtml.replace("{{ metadata }}", providedInfoString);
|
|
140
157
|
return {
|
|
141
158
|
body: infoHtml,
|
|
@@ -50,10 +50,12 @@ function requestProcessorMiddleware(app, context) {
|
|
|
50
50
|
const host = req.headers["host"];
|
|
51
51
|
const forwardedProto = req.headers["x-forwarded-proto"];
|
|
52
52
|
const protocol = req.protocol;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
if ((0, import_shared_utils.isLambdaEnv)()) {
|
|
54
|
+
import_diagnostics.logger.info({
|
|
55
|
+
label: `request-processor-middleware`,
|
|
56
|
+
message: `Original Url: ${req.originalUrl}, Forwarded: ${forwarded}, X-Forwarded-Proto: ${forwardedProto}, Host: ${host}, Protocol: ${protocol}, ${MRT_REQUEST_CLASS}: ${requestClass}, ${import_shared_utils.REQUEST_DEPTH_HEADER}: ${requestDepth}`
|
|
57
|
+
});
|
|
58
|
+
}
|
|
57
59
|
}
|
|
58
60
|
if (requestDepth && requestDepth > 0) {
|
|
59
61
|
import_diagnostics.logger.error({
|
|
@@ -51,7 +51,7 @@ function createResourceMiddleware(context) {
|
|
|
51
51
|
res.status(200).type(resource.type).stream(resource.stream());
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
res.status(404).send(import_diagnostics.descriptions.UNRESOLVABLE.RESOURCE(resourceId.specifier).message);
|
|
54
|
+
res.status(404).send(import_diagnostics.descriptions.UNRESOLVABLE.RESOURCE(resourceId.specifier, resourceId.version).message);
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
function resourceMiddleware(app, context) {
|
|
@@ -232,16 +232,21 @@ var SiteGenerator = class {
|
|
|
232
232
|
addBundleToSiteMetadata(bundleDefinition, url, siteConfig) {
|
|
233
233
|
if (siteConfig.siteMetadata) {
|
|
234
234
|
const locale = siteConfig.locale;
|
|
235
|
-
const specifier =
|
|
236
|
-
const imports = bundleDefinition.bundleRecord.imports?.map((moduleRef) => (0,
|
|
237
|
-
const dynamicImports = bundleDefinition.bundleRecord.dynamicImports?.map((moduleRef) => (0,
|
|
235
|
+
const specifier = (0, import_site_metadata.getSiteBundleId)(bundleDefinition, locale, siteConfig.i18n);
|
|
236
|
+
const imports = bundleDefinition.bundleRecord.imports?.map((moduleRef) => (0, import_site_metadata.getSiteBundleId)(moduleRef, locale, siteConfig.i18n)) || [];
|
|
237
|
+
const dynamicImports = bundleDefinition.bundleRecord.dynamicImports?.map((moduleRef) => (0, import_site_metadata.getSiteBundleId)(moduleRef, locale, siteConfig.i18n));
|
|
238
|
+
const includedModules = bundleDefinition.bundleRecord.includedModules?.map((moduleRef) => {
|
|
239
|
+
const moduleId = (0, import_shared_utils.explodeSpecifier)(moduleRef);
|
|
240
|
+
return (0, import_site_metadata.getSiteBundleId)(moduleId, locale, siteConfig.i18n);
|
|
241
|
+
}) || [];
|
|
238
242
|
const version = bundleDefinition.version === import_shared_utils.VERSION_NOT_PROVIDED ? void 0 : bundleDefinition.version;
|
|
239
243
|
const bundleMetadata = {
|
|
240
244
|
version,
|
|
241
245
|
path: decodeURIComponent(url),
|
|
242
|
-
includedModules
|
|
246
|
+
includedModules,
|
|
243
247
|
imports,
|
|
244
|
-
dynamicImports
|
|
248
|
+
dynamicImports,
|
|
249
|
+
integrity: bundleDefinition.integrity
|
|
245
250
|
};
|
|
246
251
|
const siteBundles = siteConfig.siteMetadata.getSiteBundles().bundles;
|
|
247
252
|
siteBundles[specifier] = bundleMetadata;
|
|
@@ -256,14 +261,15 @@ var SiteGenerator = class {
|
|
|
256
261
|
additionalInfo: resourceDefinition
|
|
257
262
|
});
|
|
258
263
|
} else {
|
|
259
|
-
const specifier = resourceDefinition.specifier;
|
|
260
264
|
const resourceMetadata = {
|
|
261
265
|
path: decodeURIComponent(url),
|
|
262
266
|
mimeType: resourceDefinition.type,
|
|
263
|
-
inline: resourceDefinition.inline
|
|
267
|
+
inline: resourceDefinition.inline,
|
|
268
|
+
version: resourceDefinition.version,
|
|
269
|
+
integrity: resourceDefinition.integrity
|
|
264
270
|
};
|
|
265
271
|
const siteResources = siteConfig.siteMetadata.getSiteResources();
|
|
266
|
-
siteResources.resources[
|
|
272
|
+
siteResources.resources[(0, import_site_metadata.getSiteResourceId)(resourceDefinition)] = resourceMetadata;
|
|
267
273
|
}
|
|
268
274
|
}
|
|
269
275
|
}
|
|
@@ -555,7 +561,7 @@ var SiteGenerator = class {
|
|
|
555
561
|
endpoints,
|
|
556
562
|
skipBaseDocumentGeneration,
|
|
557
563
|
...featureFlags,
|
|
558
|
-
siteMetadata: new import_site_metadata.SiteMetadataImpl({rootDir: outputDir}),
|
|
564
|
+
siteMetadata: new import_site_metadata.SiteMetadataImpl({rootDir: outputDir, i18n}),
|
|
559
565
|
i18n
|
|
560
566
|
};
|
|
561
567
|
}
|
|
@@ -79,7 +79,7 @@ var NetworkDispatcher = class {
|
|
|
79
79
|
const jsonResponse = JSON.parse(body);
|
|
80
80
|
resolve(jsonResponse);
|
|
81
81
|
} catch (err) {
|
|
82
|
-
const message =
|
|
82
|
+
const message = !(0, import_shared_utils.isLocalDev)() ? `unexpected response body: [${method}][${lang}] ${url}: '${body}'` : `unexpected response body: [${method}][${lang}] ${url}`;
|
|
83
83
|
if (import_diagnostics.logger.isDebugEnabled()) {
|
|
84
84
|
import_diagnostics.logger.warn({
|
|
85
85
|
label: `NetworkDispatcher`,
|
|
@@ -7,7 +7,7 @@ export function createProviderContext(serverContext) {
|
|
|
7
7
|
const { onModuleDefinitionChange, onModuleSourceChange } = serverContext.appObserver;
|
|
8
8
|
const { notifyModuleDefinitionChanged, notifyModuleSourceChanged, notifyViewSourceChanged, notifyAssetSourceChanged, } = serverContext.appEmitter;
|
|
9
9
|
const siteMetadata = staticSiteGenerator.outputDir && fs.existsSync(staticSiteGenerator.outputDir)
|
|
10
|
-
? new SiteMetadataImpl({ rootDir: staticSiteGenerator.outputDir })
|
|
10
|
+
? new SiteMetadataImpl({ rootDir: staticSiteGenerator.outputDir, i18n })
|
|
11
11
|
: undefined;
|
|
12
12
|
return {
|
|
13
13
|
appObserver: deepFreeze({ onModuleDefinitionChange, onModuleSourceChange }),
|
package/build/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getFeatureFlags
|
|
1
|
+
import { getFeatureFlags } from '@lwrjs/shared-utils';
|
|
2
2
|
import { createInternalServer } from '@lwrjs/server';
|
|
3
3
|
import { LwrServerError, createSingleDiagnosticError, descriptions, logger } from '@lwrjs/diagnostics';
|
|
4
|
-
import { loadConfig, executeConfigHooks, executeStartHooks, executeInstrumentationHooks, executeContextHooks, } from '@lwrjs/config';
|
|
4
|
+
import { DEFAULT_LWR_BOOTSTRAP_CONFIG, loadConfig, executeConfigHooks, executeStartHooks, executeInstrumentationHooks, executeContextHooks, } from '@lwrjs/config';
|
|
5
5
|
import { loadHooks, loadServices, loadRouteHandlers } from '@lwrjs/config/modules';
|
|
6
6
|
import SiteGenerator from './tools/static-generation.js';
|
|
7
7
|
import { warmupServer } from './tools/server-warmup.js';
|
|
@@ -71,6 +71,7 @@ const baseHtml = `<!DOCTYPE html>
|
|
|
71
71
|
<h1>Site Information</h1>
|
|
72
72
|
<h2>Environment</h2>
|
|
73
73
|
{{ versionInfo }}
|
|
74
|
+
{{ mrtInfo }}
|
|
74
75
|
<h2>Metadata</h2>
|
|
75
76
|
{{ metadata }}
|
|
76
77
|
</div>
|
|
@@ -86,11 +87,26 @@ export default async function siteInfoHandler(_request, context) {
|
|
|
86
87
|
};
|
|
87
88
|
let versionInfoString = '<ul>';
|
|
88
89
|
for (const key in versionInfo) {
|
|
89
|
-
if (versionInfo[key] !== '
|
|
90
|
+
if (versionInfo[key] !== 'not-provided') {
|
|
90
91
|
versionInfoString += `<li><span class="key">${key}:</span><span class="val">${versionInfo[key]}</span></li>\n`;
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
versionInfoString += '</ul>';
|
|
95
|
+
// If MRT add the support info
|
|
96
|
+
let mrtInfoString = '';
|
|
97
|
+
if (process.env.MRT_ORGANIZATION_SLUG || process.env.MOBIFY_PROPERTY_ID || process.env.DEPLOY_TARGET) {
|
|
98
|
+
const mrtInfo = {
|
|
99
|
+
'MRT Tenant': process.env.MRT_ORGANIZATION_SLUG,
|
|
100
|
+
'MRT Project Id': process.env.MOBIFY_PROPERTY_ID,
|
|
101
|
+
'MRT Environment': process.env.DEPLOY_TARGET,
|
|
102
|
+
'MRT Bundle Id': process.env.BUNDLE_ID,
|
|
103
|
+
};
|
|
104
|
+
mrtInfoString = '<ul>';
|
|
105
|
+
for (const key in mrtInfo) {
|
|
106
|
+
mrtInfoString += `<li><span class="key">${key}:</span><span class="val">${mrtInfo[key]}</span></li>\n`;
|
|
107
|
+
}
|
|
108
|
+
mrtInfoString += '</ul>';
|
|
109
|
+
}
|
|
94
110
|
// Get any provided metadata from site/.metadata/runtime-info.json
|
|
95
111
|
const providedMetadataPath = `${context.rootDir}/site/.metadata/runtime-info.json`;
|
|
96
112
|
let providedMetadata = {};
|
|
@@ -99,7 +115,7 @@ export default async function siteInfoHandler(_request, context) {
|
|
|
99
115
|
}
|
|
100
116
|
let providedInfoString = '<ul>';
|
|
101
117
|
for (const key in providedMetadata) {
|
|
102
|
-
if (providedMetadata[key] !== '
|
|
118
|
+
if (providedMetadata[key] !== 'not-provided') {
|
|
103
119
|
const value = typeof providedMetadata[key] === 'object'
|
|
104
120
|
? `<div class="data-container val">${JSON.stringify(providedMetadata[key], null, 2)}</div>`
|
|
105
121
|
: `<span class="val">${providedMetadata[key]}</span>`;
|
|
@@ -109,6 +125,7 @@ export default async function siteInfoHandler(_request, context) {
|
|
|
109
125
|
providedInfoString += '</ul>';
|
|
110
126
|
let infoHtml = baseHtml;
|
|
111
127
|
infoHtml = infoHtml.replace('{{ versionInfo }}', versionInfoString);
|
|
128
|
+
infoHtml = infoHtml.replace('{{ mrtInfo }}', mrtInfoString);
|
|
112
129
|
infoHtml = infoHtml.replace('{{ metadata }}', providedInfoString);
|
|
113
130
|
return {
|
|
114
131
|
body: infoHtml,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
9
|
import { logger } from '@lwrjs/diagnostics';
|
|
10
|
-
import { REQUEST_DEPTH_HEADER, parseRequestDepthHeader } from '@lwrjs/shared-utils';
|
|
10
|
+
import { REQUEST_DEPTH_HEADER, isLambdaEnv, parseRequestDepthHeader } from '@lwrjs/shared-utils';
|
|
11
11
|
const MRT_REQUEST_CLASS = 'X-Mobify-Request-Class';
|
|
12
12
|
const MRT_REQUEST_CLASS_KEY = MRT_REQUEST_CLASS.toLowerCase();
|
|
13
13
|
export function requestProcessorMiddleware(app, context) {
|
|
@@ -32,10 +32,13 @@ export function requestProcessorMiddleware(app, context) {
|
|
|
32
32
|
const host = req.headers['host'];
|
|
33
33
|
const forwardedProto = req.headers['x-forwarded-proto'];
|
|
34
34
|
const protocol = req.protocol;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
// Only Add this log when on MRT. Useful to catch issues where CDN did not send us the right info.
|
|
36
|
+
if (isLambdaEnv()) {
|
|
37
|
+
logger.info({
|
|
38
|
+
label: `request-processor-middleware`,
|
|
39
|
+
message: `Original Url: ${req.originalUrl}, Forwarded: ${forwarded}, X-Forwarded-Proto: ${forwardedProto}, Host: ${host}, Protocol: ${protocol}, ${MRT_REQUEST_CLASS}: ${requestClass}, ${REQUEST_DEPTH_HEADER}: ${requestDepth}`,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
39
42
|
}
|
|
40
43
|
// TODO Clean up once we have a long term solution
|
|
41
44
|
if (requestDepth && requestDepth > 0) {
|
|
@@ -23,7 +23,7 @@ function createResourceMiddleware(context) {
|
|
|
23
23
|
res.status(200).type(resource.type).stream(resource.stream());
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
res.status(404).send(descriptions.UNRESOLVABLE.RESOURCE(resourceId.specifier).message);
|
|
26
|
+
res.status(404).send(descriptions.UNRESOLVABLE.RESOURCE(resourceId.specifier, resourceId.version).message);
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
export function resourceMiddleware(app, context) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { performance } from 'perf_hooks';
|
|
2
2
|
import { logger } from '@lwrjs/diagnostics';
|
|
3
|
-
import { getSpecifier, getFeatureFlags, hashContent, isSelfUrl, getModuleUriPrefix, getMappingUriPrefix, isExternalUrl, mimeLookup, getViewUri, sortLocalesByFallback, VERSION_NOT_PROVIDED, PROTOCOL_FILE, normalizeFromFileURL, isExternalSpecifier, } from '@lwrjs/shared-utils';
|
|
4
|
-
import { SiteMetadataImpl } from '@lwrjs/static/site-metadata';
|
|
3
|
+
import { getSpecifier, getFeatureFlags, hashContent, isSelfUrl, getModuleUriPrefix, getMappingUriPrefix, isExternalUrl, mimeLookup, getViewUri, sortLocalesByFallback, VERSION_NOT_PROVIDED, PROTOCOL_FILE, normalizeFromFileURL, isExternalSpecifier, explodeSpecifier, } from '@lwrjs/shared-utils';
|
|
4
|
+
import { SiteMetadataImpl, getSiteBundleId, getSiteResourceId } from '@lwrjs/static/site-metadata';
|
|
5
5
|
import { join, dirname, extname, normalize } from 'path';
|
|
6
6
|
import fs from 'fs-extra';
|
|
7
7
|
import { writeResponse } from './utils/stream.js';
|
|
@@ -299,18 +299,21 @@ export default class SiteGenerator {
|
|
|
299
299
|
addBundleToSiteMetadata(bundleDefinition, url, siteConfig) {
|
|
300
300
|
if (siteConfig.siteMetadata) {
|
|
301
301
|
const locale = siteConfig.locale;
|
|
302
|
-
const specifier = siteConfig.i18n
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
|
|
302
|
+
const specifier = getSiteBundleId(bundleDefinition, locale, siteConfig.i18n);
|
|
303
|
+
const imports = bundleDefinition.bundleRecord.imports?.map((moduleRef) => getSiteBundleId(moduleRef, locale, siteConfig.i18n)) || [];
|
|
304
|
+
const dynamicImports = bundleDefinition.bundleRecord.dynamicImports?.map((moduleRef) => getSiteBundleId(moduleRef, locale, siteConfig.i18n));
|
|
305
|
+
const includedModules = bundleDefinition.bundleRecord.includedModules?.map((moduleRef) => {
|
|
306
|
+
const moduleId = explodeSpecifier(moduleRef);
|
|
307
|
+
return getSiteBundleId(moduleId, locale, siteConfig.i18n);
|
|
308
|
+
}) || [];
|
|
307
309
|
const version = bundleDefinition.version === VERSION_NOT_PROVIDED ? undefined : bundleDefinition.version;
|
|
308
310
|
const bundleMetadata = {
|
|
309
311
|
version,
|
|
310
312
|
path: decodeURIComponent(url),
|
|
311
|
-
includedModules
|
|
313
|
+
includedModules,
|
|
312
314
|
imports,
|
|
313
315
|
dynamicImports,
|
|
316
|
+
integrity: bundleDefinition.integrity,
|
|
314
317
|
};
|
|
315
318
|
const siteBundles = siteConfig.siteMetadata.getSiteBundles().bundles;
|
|
316
319
|
siteBundles[specifier] = bundleMetadata;
|
|
@@ -326,14 +329,15 @@ export default class SiteGenerator {
|
|
|
326
329
|
});
|
|
327
330
|
}
|
|
328
331
|
else {
|
|
329
|
-
const specifier = resourceDefinition.specifier;
|
|
330
332
|
const resourceMetadata = {
|
|
331
333
|
path: decodeURIComponent(url),
|
|
332
334
|
mimeType: resourceDefinition.type,
|
|
333
335
|
inline: resourceDefinition.inline,
|
|
336
|
+
version: resourceDefinition.version,
|
|
337
|
+
integrity: resourceDefinition.integrity,
|
|
334
338
|
};
|
|
335
339
|
const siteResources = siteConfig.siteMetadata.getSiteResources();
|
|
336
|
-
siteResources.resources[
|
|
340
|
+
siteResources.resources[getSiteResourceId(resourceDefinition)] = resourceMetadata;
|
|
337
341
|
}
|
|
338
342
|
}
|
|
339
343
|
}
|
|
@@ -738,7 +742,7 @@ export default class SiteGenerator {
|
|
|
738
742
|
skipBaseDocumentGeneration,
|
|
739
743
|
// Only include LEGACY_LOADER if true
|
|
740
744
|
...featureFlags,
|
|
741
|
-
siteMetadata: new SiteMetadataImpl({ rootDir: outputDir }),
|
|
745
|
+
siteMetadata: new SiteMetadataImpl({ rootDir: outputDir, i18n }),
|
|
742
746
|
i18n,
|
|
743
747
|
};
|
|
744
748
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import http from 'http';
|
|
2
2
|
import https from 'https';
|
|
3
3
|
import { logger } from '@lwrjs/diagnostics';
|
|
4
|
-
import { isModuleOrBundleUrl } from '@lwrjs/shared-utils';
|
|
4
|
+
import { isLocalDev, isModuleOrBundleUrl } from '@lwrjs/shared-utils';
|
|
5
5
|
export default class NetworkDispatcher {
|
|
6
6
|
constructor(port, internalRequestKey) {
|
|
7
7
|
this.port = port || 3000;
|
|
@@ -53,7 +53,7 @@ export default class NetworkDispatcher {
|
|
|
53
53
|
resolve(jsonResponse);
|
|
54
54
|
}
|
|
55
55
|
catch (err) {
|
|
56
|
-
const message =
|
|
56
|
+
const message = !isLocalDev() // avoid giant log messages during local dev
|
|
57
57
|
? `unexpected response body: [${method}][${lang}] ${url}: '${body}'`
|
|
58
58
|
: `unexpected response body: [${method}][${lang}] ${url}`;
|
|
59
59
|
if (logger.isDebugEnabled()) {
|
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.30",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -43,44 +43,44 @@
|
|
|
43
43
|
"build": "tsc -b"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@lwrjs/app-service": "0.13.0-alpha.
|
|
47
|
-
"@lwrjs/asset-registry": "0.13.0-alpha.
|
|
48
|
-
"@lwrjs/asset-transformer": "0.13.0-alpha.
|
|
49
|
-
"@lwrjs/base-view-provider": "0.13.0-alpha.
|
|
50
|
-
"@lwrjs/base-view-transformer": "0.13.0-alpha.
|
|
51
|
-
"@lwrjs/client-modules": "0.13.0-alpha.
|
|
52
|
-
"@lwrjs/config": "0.13.0-alpha.
|
|
53
|
-
"@lwrjs/diagnostics": "0.13.0-alpha.
|
|
54
|
-
"@lwrjs/esbuild": "0.13.0-alpha.
|
|
55
|
-
"@lwrjs/fs-asset-provider": "0.13.0-alpha.
|
|
56
|
-
"@lwrjs/fs-watch": "0.13.0-alpha.
|
|
57
|
-
"@lwrjs/html-view-provider": "0.13.0-alpha.
|
|
58
|
-
"@lwrjs/instrumentation": "0.13.0-alpha.
|
|
59
|
-
"@lwrjs/loader": "0.13.0-alpha.
|
|
60
|
-
"@lwrjs/lwc-module-provider": "0.13.0-alpha.
|
|
61
|
-
"@lwrjs/lwc-ssr": "0.13.0-alpha.
|
|
62
|
-
"@lwrjs/markdown-view-provider": "0.13.0-alpha.
|
|
63
|
-
"@lwrjs/module-bundler": "0.13.0-alpha.
|
|
64
|
-
"@lwrjs/module-registry": "0.13.0-alpha.
|
|
65
|
-
"@lwrjs/npm-module-provider": "0.13.0-alpha.
|
|
66
|
-
"@lwrjs/nunjucks-view-provider": "0.13.0-alpha.
|
|
67
|
-
"@lwrjs/o11y": "0.13.0-alpha.
|
|
68
|
-
"@lwrjs/resource-registry": "0.13.0-alpha.
|
|
69
|
-
"@lwrjs/router": "0.13.0-alpha.
|
|
70
|
-
"@lwrjs/server": "0.13.0-alpha.
|
|
71
|
-
"@lwrjs/shared-utils": "0.13.0-alpha.
|
|
72
|
-
"@lwrjs/static": "0.13.0-alpha.
|
|
73
|
-
"@lwrjs/view-registry": "0.13.0-alpha.
|
|
46
|
+
"@lwrjs/app-service": "0.13.0-alpha.30",
|
|
47
|
+
"@lwrjs/asset-registry": "0.13.0-alpha.30",
|
|
48
|
+
"@lwrjs/asset-transformer": "0.13.0-alpha.30",
|
|
49
|
+
"@lwrjs/base-view-provider": "0.13.0-alpha.30",
|
|
50
|
+
"@lwrjs/base-view-transformer": "0.13.0-alpha.30",
|
|
51
|
+
"@lwrjs/client-modules": "0.13.0-alpha.30",
|
|
52
|
+
"@lwrjs/config": "0.13.0-alpha.30",
|
|
53
|
+
"@lwrjs/diagnostics": "0.13.0-alpha.30",
|
|
54
|
+
"@lwrjs/esbuild": "0.13.0-alpha.30",
|
|
55
|
+
"@lwrjs/fs-asset-provider": "0.13.0-alpha.30",
|
|
56
|
+
"@lwrjs/fs-watch": "0.13.0-alpha.30",
|
|
57
|
+
"@lwrjs/html-view-provider": "0.13.0-alpha.30",
|
|
58
|
+
"@lwrjs/instrumentation": "0.13.0-alpha.30",
|
|
59
|
+
"@lwrjs/loader": "0.13.0-alpha.30",
|
|
60
|
+
"@lwrjs/lwc-module-provider": "0.13.0-alpha.30",
|
|
61
|
+
"@lwrjs/lwc-ssr": "0.13.0-alpha.30",
|
|
62
|
+
"@lwrjs/markdown-view-provider": "0.13.0-alpha.30",
|
|
63
|
+
"@lwrjs/module-bundler": "0.13.0-alpha.30",
|
|
64
|
+
"@lwrjs/module-registry": "0.13.0-alpha.30",
|
|
65
|
+
"@lwrjs/npm-module-provider": "0.13.0-alpha.30",
|
|
66
|
+
"@lwrjs/nunjucks-view-provider": "0.13.0-alpha.30",
|
|
67
|
+
"@lwrjs/o11y": "0.13.0-alpha.30",
|
|
68
|
+
"@lwrjs/resource-registry": "0.13.0-alpha.30",
|
|
69
|
+
"@lwrjs/router": "0.13.0-alpha.30",
|
|
70
|
+
"@lwrjs/server": "0.13.0-alpha.30",
|
|
71
|
+
"@lwrjs/shared-utils": "0.13.0-alpha.30",
|
|
72
|
+
"@lwrjs/static": "0.13.0-alpha.30",
|
|
73
|
+
"@lwrjs/view-registry": "0.13.0-alpha.30",
|
|
74
74
|
"chokidar": "^3.6.0",
|
|
75
75
|
"esbuild": "^0.9.7",
|
|
76
76
|
"fs-extra": "^11.2.0",
|
|
77
|
-
"path-to-regexp": "^6.2.
|
|
78
|
-
"qs": "^6.12.
|
|
77
|
+
"path-to-regexp": "^6.2.2",
|
|
78
|
+
"qs": "^6.12.3",
|
|
79
79
|
"rollup": "^2.78.0",
|
|
80
|
-
"ws": "^8.
|
|
80
|
+
"ws": "^8.18.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@lwrjs/types": "0.13.0-alpha.
|
|
83
|
+
"@lwrjs/types": "0.13.0-alpha.30",
|
|
84
84
|
"@types/ws": "^8.5.10",
|
|
85
85
|
"mock-fs": "^5.2.0"
|
|
86
86
|
},
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"volta": {
|
|
94
94
|
"extends": "../../../package.json"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "8bf14ed00a95675fdb506e2cbdb6033324bf95bf"
|
|
97
97
|
}
|