@lwrjs/core 0.17.2-alpha.2 → 0.17.2-alpha.4
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/middleware/bundle-middleware.cjs +4 -4
- package/build/cjs/middleware/mapping-middleware.cjs +1 -1
- package/build/cjs/middleware/module-middleware.cjs +3 -3
- package/build/cjs/middleware/resource-middleware.cjs +1 -1
- package/build/cjs/middleware/utils/error-handling.cjs +16 -8
- package/build/cjs/middleware/utils/identity.cjs +3 -3
- package/build/cjs/middleware/view-middleware.cjs +4 -4
- package/build/es/middleware/bundle-middleware.js +4 -4
- package/build/es/middleware/mapping-middleware.js +1 -1
- package/build/es/middleware/module-middleware.js +3 -3
- package/build/es/middleware/resource-middleware.js +1 -1
- package/build/es/middleware/utils/error-handling.d.ts +1 -1
- package/build/es/middleware/utils/error-handling.js +26 -10
- package/build/es/middleware/utils/identity.js +4 -4
- package/build/es/middleware/view-middleware.js +6 -4
- package/package.json +31 -31
|
@@ -45,17 +45,17 @@ function createBundleMiddleware(context) {
|
|
|
45
45
|
return async (req, res) => {
|
|
46
46
|
if (!req.validateEnvironmentRequest(appConfig)) {
|
|
47
47
|
res.status(400);
|
|
48
|
-
res.send(import_diagnostics.descriptions.
|
|
48
|
+
res.send(import_diagnostics.descriptions.INVALID.INVALID_ENVIRONMENT(req.params.environment));
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
if (!req.validateJsonRequest()) {
|
|
52
52
|
res.status(400);
|
|
53
|
-
res.send(import_diagnostics.descriptions.
|
|
53
|
+
res.send(import_diagnostics.descriptions.INVALID.INVALID_JSON());
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
if (!req.validateApiVersion(appConfig)) {
|
|
57
57
|
res.status(400);
|
|
58
|
-
res.send(import_diagnostics.descriptions.
|
|
58
|
+
res.send(import_diagnostics.descriptions.INVALID.INVALID_API_VERSION(req.params.apiVersion, appConfig.apiVersion));
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
const {runtimeEnvironment, runtimeParams} = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
@@ -92,7 +92,7 @@ function createSourceMapMiddleware(context) {
|
|
|
92
92
|
return async (req, res) => {
|
|
93
93
|
if (!req.validateEnvironmentRequest(appConfig)) {
|
|
94
94
|
res.status(400);
|
|
95
|
-
res.send(import_diagnostics.descriptions.
|
|
95
|
+
res.send(import_diagnostics.descriptions.INVALID.INVALID_ENVIRONMENT(req.params.environment));
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
const {runtimeEnvironment} = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
@@ -41,7 +41,7 @@ function createMappingMiddleware(context) {
|
|
|
41
41
|
return async (req, res) => {
|
|
42
42
|
if (!req.validateEnvironmentRequest(appConfig)) {
|
|
43
43
|
res.status(400);
|
|
44
|
-
res.send(import_diagnostics.descriptions.
|
|
44
|
+
res.send(import_diagnostics.descriptions.INVALID.INVALID_ENVIRONMENT(req.params.environment));
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
const {runtimeEnvironment, runtimeParams} = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
@@ -39,17 +39,17 @@ function createModuleMiddleware(context) {
|
|
|
39
39
|
return async (req, res) => {
|
|
40
40
|
if (!req.validateEnvironmentRequest(appConfig)) {
|
|
41
41
|
res.status(400);
|
|
42
|
-
res.send(import_diagnostics.descriptions.
|
|
42
|
+
res.send(import_diagnostics.descriptions.INVALID.INVALID_ENVIRONMENT(req.params.environment));
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
if (!req.validateJsonRequest()) {
|
|
46
46
|
res.status(400);
|
|
47
|
-
res.send(import_diagnostics.descriptions.
|
|
47
|
+
res.send(import_diagnostics.descriptions.INVALID.INVALID_JSON());
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
if (!req.validateApiVersion(appConfig)) {
|
|
51
51
|
res.status(400);
|
|
52
|
-
res.send(import_diagnostics.descriptions.
|
|
52
|
+
res.send(import_diagnostics.descriptions.INVALID.INVALID_API_VERSION(req.params.apiVersion, appConfig.apiVersion));
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
const {runtimeEnvironment, runtimeParams} = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
@@ -33,7 +33,7 @@ function createResourceMiddleware(context) {
|
|
|
33
33
|
const {appConfig, resourceRegistry, runtimeEnvironment: defaultRuntimeEnvironment} = context;
|
|
34
34
|
return async (req, res) => {
|
|
35
35
|
if (!req.validateEnvironmentRequest(appConfig)) {
|
|
36
|
-
res.status(400).send(import_diagnostics.descriptions.
|
|
36
|
+
res.status(400).send(import_diagnostics.descriptions.INVALID.INVALID_ENVIRONMENT(req.params.environment));
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
const {runtimeEnvironment, runtimeParams} = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
@@ -28,16 +28,24 @@ __export(exports, {
|
|
|
28
28
|
});
|
|
29
29
|
var import_diagnostics = __toModule(require("@lwrjs/diagnostics"));
|
|
30
30
|
var import_diagnostics2 = __toModule(require("@lwrjs/diagnostics"));
|
|
31
|
-
function createReturnStatus(error, url) {
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
function createReturnStatus(error, url, debug) {
|
|
32
|
+
let message = error.message, status = 500;
|
|
33
|
+
if (error instanceof import_diagnostics.LwrInvalidError) {
|
|
34
|
+
status = 400;
|
|
35
|
+
} else if (error instanceof import_diagnostics.LwrUnresolvableError) {
|
|
36
|
+
status = 404;
|
|
37
|
+
} else {
|
|
38
|
+
message = error instanceof import_diagnostics.LwrError ? message : `${import_diagnostics.descriptions.SERVER.SERVER_ERROR(url)}: ${error.message}`;
|
|
34
39
|
}
|
|
35
|
-
if (
|
|
36
|
-
return {
|
|
40
|
+
if (debug) {
|
|
41
|
+
return {
|
|
42
|
+
status,
|
|
43
|
+
message: `<div style="font-family:sans-serif;margin:50px;"><h1>${status}: Document generation failed</h1><p>${message.replace(/</g, "<").replace(/>/g, ">")}</p></div>`
|
|
44
|
+
};
|
|
37
45
|
}
|
|
38
|
-
return {status
|
|
46
|
+
return {status, message};
|
|
39
47
|
}
|
|
40
|
-
function handleErrors(middleware) {
|
|
48
|
+
function handleErrors(middleware, isBaseDoc = false) {
|
|
41
49
|
return async (req, res, next) => {
|
|
42
50
|
try {
|
|
43
51
|
await middleware(req, res, next);
|
|
@@ -49,7 +57,7 @@ function handleErrors(middleware) {
|
|
|
49
57
|
} else {
|
|
50
58
|
import_diagnostics2.logger.error(err);
|
|
51
59
|
}
|
|
52
|
-
const {status, message} = createReturnStatus(err, req.originalUrl);
|
|
60
|
+
const {status, message} = createReturnStatus(err, req.originalUrl, req.query.debug !== void 0 && isBaseDoc);
|
|
53
61
|
res.status(status);
|
|
54
62
|
res.send(message);
|
|
55
63
|
}
|
|
@@ -37,7 +37,7 @@ function validateSpecifier(specifer) {
|
|
|
37
37
|
function getModuleIdentity(req, importer) {
|
|
38
38
|
const {specifier, signature} = req.params;
|
|
39
39
|
if (validateSpecifier(specifier) === false) {
|
|
40
|
-
throw new import_diagnostics.
|
|
40
|
+
throw new import_diagnostics.LwrInvalidError(import_diagnostics.descriptions.INVALID.INVALID_SPECIFIER(specifier));
|
|
41
41
|
}
|
|
42
42
|
const moduleId = (0, import_shared_utils.explodeSpecifier)(specifier);
|
|
43
43
|
return {
|
|
@@ -61,7 +61,7 @@ function getMappingIdentity(req) {
|
|
|
61
61
|
function getResourceIdentity(req) {
|
|
62
62
|
const {specifier, signature = import_shared_utils.LATEST_SIGNATURE} = req.params;
|
|
63
63
|
if (validateSpecifier(specifier) === false) {
|
|
64
|
-
throw new import_diagnostics.
|
|
64
|
+
throw new import_diagnostics.LwrInvalidError(import_diagnostics.descriptions.INVALID.INVALID_SPECIFIER(specifier));
|
|
65
65
|
}
|
|
66
66
|
const resourceId = (0, import_shared_utils.explodeSpecifier)(specifier);
|
|
67
67
|
return {
|
|
@@ -73,7 +73,7 @@ function getAssetIdentity(req) {
|
|
|
73
73
|
const {signature, immutable, assetType: type} = req.params;
|
|
74
74
|
const specifier = type ? process.platform === "win32" ? req.params[0] : "/" + req.params[0] : req.originalUrl.split("?")[0];
|
|
75
75
|
if (validateSpecifier(specifier) === false) {
|
|
76
|
-
throw new import_diagnostics.
|
|
76
|
+
throw new import_diagnostics.LwrInvalidError(import_diagnostics.descriptions.INVALID.INVALID_SPECIFIER(specifier));
|
|
77
77
|
}
|
|
78
78
|
return {
|
|
79
79
|
immutable,
|
|
@@ -45,12 +45,12 @@ function createViewMiddleware(route, errorRoutes, context, viewHandler) {
|
|
|
45
45
|
return async (req, res) => {
|
|
46
46
|
if (!req.validateEnvironmentRequest(appConfig)) {
|
|
47
47
|
res.status(400);
|
|
48
|
-
res.send(import_diagnostics.descriptions.
|
|
48
|
+
res.send(import_diagnostics.descriptions.INVALID.INVALID_ENVIRONMENT(req.params.environment));
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
if (!req.validateJsonRequest()) {
|
|
52
52
|
res.status(400);
|
|
53
|
-
res.send(import_diagnostics.descriptions.
|
|
53
|
+
res.send(import_diagnostics.descriptions.INVALID.INVALID_JSON());
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
const {runtimeEnvironment, runtimeParams: defaultRuntimeParams} = req.getRuntimeContext(context.runtimeEnvironment);
|
|
@@ -96,7 +96,7 @@ function createViewMiddleware(route, errorRoutes, context, viewHandler) {
|
|
|
96
96
|
});
|
|
97
97
|
resolvedRoute = route;
|
|
98
98
|
} catch (err) {
|
|
99
|
-
if (!errorRoute) {
|
|
99
|
+
if (!errorRoute || runtimeEnvironment.debug) {
|
|
100
100
|
throw err;
|
|
101
101
|
}
|
|
102
102
|
import_diagnostics.logger.error(`[view-middleware] Route Error ${req.originalUrl}`);
|
|
@@ -264,7 +264,7 @@ function viewMiddleware(app, context) {
|
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
import_diagnostics.logger.debug({label: `view-middleware`, message: `Add view paths ${paths}`});
|
|
267
|
-
app.get(paths, (0, import_error_handling.handleErrors)(createViewMiddleware(route, errorRoutes, context, viewHandler)));
|
|
267
|
+
app.get(paths, (0, import_error_handling.handleErrors)(createViewMiddleware(route, errorRoutes, context, viewHandler), true));
|
|
268
268
|
}
|
|
269
269
|
app.get((0, import_shared_utils.getClientBootstrapConfigurationRoutes)(), (0, import_error_handling.handleErrors)(createConfigMiddleware(routes, context, viewHandler)));
|
|
270
270
|
app.get("/" + app.getRegexWildcard(), (0, import_error_handling.handleErrors)(createNotFoundMiddleware(errorRoutes, context, viewHandler)));
|
|
@@ -12,17 +12,17 @@ function createBundleMiddleware(context) {
|
|
|
12
12
|
return async (req, res) => {
|
|
13
13
|
if (!req.validateEnvironmentRequest(appConfig)) {
|
|
14
14
|
res.status(400);
|
|
15
|
-
res.send(descriptions.
|
|
15
|
+
res.send(descriptions.INVALID.INVALID_ENVIRONMENT(req.params.environment));
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
if (!req.validateJsonRequest()) {
|
|
19
19
|
res.status(400);
|
|
20
|
-
res.send(descriptions.
|
|
20
|
+
res.send(descriptions.INVALID.INVALID_JSON());
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
if (!req.validateApiVersion(appConfig)) {
|
|
24
24
|
res.status(400);
|
|
25
|
-
res.send(descriptions.
|
|
25
|
+
res.send(descriptions.INVALID.INVALID_API_VERSION(req.params.apiVersion, appConfig.apiVersion));
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
const { runtimeEnvironment, runtimeParams } = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
@@ -65,7 +65,7 @@ function createSourceMapMiddleware(context) {
|
|
|
65
65
|
return async (req, res) => {
|
|
66
66
|
if (!req.validateEnvironmentRequest(appConfig)) {
|
|
67
67
|
res.status(400);
|
|
68
|
-
res.send(descriptions.
|
|
68
|
+
res.send(descriptions.INVALID.INVALID_ENVIRONMENT(req.params.environment));
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
const { runtimeEnvironment } = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
@@ -8,7 +8,7 @@ function createMappingMiddleware(context) {
|
|
|
8
8
|
return async (req, res) => {
|
|
9
9
|
if (!req.validateEnvironmentRequest(appConfig)) {
|
|
10
10
|
res.status(400);
|
|
11
|
-
res.send(descriptions.
|
|
11
|
+
res.send(descriptions.INVALID.INVALID_ENVIRONMENT(req.params.environment));
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
const { runtimeEnvironment, runtimeParams } = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
@@ -11,17 +11,17 @@ function createModuleMiddleware(context) {
|
|
|
11
11
|
return async (req, res) => {
|
|
12
12
|
if (!req.validateEnvironmentRequest(appConfig)) {
|
|
13
13
|
res.status(400);
|
|
14
|
-
res.send(descriptions.
|
|
14
|
+
res.send(descriptions.INVALID.INVALID_ENVIRONMENT(req.params.environment));
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
if (!req.validateJsonRequest()) {
|
|
18
18
|
res.status(400);
|
|
19
|
-
res.send(descriptions.
|
|
19
|
+
res.send(descriptions.INVALID.INVALID_JSON());
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
if (!req.validateApiVersion(appConfig)) {
|
|
23
23
|
res.status(400);
|
|
24
|
-
res.send(descriptions.
|
|
24
|
+
res.send(descriptions.INVALID.INVALID_API_VERSION(req.params.apiVersion, appConfig.apiVersion));
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
const { runtimeEnvironment, runtimeParams } = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
@@ -5,7 +5,7 @@ function createResourceMiddleware(context) {
|
|
|
5
5
|
const { appConfig, resourceRegistry, runtimeEnvironment: defaultRuntimeEnvironment } = context;
|
|
6
6
|
return async (req, res) => {
|
|
7
7
|
if (!req.validateEnvironmentRequest(appConfig)) {
|
|
8
|
-
res.status(400).send(descriptions.
|
|
8
|
+
res.status(400).send(descriptions.INVALID.INVALID_ENVIRONMENT(req.params.environment));
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
const { runtimeEnvironment, runtimeParams } = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { MiddlewareFunction } from '@lwrjs/types';
|
|
2
|
-
export declare function handleErrors(middleware: MiddlewareFunction): MiddlewareFunction;
|
|
2
|
+
export declare function handleErrors(middleware: MiddlewareFunction, isBaseDoc?: boolean): MiddlewareFunction;
|
|
3
3
|
//# sourceMappingURL=error-handling.d.ts.map
|
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
import { descriptions, DiagnosticsError,
|
|
1
|
+
import { descriptions, DiagnosticsError, LwrError, LwrInvalidError, LwrUnresolvableError, } from '@lwrjs/diagnostics';
|
|
2
2
|
import { logger } from '@lwrjs/diagnostics';
|
|
3
|
-
function createReturnStatus(error, url) {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
function createReturnStatus(error, url, debug) {
|
|
4
|
+
let message = error.message, status = 500;
|
|
5
|
+
if (error instanceof LwrInvalidError) {
|
|
6
|
+
status = 400;
|
|
6
7
|
}
|
|
7
|
-
if (error instanceof LwrUnresolvableError) {
|
|
8
|
-
|
|
8
|
+
else if (error instanceof LwrUnresolvableError) {
|
|
9
|
+
status = 404;
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
else {
|
|
12
|
+
// catchall: likely a LwrServerError
|
|
13
|
+
message =
|
|
14
|
+
error instanceof LwrError
|
|
15
|
+
? message
|
|
16
|
+
: `${descriptions.SERVER.SERVER_ERROR(url)}: ${error.message}`;
|
|
17
|
+
}
|
|
18
|
+
if (debug) {
|
|
19
|
+
// return a debug base doc if debug mode is on
|
|
20
|
+
return {
|
|
21
|
+
status,
|
|
22
|
+
message: `<div style="font-family:sans-serif;margin:50px;"><h1>${status}: Document generation failed</h1><p>${message.replace(/</g, '<').replace(/>/g, '>')}</p></div>`,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return { status, message };
|
|
12
26
|
}
|
|
13
|
-
export function handleErrors(middleware) {
|
|
27
|
+
export function handleErrors(middleware, isBaseDoc = false) {
|
|
14
28
|
return async (req, res, next) => {
|
|
15
29
|
try {
|
|
16
30
|
await middleware(req, res, next);
|
|
@@ -24,7 +38,9 @@ export function handleErrors(middleware) {
|
|
|
24
38
|
else {
|
|
25
39
|
logger.error(err);
|
|
26
40
|
}
|
|
27
|
-
const { status, message } = createReturnStatus(err, req.originalUrl
|
|
41
|
+
const { status, message } = createReturnStatus(err, req.originalUrl,
|
|
42
|
+
// only return HTML error screen for base doc requests in debug mode
|
|
43
|
+
req.query.debug !== undefined && isBaseDoc);
|
|
28
44
|
res.status(status);
|
|
29
45
|
res.send(message);
|
|
30
46
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { explodeSpecifier, explodeSpecifiers, LATEST_SIGNATURE } from '@lwrjs/shared-utils';
|
|
2
|
-
import { descriptions,
|
|
2
|
+
import { descriptions, LwrInvalidError } from '@lwrjs/diagnostics';
|
|
3
3
|
function validateSpecifier(specifer) {
|
|
4
4
|
return specifer.indexOf('../') < 0;
|
|
5
5
|
}
|
|
6
6
|
export function getModuleIdentity(req, importer) {
|
|
7
7
|
const { specifier, signature } = req.params;
|
|
8
8
|
if (validateSpecifier(specifier) === false) {
|
|
9
|
-
throw new
|
|
9
|
+
throw new LwrInvalidError(descriptions.INVALID.INVALID_SPECIFIER(specifier));
|
|
10
10
|
}
|
|
11
11
|
const moduleId = explodeSpecifier(specifier);
|
|
12
12
|
return {
|
|
@@ -30,7 +30,7 @@ export function getMappingIdentity(req) {
|
|
|
30
30
|
export function getResourceIdentity(req) {
|
|
31
31
|
const { specifier, signature = LATEST_SIGNATURE } = req.params;
|
|
32
32
|
if (validateSpecifier(specifier) === false) {
|
|
33
|
-
throw new
|
|
33
|
+
throw new LwrInvalidError(descriptions.INVALID.INVALID_SPECIFIER(specifier));
|
|
34
34
|
}
|
|
35
35
|
const resourceId = explodeSpecifier(specifier);
|
|
36
36
|
return {
|
|
@@ -46,7 +46,7 @@ export function getAssetIdentity(req) {
|
|
|
46
46
|
: '/' + req.params[0]
|
|
47
47
|
: req.originalUrl.split('?')[0];
|
|
48
48
|
if (validateSpecifier(specifier) === false) {
|
|
49
|
-
throw new
|
|
49
|
+
throw new LwrInvalidError(descriptions.INVALID.INVALID_SPECIFIER(specifier));
|
|
50
50
|
}
|
|
51
51
|
return {
|
|
52
52
|
immutable,
|
|
@@ -17,12 +17,12 @@ function createViewMiddleware(route, errorRoutes, context, viewHandler) {
|
|
|
17
17
|
return async (req, res) => {
|
|
18
18
|
if (!req.validateEnvironmentRequest(appConfig)) {
|
|
19
19
|
res.status(400);
|
|
20
|
-
res.send(descriptions.
|
|
20
|
+
res.send(descriptions.INVALID.INVALID_ENVIRONMENT(req.params.environment));
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
if (!req.validateJsonRequest()) {
|
|
24
24
|
res.status(400);
|
|
25
|
-
res.send(descriptions.
|
|
25
|
+
res.send(descriptions.INVALID.INVALID_JSON());
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
const { runtimeEnvironment, runtimeParams: defaultRuntimeParams } = req.getRuntimeContext(context.runtimeEnvironment);
|
|
@@ -72,7 +72,9 @@ function createViewMiddleware(route, errorRoutes, context, viewHandler) {
|
|
|
72
72
|
resolvedRoute = route;
|
|
73
73
|
}
|
|
74
74
|
catch (err) {
|
|
75
|
-
if (!errorRoute) {
|
|
75
|
+
if (!errorRoute || runtimeEnvironment.debug) {
|
|
76
|
+
// this is handled by the error middleware
|
|
77
|
+
// when debug mode is on, always show the error screen
|
|
76
78
|
throw err;
|
|
77
79
|
}
|
|
78
80
|
// Log Unexpected Routing Errors
|
|
@@ -272,7 +274,7 @@ export function viewMiddleware(app, context) {
|
|
|
272
274
|
}
|
|
273
275
|
}
|
|
274
276
|
logger.debug({ label: `view-middleware`, message: `Add view paths ${paths}` });
|
|
275
|
-
app.get(paths, handleErrors(createViewMiddleware(route, errorRoutes, context, viewHandler)));
|
|
277
|
+
app.get(paths, handleErrors(createViewMiddleware(route, errorRoutes, context, viewHandler), true));
|
|
276
278
|
}
|
|
277
279
|
// create and attach middleware for bootstrap configurations
|
|
278
280
|
app.get(getClientBootstrapConfigurationRoutes(), handleErrors(createConfigMiddleware(routes, context, viewHandler)));
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.17.2-alpha.
|
|
7
|
+
"version": "0.17.2-alpha.4",
|
|
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.17.2-alpha.
|
|
47
|
-
"@lwrjs/asset-registry": "0.17.2-alpha.
|
|
48
|
-
"@lwrjs/asset-transformer": "0.17.2-alpha.
|
|
49
|
-
"@lwrjs/base-view-provider": "0.17.2-alpha.
|
|
50
|
-
"@lwrjs/base-view-transformer": "0.17.2-alpha.
|
|
51
|
-
"@lwrjs/client-modules": "0.17.2-alpha.
|
|
52
|
-
"@lwrjs/config": "0.17.2-alpha.
|
|
53
|
-
"@lwrjs/diagnostics": "0.17.2-alpha.
|
|
54
|
-
"@lwrjs/esbuild": "0.17.2-alpha.
|
|
55
|
-
"@lwrjs/fs-asset-provider": "0.17.2-alpha.
|
|
56
|
-
"@lwrjs/fs-watch": "0.17.2-alpha.
|
|
57
|
-
"@lwrjs/html-view-provider": "0.17.2-alpha.
|
|
58
|
-
"@lwrjs/instrumentation": "0.17.2-alpha.
|
|
59
|
-
"@lwrjs/loader": "0.17.2-alpha.
|
|
60
|
-
"@lwrjs/lwc-module-provider": "0.17.2-alpha.
|
|
61
|
-
"@lwrjs/lwc-ssr": "0.17.2-alpha.
|
|
62
|
-
"@lwrjs/markdown-view-provider": "0.17.2-alpha.
|
|
63
|
-
"@lwrjs/module-bundler": "0.17.2-alpha.
|
|
64
|
-
"@lwrjs/module-registry": "0.17.2-alpha.
|
|
65
|
-
"@lwrjs/npm-module-provider": "0.17.2-alpha.
|
|
66
|
-
"@lwrjs/nunjucks-view-provider": "0.17.2-alpha.
|
|
67
|
-
"@lwrjs/o11y": "0.17.2-alpha.
|
|
68
|
-
"@lwrjs/resource-registry": "0.17.2-alpha.
|
|
69
|
-
"@lwrjs/router": "0.17.2-alpha.
|
|
70
|
-
"@lwrjs/server": "0.17.2-alpha.
|
|
71
|
-
"@lwrjs/shared-utils": "0.17.2-alpha.
|
|
72
|
-
"@lwrjs/static": "0.17.2-alpha.
|
|
73
|
-
"@lwrjs/view-registry": "0.17.2-alpha.
|
|
46
|
+
"@lwrjs/app-service": "0.17.2-alpha.4",
|
|
47
|
+
"@lwrjs/asset-registry": "0.17.2-alpha.4",
|
|
48
|
+
"@lwrjs/asset-transformer": "0.17.2-alpha.4",
|
|
49
|
+
"@lwrjs/base-view-provider": "0.17.2-alpha.4",
|
|
50
|
+
"@lwrjs/base-view-transformer": "0.17.2-alpha.4",
|
|
51
|
+
"@lwrjs/client-modules": "0.17.2-alpha.4",
|
|
52
|
+
"@lwrjs/config": "0.17.2-alpha.4",
|
|
53
|
+
"@lwrjs/diagnostics": "0.17.2-alpha.4",
|
|
54
|
+
"@lwrjs/esbuild": "0.17.2-alpha.4",
|
|
55
|
+
"@lwrjs/fs-asset-provider": "0.17.2-alpha.4",
|
|
56
|
+
"@lwrjs/fs-watch": "0.17.2-alpha.4",
|
|
57
|
+
"@lwrjs/html-view-provider": "0.17.2-alpha.4",
|
|
58
|
+
"@lwrjs/instrumentation": "0.17.2-alpha.4",
|
|
59
|
+
"@lwrjs/loader": "0.17.2-alpha.4",
|
|
60
|
+
"@lwrjs/lwc-module-provider": "0.17.2-alpha.4",
|
|
61
|
+
"@lwrjs/lwc-ssr": "0.17.2-alpha.4",
|
|
62
|
+
"@lwrjs/markdown-view-provider": "0.17.2-alpha.4",
|
|
63
|
+
"@lwrjs/module-bundler": "0.17.2-alpha.4",
|
|
64
|
+
"@lwrjs/module-registry": "0.17.2-alpha.4",
|
|
65
|
+
"@lwrjs/npm-module-provider": "0.17.2-alpha.4",
|
|
66
|
+
"@lwrjs/nunjucks-view-provider": "0.17.2-alpha.4",
|
|
67
|
+
"@lwrjs/o11y": "0.17.2-alpha.4",
|
|
68
|
+
"@lwrjs/resource-registry": "0.17.2-alpha.4",
|
|
69
|
+
"@lwrjs/router": "0.17.2-alpha.4",
|
|
70
|
+
"@lwrjs/server": "0.17.2-alpha.4",
|
|
71
|
+
"@lwrjs/shared-utils": "0.17.2-alpha.4",
|
|
72
|
+
"@lwrjs/static": "0.17.2-alpha.4",
|
|
73
|
+
"@lwrjs/view-registry": "0.17.2-alpha.4",
|
|
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.17.2-alpha.
|
|
83
|
+
"@lwrjs/types": "0.17.2-alpha.4",
|
|
84
84
|
"@types/ws": "^8.5.12",
|
|
85
85
|
"memfs": "^4.13.0"
|
|
86
86
|
},
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"volta": {
|
|
94
94
|
"extends": "../../../package.json"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "d7fb1605cec0bf9fef18e3daeb17dc28b35a80d3"
|
|
97
97
|
}
|