@lwrjs/config 0.15.0-alpha.21 → 0.15.0-alpha.22

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.
@@ -88,7 +88,7 @@ var ASSET_DIR_ATTRIBUTE_KEYS = createKeys("assetDir", ["alias", "dir", "urlPath"
88
88
  var ASSET_FILE_ATTRIBUTE_KEYS = createKeys("assetFile", ["alias", "file", "urlPath"]);
89
89
  var LOCKER_ATTRIBUTE_KEYS = createKeys("locker", ["enabled", "trustedComponents"]);
90
90
  var I18N_ATTRIBUTE_KEYS = createKeys("i18n", ["defaultLocale", "locales", "uriPattern"]);
91
- var CORE_PROXY_ATTRIBUTE_KEYS = createKeys("coreProxy", ["origin", "host", "servername", "sitePath"]);
91
+ var CORE_PROXY_ATTRIBUTE_KEYS = createKeys("coreProxy", ["origin", "host", "servername"]);
92
92
  var STATIC_SITE_GENERATOR_ATTRIBUTE_KEYS = createKeys("staticSiteGenerator", [
93
93
  "outputDir",
94
94
  "skipBaseDocumentGeneration",
@@ -550,19 +550,12 @@ var ValidationContext = class {
550
550
  if (node && node.type !== "null") {
551
551
  validationContext.assertIsObject(node, "coreProxy");
552
552
  validationContext.assertValidKeys(node, "coreProxy", CORE_PROXY_ATTRIBUTE_KEYS);
553
- validationContext.assertRequiredKeys(node, "coreProxy", ["origin", "host"]);
554
- validationContext.assertIsOrigin((0, import_jsonc_parser.findNodeAtLocation)(node, ["origin"]), "coreProxy.origin");
555
- validationContext.assertNotEmptyString((0, import_jsonc_parser.findNodeAtLocation)(node, ["host"]), "coreProxy.host");
553
+ validationContext.assertRequiredKeys(node, "coreProxy", ["origin"]);
554
+ validationContext.assertNotEmptyString((0, import_jsonc_parser.findNodeAtLocation)(node, ["origin"]), "coreProxy.origin");
555
+ const host = (0, import_jsonc_parser.findNodeAtLocation)(node, ["host"]);
556
+ host && validationContext.assertNotEmptyString(host, "coreProxy.host");
556
557
  const servername = (0, import_jsonc_parser.findNodeAtLocation)(node, ["servername"]);
557
- const sitePath = (0, import_jsonc_parser.findNodeAtLocation)(node, ["sitePath"]);
558
- if (!servername && !sitePath) {
559
- this.diagnostics.push({
560
- description: import_diagnostics.descriptions.CONFIG_PARSER.INCOMPLETE_CORE_PROXY(),
561
- location: this.getLocationFromNode(node)
562
- });
563
- }
564
558
  servername && validationContext.assertNotEmptyString(servername, "coreProxy.servername");
565
- sitePath && validationContext.assertIsBasePath(sitePath, "coreProxy.sitePath", true);
566
559
  }
567
560
  }
568
561
  };
@@ -32,7 +32,7 @@ export declare const ASSET_DIR_ATTRIBUTE_KEYS: ["alias", "dir", "urlPath", "root
32
32
  export declare const ASSET_FILE_ATTRIBUTE_KEYS: ["alias", "file", "urlPath"];
33
33
  export declare const LOCKER_ATTRIBUTE_KEYS: ["enabled", "trustedComponents"];
34
34
  export declare const I18N_ATTRIBUTE_KEYS: ["defaultLocale", "locales", "uriPattern"];
35
- export declare const CORE_PROXY_ATTRIBUTE_KEYS: ["origin", "host", "servername", "sitePath"];
35
+ export declare const CORE_PROXY_ATTRIBUTE_KEYS: ["origin", "host", "servername"];
36
36
  export declare const STATIC_SITE_GENERATOR_ATTRIBUTE_KEYS: ["outputDir", "skipBaseDocumentGeneration", "skipCleanOutputDir", "_additionalModules", "_additionalRoutePaths"];
37
37
  export declare const ROUTE_ATTRIBUTE_KEYS: ["bootstrap", "subRoutes", "contentTemplate", "id", "cache", "layoutTemplate", "method", "path", "rootComponent", "routeHandler", "properties"];
38
38
  export declare const ERROR_ROUTE_ATTRIBUTE_KEYS: ["bootstrap", "subRoutes", "contentTemplate", "id", "layoutTemplate", "rootComponent", "routeHandler", "status", "properties", "cache"];
@@ -51,7 +51,7 @@ export const ASSET_DIR_ATTRIBUTE_KEYS = createKeys('assetDir', ['alias', 'dir',
51
51
  export const ASSET_FILE_ATTRIBUTE_KEYS = createKeys('assetFile', ['alias', 'file', 'urlPath']);
52
52
  export const LOCKER_ATTRIBUTE_KEYS = createKeys('locker', ['enabled', 'trustedComponents']);
53
53
  export const I18N_ATTRIBUTE_KEYS = createKeys('i18n', ['defaultLocale', 'locales', 'uriPattern']);
54
- export const CORE_PROXY_ATTRIBUTE_KEYS = createKeys('coreProxy', ['origin', 'host', 'servername', 'sitePath']);
54
+ export const CORE_PROXY_ATTRIBUTE_KEYS = createKeys('coreProxy', ['origin', 'host', 'servername']);
55
55
  export const STATIC_SITE_GENERATOR_ATTRIBUTE_KEYS = createKeys('staticSiteGenerator', [
56
56
  'outputDir',
57
57
  'skipBaseDocumentGeneration',
@@ -536,20 +536,12 @@ export class ValidationContext {
536
536
  if (node && node.type !== 'null') {
537
537
  validationContext.assertIsObject(node, 'coreProxy');
538
538
  validationContext.assertValidKeys(node, 'coreProxy', CORE_PROXY_ATTRIBUTE_KEYS);
539
- validationContext.assertRequiredKeys(node, 'coreProxy', ['origin', 'host']);
540
- validationContext.assertIsOrigin(findNodeAtLocation(node, ['origin']), 'coreProxy.origin');
541
- validationContext.assertNotEmptyString(findNodeAtLocation(node, ['host']), 'coreProxy.host');
542
- // Validate locales the config has one of [servername, sitePath]
539
+ validationContext.assertRequiredKeys(node, 'coreProxy', ['origin']);
540
+ validationContext.assertNotEmptyString(findNodeAtLocation(node, ['origin']), 'coreProxy.origin');
541
+ const host = findNodeAtLocation(node, ['host']);
542
+ host && validationContext.assertNotEmptyString(host, 'coreProxy.host');
543
543
  const servername = findNodeAtLocation(node, ['servername']);
544
- const sitePath = findNodeAtLocation(node, ['sitePath']);
545
- if (!servername && !sitePath) {
546
- this.diagnostics.push({
547
- description: descriptions.CONFIG_PARSER.INCOMPLETE_CORE_PROXY(),
548
- location: this.getLocationFromNode(node),
549
- });
550
- }
551
544
  servername && validationContext.assertNotEmptyString(servername, 'coreProxy.servername');
552
- sitePath && validationContext.assertIsBasePath(sitePath, 'coreProxy.sitePath', true);
553
545
  }
554
546
  }
555
547
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.15.0-alpha.21",
7
+ "version": "0.15.0-alpha.22",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -42,14 +42,14 @@
42
42
  "test": "jest"
43
43
  },
44
44
  "dependencies": {
45
- "@lwrjs/diagnostics": "0.15.0-alpha.21",
46
- "@lwrjs/instrumentation": "0.15.0-alpha.21",
47
- "@lwrjs/shared-utils": "0.15.0-alpha.21",
45
+ "@lwrjs/diagnostics": "0.15.0-alpha.22",
46
+ "@lwrjs/instrumentation": "0.15.0-alpha.22",
47
+ "@lwrjs/shared-utils": "0.15.0-alpha.22",
48
48
  "fs-extra": "^11.2.0",
49
49
  "jsonc-parser": "^3.3.1"
50
50
  },
51
51
  "devDependencies": {
52
- "@lwrjs/types": "0.15.0-alpha.21",
52
+ "@lwrjs/types": "0.15.0-alpha.22",
53
53
  "jest": "^26.6.3",
54
54
  "memfs": "^4.9.3",
55
55
  "ts-jest": "^26.5.6"
@@ -71,5 +71,5 @@
71
71
  "volta": {
72
72
  "extends": "../../../package.json"
73
73
  },
74
- "gitHead": "4c09ff654569ab490fc77f196d3230b31404940e"
74
+ "gitHead": "0c89221b041a09f05fe6463ad385941f0351dbbe"
75
75
  }