diff --git a/package-lock.json b/package-lock.json index 2cdcc2a979..f357d6cecf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -688,7 +688,6 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/@electron/get/-/get-1.14.1.tgz", "integrity": "sha512-BrZYyL/6m0ZXz/lDxy/nlVhQz+WF+iPS6qXolEU8atw7h6v1aYkjwJZ63m+bJMBTxDE66X+r2tPS4a/8C82sZw==", - "dev": true, "dependencies": { "debug": "^4.1.1", "env-paths": "^2.2.0", @@ -710,7 +709,6 @@ "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", - "dev": true, "engines": { "node": ">=6" } @@ -719,7 +717,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", - "dev": true, "dependencies": { "defer-to-connect": "^1.0.1" }, @@ -731,7 +728,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", - "dev": true, "dependencies": { "clone-response": "^1.0.2", "get-stream": "^5.1.0", @@ -749,7 +745,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, "dependencies": { "pump": "^3.0.0" }, @@ -764,7 +759,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", "integrity": "sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==", - "dev": true, "dependencies": { "mimic-response": "^1.0.0" }, @@ -775,14 +769,12 @@ "node_modules/@electron/get/node_modules/defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", - "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", - "dev": true + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==" }, "node_modules/@electron/get/node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", @@ -796,7 +788,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, "dependencies": { "pump": "^3.0.0" }, @@ -808,7 +799,6 @@ "version": "9.6.0", "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", - "dev": true, "dependencies": { "@sindresorhus/is": "^0.14.0", "@szmarczak/http-timer": "^1.1.2", @@ -830,7 +820,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -838,14 +827,12 @@ "node_modules/@electron/get/node_modules/json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==", - "dev": true + "integrity": "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==" }, "node_modules/@electron/get/node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -854,7 +841,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", - "dev": true, "dependencies": { "json-buffer": "3.0.0" } @@ -863,7 +849,6 @@ "version": "4.5.1", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", - "dev": true, "engines": { "node": ">=8" } @@ -872,7 +857,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", - "dev": true, "engines": { "node": ">=6" } @@ -881,7 +865,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -891,7 +874,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", "integrity": "sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==", - "dev": true, "dependencies": { "lowercase-keys": "^1.0.0" } @@ -900,7 +882,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -909,7 +890,6 @@ "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, "bin": { "semver": "bin/semver.js" } @@ -918,7 +898,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, "engines": { "node": ">= 4.0.0" } @@ -3285,6 +3264,10 @@ "resolved": "packages/technical-features/application/agnostic", "link": true }, + "node_modules/@k8slens/application-for-electron-main": { + "resolved": "packages/technical-features/application/electron-main", + "link": true + }, "node_modules/@k8slens/bump-version-for-cron": { "resolved": "packages/bump-version-for-cron", "link": true @@ -4717,6 +4700,15 @@ "lodash": "^4.17.21" } }, + "node_modules/@ogre-tools/test-utils": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/@ogre-tools/test-utils/-/test-utils-15.1.1.tgz", + "integrity": "sha512-g+mn4qAZb8ACDReeuCgKgnvhAzE/AdL4Vr02DpO6W3msseC7Z3SEW/TIjfHFkajaciQiQoPh7hbw0TMLzJicLA==", + "dev": true, + "peerDependencies": { + "lodash": "^4.17.21" + } + }, "node_modules/@parcel/watcher": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.0.4.tgz", @@ -8303,8 +8295,8 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==", - "dev": true, - "optional": true + "optional": true, + "peer": true }, "node_modules/brace-expansion": { "version": "1.1.11", @@ -8429,7 +8421,6 @@ "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", - "dev": true, "engines": { "node": "*" } @@ -9464,7 +9455,6 @@ "version": "1.6.2", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, "engines": [ "node >= 0.8" ], @@ -9478,14 +9468,12 @@ "node_modules/concat-stream/node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, "node_modules/concat-stream/node_modules/readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -9500,7 +9488,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, "dependencies": { "safe-buffer": "~5.1.0" } @@ -9592,7 +9579,7 @@ "version": "1.1.12", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", - "dev": true, + "devOptional": true, "dependencies": { "ini": "^1.3.4", "proto-list": "~1.2.1" @@ -10689,7 +10676,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", - "dev": true + "devOptional": true }, "node_modules/detective": { "version": "5.2.1", @@ -11055,8 +11042,7 @@ "node_modules/duplexer3": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz", - "integrity": "sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==", - "dev": true + "integrity": "sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==" }, "node_modules/duplexify": { "version": "3.7.1", @@ -11135,7 +11121,6 @@ "version": "19.1.9", "resolved": "https://registry.npmjs.org/electron/-/electron-19.1.9.tgz", "integrity": "sha512-XT5LkTzIHB+ZtD3dTmNnKjVBWrDWReCKt9G1uAFLz6uJMEVcIUiYO+fph5pLXETiBw/QZBx8egduMEfIccLx+g==", - "dev": true, "hasInstallScript": true, "dependencies": { "@electron/get": "^1.14.1", @@ -11415,8 +11400,7 @@ "node_modules/electron/node_modules/@types/node": { "version": "16.18.12", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.12.tgz", - "integrity": "sha512-vzLe5NaNMjIE3mcddFVGlAXN1LEWueUsMsOJWaT6wWMJGyljHAWHznqfnKUQWGzu7TLPrGvWdNAsvQYW+C0xtw==", - "dev": true + "integrity": "sha512-vzLe5NaNMjIE3mcddFVGlAXN1LEWueUsMsOJWaT6wWMJGyljHAWHznqfnKUQWGzu7TLPrGvWdNAsvQYW+C0xtw==" }, "node_modules/emittery": { "version": "0.10.2", @@ -11452,7 +11436,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "dev": true, + "devOptional": true, "engines": { "node": ">= 0.8" } @@ -11685,8 +11669,8 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true, - "optional": true + "optional": true, + "peer": true }, "node_modules/esbuild": { "version": "0.17.9", @@ -12152,7 +12136,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=10" }, @@ -13197,7 +13181,6 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz", "integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==", - "dev": true, "dependencies": { "concat-stream": "^1.6.2", "debug": "^2.6.9", @@ -13212,7 +13195,6 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, "dependencies": { "ms": "2.0.0" } @@ -13221,7 +13203,6 @@ "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, "dependencies": { "minimist": "^1.2.6" }, @@ -13232,8 +13213,7 @@ "node_modules/extract-zip/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/extsprintf": { "version": "1.3.0", @@ -13323,7 +13303,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, "dependencies": { "pend": "~1.2.0" } @@ -14279,8 +14258,8 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", - "dev": true, "optional": true, + "peer": true, "dependencies": { "boolean": "^3.0.1", "es6-error": "^4.1.1", @@ -14297,8 +14276,8 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/global-tunnel-ng/-/global-tunnel-ng-2.7.1.tgz", "integrity": "sha512-4s+DyciWBV0eK148wqXxcmVAbFVPqtc3sEtUE/GTQfuU80rySLcMhUmHKSHI7/LDj8q0gDYI1lIhRRB7ieRAqg==", - "dev": true, "optional": true, + "peer": true, "dependencies": { "encodeurl": "^1.0.2", "lodash": "^4.17.10", @@ -14321,7 +14300,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", - "dev": true, + "devOptional": true, "dependencies": { "define-properties": "^1.1.3" }, @@ -20730,8 +20709,8 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", - "dev": true, "optional": true, + "peer": true, "dependencies": { "escape-string-regexp": "^4.0.0" }, @@ -22214,8 +22193,8 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/npm-conf/-/npm-conf-1.1.3.tgz", "integrity": "sha512-Yic4bZHJOt9RCFbRP3GgpqhScOY4HH3V2P8yBj6CeYq118Qr+BLXqT2JvpJ00mryLESpgOxf5XlFv4ZjXxLScw==", - "dev": true, "optional": true, + "peer": true, "dependencies": { "config-chain": "^1.1.11", "pify": "^3.0.0" @@ -22228,8 +22207,8 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", - "dev": true, "optional": true, + "peer": true, "engines": { "node": ">=4" } @@ -25872,8 +25851,7 @@ "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==" }, "node_modules/performance-now": { "version": "2.1.0", @@ -26638,7 +26616,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==", - "dev": true, "engines": { "node": ">=4" } @@ -26719,7 +26696,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, "engines": { "node": ">=0.4.0" } @@ -26811,7 +26787,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", - "dev": true + "devOptional": true }, "node_modules/protocols": { "version": "2.0.1", @@ -28120,8 +28096,8 @@ "version": "2.15.4", "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", "integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==", - "dev": true, "optional": true, + "peer": true, "dependencies": { "boolean": "^3.0.1", "detect-node": "^2.0.4", @@ -28354,8 +28330,8 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", - "dev": true, - "optional": true + "optional": true, + "peer": true }, "node_modules/semver-regex": { "version": "4.0.5", @@ -28476,8 +28452,8 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==", - "dev": true, "optional": true, + "peer": true, "dependencies": { "type-fest": "^0.13.1" }, @@ -28492,8 +28468,8 @@ "version": "0.13.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", - "dev": true, "optional": true, + "peer": true, "engines": { "node": ">=10" }, @@ -29070,8 +29046,8 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", - "dev": true, - "optional": true + "optional": true, + "peer": true }, "node_modules/sshpk": { "version": "1.17.0", @@ -29604,7 +29580,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz", "integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==", - "dev": true, "dependencies": { "debug": "^4.1.0" }, @@ -30358,7 +30333,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", - "dev": true, "engines": { "node": ">=6" } @@ -30681,8 +30655,8 @@ "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", - "dev": true, "optional": true, + "peer": true, "engines": { "node": ">=0.6.11 <=0.7.0 || >=0.7.3" } @@ -30776,8 +30750,7 @@ "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", - "dev": true + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "node_modules/typedoc": { "version": "0.23.25", @@ -31066,7 +31039,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", "integrity": "sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==", - "dev": true, "dependencies": { "prepend-http": "^2.0.0" }, @@ -32201,7 +32173,6 @@ "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "dev": true, "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" @@ -32474,6 +32445,7 @@ }, "peerDependencies": { "@k8slens/application": "^6.4.0-beta.13", + "@k8slens/application-for-electron-main": "^6.4.0-beta.13", "@types/byline": "^4.2.33", "@types/chart.js": "^2.9.36", "@types/color": "^3.0.3", @@ -34300,6 +34272,7 @@ "license": "MIT", "dependencies": { "@k8slens/application": "^6.4.0-beta.13", + "@k8slens/application-for-electron-main": "^6.4.0-beta.13", "@k8slens/core": "^6.4.0-beta.13", "@k8slens/ensure-binaries": "^6.4.0-beta.13", "@k8slens/generate-tray-icons": "^6.4.0-beta.13", @@ -34825,6 +34798,7 @@ } }, "packages/technical-features/application/agnostic": { + "name": "@k8slens/application", "version": "6.4.0-beta.13", "license": "MIT", "devDependencies": { @@ -34839,6 +34813,23 @@ "lodash": "^4.17.15" } }, + "packages/technical-features/application/electron-main": { + "name": "@k8slens/application-for-electron-main", + "version": "6.4.0-beta.13", + "license": "MIT", + "devDependencies": { + "@async-fn/jest": "^1.6.4", + "@ogre-tools/test-utils": "^15.1.1" + }, + "peerDependencies": { + "@k8slens/application": "6.4.0-beta.13", + "@k8slens/feature-core": "^0.0.1", + "@ogre-tools/injectable": "^15.1.1", + "@ogre-tools/injectable-extension-for-auto-registration": "^15.1.1", + "@ogre-tools/injectable-utils": "^15.1.1", + "electron": "^19.1.9" + } + }, "packages/technical-features/feature-core": { "name": "@k8slens/feature-core", "version": "0.0.1", diff --git a/packages/technical-features/application/agnostic/src/start-application/start-application.injectable.ts b/packages/technical-features/application/agnostic/src/start-application/start-application.injectable.ts index 80fcbf67ce..4d9d8c9da2 100644 --- a/packages/technical-features/application/agnostic/src/start-application/start-application.injectable.ts +++ b/packages/technical-features/application/agnostic/src/start-application/start-application.injectable.ts @@ -4,7 +4,7 @@ import { beforeApplicationIsLoadingInjectionToken } from "./timeslots/before-app import { onLoadOfApplicationInjectionToken } from "./timeslots/on-load-of-application-injection-token"; import { afterApplicationIsLoadedInjectionToken } from "./timeslots/after-application-is-loaded-injection-token"; -export type StartApplication = () => void; +export type StartApplication = () => Promise; export const startApplicationInjectionToken = getInjectionToken({ diff --git a/packages/technical-features/application/electron-main/index.ts b/packages/technical-features/application/electron-main/index.ts index d1d57d4fe7..a402fd864f 100644 --- a/packages/technical-features/application/electron-main/index.ts +++ b/packages/technical-features/application/electron-main/index.ts @@ -1 +1,8 @@ +import { overrideSideEffectsWithFakes } from "./src/override-side-effects-with-fakes"; + +export { beforeElectronIsReadyInjectionToken } from "./src/start-application/timeslots/before-electron-is-ready-injection-token"; +export { beforeAnythingInjectionToken } from "./src/start-application/timeslots/before-anything-injection-token"; + export { feature } from "./src/feature"; + +export const testUtils = { overrideSideEffectsWithFakes } diff --git a/packages/technical-features/application/electron-main/package.json b/packages/technical-features/application/electron-main/package.json index 16e7981eff..558602829b 100644 --- a/packages/technical-features/application/electron-main/package.json +++ b/packages/technical-features/application/electron-main/package.json @@ -30,14 +30,15 @@ }, "peerDependencies": { "@k8slens/feature-core": "^0.0.1", - "@ogre-tools/fp": "^15.1.1", + "@k8slens/application": "6.4.0-beta.13", "@ogre-tools/injectable": "^15.1.1", "@ogre-tools/injectable-extension-for-auto-registration": "^15.1.1", "@ogre-tools/injectable-utils": "^15.1.1", - "lodash": "^4.17.15" + "electron": "^19.1.9" }, "devDependencies": { - "@async-fn/jest": "^1.6.4" + "@async-fn/jest": "^1.6.4", + "@ogre-tools/test-utils": "^15.1.1" } } diff --git a/packages/technical-features/application/electron-main/src/electron/electron-app.injectable.ts b/packages/technical-features/application/electron-main/src/electron/electron-app.injectable.ts new file mode 100644 index 0000000000..52b037c4e1 --- /dev/null +++ b/packages/technical-features/application/electron-main/src/electron/electron-app.injectable.ts @@ -0,0 +1,14 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ +import { getInjectable } from "@ogre-tools/injectable"; +import { app } from "electron"; + +const electronAppInjectable = getInjectable({ + id: "electron-app", + instantiate: () => app, + causesSideEffects: true, +}); + +export default electronAppInjectable; diff --git a/packages/technical-features/application/electron-main/src/electron/electron-app.test.ts b/packages/technical-features/application/electron-main/src/electron/electron-app.test.ts new file mode 100644 index 0000000000..3b6b1f7e2b --- /dev/null +++ b/packages/technical-features/application/electron-main/src/electron/electron-app.test.ts @@ -0,0 +1,17 @@ +import electronAppInjectable from "./electron-app.injectable"; +import { app } from 'electron'; +import { createContainer } from "@ogre-tools/injectable"; +import { feature } from "../feature"; +import { registerFeature } from "@k8slens/feature-core"; + +describe('electron-app', () => { + it('is electron app', () => { + const di = createContainer('irrelevant'); + + registerFeature(di, feature) + + const actual = di.inject(electronAppInjectable); + + expect(actual).toBe(app); + }); +}); diff --git a/packages/technical-features/application/electron-main/src/feature.ts b/packages/technical-features/application/electron-main/src/feature.ts index d2ea3df020..36f1b7c4eb 100644 --- a/packages/technical-features/application/electron-main/src/feature.ts +++ b/packages/technical-features/application/electron-main/src/feature.ts @@ -1,8 +1,9 @@ import { getFeature } from "@k8slens/feature-core"; import { autoRegister } from "@ogre-tools/injectable-extension-for-auto-registration"; +import { feature as applicationFeature } from '@k8slens/application'; export const feature = getFeature({ - id: "application", + id: "application-for-electron-main", register: (di) => { autoRegister({ @@ -14,4 +15,8 @@ export const feature = getFeature({ ], }); }, + + dependencies: [ + applicationFeature + ] }); diff --git a/packages/technical-features/application/electron-main/src/override-side-effects-with-fakes.ts b/packages/technical-features/application/electron-main/src/override-side-effects-with-fakes.ts new file mode 100644 index 0000000000..0d33c944d8 --- /dev/null +++ b/packages/technical-features/application/electron-main/src/override-side-effects-with-fakes.ts @@ -0,0 +1,6 @@ +import type { DiContainer } from "@ogre-tools/injectable"; +import whenAppIsReadyInjectable from "./start-application/when-app-is-ready.injectable"; + +export const overrideSideEffectsWithFakes = (di: DiContainer) => { + di.override(whenAppIsReadyInjectable, () => () => Promise.resolve()) +}; diff --git a/packages/technical-features/application/electron-main/src/start-application/start-electron-application.injectable.ts b/packages/technical-features/application/electron-main/src/start-application/start-electron-application.injectable.ts new file mode 100644 index 0000000000..28abc4a72d --- /dev/null +++ b/packages/technical-features/application/electron-main/src/start-application/start-electron-application.injectable.ts @@ -0,0 +1,56 @@ +import { + DiContainer, + getInjectable, + instantiationDecoratorToken, + lifecycleEnum, +} from "@ogre-tools/injectable"; +import { startApplicationInjectionToken } from "@k8slens/application"; +import whenAppIsReadyInjectable from "./when-app-is-ready.injectable"; +import { beforeAnythingInjectionToken } from "./timeslots/before-anything-injection-token"; +import { beforeElectronIsReadyInjectionToken } from "./timeslots/before-electron-is-ready-injection-token"; +import { runManySyncFor } from "@ogre-tools/injectable-utils"; + +const startElectronApplicationInjectable = getInjectable({ + id: "start-electron-application", + + instantiate: () => ({ + decorate: + (toBeDecorated: unknown) => + (di: DiContainer, ...args: unknown[]) => { + const whenAppIsReady = di.inject(whenAppIsReadyInjectable); + const runManySync = runManySyncFor(di); + const beforeAnything = runManySync(beforeAnythingInjectionToken); + const beforeElectronIsReady = runManySync( + beforeElectronIsReadyInjectionToken + ); + + const typedToBeDecorated = toBeDecorated as ( + di: DiContainer, + ...args: unknown[] + ) => unknown; + + const startApplication = typedToBeDecorated(di, ...args) as ( + ...args: unknown[] + ) => unknown; + + return async (...startApplicationArgs: unknown[]) => { + beforeAnything(); + beforeElectronIsReady(); + + await whenAppIsReady(); + + return startApplication(...startApplicationArgs); + }; + }, + + target: startApplicationInjectionToken, + }), + + decorable: false, + + injectionToken: instantiationDecoratorToken, + + lifecycle: lifecycleEnum.singleton, +}); + +export default startElectronApplicationInjectable; diff --git a/packages/technical-features/application/electron-main/src/start-application/timeslots/before-anything-injection-token.ts b/packages/technical-features/application/electron-main/src/start-application/timeslots/before-anything-injection-token.ts new file mode 100644 index 0000000000..f8d2ef9203 --- /dev/null +++ b/packages/technical-features/application/electron-main/src/start-application/timeslots/before-anything-injection-token.ts @@ -0,0 +1,6 @@ +import { getInjectionToken } from "@ogre-tools/injectable"; +import type { Runnable } from "@ogre-tools/injectable-utils"; + +export const beforeAnythingInjectionToken = getInjectionToken({ + id: "before-anything", +}); diff --git a/packages/technical-features/application/electron-main/src/start-application/timeslots/before-electron-is-ready-injection-token.ts b/packages/technical-features/application/electron-main/src/start-application/timeslots/before-electron-is-ready-injection-token.ts new file mode 100644 index 0000000000..c8c88bddae --- /dev/null +++ b/packages/technical-features/application/electron-main/src/start-application/timeslots/before-electron-is-ready-injection-token.ts @@ -0,0 +1,6 @@ +import { getInjectionToken } from "@ogre-tools/injectable"; +import type { Runnable } from "@ogre-tools/injectable-utils"; + +export const beforeElectronIsReadyInjectionToken = getInjectionToken({ + id: "before-electron-is-ready-injection-token", +}); diff --git a/packages/technical-features/application/electron-main/src/start-application/when-app-is-ready.injectable.ts b/packages/technical-features/application/electron-main/src/start-application/when-app-is-ready.injectable.ts new file mode 100644 index 0000000000..27c169b2c2 --- /dev/null +++ b/packages/technical-features/application/electron-main/src/start-application/when-app-is-ready.injectable.ts @@ -0,0 +1,16 @@ +import { getInjectable } from "@ogre-tools/injectable"; +import electronAppInjectable from "../electron/electron-app.injectable"; + +const whenAppIsReadyInjectable = getInjectable({ + id: "when-app-is-ready", + + instantiate: (di) => { + const electronApp = di.inject(electronAppInjectable); + + return () => electronApp.whenReady(); + }, + + decorable: false, +}); + +export default whenAppIsReadyInjectable; diff --git a/packages/technical-features/application/electron-main/src/start-application/when-app-is-ready/when-app-is-ready.test.ts b/packages/technical-features/application/electron-main/src/start-application/when-app-is-ready/when-app-is-ready.test.ts new file mode 100644 index 0000000000..0385c0abe7 --- /dev/null +++ b/packages/technical-features/application/electron-main/src/start-application/when-app-is-ready/when-app-is-ready.test.ts @@ -0,0 +1,50 @@ +import { createContainer, DiContainer } from "@ogre-tools/injectable"; +import { feature } from "../../feature"; +import { registerFeature } from "@k8slens/feature-core"; +import whenAppIsReadyInjectable from "../when-app-is-ready.injectable"; +import { getPromiseStatus } from "@ogre-tools/test-utils"; +import electronAppInjectable from "../../electron/electron-app.injectable"; +import type { AsyncFnMock } from "@async-fn/jest"; +import asyncFn from "@async-fn/jest"; + +describe("when-app-is-ready", () => { + let di: DiContainer; + let whenReadyMock: AsyncFnMock<() => Promise>; + + beforeEach(() => { + di = createContainer("irrelevant"); + + registerFeature(di, feature); + + whenReadyMock = asyncFn(); + + di.override( + electronAppInjectable, + () => ({ whenReady: whenReadyMock } as unknown) + ); + }); + + describe("when called", () => { + let actualPromise: Promise; + + beforeEach(() => { + const whenAppIsReady = di.inject(whenAppIsReadyInjectable); + + actualPromise = whenAppIsReady(); + }); + + it("does not resolve yet", async () => { + const promiseStatus = await getPromiseStatus(actualPromise); + + expect(promiseStatus.fulfilled).toBe(false); + }); + + it("when app is ready, resolves", async () => { + await whenReadyMock.resolve(); + + const promiseStatus = await getPromiseStatus(actualPromise); + + expect(promiseStatus.fulfilled).toBe(true); + }); + }); +}); diff --git a/packages/technical-features/application/electron-main/src/starting-of-electron-main-application.test.ts b/packages/technical-features/application/electron-main/src/starting-of-electron-main-application.test.ts new file mode 100644 index 0000000000..0abd9a9268 --- /dev/null +++ b/packages/technical-features/application/electron-main/src/starting-of-electron-main-application.test.ts @@ -0,0 +1,94 @@ +import { + createContainer, + DiContainer, + getInjectable, +} from "@ogre-tools/injectable"; +import { registerFeature } from "@k8slens/feature-core"; +import { feature } from "./feature"; +import { + beforeApplicationIsLoadingInjectionToken, + startApplicationInjectionToken, +} from "@k8slens/application"; +import asyncFn, { AsyncFnMock } from "@async-fn/jest"; +import whenAppIsReadyInjectable from "./start-application/when-app-is-ready.injectable"; +import { beforeAnythingInjectionToken } from "./start-application/timeslots/before-anything-injection-token"; +import { beforeElectronIsReadyInjectionToken } from "./start-application/timeslots/before-electron-is-ready-injection-token"; + +describe("starting-of-electron-main-application", () => { + let di: DiContainer; + let beforeAnythingMock: jest.Mock; + let beforeElectronIsReadyMock: jest.Mock; + let beforeApplicationIsLoadingMock: AsyncFnMock<() => Promise>; + let whenAppIsReadyMock: AsyncFnMock<() => Promise>; + + beforeEach(() => { + di = createContainer("irrelevant"); + + beforeAnythingMock = jest.fn(); + beforeElectronIsReadyMock = jest.fn(); + + beforeApplicationIsLoadingMock = asyncFn(); + whenAppIsReadyMock = asyncFn(); + + registerFeature(di, feature); + + const beforeAnythingIsLoadingInjectable = getInjectable({ + id: "before-anything", + instantiate: () => ({ run: beforeAnythingMock }), + injectionToken: beforeAnythingInjectionToken, + }); + + const beforeElectronIsReadyIsLoadingInjectable = getInjectable({ + id: "before-electron-is-ready", + instantiate: () => ({ run: beforeElectronIsReadyMock }), + injectionToken: beforeElectronIsReadyInjectionToken, + }); + + const beforeApplicationIsLoadingInjectable = getInjectable({ + id: "before-application-is-loading", + instantiate: () => ({ run: beforeApplicationIsLoadingMock }), + injectionToken: beforeApplicationIsLoadingInjectionToken, + }); + + di.register( + beforeAnythingIsLoadingInjectable, + beforeElectronIsReadyIsLoadingInjectable, + beforeApplicationIsLoadingInjectable + ); + + di.override(whenAppIsReadyInjectable, () => whenAppIsReadyMock); + }); + + describe("when application is started", () => { + beforeEach(() => { + const startApplication = di.inject(startApplicationInjectionToken); + + startApplication(); + }); + + it("calls for synchronous runnables for before anything", () => { + expect(beforeAnythingMock).toHaveBeenCalled(); + }); + + it("calls for synchronous runnables for before electron is ready", () => { + expect(beforeElectronIsReadyMock).toHaveBeenCalled(); + }); + it("calls to wait when electron is ready", () => { + expect(whenAppIsReadyMock).toHaveBeenCalled(); + }); + + it("does not call runnables for before application is loading yet", () => { + expect(beforeApplicationIsLoadingMock).not.toHaveBeenCalled(); + }); + + describe("when electron is ready", () => { + beforeEach(async () => { + await whenAppIsReadyMock.resolve(); + }); + + it("calls runnables for before application is loading", () => { + expect(beforeApplicationIsLoadingMock).toHaveBeenCalled(); + }); + }); + }); +});