Fix default configuration handling on some sections
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 9 Dec 2021 14:28:52 +0000 (15:28 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 9 Dec 2021 14:28:52 +0000 (15:28 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
package-lock.json
package.json
src/utils/Configuration.ts

index e5975774c06f406a7217bb691f73b97b0267d497..2d31f4ef52637cf4c184327b2a0e9b9c0fc37e51 100644 (file)
         "@types/tar": "^6.1.1",
         "@types/uuid": "^8.3.3",
         "@types/ws": "^8.2.2",
-        "@typescript-eslint/eslint-plugin": "^5.5.0",
-        "@typescript-eslint/parser": "^5.5.0",
+        "@typescript-eslint/eslint-plugin": "^5.6.0",
+        "@typescript-eslint/parser": "^5.6.0",
         "auto-changelog": "^2.3.0",
         "clinic": "^10.0.0",
         "cross-env": "^7.0.3",
         "eslint": "^8.4.1",
         "eslint-plugin-import": "^2.25.3",
-        "eslint-plugin-jsdoc": "^37.1.0",
+        "eslint-plugin-jsdoc": "^37.2.0",
         "eslint-plugin-node": "^11.1.0",
         "expect": "^27.4.2",
         "mocha": "^9.1.3",
@@ -53,7 +53,7 @@
         "nyc": "^15.1.0",
         "release-it": "^14.11.8",
         "robohydra": "^0.6.9",
-        "rollup": "^2.60.2",
+        "rollup": "^2.61.0",
         "rollup-plugin-analyzer": "^4.0.0",
         "rollup-plugin-copy": "^3.4.0",
         "rollup-plugin-delete": "^2.0.0",
       }
     },
     "node_modules/@es-joy/jsdoccomment": {
-      "version": "0.12.0",
-      "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.12.0.tgz",
-      "integrity": "sha512-Gw4/j9v36IKY8ET+W0GoOzrRw17xjf21EIFFRL3zx21fF5MnqmeNpNi+PU/LKjqLpPb2Pw2XdlJbYM31VVo/PQ==",
+      "version": "0.13.0",
+      "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.13.0.tgz",
+      "integrity": "sha512-APVqbVPGOprb4BmjEnwbSzV+V2e/6DVIUnZG3zdW5uWXWkN0DKMCpiIy2TdBauoANKYO7RQpO8cTjIYNVSKwUA==",
       "dev": true,
       "dependencies": {
-        "comment-parser": "1.2.4",
+        "comment-parser": "1.3.0",
         "esquery": "^1.4.0",
         "jsdoc-type-pratt-parser": "2.0.0"
       },
         "node": "^12 || ^14 || ^16 || ^17"
       }
     },
-    "node_modules/@es-joy/jsdoccomment/node_modules/comment-parser": {
-      "version": "1.2.4",
-      "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.4.tgz",
-      "integrity": "sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw==",
-      "dev": true,
-      "engines": {
-        "node": ">= 12.0.0"
-      }
-    },
     "node_modules/@eslint/eslintrc": {
       "version": "1.0.5",
       "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz",
       }
     },
     "node_modules/@types/lodash": {
-      "version": "4.14.177",
-      "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.177.tgz",
-      "integrity": "sha512-0fDwydE2clKe9MNfvXHBHF9WEahRuj+msTuQqOmAApNORFvhMYZKNGGJdCzuhheVjMps/ti0Ak/iJPACMaevvw==",
+      "version": "4.14.178",
+      "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.178.tgz",
+      "integrity": "sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==",
       "devOptional": true
     },
     "node_modules/@types/minimatch": {
       }
     },
     "node_modules/caniuse-lite": {
-      "version": "1.0.30001285",
-      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001285.tgz",
-      "integrity": "sha512-KAOkuUtcQ901MtmvxfKD+ODHH9YVDYnBt+TGYSz2KIfnq22CiArbUxXPN9067gNbgMlnNYRSwho8OPXZPALB9Q==",
+      "version": "1.0.30001286",
+      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001286.tgz",
+      "integrity": "sha512-zaEMRH6xg8ESMi2eQ3R4eZ5qw/hJiVsO/HlLwniIwErij0JDr9P+8V4dtx1l+kLq6j3yy8l8W4fst1lBnat5wQ==",
       "dev": true,
       "funding": {
         "type": "opencollective",
       }
     },
     "node_modules/electron-to-chromium": {
-      "version": "1.4.13",
-      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.13.tgz",
-      "integrity": "sha512-ih5tIhzEuf78pBY70FXLo+Pw73R5MPPPcXb4CGBMJaCQt/qo/IGIesKXmswpemVCKSE2Bulr5FslUv7gAWJoOw==",
+      "version": "1.4.14",
+      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.14.tgz",
+      "integrity": "sha512-RsGkAN9JEAYMObS72kzUsPPcPGMqX1rBqGuXi9aa4TBKLzICoLf+DAAtd0fVFzrniJqYzpby47gthCUoObfs0Q==",
       "dev": true
     },
     "node_modules/elliptic": {
       }
     },
     "node_modules/eslint-plugin-jsdoc": {
-      "version": "37.1.0",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.1.0.tgz",
-      "integrity": "sha512-DpkFzX5Sqkqzy4MCgowhDXmusWcF1Gn7wYnphdGfWmIkoQr6SwL0jEtltGAVyF5Rj6ACi6ydw0oCCI5hF3yz6w==",
+      "version": "37.2.0",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.2.0.tgz",
+      "integrity": "sha512-ca7s/DD1mMObZQ2Y0n0DO/KnFV+FqCX6ztir8pcSuylg3GGCREIisn36P/0cRySuWW/7Y7MNCuUDqtKdgLPU7Q==",
       "dev": true,
       "dependencies": {
-        "@es-joy/jsdoccomment": "0.12.0",
+        "@es-joy/jsdoccomment": "0.13.0",
         "comment-parser": "1.3.0",
         "debug": "^4.3.3",
         "escape-string-regexp": "^4.0.0",
       }
     },
     "node_modules/rollup": {
-      "version": "2.60.2",
-      "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.60.2.tgz",
-      "integrity": "sha512-1Bgjpq61sPjgoZzuiDSGvbI1tD91giZABgjCQBKM5aYLnzjq52GoDuWVwT/cm/MCxCMPU8gqQvkj8doQ5C8Oqw==",
+      "version": "2.61.0",
+      "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.61.0.tgz",
+      "integrity": "sha512-teQ+T1mUYbyvGyUavCodiyA9hD4DxwYZJwr/qehZGhs1Z49vsmzelMVYMxGU4ZhGRKxYPupHuz5yzm/wj7VpWA==",
       "dev": true,
       "bin": {
         "rollup": "dist/bin/rollup"
       }
     },
     "@es-joy/jsdoccomment": {
-      "version": "0.12.0",
-      "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.12.0.tgz",
-      "integrity": "sha512-Gw4/j9v36IKY8ET+W0GoOzrRw17xjf21EIFFRL3zx21fF5MnqmeNpNi+PU/LKjqLpPb2Pw2XdlJbYM31VVo/PQ==",
+      "version": "0.13.0",
+      "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.13.0.tgz",
+      "integrity": "sha512-APVqbVPGOprb4BmjEnwbSzV+V2e/6DVIUnZG3zdW5uWXWkN0DKMCpiIy2TdBauoANKYO7RQpO8cTjIYNVSKwUA==",
       "dev": true,
       "requires": {
-        "comment-parser": "1.2.4",
+        "comment-parser": "1.3.0",
         "esquery": "^1.4.0",
         "jsdoc-type-pratt-parser": "2.0.0"
-      },
-      "dependencies": {
-        "comment-parser": {
-          "version": "1.2.4",
-          "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.4.tgz",
-          "integrity": "sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw==",
-          "dev": true
-        }
       }
     },
     "@eslint/eslintrc": {
       }
     },
     "@types/lodash": {
-      "version": "4.14.177",
-      "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.177.tgz",
-      "integrity": "sha512-0fDwydE2clKe9MNfvXHBHF9WEahRuj+msTuQqOmAApNORFvhMYZKNGGJdCzuhheVjMps/ti0Ak/iJPACMaevvw==",
+      "version": "4.14.178",
+      "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.178.tgz",
+      "integrity": "sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==",
       "devOptional": true
     },
     "@types/minimatch": {
       }
     },
     "caniuse-lite": {
-      "version": "1.0.30001285",
-      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001285.tgz",
-      "integrity": "sha512-KAOkuUtcQ901MtmvxfKD+ODHH9YVDYnBt+TGYSz2KIfnq22CiArbUxXPN9067gNbgMlnNYRSwho8OPXZPALB9Q==",
+      "version": "1.0.30001286",
+      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001286.tgz",
+      "integrity": "sha512-zaEMRH6xg8ESMi2eQ3R4eZ5qw/hJiVsO/HlLwniIwErij0JDr9P+8V4dtx1l+kLq6j3yy8l8W4fst1lBnat5wQ==",
       "dev": true
     },
     "capture-stack-trace": {
       }
     },
     "electron-to-chromium": {
-      "version": "1.4.13",
-      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.13.tgz",
-      "integrity": "sha512-ih5tIhzEuf78pBY70FXLo+Pw73R5MPPPcXb4CGBMJaCQt/qo/IGIesKXmswpemVCKSE2Bulr5FslUv7gAWJoOw==",
+      "version": "1.4.14",
+      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.14.tgz",
+      "integrity": "sha512-RsGkAN9JEAYMObS72kzUsPPcPGMqX1rBqGuXi9aa4TBKLzICoLf+DAAtd0fVFzrniJqYzpby47gthCUoObfs0Q==",
       "dev": true
     },
     "elliptic": {
       }
     },
     "eslint-plugin-jsdoc": {
-      "version": "37.1.0",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.1.0.tgz",
-      "integrity": "sha512-DpkFzX5Sqkqzy4MCgowhDXmusWcF1Gn7wYnphdGfWmIkoQr6SwL0jEtltGAVyF5Rj6ACi6ydw0oCCI5hF3yz6w==",
+      "version": "37.2.0",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.2.0.tgz",
+      "integrity": "sha512-ca7s/DD1mMObZQ2Y0n0DO/KnFV+FqCX6ztir8pcSuylg3GGCREIisn36P/0cRySuWW/7Y7MNCuUDqtKdgLPU7Q==",
       "dev": true,
       "requires": {
-        "@es-joy/jsdoccomment": "0.12.0",
+        "@es-joy/jsdoccomment": "0.13.0",
         "comment-parser": "1.3.0",
         "debug": "^4.3.3",
         "escape-string-regexp": "^4.0.0",
       }
     },
     "rollup": {
-      "version": "2.60.2",
-      "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.60.2.tgz",
-      "integrity": "sha512-1Bgjpq61sPjgoZzuiDSGvbI1tD91giZABgjCQBKM5aYLnzjq52GoDuWVwT/cm/MCxCMPU8gqQvkj8doQ5C8Oqw==",
+      "version": "2.61.0",
+      "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.61.0.tgz",
+      "integrity": "sha512-teQ+T1mUYbyvGyUavCodiyA9hD4DxwYZJwr/qehZGhs1Z49vsmzelMVYMxGU4ZhGRKxYPupHuz5yzm/wj7VpWA==",
       "dev": true,
       "requires": {
         "fsevents": "~2.3.2"
index cd95341b27f7877f5cf81d92c8013d4e1c9a61a4..a06b58ff282679325c52201d02b3c3de1e109793 100644 (file)
     "@types/tar": "^6.1.1",
     "@types/uuid": "^8.3.3",
     "@types/ws": "^8.2.2",
-    "@typescript-eslint/eslint-plugin": "^5.5.0",
-    "@typescript-eslint/parser": "^5.5.0",
+    "@typescript-eslint/eslint-plugin": "^5.6.0",
+    "@typescript-eslint/parser": "^5.6.0",
     "auto-changelog": "^2.3.0",
     "clinic": "^10.0.0",
     "cross-env": "^7.0.3",
     "eslint": "^8.4.1",
     "eslint-plugin-import": "^2.25.3",
-    "eslint-plugin-jsdoc": "^37.1.0",
+    "eslint-plugin-jsdoc": "^37.2.0",
     "eslint-plugin-node": "^11.1.0",
     "expect": "^27.4.2",
     "mocha": "^9.1.3",
     "nyc": "^15.1.0",
     "release-it": "^14.11.8",
     "robohydra": "^0.6.9",
-    "rollup": "^2.60.2",
+    "rollup": "^2.61.0",
     "rollup-plugin-analyzer": "^4.0.0",
     "rollup-plugin-copy": "^3.4.0",
     "rollup-plugin-delete": "^2.0.0",
index 8311d5d8aabd1c5fa6ab527f57f8b75b12b67e75..8e3675b1a6e71c8c6e3e274dd719784aed23a47c 100644 (file)
@@ -37,12 +37,14 @@ export default class Configuration {
     if (Configuration.objectHasOwnProperty(Configuration.getConfig(), 'uiWebSocketServer')) {
       if (Configuration.objectHasOwnProperty(Configuration.getConfig().uiWebSocketServer, 'options')) {
         options = {
+          ...options,
           ...Configuration.objectHasOwnProperty(Configuration.getConfig().uiWebSocketServer.options, 'host') && { host: Configuration.getConfig().uiWebSocketServer.options.host },
           ...Configuration.objectHasOwnProperty(Configuration.getConfig().uiWebSocketServer.options, 'port') && { port: Configuration.getConfig().uiWebSocketServer.options.port }
         };
       }
       uiWebSocketServerConfiguration =
       {
+        ...uiWebSocketServerConfiguration,
         ...Configuration.objectHasOwnProperty(Configuration.getConfig().uiWebSocketServer, 'enabled') && { enabled: Configuration.getConfig().uiWebSocketServer.enabled },
         options
       };
@@ -60,15 +62,10 @@ export default class Configuration {
     if (Configuration.objectHasOwnProperty(Configuration.getConfig(), 'performanceStorage')) {
       storageConfiguration =
       {
-        ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'enabled')
-          ? { enabled: Configuration.getConfig().performanceStorage.enabled }
-          : { enabled: false },
-        ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'type')
-          ? { type: Configuration.getConfig().performanceStorage.type }
-          : { type: StorageType.JSON_FILE },
-        ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'uri')
-          ? { uri: Configuration.getConfig().performanceStorage.uri }
-          : { uri: this.getDefaultPerformanceStorageUri(Configuration.getConfig()?.performanceStorage?.type ?? StorageType.JSON_FILE) }
+        ...storageConfiguration,
+        ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'enabled') && { enabled: Configuration.getConfig().performanceStorage.enabled },
+        ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'type') && { type: Configuration.getConfig().performanceStorage.type },
+        ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'uri') && { uri: this.getDefaultPerformanceStorageUri(Configuration.getConfig()?.performanceStorage?.type ?? StorageType.JSON_FILE) }
       };
     }
     return storageConfiguration;