@lwrjs/core 0.15.0-alpha.11 → 0.15.0-alpha.13
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.
|
@@ -61,7 +61,8 @@ function createViewMiddleware(route, errorRoutes, context, viewHandler) {
|
|
|
61
61
|
...defaultRuntimeParams,
|
|
62
62
|
url: viewRequest.url,
|
|
63
63
|
params: viewRequest.params,
|
|
64
|
-
query: viewRequest.query
|
|
64
|
+
query: viewRequest.query,
|
|
65
|
+
cookie: req.headers?.cookie
|
|
65
66
|
};
|
|
66
67
|
const resolve = req.isJsonRequest() ? viewHandler.getViewJson : viewHandler.getViewContent;
|
|
67
68
|
let viewResponse;
|
|
@@ -114,7 +115,12 @@ function createViewMiddleware(route, errorRoutes, context, viewHandler) {
|
|
|
114
115
|
if (traceId?.length) {
|
|
115
116
|
res.setHeader("x-trace-id", traceId);
|
|
116
117
|
}
|
|
117
|
-
|
|
118
|
+
let status;
|
|
119
|
+
if (viewResponse.status === 301 || viewResponse.status === 302) {
|
|
120
|
+
status = viewResponse.status;
|
|
121
|
+
} else {
|
|
122
|
+
status = resolvedRoute.status || viewResponse.status || 200;
|
|
123
|
+
}
|
|
118
124
|
res.status(status);
|
|
119
125
|
res.send(viewResponse.body);
|
|
120
126
|
};
|
|
@@ -232,12 +232,12 @@ var SiteGenerator = class {
|
|
|
232
232
|
addBundleToSiteMetadata(bundleDefinition, url, siteConfig) {
|
|
233
233
|
if (siteConfig.siteMetadata) {
|
|
234
234
|
const locale = siteConfig.locale;
|
|
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));
|
|
235
|
+
const specifier = (0, import_site_metadata.getSiteBundleId)(bundleDefinition, locale, false, siteConfig.i18n);
|
|
236
|
+
const imports = bundleDefinition.bundleRecord.imports?.map((moduleRef) => (0, import_site_metadata.getSiteBundleId)(moduleRef, locale, false, siteConfig.i18n)) || [];
|
|
237
|
+
const dynamicImports = bundleDefinition.bundleRecord.dynamicImports?.map((moduleRef) => (0, import_site_metadata.getSiteBundleId)(moduleRef, locale, false, siteConfig.i18n));
|
|
238
238
|
const includedModules = bundleDefinition.bundleRecord.includedModules?.map((moduleRef) => {
|
|
239
239
|
const moduleId = (0, import_shared_utils.explodeSpecifier)(moduleRef);
|
|
240
|
-
return (0, import_site_metadata.getSiteBundleId)(moduleId, locale, siteConfig.i18n);
|
|
240
|
+
return (0, import_site_metadata.getSiteBundleId)(moduleId, locale, false, siteConfig.i18n);
|
|
241
241
|
}) || [];
|
|
242
242
|
const version = bundleDefinition.version === import_shared_utils.VERSION_NOT_PROVIDED ? void 0 : bundleDefinition.version;
|
|
243
243
|
const bundleMetadata = {
|
|
@@ -36,6 +36,7 @@ function createViewMiddleware(route, errorRoutes, context, viewHandler) {
|
|
|
36
36
|
url: viewRequest.url,
|
|
37
37
|
params: viewRequest.params,
|
|
38
38
|
query: viewRequest.query,
|
|
39
|
+
cookie: req.headers?.cookie,
|
|
39
40
|
};
|
|
40
41
|
const resolve = req.isJsonRequest() ? viewHandler.getViewJson : viewHandler.getViewContent;
|
|
41
42
|
let viewResponse;
|
|
@@ -93,7 +94,13 @@ function createViewMiddleware(route, errorRoutes, context, viewHandler) {
|
|
|
93
94
|
if (traceId?.length) {
|
|
94
95
|
res.setHeader('x-trace-id', traceId);
|
|
95
96
|
}
|
|
96
|
-
|
|
97
|
+
let status;
|
|
98
|
+
if (viewResponse.status === 301 || viewResponse.status === 302) {
|
|
99
|
+
status = viewResponse.status;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
status = resolvedRoute.status || viewResponse.status || 200;
|
|
103
|
+
}
|
|
97
104
|
res.status(status);
|
|
98
105
|
res.send(viewResponse.body);
|
|
99
106
|
};
|
|
@@ -299,12 +299,12 @@ export default class SiteGenerator {
|
|
|
299
299
|
addBundleToSiteMetadata(bundleDefinition, url, siteConfig) {
|
|
300
300
|
if (siteConfig.siteMetadata) {
|
|
301
301
|
const locale = siteConfig.locale;
|
|
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));
|
|
302
|
+
const specifier = getSiteBundleId(bundleDefinition, locale, false, siteConfig.i18n);
|
|
303
|
+
const imports = bundleDefinition.bundleRecord.imports?.map((moduleRef) => getSiteBundleId(moduleRef, locale, false, siteConfig.i18n)) || [];
|
|
304
|
+
const dynamicImports = bundleDefinition.bundleRecord.dynamicImports?.map((moduleRef) => getSiteBundleId(moduleRef, locale, false, siteConfig.i18n));
|
|
305
305
|
const includedModules = bundleDefinition.bundleRecord.includedModules?.map((moduleRef) => {
|
|
306
306
|
const moduleId = explodeSpecifier(moduleRef);
|
|
307
|
-
return getSiteBundleId(moduleId, locale, siteConfig.i18n);
|
|
307
|
+
return getSiteBundleId(moduleId, locale, false, siteConfig.i18n);
|
|
308
308
|
}) || [];
|
|
309
309
|
const version = bundleDefinition.version === VERSION_NOT_PROVIDED ? undefined : bundleDefinition.version;
|
|
310
310
|
const bundleMetadata = {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.15.0-alpha.
|
|
7
|
+
"version": "0.15.0-alpha.13",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -43,34 +43,34 @@
|
|
|
43
43
|
"build": "tsc -b"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@lwrjs/app-service": "0.15.0-alpha.
|
|
47
|
-
"@lwrjs/asset-registry": "0.15.0-alpha.
|
|
48
|
-
"@lwrjs/asset-transformer": "0.15.0-alpha.
|
|
49
|
-
"@lwrjs/base-view-provider": "0.15.0-alpha.
|
|
50
|
-
"@lwrjs/base-view-transformer": "0.15.0-alpha.
|
|
51
|
-
"@lwrjs/client-modules": "0.15.0-alpha.
|
|
52
|
-
"@lwrjs/config": "0.15.0-alpha.
|
|
53
|
-
"@lwrjs/diagnostics": "0.15.0-alpha.
|
|
54
|
-
"@lwrjs/esbuild": "0.15.0-alpha.
|
|
55
|
-
"@lwrjs/fs-asset-provider": "0.15.0-alpha.
|
|
56
|
-
"@lwrjs/fs-watch": "0.15.0-alpha.
|
|
57
|
-
"@lwrjs/html-view-provider": "0.15.0-alpha.
|
|
58
|
-
"@lwrjs/instrumentation": "0.15.0-alpha.
|
|
59
|
-
"@lwrjs/loader": "0.15.0-alpha.
|
|
60
|
-
"@lwrjs/lwc-module-provider": "0.15.0-alpha.
|
|
61
|
-
"@lwrjs/lwc-ssr": "0.15.0-alpha.
|
|
62
|
-
"@lwrjs/markdown-view-provider": "0.15.0-alpha.
|
|
63
|
-
"@lwrjs/module-bundler": "0.15.0-alpha.
|
|
64
|
-
"@lwrjs/module-registry": "0.15.0-alpha.
|
|
65
|
-
"@lwrjs/npm-module-provider": "0.15.0-alpha.
|
|
66
|
-
"@lwrjs/nunjucks-view-provider": "0.15.0-alpha.
|
|
67
|
-
"@lwrjs/o11y": "0.15.0-alpha.
|
|
68
|
-
"@lwrjs/resource-registry": "0.15.0-alpha.
|
|
69
|
-
"@lwrjs/router": "0.15.0-alpha.
|
|
70
|
-
"@lwrjs/server": "0.15.0-alpha.
|
|
71
|
-
"@lwrjs/shared-utils": "0.15.0-alpha.
|
|
72
|
-
"@lwrjs/static": "0.15.0-alpha.
|
|
73
|
-
"@lwrjs/view-registry": "0.15.0-alpha.
|
|
46
|
+
"@lwrjs/app-service": "0.15.0-alpha.13",
|
|
47
|
+
"@lwrjs/asset-registry": "0.15.0-alpha.13",
|
|
48
|
+
"@lwrjs/asset-transformer": "0.15.0-alpha.13",
|
|
49
|
+
"@lwrjs/base-view-provider": "0.15.0-alpha.13",
|
|
50
|
+
"@lwrjs/base-view-transformer": "0.15.0-alpha.13",
|
|
51
|
+
"@lwrjs/client-modules": "0.15.0-alpha.13",
|
|
52
|
+
"@lwrjs/config": "0.15.0-alpha.13",
|
|
53
|
+
"@lwrjs/diagnostics": "0.15.0-alpha.13",
|
|
54
|
+
"@lwrjs/esbuild": "0.15.0-alpha.13",
|
|
55
|
+
"@lwrjs/fs-asset-provider": "0.15.0-alpha.13",
|
|
56
|
+
"@lwrjs/fs-watch": "0.15.0-alpha.13",
|
|
57
|
+
"@lwrjs/html-view-provider": "0.15.0-alpha.13",
|
|
58
|
+
"@lwrjs/instrumentation": "0.15.0-alpha.13",
|
|
59
|
+
"@lwrjs/loader": "0.15.0-alpha.13",
|
|
60
|
+
"@lwrjs/lwc-module-provider": "0.15.0-alpha.13",
|
|
61
|
+
"@lwrjs/lwc-ssr": "0.15.0-alpha.13",
|
|
62
|
+
"@lwrjs/markdown-view-provider": "0.15.0-alpha.13",
|
|
63
|
+
"@lwrjs/module-bundler": "0.15.0-alpha.13",
|
|
64
|
+
"@lwrjs/module-registry": "0.15.0-alpha.13",
|
|
65
|
+
"@lwrjs/npm-module-provider": "0.15.0-alpha.13",
|
|
66
|
+
"@lwrjs/nunjucks-view-provider": "0.15.0-alpha.13",
|
|
67
|
+
"@lwrjs/o11y": "0.15.0-alpha.13",
|
|
68
|
+
"@lwrjs/resource-registry": "0.15.0-alpha.13",
|
|
69
|
+
"@lwrjs/router": "0.15.0-alpha.13",
|
|
70
|
+
"@lwrjs/server": "0.15.0-alpha.13",
|
|
71
|
+
"@lwrjs/shared-utils": "0.15.0-alpha.13",
|
|
72
|
+
"@lwrjs/static": "0.15.0-alpha.13",
|
|
73
|
+
"@lwrjs/view-registry": "0.15.0-alpha.13",
|
|
74
74
|
"chokidar": "^3.6.0",
|
|
75
75
|
"esbuild": "^0.9.7",
|
|
76
76
|
"fs-extra": "^11.2.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"ws": "^8.18.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@lwrjs/types": "0.15.0-alpha.
|
|
83
|
+
"@lwrjs/types": "0.15.0-alpha.13",
|
|
84
84
|
"@types/ws": "^8.5.12",
|
|
85
85
|
"memfs": "^4.9.3"
|
|
86
86
|
},
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"volta": {
|
|
94
94
|
"extends": "../../../package.json"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "687327a328b33a1abc3ac45e1406d72ebe7d37b4"
|
|
97
97
|
}
|