@lwrjs/core 0.12.0-alpha.3 → 0.12.0-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 +5 -0
- package/build/cjs/middleware/module-middleware.cjs +5 -0
- package/build/cjs/middleware/utils/identity.cjs +1 -1
- package/build/es/middleware/bundle-middleware.js +6 -0
- package/build/es/middleware/module-middleware.js +6 -0
- package/build/es/middleware/utils/identity.js +5 -1
- package/package.json +30 -30
|
@@ -53,6 +53,11 @@ function createBundleMiddleware(context) {
|
|
|
53
53
|
res.send(import_diagnostics.descriptions.UNRESOLVABLE.INVALID_JSON().message);
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
+
if (!req.validateApiVersion(appConfig)) {
|
|
57
|
+
res.status(400);
|
|
58
|
+
res.send(import_diagnostics.descriptions.UNRESOLVABLE.INVALID_API_VERSION(req.params.apiVersion, appConfig.apiVersion).message);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
56
61
|
const {runtimeEnvironment, runtimeParams} = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
57
62
|
const importer = req.query.importer ? await (0, import_request.getRequestImporter)(req, moduleRegistry, runtimeParams) : void 0;
|
|
58
63
|
const {moduleId, signature} = (0, import_identity.getModuleIdentity)(req, importer);
|
|
@@ -47,6 +47,11 @@ function createModuleMiddleware(context) {
|
|
|
47
47
|
res.send(import_diagnostics.descriptions.UNRESOLVABLE.INVALID_JSON().message);
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
+
if (!req.validateApiVersion(appConfig)) {
|
|
51
|
+
res.status(400);
|
|
52
|
+
res.send(import_diagnostics.descriptions.UNRESOLVABLE.INVALID_API_VERSION(req.params.apiVersion, appConfig.apiVersion).message);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
50
55
|
const {runtimeEnvironment, runtimeParams} = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
51
56
|
const importer = req.query.importer ? await (0, import_request.getRequestImporter)(req, moduleRegistry, runtimeParams) : void 0;
|
|
52
57
|
const {moduleId, signature} = (0, import_identity.getModuleIdentity)(req, importer);
|
|
@@ -75,7 +75,7 @@ function getResourceIdentity(req) {
|
|
|
75
75
|
}
|
|
76
76
|
function getAssetIdentity(req) {
|
|
77
77
|
const {signature, immutable, assetType: type} = req.params;
|
|
78
|
-
const specifier = type ? "/" + req.params[0] : req.originalUrl.split("?")[0];
|
|
78
|
+
const specifier = type ? process.platform === "win32" ? req.params[0] : "/" + req.params[0] : req.originalUrl.split("?")[0];
|
|
79
79
|
if (validateSpecifier(specifier) === false) {
|
|
80
80
|
throw (0, import_diagnostics.createSingleDiagnosticError)({
|
|
81
81
|
description: import_diagnostics.descriptions.UNRESOLVABLE.INVALID_SPECIFIER(specifier)
|
|
@@ -20,6 +20,12 @@ function createBundleMiddleware(context) {
|
|
|
20
20
|
res.send(descriptions.UNRESOLVABLE.INVALID_JSON().message);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
+
if (!req.validateApiVersion(appConfig)) {
|
|
24
|
+
res.status(400);
|
|
25
|
+
res.send(descriptions.UNRESOLVABLE.INVALID_API_VERSION(req.params.apiVersion, appConfig.apiVersion)
|
|
26
|
+
.message);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
23
29
|
const { runtimeEnvironment, runtimeParams } = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
24
30
|
const importer = req.query.importer
|
|
25
31
|
? await getRequestImporter(req, moduleRegistry, runtimeParams)
|
|
@@ -19,6 +19,12 @@ function createModuleMiddleware(context) {
|
|
|
19
19
|
res.send(descriptions.UNRESOLVABLE.INVALID_JSON().message);
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
+
if (!req.validateApiVersion(appConfig)) {
|
|
23
|
+
res.status(400);
|
|
24
|
+
res.send(descriptions.UNRESOLVABLE.INVALID_API_VERSION(req.params.apiVersion, appConfig.apiVersion)
|
|
25
|
+
.message);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
22
28
|
const { runtimeEnvironment, runtimeParams } = req.getRuntimeContext(defaultRuntimeEnvironment);
|
|
23
29
|
const importer = req.query.importer
|
|
24
30
|
? await getRequestImporter(req, moduleRegistry, runtimeParams)
|
|
@@ -44,7 +44,11 @@ export function getResourceIdentity(req) {
|
|
|
44
44
|
}
|
|
45
45
|
export function getAssetIdentity(req) {
|
|
46
46
|
const { signature, immutable, assetType: type } = req.params;
|
|
47
|
-
const specifier = type
|
|
47
|
+
const specifier = type
|
|
48
|
+
? process.platform === 'win32'
|
|
49
|
+
? req.params[0]
|
|
50
|
+
: '/' + req.params[0]
|
|
51
|
+
: req.originalUrl.split('?')[0];
|
|
48
52
|
if (validateSpecifier(specifier) === false) {
|
|
49
53
|
throw createSingleDiagnosticError({
|
|
50
54
|
description: descriptions.UNRESOLVABLE.INVALID_SPECIFIER(specifier),
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.12.0-alpha.
|
|
7
|
+
"version": "0.12.0-alpha.4",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -39,33 +39,33 @@
|
|
|
39
39
|
"build": "tsc -b"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@lwrjs/app-service": "0.12.0-alpha.
|
|
43
|
-
"@lwrjs/asset-registry": "0.12.0-alpha.
|
|
44
|
-
"@lwrjs/asset-transformer": "0.12.0-alpha.
|
|
45
|
-
"@lwrjs/base-view-provider": "0.12.0-alpha.
|
|
46
|
-
"@lwrjs/base-view-transformer": "0.12.0-alpha.
|
|
47
|
-
"@lwrjs/client-modules": "0.12.0-alpha.
|
|
48
|
-
"@lwrjs/config": "0.12.0-alpha.
|
|
49
|
-
"@lwrjs/diagnostics": "0.12.0-alpha.
|
|
50
|
-
"@lwrjs/esbuild": "0.12.0-alpha.
|
|
51
|
-
"@lwrjs/fs-asset-provider": "0.12.0-alpha.
|
|
52
|
-
"@lwrjs/fs-watch": "0.12.0-alpha.
|
|
53
|
-
"@lwrjs/html-view-provider": "0.12.0-alpha.
|
|
54
|
-
"@lwrjs/instrumentation": "0.12.0-alpha.
|
|
55
|
-
"@lwrjs/loader": "0.12.0-alpha.
|
|
56
|
-
"@lwrjs/lwc-module-provider": "0.12.0-alpha.
|
|
57
|
-
"@lwrjs/markdown-view-provider": "0.12.0-alpha.
|
|
58
|
-
"@lwrjs/module-bundler": "0.12.0-alpha.
|
|
59
|
-
"@lwrjs/module-registry": "0.12.0-alpha.
|
|
60
|
-
"@lwrjs/npm-module-provider": "0.12.0-alpha.
|
|
61
|
-
"@lwrjs/nunjucks-view-provider": "0.12.0-alpha.
|
|
62
|
-
"@lwrjs/o11y": "0.12.0-alpha.
|
|
63
|
-
"@lwrjs/resource-registry": "0.12.0-alpha.
|
|
64
|
-
"@lwrjs/router": "0.12.0-alpha.
|
|
65
|
-
"@lwrjs/server": "0.12.0-alpha.
|
|
66
|
-
"@lwrjs/shared-utils": "0.12.0-alpha.
|
|
67
|
-
"@lwrjs/static": "0.12.0-alpha.
|
|
68
|
-
"@lwrjs/view-registry": "0.12.0-alpha.
|
|
42
|
+
"@lwrjs/app-service": "0.12.0-alpha.4",
|
|
43
|
+
"@lwrjs/asset-registry": "0.12.0-alpha.4",
|
|
44
|
+
"@lwrjs/asset-transformer": "0.12.0-alpha.4",
|
|
45
|
+
"@lwrjs/base-view-provider": "0.12.0-alpha.4",
|
|
46
|
+
"@lwrjs/base-view-transformer": "0.12.0-alpha.4",
|
|
47
|
+
"@lwrjs/client-modules": "0.12.0-alpha.4",
|
|
48
|
+
"@lwrjs/config": "0.12.0-alpha.4",
|
|
49
|
+
"@lwrjs/diagnostics": "0.12.0-alpha.4",
|
|
50
|
+
"@lwrjs/esbuild": "0.12.0-alpha.4",
|
|
51
|
+
"@lwrjs/fs-asset-provider": "0.12.0-alpha.4",
|
|
52
|
+
"@lwrjs/fs-watch": "0.12.0-alpha.4",
|
|
53
|
+
"@lwrjs/html-view-provider": "0.12.0-alpha.4",
|
|
54
|
+
"@lwrjs/instrumentation": "0.12.0-alpha.4",
|
|
55
|
+
"@lwrjs/loader": "0.12.0-alpha.4",
|
|
56
|
+
"@lwrjs/lwc-module-provider": "0.12.0-alpha.4",
|
|
57
|
+
"@lwrjs/markdown-view-provider": "0.12.0-alpha.4",
|
|
58
|
+
"@lwrjs/module-bundler": "0.12.0-alpha.4",
|
|
59
|
+
"@lwrjs/module-registry": "0.12.0-alpha.4",
|
|
60
|
+
"@lwrjs/npm-module-provider": "0.12.0-alpha.4",
|
|
61
|
+
"@lwrjs/nunjucks-view-provider": "0.12.0-alpha.4",
|
|
62
|
+
"@lwrjs/o11y": "0.12.0-alpha.4",
|
|
63
|
+
"@lwrjs/resource-registry": "0.12.0-alpha.4",
|
|
64
|
+
"@lwrjs/router": "0.12.0-alpha.4",
|
|
65
|
+
"@lwrjs/server": "0.12.0-alpha.4",
|
|
66
|
+
"@lwrjs/shared-utils": "0.12.0-alpha.4",
|
|
67
|
+
"@lwrjs/static": "0.12.0-alpha.4",
|
|
68
|
+
"@lwrjs/view-registry": "0.12.0-alpha.4",
|
|
69
69
|
"chokidar": "^3.5.3",
|
|
70
70
|
"esbuild": "^0.9.7",
|
|
71
71
|
"fs-extra": "^11.1.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"ws": "^8.8.1"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@lwrjs/types": "0.12.0-alpha.
|
|
78
|
+
"@lwrjs/types": "0.12.0-alpha.4",
|
|
79
79
|
"@types/ws": "^8.5.3"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"volta": {
|
|
88
88
|
"extends": "../../../package.json"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "7b68e0ffa5e4d61ae97a4b020f9690ee7b08d5da"
|
|
91
91
|
}
|