@redhat-cloud-services/frontend-components-config-utilities 4.13.5 → 4.14.1

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.
@@ -102,6 +102,7 @@ export type CRDObject = {
102
102
  navigationSegments?: DirectNavItem[];
103
103
  module: ChromeModule;
104
104
  searchEntries?: ChromeStaticSearchEntry[];
105
+ locales?: Record<string, Record<string, string>>;
105
106
  serviceTiles?: ServiceTile[];
106
107
  widgetRegistry?: ChromeWidgetEntry[];
107
108
  feoConfigEnabled?: boolean;
@@ -729,6 +729,19 @@
729
729
  "feoConfigEnabled": {
730
730
  "type": "boolean"
731
731
  },
732
+ "locales": {
733
+ "type": "object",
734
+ "description": "Generated translations keyed by locale and stable message ID",
735
+ "propertyNames": {
736
+ "format": "bcp47"
737
+ },
738
+ "additionalProperties": {
739
+ "type": "object",
740
+ "additionalProperties": {
741
+ "type": "string"
742
+ }
743
+ }
744
+ },
732
745
  "akamaiCacheBustDisable": {
733
746
  "type": "boolean"
734
747
  },
@@ -21,6 +21,17 @@ function validateFrontendCrd(crd) {
21
21
  var validator = new _2020_1.default({
22
22
  strict: true,
23
23
  });
24
+ validator.addFormat('bcp47', {
25
+ type: 'string',
26
+ validate: function (locale) {
27
+ try {
28
+ return Intl.getCanonicalLocales(locale).length === 1;
29
+ }
30
+ catch (_a) {
31
+ return false;
32
+ }
33
+ },
34
+ });
24
35
  var crdInternal = typeof crd === 'string' ? readCrdYaml(crd) : crd;
25
36
  delete frontend_crd_schema_json_1.default.$schema;
26
37
  var validate = validator.compile(frontend_crd_schema_json_1.default);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redhat-cloud-services/frontend-components-config-utilities",
3
- "version": "4.13.5",
3
+ "version": "4.14.1",
4
4
  "description": "Utilities for shared config used in Red Hat Cloud Services project.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
@@ -7,7 +40,7 @@ var path_1 = __importDefault(require("path"));
7
40
  var fs_1 = __importDefault(require("fs"));
8
41
  var concurrently_1 = __importDefault(require("concurrently"));
9
42
  var crd_check_1 = require("./feo/crd-check");
10
- var _1 = require(".");
43
+ var fec_logger_1 = __importStar(require("./fec-logger"));
11
44
  function federate(argv, cwd) {
12
45
  var _a, _b, _c;
13
46
  process.env.FEC_STATIC = 'true';
@@ -27,7 +60,7 @@ function federate(argv, cwd) {
27
60
  FEOFeaturesEnabled = (0, crd_check_1.hasFEOFeaturesEnabled)(frontendCrdRef.current);
28
61
  }
29
62
  catch (e) {
30
- (0, _1.fecLogger)(_1.LogType.warn, "FEO features are not enabled. Unable to find frontend CRD file at ".concat(frontendCRDPath, ". If you want FEO features for local development, make sure to have a \"deploy/frontend.yaml\" file in your project or specify its location via \"frontendCRDPath\" attribute."));
63
+ (0, fec_logger_1.default)(fec_logger_1.LogType.warn, "FEO features are not enabled. Unable to find frontend CRD file at ".concat(frontendCRDPath, ". If you want FEO features for local development, make sure to have a \"deploy/frontend.yaml\" file in your project or specify its location via \"frontendCRDPath\" attribute."));
31
64
  }
32
65
  try {
33
66
  fs_1.default.statSync(configPath);