From c9b1849314819d33689fd1229926e6fb1a9bd606 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Sep 2022 08:36:23 -0400 Subject: [PATCH 001/280] Bump typescript from 4.8.2 to 4.8.3 (#6216) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c206996bbc..34df5c68e5 100644 --- a/package.json +++ b/package.json @@ -429,7 +429,7 @@ "typed-emitter": "^1.4.0", "typedoc": "0.23.14", "typedoc-plugin-markdown": "^3.13.1", - "typescript": "^4.8.2", + "typescript": "^4.8.3", "typescript-plugin-css-modules": "^3.4.0", "webpack": "^5.74.0", "webpack-cli": "^4.9.2", diff --git a/yarn.lock b/yarn.lock index d753fda2fb..2fcacf8460 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12639,10 +12639,10 @@ typescript-plugin-css-modules@^3.4.0: stylus "^0.54.8" tsconfig-paths "^3.9.0" -typescript@^4.8.2: - version "4.8.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.2.tgz#e3b33d5ccfb5914e4eeab6699cf208adee3fd790" - integrity sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw== +typescript@^4.8.3: + version "4.8.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.3.tgz#d59344522c4bc464a65a730ac695007fdb66dd88" + integrity sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig== typical@^4.0.0: version "4.0.0" From 2d6239123b4f32696e70c9bd09e9279c61a89a80 Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Fri, 9 Sep 2022 16:15:28 +0300 Subject: [PATCH 002/280] Install all extensions via package.json (#6214) --- .../extension-discovery.ts | 28 +++++-------------- .../extension-installer.ts | 4 +-- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/src/extensions/extension-discovery/extension-discovery.ts b/src/extensions/extension-discovery/extension-discovery.ts index 40df43ebdf..0d20db7d60 100644 --- a/src/extensions/extension-discovery/extension-discovery.ts +++ b/src/extensions/extension-discovery/extension-discovery.ts @@ -390,28 +390,11 @@ export class ExtensionDiscovery { async ensureExtensions(): Promise> { const bundledExtensions = await this.loadBundledExtensions(); - - await this.installBundledPackages(this.packageJsonPath, bundledExtensions); - const userExtensions = await this.loadFromFolder(this.localFolderPath, bundledExtensions.map((extension) => extension.manifest.name)); - - for (const extension of userExtensions) { - if (!(await this.dependencies.pathExists(extension.manifestPath))) { - try { - await this.dependencies.installExtension(extension.absolutePath); - } catch (error) { - const message = error instanceof Error - ? error.message - : String(error || "unknown error"); - const { name, version } = extension.manifest; - - this.dependencies.logger.error(`${logModule}: failed to install user extension ${name}@${version}: ${message}`); - } - } - } - const extensions = bundledExtensions.concat(userExtensions); + await this.installBundledPackages(this.packageJsonPath, extensions); + return this.extensions = new Map(extensions.map(extension => [extension.id, extension])); } @@ -420,10 +403,13 @@ export class ExtensionDiscovery { */ installBundledPackages(packageJsonPath: string, extensions: InstalledExtension[]): Promise { const dependencies = Object.fromEntries( - extensions.map(extension => [extension.manifest.name, extension.absolutePath]), + extensions.filter(extension => extension.isBundled).map(extension => [extension.manifest.name, extension.absolutePath]), + ); + const optionalDependencies = Object.fromEntries( + extensions.filter(extension => !extension.isBundled).map(extension => [extension.manifest.name, extension.absolutePath]), ); - return this.dependencies.installExtensions(packageJsonPath, { dependencies }); + return this.dependencies.installExtensions(packageJsonPath, { dependencies, optionalDependencies }); } async loadBundledExtensions(): Promise { diff --git a/src/extensions/extension-installer/extension-installer.ts b/src/extensions/extension-installer/extension-installer.ts index a2781f15bc..1764435a54 100644 --- a/src/extensions/extension-installer/extension-installer.ts +++ b/src/extensions/extension-installer/extension-installer.ts @@ -42,7 +42,7 @@ export class ExtensionInstaller { }); logger.info(`${logModule} installing dependencies at ${this.dependencies.extensionPackageRootDirectory}`); - await this.npm(["install", "--no-audit", "--only=prod", "--prefer-offline", "--no-package-lock"]); + await this.npm(["install", "--audit=false", "--fund=false", "--only=prod", "--prefer-offline"]); logger.info(`${logModule} dependencies installed at ${this.dependencies.extensionPackageRootDirectory}`); } finally { this.installLock.release(); @@ -58,7 +58,7 @@ export class ExtensionInstaller { try { logger.info(`${logModule} installing package from ${name} to ${this.dependencies.extensionPackageRootDirectory}`); - await this.npm(["install", "--no-audit", "--only=prod", "--package-lock=false", "--prefer-offline", "--no-package-lock", name]); + await this.npm(["install", "--audit=false", "--fund=false", "--only=prod", "--prefer-offline", name]); logger.info(`${logModule} package ${name} installed to ${this.dependencies.extensionPackageRootDirectory}`); } finally { this.installLock.release(); From 23cb231c8f46f0defba007806657c102a55298ab Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Fri, 9 Sep 2022 16:05:16 -0400 Subject: [PATCH 003/280] Fix discovering extensions with with scopes (#6221) --- src/extensions/extension-discovery/extension-discovery.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/extensions/extension-discovery/extension-discovery.ts b/src/extensions/extension-discovery/extension-discovery.ts index 0d20db7d60..e6f500805a 100644 --- a/src/extensions/extension-discovery/extension-discovery.ts +++ b/src/extensions/extension-discovery/extension-discovery.ts @@ -363,7 +363,8 @@ export class ExtensionDiscovery { const id = this.getInstalledManifestPath(manifest.name); const isEnabled = this.dependencies.extensionsStore.isEnabled({ id, isBundled }); const extensionDir = path.dirname(manifestPath); - const npmPackage = path.join(extensionDir, `${manifest.name}-${manifest.version}.tgz`); + const packedName = manifest.name.replaceAll("@", "").replaceAll("/", "-"); + const npmPackage = path.join(extensionDir, `${packedName}-${manifest.version}.tgz`); const absolutePath = (isProduction && await this.dependencies.pathExists(npmPackage)) ? npmPackage : extensionDir; const isCompatible = isBundled || this.dependencies.isCompatibleExtension(manifest); From 268e302a59495c460b33b7502a99c9dcb4bb1cfb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 09:38:52 -0400 Subject: [PATCH 004/280] Bump @swc/core from 1.2.249 to 1.3.0 (#6228) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 138 +++++++++++++++++++++++++-------------------------- 2 files changed, 70 insertions(+), 70 deletions(-) diff --git a/package.json b/package.json index 34df5c68e5..98710791d7 100644 --- a/package.json +++ b/package.json @@ -302,7 +302,7 @@ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7", "@sentry/types": "^6.19.7", "@swc/cli": "^0.1.57", - "@swc/core": "^1.2.249", + "@swc/core": "^1.3.0", "@swc/jest": "^0.2.22", "@testing-library/dom": "^7.31.2", "@testing-library/jest-dom": "^5.16.5", diff --git a/yarn.lock b/yarn.lock index 2fcacf8460..1b80c36542 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1622,101 +1622,101 @@ slash "3.0.0" source-map "^0.7.3" -"@swc/core-android-arm-eabi@1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.2.249.tgz#3aa864f15f47e5f66886a2a6cf838a93813cbb38" - integrity sha512-iOcGLHCsqZHQWGmgLEzagkRct40S3MjVBPQ/swR5kHUZef+//pjGyrr3RVyrp7bxb1Q0RaIKM8iZEvBiG6NGmw== +"@swc/core-android-arm-eabi@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.3.0.tgz#6ff8c5020e13794b536d6f0fd89817f2f10e8250" + integrity sha512-1F/U0Vh78ZL7OUlCfaRWCtnYnIfsMA8WDtKyf3UT9b3C0L5HajB9TgMH4c0OKhjfP5Q2/M1/Pm00A+96nhKH8A== dependencies: "@swc/wasm" "1.2.122" -"@swc/core-android-arm64@1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core-android-arm64/-/core-android-arm64-1.2.249.tgz#ee3435379b399f2ca651ba99c2ca380518a31e41" - integrity sha512-SraLJ+Vaa8sP/V+gWFVQEKO4QzRVOu8/Df4JYzGj+qEAxsUjE4sIigCyDtYhOvv3hW4Rm8iABJ7me0obRhV6PA== +"@swc/core-android-arm64@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core-android-arm64/-/core-android-arm64-1.3.0.tgz#e09c3f6cc478f2c501d5441eb566a4e2c5b88368" + integrity sha512-dtryoOvQ27s9euAcLinExuaU+mMr8o0N8CBTH3f+JwKjQsIa9v0jPOjJ9jaWktnAdDy/FztB5iBCqTAwbqRG/w== dependencies: "@swc/wasm" "1.2.130" -"@swc/core-darwin-arm64@1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.2.249.tgz#99220e1e10bf02728e9ca3bed31c3b0d634dc9aa" - integrity sha512-nlS9wX0tnq1DGv+I8h/KF3SuqZbn5B/+EDq3m88jE/X8RVNFTXkbO10nKQaXkPIEwOzUX3ImQoa070B/P4Gdhw== +"@swc/core-darwin-arm64@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.0.tgz#232e96f2a84da8698c1125684d489f8bec587d35" + integrity sha512-WSf29/wneQf5k7mdLKqaSRLDycIZaLATc6m7BKpFi34iCGSvXJfc375OrVG9BS0rReX5LT49XxXp6GQs9oFmVA== -"@swc/core-darwin-x64@1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.2.249.tgz#578ea5854603985bf3bcd15ffed71f20d96e1f63" - integrity sha512-myWcyqp541emXd+bLQ2G6fL7elpsO9D/r04ImvgPrNoESe2UhvkhXQ6T548nxg5qNprSzFRYQGOdD8ydaQSWKg== +"@swc/core-darwin-x64@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.0.tgz#37d89cfa54311db31302fed8888db03460ccd166" + integrity sha512-eDa1EZAnchMtkdZ52bWfseKla370c8BCj/RWAtHJcZMon3WVkWcZlMgZPPiPIxYz8hGtomqs+pkQv34hEVcx0A== -"@swc/core-freebsd-x64@1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core-freebsd-x64/-/core-freebsd-x64-1.2.249.tgz#795349a9a85fef86f080e2b5ce39f4ba770ad44c" - integrity sha512-f2ahMbHGGAjGbDeKcsKed2oiW68hMJtBZaH0DUrg/VbDE9lkiIEdmU/Qpb1eDJjOtEpm1V47OTAeOpcJm3Fo3g== +"@swc/core-freebsd-x64@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core-freebsd-x64/-/core-freebsd-x64-1.3.0.tgz#652995139abe70d67e082168cbc44e726efdca61" + integrity sha512-ZV9rRmUZqJGCYqnV/3aIJUHELY/MFyABowDN8ijCvN67EjGfoNYx0jpd4hzFWwGC8LohthHNi6hiFfmnvGaKsw== dependencies: "@swc/wasm" "1.2.130" -"@swc/core-linux-arm-gnueabihf@1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.2.249.tgz#09433f7df8b8ec6b2543121e7ff50403d5ad0cd9" - integrity sha512-RMcvTRSGhWBVRZbHT2wip4GSC8PiN9OtQqz0rcQw7uPfYKcaRKN/7b4HmJvuN1u6WDx+loq+GmnvN8ncLD3aXA== +"@swc/core-linux-arm-gnueabihf@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.0.tgz#25a3260634527a678fa83d5e6aa9726fad6f1f32" + integrity sha512-3fPWh4SB3lz0ZlQWsHjqZFJK1SIkYqjLpm6mR1jzp/LJx4Oq1baid9CP1eiLd/rijSIgVdUJNMGfiOK9uymEbw== dependencies: "@swc/wasm" "1.2.130" -"@swc/core-linux-arm64-gnu@1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.2.249.tgz#20585c96b1d9419632303afec33130bae9612db3" - integrity sha512-EErpv+SZK5mqoKnhxw2VSW7QsGgeYVV7UL4XgfOxLUqDLXq8W/WDgsnhLsj+D8SSOIxFKRGnM6A3Au/XHwTV4w== +"@swc/core-linux-arm64-gnu@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.0.tgz#f9fd72628f19504a62d663e80fc0a306913c34bd" + integrity sha512-CavXNYHKaPTMOvRXh1u7ZfMS5hKDXNSWTdeo+1+2M2XLCP0r0+2Iaeg0IZJD8nIwAlwwP8+rskan2Ekq6jaIfw== -"@swc/core-linux-arm64-musl@1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.2.249.tgz#300a77db97a56f7fbd705425fa737451dd1fa681" - integrity sha512-5ig/Aju0yP9ljBeqCGsxBCAZRVBNPVFUroxv51hAWk5ji0CIROctfWH4NkpsJqC9AyGxZPw3Q/cqzUe5o0Gc5A== +"@swc/core-linux-arm64-musl@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.0.tgz#a80dd31211d6d866139cee6237edd919393c5f08" + integrity sha512-/3UiX8jH+OWleJbqYiwJEf4GQKP6xnm/6gyBt7V0GdhM4/ETMvzTFUNRObgpmxYMhXmNGAlxekU8+0QuAvyRJQ== -"@swc/core-linux-x64-gnu@1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.249.tgz#5b684c4b43625ce3a970df6d25094f22686f1430" - integrity sha512-lE9uzEXj0f4Qw53yHTf5j0hH2WgwbQstTamaUBFHGXGAUlqhSMJW9Yc1pvejbDD1VAADCeqc1eSNH3aihMRP4A== +"@swc/core-linux-x64-gnu@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.0.tgz#6463fc20af367391da3e612438e8f302b89c6d6b" + integrity sha512-Ds76Lu7vfE01rgFcf9O1OuNBwQSHBpGwGOKGnwob6T2SCR4DBQz4MD0jLw/tdCZGR8x7NVMteBzQAp3CsUORZw== -"@swc/core-linux-x64-musl@1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.2.249.tgz#66d02bce7df54386947b68296e934c7029a14f5a" - integrity sha512-2hiUkpRgGXEJz2+SoaZIRUuPWeBKj3PH28fN0WR9HIqbglU8gKr3LHyQKbx8SRBosYeSbRSFknw44ucK7IY9rQ== +"@swc/core-linux-x64-musl@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.0.tgz#534d1b5368d42fcf9901cbc33f144367b0961e45" + integrity sha512-fgGq/SyX6DsTgJIujBbopaEu17f8u+cyTsJBluc5cF7HxspB4wC72sdq4KGgUoEYObVTgFejnEBZkm8hLOCwYA== -"@swc/core-win32-arm64-msvc@1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.2.249.tgz#d77dcf2ab4627465b936d9afce320d1e6dcd81bd" - integrity sha512-lP8Gvqnj6FSnJpNkR06yd522CUS3HbS7D1ZWhxlr7xy2xB9bmQhQL3CloZONVRBU+0vvwE54p4k5X6/oJus+qQ== +"@swc/core-win32-arm64-msvc@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.0.tgz#1797b9d2729673fa5715315f671de2a52bbd6e37" + integrity sha512-7B7XggbCmm1oHeNvz5ekWmWmJP/WeGpmGZ10Qca3/zrVm+IRN4ZBT+jpWm+cuuYJh0Llr5UYgTFib3cyOLWkJg== dependencies: "@swc/wasm" "1.2.130" -"@swc/core-win32-ia32-msvc@1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.2.249.tgz#98305c32d6ce6114be0980542075477aed1843d9" - integrity sha512-zm4Wj1cvmiBHShRhX33hSzI/I7FctWA6svxlsx1zEQmTtKSqUqEKoswy/XUNsJ9p6Knf9INLPItfv/7HI/Eqaw== +"@swc/core-win32-ia32-msvc@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.0.tgz#835c3f41ff6e01a53cbcfebafe9784e135847f08" + integrity sha512-vDIu5FjoqB3G7awWCyNsUh5UAzTtJPMEwG75Cwx51fxMPxXrVPHP6XpRovIjQ5wiKL5lGqicckieduJkgBvp7Q== dependencies: "@swc/wasm" "1.2.130" -"@swc/core-win32-x64-msvc@1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.249.tgz#0b3eb647a285ec94d17230f13c3bf0299ef41913" - integrity sha512-IxRvePerNYVJXr6lk0P09y1XAqPncMHWWvWm7p3CvTAfxEuiM5DqD5wtIbFMXfPSi1TTSkzAqBoH6Nushvgb3Q== +"@swc/core-win32-x64-msvc@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.0.tgz#7197ac806ab0673268cbf394f9dcf0fcec160aa2" + integrity sha512-ZEgMvq01Ningz6IOD6ixrpsfA83u+B/1TwnYmWuRl9hMml9lnPwdg3o1P0pwbSO1moKlUhSwc8WVYmI0bXF+gA== -"@swc/core@^1.2.249": - version "1.2.249" - resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.2.249.tgz#5fb1e2654fadadb7bc1b846f77627a92f36d174b" - integrity sha512-aXAoNQLfba/3YcR6wdBM21Gp3q+G6Ay9Ey+BZHOBGW5amewzd84WYKIMoIc4fZhFj9dv6UaUu3B9qD+4oP/zhg== +"@swc/core@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.0.tgz#4bc9006cdb5de8f63c4e5b280d89f71f3384b39a" + integrity sha512-0mshAzMvdhL0v3lNMJowzMd8Du0bJf+PUTxhVm4uIb/h8qCDQjFERXj0RGejcDFSL7fJzLI3MzS5WR45KDrrLA== optionalDependencies: - "@swc/core-android-arm-eabi" "1.2.249" - "@swc/core-android-arm64" "1.2.249" - "@swc/core-darwin-arm64" "1.2.249" - "@swc/core-darwin-x64" "1.2.249" - "@swc/core-freebsd-x64" "1.2.249" - "@swc/core-linux-arm-gnueabihf" "1.2.249" - "@swc/core-linux-arm64-gnu" "1.2.249" - "@swc/core-linux-arm64-musl" "1.2.249" - "@swc/core-linux-x64-gnu" "1.2.249" - "@swc/core-linux-x64-musl" "1.2.249" - "@swc/core-win32-arm64-msvc" "1.2.249" - "@swc/core-win32-ia32-msvc" "1.2.249" - "@swc/core-win32-x64-msvc" "1.2.249" + "@swc/core-android-arm-eabi" "1.3.0" + "@swc/core-android-arm64" "1.3.0" + "@swc/core-darwin-arm64" "1.3.0" + "@swc/core-darwin-x64" "1.3.0" + "@swc/core-freebsd-x64" "1.3.0" + "@swc/core-linux-arm-gnueabihf" "1.3.0" + "@swc/core-linux-arm64-gnu" "1.3.0" + "@swc/core-linux-arm64-musl" "1.3.0" + "@swc/core-linux-x64-gnu" "1.3.0" + "@swc/core-linux-x64-musl" "1.3.0" + "@swc/core-win32-arm64-msvc" "1.3.0" + "@swc/core-win32-ia32-msvc" "1.3.0" + "@swc/core-win32-x64-msvc" "1.3.0" "@swc/jest@^0.2.22": version "0.2.22" From 88269d9967eb3e8b3291651ec7ce906c9b290fc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 09:39:22 -0400 Subject: [PATCH 005/280] Bump eslint-plugin-react from 7.31.7 to 7.31.8 (#6230) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 98710791d7..b61b84235d 100644 --- a/package.json +++ b/package.json @@ -383,7 +383,7 @@ "eslint": "^8.23.0", "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.26.0", - "eslint-plugin-react": "7.31.7", + "eslint-plugin-react": "7.31.8", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-unused-imports": "^2.0.0", "flex.box": "^3.4.4", diff --git a/yarn.lock b/yarn.lock index 1b80c36542..7a44365f32 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5682,10 +5682,10 @@ eslint-plugin-react-hooks@^4.6.0: resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3" integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g== -eslint-plugin-react@7.31.7: - version "7.31.7" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.31.7.tgz#36fb1c611a7db5f757fce09cbbcc01682f8b0fbb" - integrity sha512-8NldBTeYp/kQoTV1uT0XF6HcmDqbgZ0lNPkN0wlRw8DJKXEnaWu+oh/6gt3xIhzvQ35wB2Y545fJhIbJSZ2NNw== +eslint-plugin-react@7.31.8: + version "7.31.8" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.31.8.tgz#3a4f80c10be1bcbc8197be9e8b641b2a3ef219bf" + integrity sha512-5lBTZmgQmARLLSYiwI71tiGVTLUuqXantZM6vlSY39OaDSV0M7+32K5DnLkmFrwTe+Ksz0ffuLUC91RUviVZfw== dependencies: array-includes "^3.1.5" array.prototype.flatmap "^1.3.0" From caac17f4e61c6e1ee28193668c791831acd40b07 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 09:39:40 -0400 Subject: [PATCH 006/280] Bump @types/lodash from 4.14.184 to 4.14.185 (#6227) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b61b84235d..32f0def800 100644 --- a/package.json +++ b/package.json @@ -327,7 +327,7 @@ "@types/jest": "^28.1.6", "@types/js-yaml": "^4.0.5", "@types/jsdom": "^16.2.14", - "@types/lodash": "^4.14.184", + "@types/lodash": "^4.14.185", "@types/marked": "^4.0.7", "@types/md5-file": "^4.0.2", "@types/mini-css-extract-plugin": "^2.4.0", diff --git a/yarn.lock b/yarn.lock index 7a44365f32..6fcd0f7783 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2219,10 +2219,10 @@ dependencies: "@types/node" "*" -"@types/lodash@^4.14.184": - version "4.14.184" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.184.tgz#23f96cd2a21a28e106dc24d825d4aa966de7a9fe" - integrity sha512-RoZphVtHbxPZizt4IcILciSWiC6dcn+eZ8oX9IWEYfDMcocdd42f7NPI6fQj+6zI8y4E0L7gu2pcZKLGTRaV9Q== +"@types/lodash@^4.14.185": + version "4.14.185" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.185.tgz#c9843f5a40703a8f5edfd53358a58ae729816908" + integrity sha512-evMDG1bC4rgQg4ku9tKpuMh5iBNEwNa3tf9zRHdP1qlv+1WUg44xat4IxCE14gIpZRGUUWAx2VhItCZc25NfMA== "@types/marked@^4.0.7": version "4.0.7" From 8fb289c1a42ef06a5eb6a3dd430b0bed30feca57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 09:40:13 -0400 Subject: [PATCH 007/280] Bump @kubernetes/client-node from 0.17.0 to 0.17.1 (#6229) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 55 ++++++++++------------------------------------------ 2 files changed, 11 insertions(+), 46 deletions(-) diff --git a/package.json b/package.json index 32f0def800..4441460b6a 100644 --- a/package.json +++ b/package.json @@ -216,7 +216,7 @@ "@astronautlabs/jsonpath": "^1.1.0", "@hapi/call": "^9.0.0", "@hapi/subtext": "^7.0.4", - "@kubernetes/client-node": "^0.17.0", + "@kubernetes/client-node": "^0.17.1", "@material-ui/styles": "^4.11.5", "@ogre-tools/fp": "10.1.0", "@ogre-tools/injectable": "10.1.0", diff --git a/yarn.lock b/yarn.lock index 6fcd0f7783..5da20e3f86 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1062,24 +1062,16 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@kubernetes/client-node@^0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@kubernetes/client-node/-/client-node-0.17.0.tgz#cbf69ff6c8a311c1461275169612ac46db00fe3f" - integrity sha512-oKQfRf7RPpJIF2Ft92g6jefbW3Mddf6IzcfpBNDWrAy66LmyAWds6fQTMsdutGPuXV6KD29u6RfM3rdzddGMIA== +"@kubernetes/client-node@^0.17.1": + version "0.17.1" + resolved "https://registry.yarnpkg.com/@kubernetes/client-node/-/client-node-0.17.1.tgz#a5740712848d77823e7d0eee70229936398b4142" + integrity sha512-qXANjukuTq/drb1hq1NCYZafpdRTvbyTzbliWO6RwW7eEb2b9qwINbw0DiVHpBQg3e9DeQd8+brI1sR1Fck5kQ== dependencies: - "@types/js-yaml" "^4.0.1" - "@types/node" "^10.12.0" - "@types/request" "^2.47.1" - "@types/stream-buffers" "^3.0.3" - "@types/tar" "^4.0.3" - "@types/underscore" "^1.8.9" - "@types/ws" "^6.0.1" byline "^5.0.0" execa "5.0.0" isomorphic-ws "^4.0.1" js-yaml "^4.1.0" jsonpath-plus "^0.19.0" - openid-client "^5.1.6" request "^2.88.0" rfc4648 "^1.3.0" shelljs "^0.8.5" @@ -1089,6 +1081,8 @@ tslib "^1.9.3" underscore "^1.9.1" ws "^7.3.1" + optionalDependencies: + openid-client "^5.1.6" "@leichtgewicht/ip-codec@^2.0.1": version "2.0.4" @@ -2183,7 +2177,7 @@ jest-matcher-utils "^28.0.0" pretty-format "^28.0.0" -"@types/js-yaml@^4.0.1", "@types/js-yaml@^4.0.5": +"@types/js-yaml@^4.0.5": version "4.0.5" resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.5.tgz#738dd390a6ecc5442f35e7f03fa1431353f7e138" integrity sha512-FhpRzf927MNQdRZP0J5DLIdTXhjLYzeUTmLAu69mnVksLH9CJY3IuSeEgbKUki7GQZm0WqDkGzyxju2EZGD2wA== @@ -2290,11 +2284,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.24.tgz#20ba1bf69c1b4ab405c7a01e950c4f446b05029f" integrity sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g== -"@types/node@^10.12.0": - version "10.17.60" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b" - integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== - "@types/node@^16.11.26", "@types/node@^16.11.58": version "16.11.58" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.58.tgz#0a3698dee3492617a8d5fe7998d18d7520b63026" @@ -2472,7 +2461,7 @@ dependencies: "@types/request" "*" -"@types/request@*", "@types/request@^2.47.1", "@types/request@^2.48.7": +"@types/request@*", "@types/request@^2.48.7": version "2.48.8" resolved "https://registry.yarnpkg.com/@types/request/-/request-2.48.8.tgz#0b90fde3b655ab50976cb8c5ac00faca22f5a82c" integrity sha512-whjk1EDJPcAR2kYHRbFl/lKeeKYTi05A15K9bnLInCVroNDCtXce57xKdI0/rQaA3K+6q0eFyUBPmqfSndUZdQ== @@ -2555,13 +2544,6 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== -"@types/stream-buffers@^3.0.3": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@types/stream-buffers/-/stream-buffers-3.0.4.tgz#bf128182da7bc62722ca0ddf5458a9c65f76e648" - integrity sha512-qU/K1tb2yUdhXkLIATzsIPwbtX6BpZk0l3dPW6xqWyhfzzM1ECaQ/8faEnu3CNraLiQ9LHyQQPBGp7N9Fbs25w== - dependencies: - "@types/node" "*" - "@types/tapable@^1": version "1.0.8" resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.8.tgz#b94a4391c85666c7b73299fd3ad79d4faa435310" @@ -2574,7 +2556,7 @@ dependencies: "@types/node" "*" -"@types/tar@^4.0.3", "@types/tar@^4.0.5": +"@types/tar@^4.0.5": version "4.0.5" resolved "https://registry.yarnpkg.com/@types/tar/-/tar-4.0.5.tgz#5f953f183e36a15c6ce3f336568f6051b7b183f3" integrity sha512-cgwPhNEabHaZcYIy5xeMtux2EmYBitfqEceBUi2t5+ETy4dW6kswt6WX4+HqLeiiKOo42EXbGiDmVJ2x+vi37Q== @@ -2623,11 +2605,6 @@ dependencies: source-map "^0.6.1" -"@types/underscore@^1.8.9": - version "1.11.4" - resolved "https://registry.yarnpkg.com/@types/underscore/-/underscore-1.11.4.tgz#62e393f8bc4bd8a06154d110c7d042a93751def3" - integrity sha512-uO4CD2ELOjw8tasUrAhvnn2W4A0ZECOvMjCivJr4gA9pGgjv+qxKWY9GLTMVEK8ej85BxQOocUyE7hImmSQYcg== - "@types/url-parse@^1.4.8": version "1.4.8" resolved "https://registry.yarnpkg.com/@types/url-parse/-/url-parse-1.4.8.tgz#c3825047efbca1295b7f1646f38203d9145130d6" @@ -2693,13 +2670,6 @@ tapable "^2.2.0" webpack "^5" -"@types/ws@^6.0.1": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-6.0.4.tgz#7797707c8acce8f76d8c34b370d4645b70421ff1" - integrity sha512-PpPrX7SZW9re6+Ha8ojZG4Se8AZXgf0GK6zmfqEuCsY49LFDNXO3SByp44X3dFEqtB73lkCDAdUazhAjVPiNwg== - dependencies: - "@types/node" "*" - "@types/ws@^8.5.1": version "8.5.3" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.3.tgz#7d25a1ffbecd3c4f2d35068d0b283c037003274d" @@ -12669,16 +12639,11 @@ undefsafe@^2.0.5: resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.5.tgz#38733b9327bdcd226db889fb723a6efd162e6e2c" integrity sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA== -underscore@1.7.0, underscore@^1.12.1: +underscore@1.7.0, underscore@^1.12.1, underscore@^1.9.1: version "1.13.4" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.4.tgz#7886b46bbdf07f768e0052f1828e1dcab40c0dee" integrity sha512-BQFnUDuAQ4Yf/cYY5LNrK9NCJFKriaRbD9uR1fTeXnBeoa97W0i41qkZfGO9pSo8I5KzjAcSY2XYtdf0oKd7KQ== -underscore@^1.9.1: - version "1.13.3" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.3.tgz#54bc95f7648c5557897e5e968d0f76bc062c34ee" - integrity sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA== - unique-filename@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" From 32e64ce41734aa1968e3ca60442d17e9c7160b72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 22:08:48 -0400 Subject: [PATCH 008/280] Bump eslint from 8.23.0 to 8.23.1 (#6233) Bumps [eslint](https://github.com/eslint/eslint) from 8.23.0 to 8.23.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.23.0...v8.23.1) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 4441460b6a..f648f6b8f5 100644 --- a/package.json +++ b/package.json @@ -380,7 +380,7 @@ "electron-notarize": "^0.3.0", "esbuild": "^0.15.7", "esbuild-loader": "^2.20.0", - "eslint": "^8.23.0", + "eslint": "^8.23.1", "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.26.0", "eslint-plugin-react": "7.31.8", diff --git a/yarn.lock b/yarn.lock index 5da20e3f86..74fbd8ffcf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -603,10 +603,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.15.7.tgz#1ec4af4a16c554cbd402cc557ccdd874e3f7be53" integrity sha512-IKznSJOsVUuyt7cDzzSZyqBEcZe+7WlBqTVXiF1OXP/4Nm387ToaXZ0fyLwI1iBlI/bzpxVq411QE2/Bt2XWWw== -"@eslint/eslintrc@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.1.tgz#de0807bfeffc37b964a7d0400e0c348ce5a2543d" - integrity sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ== +"@eslint/eslintrc@^1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.2.tgz#58b69582f3b7271d8fa67fe5251767a5b38ea356" + integrity sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -5717,12 +5717,12 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^8.23.0: - version "8.23.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.23.0.tgz#a184918d288820179c6041bb3ddcc99ce6eea040" - integrity sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA== +eslint@^8.23.1: + version "8.23.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.23.1.tgz#cfd7b3f7fdd07db8d16b4ac0516a29c8d8dca5dc" + integrity sha512-w7C1IXCc6fNqjpuYd0yPlcTKKmHlHHktRkzmBPZ+7cvNBQuiNjx0xaMTjAJGCafJhQkrFJooREv0CtrVzmHwqg== dependencies: - "@eslint/eslintrc" "^1.3.1" + "@eslint/eslintrc" "^1.3.2" "@humanwhocodes/config-array" "^0.10.4" "@humanwhocodes/gitignore-to-minimatch" "^1.0.2" "@humanwhocodes/module-importer" "^1.0.1" @@ -5741,7 +5741,6 @@ eslint@^8.23.0: fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" find-up "^5.0.0" - functional-red-black-tree "^1.0.1" glob-parent "^6.0.1" globals "^13.15.0" globby "^11.1.0" @@ -5750,6 +5749,7 @@ eslint@^8.23.0: import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" + js-sdsl "^4.1.4" js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" @@ -8026,6 +8026,11 @@ joycon@^3.0.1: resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03" integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== +js-sdsl@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.4.tgz#78793c90f80e8430b7d8dc94515b6c77d98a26a6" + integrity sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" From afebeb0e218ac5add46c7a81fba985e0feebbf73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 22:09:08 -0400 Subject: [PATCH 009/280] Bump @typescript-eslint/eslint-plugin from 5.36.2 to 5.37.0 (#6236) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.36.2 to 5.37.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.37.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 74 ++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 55 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index f648f6b8f5..aa7afce406 100644 --- a/package.json +++ b/package.json @@ -362,7 +362,7 @@ "@types/webpack-dev-server": "^4.7.2", "@types/webpack-env": "^1.18.0", "@types/webpack-node-externals": "^2.5.3", - "@typescript-eslint/eslint-plugin": "^5.36.2", + "@typescript-eslint/eslint-plugin": "^5.37.0", "@typescript-eslint/parser": "^5.36.2", "adr": "^1.4.1", "ansi_up": "^5.1.0", diff --git a/yarn.lock b/yarn.lock index 74fbd8ffcf..339f7f0904 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2703,14 +2703,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.36.2.tgz#6df092a20e0f9ec748b27f293a12cb39d0c1fe4d" - integrity sha512-OwwR8LRwSnI98tdc2z7mJYgY60gf7I9ZfGjN5EjCwwns9bdTuQfAXcsjSB2wSQ/TVNYSGKf4kzVXbNGaZvwiXw== +"@typescript-eslint/eslint-plugin@^5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.37.0.tgz#5ccdd5d9004120f28fc6e717fb4b5c9bddcfbc04" + integrity sha512-Fde6W0IafXktz1UlnhGkrrmnnGpAo1kyX7dnyHHVrmwJOn72Oqm3eYtddrpOwwel2W8PAK9F3pIL5S+lfoM0og== dependencies: - "@typescript-eslint/scope-manager" "5.36.2" - "@typescript-eslint/type-utils" "5.36.2" - "@typescript-eslint/utils" "5.36.2" + "@typescript-eslint/scope-manager" "5.37.0" + "@typescript-eslint/type-utils" "5.37.0" + "@typescript-eslint/utils" "5.37.0" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -2736,13 +2736,21 @@ "@typescript-eslint/types" "5.36.2" "@typescript-eslint/visitor-keys" "5.36.2" -"@typescript-eslint/type-utils@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.36.2.tgz#752373f4babf05e993adf2cd543a763632826391" - integrity sha512-rPQtS5rfijUWLouhy6UmyNquKDPhQjKsaKH0WnY6hl/07lasj8gPaH2UD8xWkePn6SC+jW2i9c2DZVDnL+Dokw== +"@typescript-eslint/scope-manager@5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.37.0.tgz#044980e4f1516a774a418dafe701a483a6c9f9ca" + integrity sha512-F67MqrmSXGd/eZnujjtkPgBQzgespu/iCZ+54Ok9X5tALb9L2v3G+QBSoWkXG0p3lcTJsL+iXz5eLUEdSiJU9Q== dependencies: - "@typescript-eslint/typescript-estree" "5.36.2" - "@typescript-eslint/utils" "5.36.2" + "@typescript-eslint/types" "5.37.0" + "@typescript-eslint/visitor-keys" "5.37.0" + +"@typescript-eslint/type-utils@5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.37.0.tgz#43ed2f567ada49d7e33a6e4b6f9babd060445fe5" + integrity sha512-BSx/O0Z0SXOF5tY0bNTBcDEKz2Ec20GVYvq/H/XNKiUorUFilH7NPbFUuiiyzWaSdN3PA8JV0OvYx0gH/5aFAQ== + dependencies: + "@typescript-eslint/typescript-estree" "5.37.0" + "@typescript-eslint/utils" "5.37.0" debug "^4.3.4" tsutils "^3.21.0" @@ -2751,6 +2759,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.36.2.tgz#a5066e500ebcfcee36694186ccc57b955c05faf9" integrity sha512-9OJSvvwuF1L5eS2EQgFUbECb99F0mwq501w0H0EkYULkhFa19Qq7WFbycdw1PexAc929asupbZcgjVIe6OK/XQ== +"@typescript-eslint/types@5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.37.0.tgz#09e4870a5f3af7af3f84e08d792644a87d232261" + integrity sha512-3frIJiTa5+tCb2iqR/bf7XwU20lnU05r/sgPJnRpwvfZaqCJBrl8Q/mw9vr3NrNdB/XtVyMA0eppRMMBqdJ1bA== + "@typescript-eslint/typescript-estree@5.36.2": version "5.36.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.36.2.tgz#0c93418b36c53ba0bc34c61fe9405c4d1d8fe560" @@ -2764,15 +2777,28 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.36.2.tgz#b01a76f0ab244404c7aefc340c5015d5ce6da74c" - integrity sha512-uNcopWonEITX96v9pefk9DC1bWMdkweeSsewJ6GeC7L6j2t0SJywisgkr9wUTtXk90fi2Eljj90HSHm3OGdGRg== +"@typescript-eslint/typescript-estree@5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.37.0.tgz#956dcf5c98363bcb97bdd5463a0a86072ff79355" + integrity sha512-JkFoFIt/cx59iqEDSgIGnQpCTRv96MQnXCYvJi7QhBC24uyuzbD8wVbajMB1b9x4I0octYFJ3OwjAwNqk1AjDA== + dependencies: + "@typescript-eslint/types" "5.37.0" + "@typescript-eslint/visitor-keys" "5.37.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.37.0.tgz#7784cb8e91390c4f90ccaffd24a0cf9874df81b2" + integrity sha512-jUEJoQrWbZhmikbcWSMDuUSxEE7ID2W/QCV/uz10WtQqfOuKZUqFGjqLJ+qhDd17rjgp+QJPqTdPIBWwoob2NQ== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.36.2" - "@typescript-eslint/types" "5.36.2" - "@typescript-eslint/typescript-estree" "5.36.2" + "@typescript-eslint/scope-manager" "5.37.0" + "@typescript-eslint/types" "5.37.0" + "@typescript-eslint/typescript-estree" "5.37.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -2784,6 +2810,14 @@ "@typescript-eslint/types" "5.36.2" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.37.0.tgz#7b72dd343295ea11e89b624995abc7103c554eee" + integrity sha512-Hp7rT4cENBPIzMwrlehLW/28EVCOcE9U1Z1BQTc8EA8v5qpr7GRGuG+U58V5tTY48zvUOA3KHvw3rA8tY9fbdA== + dependencies: + "@typescript-eslint/types" "5.37.0" + eslint-visitor-keys "^3.3.0" + "@webassemblyjs/ast@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" From 392d4b3134f579f1f1840ae131e7bcc5a968ff2b Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Tue, 13 Sep 2022 18:26:06 +0530 Subject: [PATCH 010/280] Updated README file (#6225) Added License section in Readme. Signed-off-by: Saptarshi Sarkar Signed-off-by: Saptarshi Sarkar --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5e97035d0f..0c4a63c174 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,7 @@ See [Development](https://docs.k8slens.dev/latest/contributing/development/) pag ## Contributing See [Contributing](https://docs.k8slens.dev/latest/contributing/) page. + +## License + +See [License](LICENSE). From aa498c84713c8c5171e712d48e79b98cbca47d75 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 09:07:17 -0400 Subject: [PATCH 011/280] Bump @typescript-eslint/parser from 5.36.2 to 5.37.0 (#6234) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 48 +++++++----------------------------------------- 2 files changed, 8 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index aa7afce406..9e1d99f8d4 100644 --- a/package.json +++ b/package.json @@ -363,7 +363,7 @@ "@types/webpack-env": "^1.18.0", "@types/webpack-node-externals": "^2.5.3", "@typescript-eslint/eslint-plugin": "^5.37.0", - "@typescript-eslint/parser": "^5.36.2", + "@typescript-eslint/parser": "^5.37.0", "adr": "^1.4.1", "ansi_up": "^5.1.0", "chart.js": "^2.9.4", diff --git a/yarn.lock b/yarn.lock index 339f7f0904..c27210a251 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2718,24 +2718,16 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.36.2.tgz#3ddf323d3ac85a25295a55fcb9c7a49ab4680ddd" - integrity sha512-qS/Kb0yzy8sR0idFspI9Z6+t7mqk/oRjnAYfewG+VN73opAUvmYL3oPIMmgOX6CnQS6gmVIXGshlb5RY/R22pA== +"@typescript-eslint/parser@^5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.37.0.tgz#c382077973f3a4ede7453fb14cadcad3970cbf3b" + integrity sha512-01VzI/ipYKuaG5PkE5+qyJ6m02fVALmMPY3Qq5BHflDx3y4VobbLdHQkSMg9VPRS4KdNt4oYTMaomFoHonBGAw== dependencies: - "@typescript-eslint/scope-manager" "5.36.2" - "@typescript-eslint/types" "5.36.2" - "@typescript-eslint/typescript-estree" "5.36.2" + "@typescript-eslint/scope-manager" "5.37.0" + "@typescript-eslint/types" "5.37.0" + "@typescript-eslint/typescript-estree" "5.37.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.36.2.tgz#a75eb588a3879ae659514780831370642505d1cd" - integrity sha512-cNNP51L8SkIFSfce8B1NSUBTJTu2Ts4nWeWbFrdaqjmn9yKrAaJUBHkyTZc0cL06OFHpb+JZq5AUHROS398Orw== - dependencies: - "@typescript-eslint/types" "5.36.2" - "@typescript-eslint/visitor-keys" "5.36.2" - "@typescript-eslint/scope-manager@5.37.0": version "5.37.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.37.0.tgz#044980e4f1516a774a418dafe701a483a6c9f9ca" @@ -2754,29 +2746,11 @@ debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.36.2.tgz#a5066e500ebcfcee36694186ccc57b955c05faf9" - integrity sha512-9OJSvvwuF1L5eS2EQgFUbECb99F0mwq501w0H0EkYULkhFa19Qq7WFbycdw1PexAc929asupbZcgjVIe6OK/XQ== - "@typescript-eslint/types@5.37.0": version "5.37.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.37.0.tgz#09e4870a5f3af7af3f84e08d792644a87d232261" integrity sha512-3frIJiTa5+tCb2iqR/bf7XwU20lnU05r/sgPJnRpwvfZaqCJBrl8Q/mw9vr3NrNdB/XtVyMA0eppRMMBqdJ1bA== -"@typescript-eslint/typescript-estree@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.36.2.tgz#0c93418b36c53ba0bc34c61fe9405c4d1d8fe560" - integrity sha512-8fyH+RfbKc0mTspfuEjlfqA4YywcwQK2Amcf6TDOwaRLg7Vwdu4bZzyvBZp4bjt1RRjQ5MDnOZahxMrt2l5v9w== - dependencies: - "@typescript-eslint/types" "5.36.2" - "@typescript-eslint/visitor-keys" "5.36.2" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.37.0": version "5.37.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.37.0.tgz#956dcf5c98363bcb97bdd5463a0a86072ff79355" @@ -2802,14 +2776,6 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.36.2.tgz#2f8f78da0a3bad3320d2ac24965791ac39dace5a" - integrity sha512-BtRvSR6dEdrNt7Net2/XDjbYKU5Ml6GqJgVfXT0CxTCJlnIqK7rAGreuWKMT2t8cFUT2Msv5oxw0GMRD7T5J7A== - dependencies: - "@typescript-eslint/types" "5.36.2" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.37.0": version "5.37.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.37.0.tgz#7b72dd343295ea11e89b624995abc7103c554eee" From 9d571b06392f942a36055043fdf029e973d073dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 09:07:39 -0400 Subject: [PATCH 012/280] Bump react-virtualized-auto-sizer from 1.0.6 to 1.0.7 (#6235) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9e1d99f8d4..90438b7222 100644 --- a/package.json +++ b/package.json @@ -272,7 +272,7 @@ "react-dom": "^17.0.2", "react-material-ui-carousel": "^2.3.11", "react-router": "^5.2.0", - "react-virtualized-auto-sizer": "^1.0.6", + "react-virtualized-auto-sizer": "^1.0.7", "readable-stream": "^3.6.0", "request": "^2.88.2", "request-promise-native": "^1.0.9", diff --git a/yarn.lock b/yarn.lock index c27210a251..d4df7397a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10809,10 +10809,10 @@ react-transition-group@^4.3.0, react-transition-group@^4.4.0: loose-envify "^1.4.0" prop-types "^15.6.2" -react-virtualized-auto-sizer@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/react-virtualized-auto-sizer/-/react-virtualized-auto-sizer-1.0.6.tgz#66c5b1c9278064c5ef1699ed40a29c11518f97ca" - integrity sha512-7tQ0BmZqfVF6YYEWcIGuoR3OdYe8I/ZFbNclFlGOC3pMqunkYF/oL30NCjSGl9sMEb17AnzixDz98Kqc3N76HQ== +react-virtualized-auto-sizer@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/react-virtualized-auto-sizer/-/react-virtualized-auto-sizer-1.0.7.tgz#bfb8414698ad1597912473de3e2e5f82180c1195" + integrity sha512-Mxi6lwOmjwIjC1X4gABXMJcKHsOo0xWl3E3ugOgufB8GJU+MqrtY35aBuvCYv/razQ1Vbp7h1gWJjGjoNN5pmA== react-window@^1.8.7: version "1.8.7" From e3703dbf2602ac97615548c98d7cf161605128ee Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Tue, 13 Sep 2022 17:43:51 +0300 Subject: [PATCH 013/280] Leading topbar home button to welcome page (#6218) --- ...acters-in-page-registrations.test.tsx.snap | 3 +-- .../navigate-to-extension-page.test.tsx.snap | 3 +-- ...ation-using-application-menu.test.tsx.snap | 3 +-- ...e-since-update-was-downloaded.test.ts.snap | 9 +++---- ...g-update-using-topbar-button.test.tsx.snap | 6 ++--- .../installing-update-using-tray.test.ts.snap | 18 +++++--------- .../installing-update.test.ts.snap | 18 +++++--------- ...eriodical-checking-of-updates.test.ts.snap | 3 +-- ...selection-of-update-stability.test.ts.snap | 3 +-- .../keyboard-shortcuts.test.tsx.snap | 24 +++++++------------ ...gation-using-application-menu.test.ts.snap | 3 +-- ...gation-using-application-menu.test.ts.snap | 3 +-- .../navigation-using-tray.test.ts.snap | 3 +-- ...-originating-from-extensions.test.tsx.snap | 3 +-- ...gation-using-application-menu.test.ts.snap | 6 ++--- .../components/layout/top-bar/top-bar.tsx | 23 +++++++++--------- 16 files changed, 47 insertions(+), 84 deletions(-) diff --git a/src/features/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap b/src/features/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap index 6fff5572d7..d4cda2d767 100644 --- a/src/features/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap +++ b/src/features/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap @@ -12,9 +12,8 @@ exports[`extension special characters in page registrations renders 1`] = ` class="items" > ; + navigateToWelcomePage: () => void; + welcomeRouteIsActive: IComputedValue; items: IComputedValue; isWindows: boolean; isLinux: boolean; @@ -48,8 +47,8 @@ interface Dependencies { const NonInjectedTopBar = observer(({ items, - navigateToCatalog, - catalogRouteIsActive, + navigateToWelcomePage, + welcomeRouteIsActive, isWindows, isLinux, prevEnabled, @@ -65,7 +64,7 @@ const NonInjectedTopBar = observer(({ const elem = useRef(null); const goHome = () => { - navigateToCatalog(); + navigateToWelcomePage(); }; const windowSizeToggle = (evt: React.MouseEvent) => { @@ -103,7 +102,7 @@ const NonInjectedTopBar = observer(({ data-testid="home-button" material="home" onClick={goHome} - disabled={catalogRouteIsActive.get()} + disabled={welcomeRouteIsActive.get()} /> ( export const TopBar = withInjectables(NonInjectedTopBar, { getProps: (di) => ({ - navigateToCatalog: di.inject(navigateToCatalogInjectable), + navigateToWelcomePage: di.inject(navigateToWelcomeInjectable), items: di.inject(topBarItemsInjectable), isLinux: di.inject(isLinuxInjectable), isWindows: di.inject(isWindowsInjectable), prevEnabled: di.inject(topBarPrevEnabledInjectable), nextEnabled: di.inject(topBarNextEnabledInjectable), - catalogRouteIsActive: di.inject( + welcomeRouteIsActive: di.inject( routeIsActiveInjectable, - di.inject(catalogRouteInjectable), + di.inject(welcomeRouteInjectable), ), openAppContextMenu: di.inject(openAppContextMenuInjectable), goBack: di.inject(goBackInjectable), From ab8165a1e40016c18e75d192893ae271c8a4e5f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 08:39:30 -0400 Subject: [PATCH 014/280] Bump jest-mock-extended from 2.0.7 to 2.0.9 (#6244) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 90438b7222..d73ec44307 100644 --- a/package.json +++ b/package.json @@ -397,7 +397,7 @@ "jest-canvas-mock": "^2.3.1", "jest-environment-jsdom": "^28.1.3", "jest-fetch-mock": "^3.0.3", - "jest-mock-extended": "^2.0.7", + "jest-mock-extended": "^2.0.9", "make-plural": "^6.2.2", "mini-css-extract-plugin": "^2.6.1", "mock-http": "^1.1.0", diff --git a/yarn.lock b/yarn.lock index d4df7397a9..5601c745c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7807,10 +7807,10 @@ jest-message-util@^28.1.3: slash "^3.0.0" stack-utils "^2.0.3" -jest-mock-extended@^2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/jest-mock-extended/-/jest-mock-extended-2.0.7.tgz#73ad87d8a744949bc3415d840f03468229f73f2a" - integrity sha512-h8brJJN5BZb03hTwplvt+raT6Nj0U2U71Z26Py12Qc3kvYnAjDW/zSuQJLnXCNyyufy592VC9k3X7AOz+2H52g== +jest-mock-extended@^2.0.9: + version "2.0.9" + resolved "https://registry.yarnpkg.com/jest-mock-extended/-/jest-mock-extended-2.0.9.tgz#bc0e4a269cdb6047d7cc086e1d9722f7215ca795" + integrity sha512-eRZq7/FgwHbxOMm3Lo4DpQX6S2zi4OvwMVFHEb3FgDLp0Xy3P1WARkF93xxO5uD4nAHiEPYHZ25qVU9mAVxoLQ== dependencies: ts-essentials "^7.0.3" From 6546a775b03155f4cfd0bdabb961a7059ebe9b3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 08:39:55 -0400 Subject: [PATCH 015/280] Bump npm from 8.19.1 to 8.19.2 (#6243) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 64 +++++++++++++++++++++------------------------------- 2 files changed, 27 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index d73ec44307..b221c78f5a 100644 --- a/package.json +++ b/package.json @@ -264,7 +264,7 @@ "monaco-editor-webpack-plugin": "^5.0.0", "node-fetch": "^2.6.7", "node-pty": "0.10.1", - "npm": "^8.19.1", + "npm": "^8.19.2", "p-limit": "^3.1.0", "path-to-regexp": "^6.2.0", "proper-lockfile": "^4.1.2", diff --git a/yarn.lock b/yarn.lock index 5601c745c4..221e75788e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1209,10 +1209,10 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@npmcli/arborist@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@npmcli/arborist/-/arborist-5.6.1.tgz#8371fe6e38f2d9ebc57a77be9ac0a8276564aa07" - integrity sha512-bFEihRTSzIpJY+EJjyUUiTHkuZfFyn6ROlPzyVVDsHmysN8JRZ0LdgA/cwNuTGndb1ddsUxhSENhLp5pJHhX3Q== +"@npmcli/arborist@^5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@npmcli/arborist/-/arborist-5.6.2.tgz#552b554f34777e5dcc8e68ad86cdaeebc0788790" + integrity sha512-Lyj2g+foWKzrwW2bT/RGO982VR9vb5tlvfD88n4PwWJRrDttQbJoIdcQzN9b+NIBhI1/8iEhC5b8far9U0fQxA== dependencies: "@isaacs/string-locale-compare" "^1.1.0" "@npmcli/installed-package-contents" "^1.0.7" @@ -8456,12 +8456,12 @@ libnpmdiff@^4.0.5: pacote "^13.6.1" tar "^6.1.0" -libnpmexec@^4.0.12: - version "4.0.12" - resolved "https://registry.yarnpkg.com/libnpmexec/-/libnpmexec-4.0.12.tgz#462955cdc80894122a09720ccb86e074989ab209" - integrity sha512-iGk63HwzPz6U2mDyuUu0AV4f/yWpxxbrly6LUJgZZ3tD00qVgV530oI4sr3baTLzq8VOyQeDJr0wmEdpXJsHjQ== +libnpmexec@^4.0.13: + version "4.0.13" + resolved "https://registry.yarnpkg.com/libnpmexec/-/libnpmexec-4.0.13.tgz#6688bd6c02cac31a32d2e56680c3884948cbf453" + integrity sha512-MGi6eD6zqZ1V8VCJenWRc2+rWaFiW/Vkr5Aa/cQAd3duWNvXen9sm101M6ww5ER5PmsT+qX2aZOA3A9ZPfJQXg== dependencies: - "@npmcli/arborist" "^5.6.1" + "@npmcli/arborist" "^5.6.2" "@npmcli/ci-detect" "^2.0.0" "@npmcli/fs" "^2.1.1" "@npmcli/run-script" "^4.2.0" @@ -8476,12 +8476,12 @@ libnpmexec@^4.0.12: semver "^7.3.7" walk-up-path "^1.0.0" -libnpmfund@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/libnpmfund/-/libnpmfund-3.0.3.tgz#334a3bb58c64ad18803056373545f6528b04dceb" - integrity sha512-vIlrudn2vzCQ8YRiImh/Kcf6/igjITDNqJPm2ifQDLJIrtqHc22BQb1SCyH+bajHL/DVHzGKD4VuxUtLHT641w== +libnpmfund@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/libnpmfund/-/libnpmfund-3.0.4.tgz#be1fd46bcfa9432660f98d935135d7ee3e620239" + integrity sha512-azKUVFkL27AsvzEzLKMHX/L8j/GE2TL6eZ6KIdc9hsvleoNLT+Y6XO9w9v7JWwg03smZK9dbqwvnYZzO3vzrIA== dependencies: - "@npmcli/arborist" "^5.6.1" + "@npmcli/arborist" "^5.6.2" libnpmhook@^8.0.4: version "8.0.4" @@ -9110,14 +9110,7 @@ minipass-sized@^1.0.3: dependencies: minipass "^3.0.0" -minipass@^3.0.0: - version "3.1.6" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.6.tgz#3b8150aa688a711a1521af5e8779c1d3bb4f45ee" - integrity sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ== - dependencies: - yallist "^4.0.0" - -minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3, minipass@^3.1.6: +minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3, minipass@^3.1.6: version "3.3.4" resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.4.tgz#ca99f95dd77c43c7a76bf51e6d200025eee0ffae" integrity sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw== @@ -9600,18 +9593,19 @@ npm-user-validate@^1.0.1: resolved "https://registry.yarnpkg.com/npm-user-validate/-/npm-user-validate-1.0.1.tgz#31428fc5475fe8416023f178c0ab47935ad8c561" integrity sha512-uQwcd/tY+h1jnEaze6cdX/LrhWhoBxfSknxentoqmIuStxUExxjWd3ULMLFPiFUrZKbOVMowH6Jq2FRWfmhcEw== -npm@^8.19.1: - version "8.19.1" - resolved "https://registry.yarnpkg.com/npm/-/npm-8.19.1.tgz#78bfc5fc1b7bc36881a2d9d1f2c93ad0246f31e5" - integrity sha512-FtWzipzng+NmtTQDXSCvA9D7H4d7vkA7ciahmY89fGK/Eo95pbnKn0hatEUfomj1jUDEXvAEi/tKiQ2nrAc7Jg== +npm@^8.19.2: + version "8.19.2" + resolved "https://registry.yarnpkg.com/npm/-/npm-8.19.2.tgz#db90e88584d065f51b069ab46b4f02f5cf4898b7" + integrity sha512-MWkISVv5f7iZbfNkry5/5YBqSYJEDAKSJdL+uzSQuyLg+hgLQUyZynu3SH6bOZlvR9ZvJYk2EiJO6B1r+ynwHg== dependencies: "@isaacs/string-locale-compare" "^1.1.0" - "@npmcli/arborist" "^5.6.1" + "@npmcli/arborist" "^5.6.2" "@npmcli/ci-detect" "^2.0.0" "@npmcli/config" "^4.2.1" "@npmcli/fs" "^2.1.0" "@npmcli/map-workspaces" "^2.0.3" "@npmcli/package-json" "^2.0.0" + "@npmcli/promise-spawn" "^3.0.0" "@npmcli/run-script" "^4.2.1" abbrev "~1.1.1" archy "~1.0.0" @@ -9622,6 +9616,7 @@ npm@^8.19.1: cli-table3 "^0.6.2" columnify "^1.6.0" fastest-levenshtein "^1.0.12" + fs-minipass "^2.1.0" glob "^8.0.1" graceful-fs "^4.2.10" hosted-git-info "^5.1.0" @@ -9631,8 +9626,8 @@ npm@^8.19.1: json-parse-even-better-errors "^2.3.1" libnpmaccess "^6.0.4" libnpmdiff "^4.0.5" - libnpmexec "^4.0.12" - libnpmfund "^3.0.3" + libnpmexec "^4.0.13" + libnpmfund "^3.0.4" libnpmhook "^8.0.4" libnpmorg "^4.0.4" libnpmpack "^4.1.3" @@ -9641,6 +9636,7 @@ npm@^8.19.1: libnpmteam "^4.0.4" libnpmversion "^3.0.7" make-fetch-happen "^10.2.0" + minimatch "^5.1.0" minipass "^3.1.6" minipass-pipeline "^1.2.4" mkdirp "^1.0.4" @@ -13285,7 +13281,7 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -write-file-atomic@^4.0.0: +write-file-atomic@^4.0.0, write-file-atomic@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== @@ -13293,14 +13289,6 @@ write-file-atomic@^4.0.0: imurmurhash "^0.1.4" signal-exit "^3.0.7" -write-file-atomic@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.1.tgz#9faa33a964c1c85ff6f849b80b42a88c2c537c8f" - integrity sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ== - dependencies: - imurmurhash "^0.1.4" - signal-exit "^3.0.7" - ws@^7.3.1, ws@^7.4.6: version "7.5.7" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67" From 367bb059b89b82b408b3e1c1c6ea77d11116380b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 08:43:58 -0400 Subject: [PATCH 016/280] Bump @types/node from 16.11.58 to 16.11.59 (#6242) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b221c78f5a..ffae6dddd2 100644 --- a/package.json +++ b/package.json @@ -332,7 +332,7 @@ "@types/md5-file": "^4.0.2", "@types/mini-css-extract-plugin": "^2.4.0", "@types/mock-fs": "^4.13.1", - "@types/node": "^16.11.58", + "@types/node": "^16.11.59", "@types/node-fetch": "^2.6.2", "@types/npm": "^2.0.32", "@types/proper-lockfile": "^4.1.2", diff --git a/yarn.lock b/yarn.lock index 221e75788e..0c4bc755ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2284,10 +2284,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.24.tgz#20ba1bf69c1b4ab405c7a01e950c4f446b05029f" integrity sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g== -"@types/node@^16.11.26", "@types/node@^16.11.58": - version "16.11.58" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.58.tgz#0a3698dee3492617a8d5fe7998d18d7520b63026" - integrity sha512-uMVxJ111wpHzkx/vshZFb6Qni3BOMnlWLq7q9jrwej7Yw/KvjsEbpxCCxw+hLKxexFMc8YmpG8J9tnEe/rKsIg== +"@types/node@^16.11.26", "@types/node@^16.11.59": + version "16.11.59" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.59.tgz#823f238b9063ccc3b3b7f13186f143a57926c4f6" + integrity sha512-6u+36Dj3aDzhfBVUf/mfmc92OEdzQ2kx2jcXGdigfl70E/neV21ZHE6UCz4MDzTRcVqGAM27fk+DLXvyDsn3Jw== "@types/npm@^2.0.32": version "2.0.32" From 5d5dd08fda0b52d68c394a1e5ea0b3b529aa7a36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 08:45:49 -0400 Subject: [PATCH 017/280] Bump @sentry/electron from 3.0.7 to 3.0.8 (#6241) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ffae6dddd2..dcb42cf39a 100644 --- a/package.json +++ b/package.json @@ -223,7 +223,7 @@ "@ogre-tools/injectable-extension-for-auto-registration": "10.1.0", "@ogre-tools/injectable-extension-for-mobx": "10.1.0", "@ogre-tools/injectable-react": "10.1.0", - "@sentry/electron": "^3.0.7", + "@sentry/electron": "^3.0.8", "@sentry/integrations": "^6.19.3", "@side/jest-runtime": "^1.0.1", "@types/circular-dependency-plugin": "5.0.5", diff --git a/yarn.lock b/yarn.lock index 0c4bc755ed..885cef647c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1474,10 +1474,10 @@ "@sentry/utils" "6.19.2" tslib "^1.9.3" -"@sentry/electron@^3.0.7": - version "3.0.7" - resolved "https://registry.yarnpkg.com/@sentry/electron/-/electron-3.0.7.tgz#d32ebd27d7fc9b0e7e8dd8498ee797fcaafb5a13" - integrity sha512-Rahi1jgvjHnx1jGkkPPvDCxSCAME7xc2eBcFCLb4R/WDuNblR7tgJUuAtzv9JpxUgRHy1oLNct0wcvIu1mcXoA== +"@sentry/electron@^3.0.8": + version "3.0.8" + resolved "https://registry.yarnpkg.com/@sentry/electron/-/electron-3.0.8.tgz#ad4aaa0290c31fb5eb3ed06377da46ee501ec97d" + integrity sha512-D330t0rRswAYreFtzIICD5uQH7Wp2e7g6GEFTGisTouHY9+qSu7q9J/hGe5Vase5cY5277/YmUaUKRrVxj/2DQ== dependencies: "@sentry/browser" "6.19.2" "@sentry/core" "6.19.2" From e6a284a8773a655dd7c347d9d7fda43390c87003 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Wed, 14 Sep 2022 08:50:46 -0400 Subject: [PATCH 018/280] Bump version in package.json (#6249) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dcb42cf39a..d96c2c9cdf 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "OpenLens", "description": "OpenLens - Open Source IDE for Kubernetes", "homepage": "https://github.com/lensapp/lens", - "version": "6.0.0", + "version": "6.1.0-alpha.0", "main": "static/build/main.js", "copyright": "© 2022 OpenLens Authors", "license": "MIT", From 25556437496a1a2f092e411271b465ab061dc316 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Wed, 14 Sep 2022 08:51:51 -0400 Subject: [PATCH 019/280] Upgrade release making script to support skipping PRs (#6182) --- scripts/create-release-pr.ts | 199 +++++++++++++++++++++-------------- 1 file changed, 120 insertions(+), 79 deletions(-) diff --git a/scripts/create-release-pr.ts b/scripts/create-release-pr.ts index da0d5d4f26..be4a13d426 100755 --- a/scripts/create-release-pr.ts +++ b/scripts/create-release-pr.ts @@ -8,7 +8,7 @@ import fse from "fs-extra"; import { basename } from "path"; import { createInterface } from "readline"; import semver from "semver"; -import { inspect, promisify } from "util"; +import { promisify } from "util"; const { SemVer, @@ -27,6 +27,10 @@ const options = commandLineArgs([ { name: "preid", }, + { + name: "check-commits", + type: Boolean, + }, ]); const validReleaseValues = [ @@ -79,10 +83,22 @@ if (basename(process.cwd()) === "scripts") { console.error(errorMessages.wrongCwd); } - -const currentVersion = new SemVer((await fse.readJson("./package.json")).version); +const packageJson = await fse.readJson("./package.json"); +const currentVersion = new SemVer(packageJson.version); console.log(`current version: ${currentVersion.format()}`); + +const newVersion = currentVersion.inc(options.type, options.preid); +const newVersionMilestone = `${newVersion.major}.${newVersion.minor}.${newVersion.patch}`; +const prBranch = `release/v${newVersion.format()}`; + +await fse.writeJson("./package.json", { ...packageJson, version: newVersion.format() }, { spaces: 2 }); +await exec(`git checkout -b ${prBranch}`); +await exec("git add package.json"); +await exec(`git commit -sm "Release ${newVersion.format()}"`); + +console.log(`new version: ${newVersion.format()}`); + console.log("fetching tags..."); await exec("git fetch --tags --force"); @@ -93,25 +109,6 @@ const [previousReleasedVersion] = actualTags .sort((l, r) => semverRcompare(l, r)) .filter(version => semverLte(version, currentVersion)); -const npmVersionArgs = [ - "npm", - "version", - options.type, -]; - -if (options.preid) { - npmVersionArgs.push(`--preid=${options.preid}`); -} - -npmVersionArgs.push("--git-tag-version false"); - -await exec(npmVersionArgs.join(" ")); - -const newVersion = new SemVer((await fse.readJson("./package.json")).version); -const newVersionMilestone = `${newVersion.major}.${newVersion.minor}.${newVersion.patch}`; - -console.log(`new version: ${newVersion.format()}`); - const getMergedPrsArgs = [ "gh", "pr", @@ -146,6 +143,10 @@ interface GithubPrData { title: string; } +interface ExtendedGithubPrData extends Omit { + mergedAt: Date; +} + console.log("retreiving last 500 PRs to create release PR body..."); const mergedPrs = JSON.parse((await exec(getMergedPrsArgs.join(" "), { encoding: "utf-8" })).stdout) as GithubPrData[]; const milestoneRelevantPrs = mergedPrs.filter(pr => pr.milestone?.title === newVersionMilestone); @@ -159,7 +160,7 @@ const relaventPrs = relaventPrsQuery .filter(query => query.stdout) .map(query => query.pr) .filter(pr => pr.labels.every(label => label.name !== "skip-changelog")) - .map(pr => ({ ...pr, mergedAt: new Date(pr.mergedAt) })) + .map(pr => ({ ...pr, mergedAt: new Date(pr.mergedAt) } as ExtendedGithubPrData)) .sort((left, right) => { const leftAge = left.mergedAt.valueOf(); const rightAge = right.mergedAt.valueOf(); @@ -175,75 +176,55 @@ const relaventPrs = relaventPrsQuery return -1; }); -console.log(inspect(relaventPrs, false, null, true)); - const enhancementPrLabelName = "enhancement"; const bugfixPrLabelName = "bug"; -const enhancementPrs = relaventPrs.filter(pr => pr.labels.some(label => label.name === enhancementPrLabelName)); -const bugfixPrs = relaventPrs.filter(pr => pr.labels.some(label => label.name === bugfixPrLabelName)); -const maintenencePrs = relaventPrs.filter(pr => pr.labels.every(label => label.name !== bugfixPrLabelName && label.name !== enhancementPrLabelName)); +const isEnhancementPr = (pr: ExtendedGithubPrData) => pr.labels.some(label => label.name === enhancementPrLabelName); +const isBugfixPr = (pr: ExtendedGithubPrData) => pr.labels.some(label => label.name === bugfixPrLabelName); -console.log("Found:"); -console.log(`${enhancementPrs.length} enhancement PRs`); -console.log(`${bugfixPrs.length} bug fix PRs`); -console.log(`${maintenencePrs.length} maintenence PRs`); +const prLines = { + enhancement: [] as string[], + bugfix: [] as string[], + maintenence: [] as string[], +}; -const prBodyLines = [ - `## Changes since ${previousReleasedVersion}`, - "", -]; - -function getPrEntry(pr) { +function getPrEntry(pr: ExtendedGithubPrData) { return `- ${pr.title} (**[#${pr.number}](https://github.com/lensapp/lens/pull/${pr.number})**) https://github.com/${pr.author.login}`; } -if (enhancementPrs.length > 0) { - prBodyLines.push( - "## 🚀 Features", - "", - ...enhancementPrs.map(getPrEntry), - "", - ); -} - -if (bugfixPrs.length > 0) { - prBodyLines.push( - "## 🐛 Bug Fixes", - "", - ...bugfixPrs.map(getPrEntry), - "", - ); -} - -if (maintenencePrs.length > 0) { - prBodyLines.push( - "## 🧰 Maintenance", - "", - ...maintenencePrs.map(getPrEntry), - "", - ); -} - -const prBody = prBodyLines.join("\n"); +const rl = createInterface(process.stdin); const prBase = newVersion.patch === 0 ? "master" : `release/v${newVersion.major}.${newVersion.minor}`; -const createPrArgs = [ - "pr", - "create", - "--base", prBase, - "--title", `release ${newVersion.format()}`, - "--label", "skip-changelog", - "--body-file", "-", -]; -const rl = createInterface(process.stdin); +function askQuestion(question: string): Promise { + return new Promise(resolve => { + function _askQuestion() { + console.log(question); -if (prBase !== "master") { - console.log("Cherry-picking commits to current branch"); + rl.once("line", (answer) => { + const cleaned = answer.trim().toLowerCase(); - for (const pr of relaventPrs) { + if (cleaned === "y") { + resolve(true); + } else if (cleaned === "n") { + resolve(false); + } else { + _askQuestion(); + } + }); + } + + _askQuestion(); + }); +} + +async function handleRelaventPr(pr: ExtendedGithubPrData) { + if (options["check-commits"] && !(await askQuestion(`Would you like to use #${pr.number}: ${pr.title}? - Y/N`))) { + return; + } + + if (prBase !== "master") { try { const promise = exec(`git cherry-pick ${pr.mergeCommit.oid}`); @@ -255,11 +236,71 @@ if (prBase !== "master") { await promise; } catch { console.error(`Failed to cherry-pick ${pr.mergeCommit.oid}, please resolve conflicts and then press enter here:`); - await new Promise(resolve => rl.on("line", () => resolve())); + await new Promise(resolve => rl.once("line", () => resolve())); } } + + if (isEnhancementPr(pr)) { + prLines.enhancement.push(getPrEntry(pr)); + } else if (isBugfixPr(pr)) { + prLines.bugfix.push(getPrEntry(pr)); + } else { + prLines.maintenence.push(getPrEntry(pr)); + } } +for (const pr of relaventPrs) { + await handleRelaventPr(pr); +} + +rl.close(); + +const prBodyLines = [ + `## Changes since ${previousReleasedVersion}`, + "", + ...( + prLines.enhancement.length > 0 + ? [ + "## 🚀 Features", + "", + ...prLines.enhancement, + "", + ] + : [] + ), + ...( + prLines.bugfix.length > 0 + ? [ + "## 🐛 Bug Fixes", + "", + ...prLines.bugfix, + "", + ] + : [] + ), + ...( + prLines.maintenence.length > 0 + ? [ + "## 🧰 Maintenance", + "", + ...prLines.maintenence, + "", + ] + : [] + ), +]; +const prBody = prBodyLines.join("\n"); +const createPrArgs = [ + "pr", + "create", + "--base", prBase, + "--title", `Release ${newVersion.format()}`, + "--label", "skip-changelog", + "--body-file", "-", +]; + +await exec(`git push --set-upstream origin ${prBranch}`); + const createPrProcess = execFile("gh", createPrArgs); createPrProcess.child.stdout?.pipe(process.stdout); From a2d52fa6b81faeb747a2a5dc5bd86a9d8626709d Mon Sep 17 00:00:00 2001 From: Jim Ehrismann <40840436+jim-docker@users.noreply.github.com> Date: Wed, 14 Sep 2022 09:07:44 -0400 Subject: [PATCH 020/280] Made welcome page configurable (#6232) Co-authored-by: Sebastian Malton --- package.json | 3 +- .../default-welcome-route.injectable.ts | 26 +++++ ...e-config.global-override-for-injectable.ts | 8 ++ .../welcome-route-config.injectable.ts | 18 ++++ .../welcome/welcome-route.injectable.ts | 15 ++- ...at-all-routes-have-route-component.test.ts | 10 +- .../welcome/setting-welcome-page.test.tsx | 99 +++++++++++++++++++ ...ult-welcome-route-component.injectable.ts} | 10 +- .../cluster-manager/cluster-manager.scss | 4 + .../cluster-manager/cluster-manager.tsx | 30 +++++- .../current-route-component.injectable.ts | 11 ++- 11 files changed, 211 insertions(+), 23 deletions(-) create mode 100644 src/common/front-end-routing/routes/welcome/default-welcome-route.injectable.ts create mode 100644 src/common/front-end-routing/routes/welcome/welcome-route-config.global-override-for-injectable.ts create mode 100644 src/common/front-end-routing/routes/welcome/welcome-route-config.injectable.ts create mode 100644 src/features/welcome/setting-welcome-page.test.tsx rename src/renderer/components/+welcome/{welcome-route-component.injectable.ts => default-welcome-route-component.injectable.ts} (58%) diff --git a/package.json b/package.json index d96c2c9cdf..46c6cb6f7f 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,8 @@ "bundledKubectlVersion": "1.23.3", "bundledHelmVersion": "3.7.2", "sentryDsn": "", - "contentSecurityPolicy": "script-src 'unsafe-eval' 'self'; frame-src http://*.localhost:*/; img-src * data:" + "contentSecurityPolicy": "script-src 'unsafe-eval' 'self'; frame-src http://*.localhost:*/; img-src * data:", + "welcomeRoute": "/welcome" }, "engines": { "node": ">=16 <17" diff --git a/src/common/front-end-routing/routes/welcome/default-welcome-route.injectable.ts b/src/common/front-end-routing/routes/welcome/default-welcome-route.injectable.ts new file mode 100644 index 0000000000..d8db889033 --- /dev/null +++ b/src/common/front-end-routing/routes/welcome/default-welcome-route.injectable.ts @@ -0,0 +1,26 @@ +/** + * 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 { computed } from "mobx"; +import welcomeRouteConfigInjectable from "./welcome-route-config.injectable"; +import { frontEndRouteInjectionToken } from "../../front-end-route-injection-token"; + +const defaultWelcomeRouteInjectable = getInjectable({ + id: "default-welcome-route", + + instantiate: (di) => { + const welcomeRoute = di.inject(welcomeRouteConfigInjectable); + + return { + path: "/welcome", + clusterFrame: false, + isEnabled: computed(() => welcomeRoute === "/welcome"), + }; + }, + + injectionToken: frontEndRouteInjectionToken, +}); + +export default defaultWelcomeRouteInjectable; diff --git a/src/common/front-end-routing/routes/welcome/welcome-route-config.global-override-for-injectable.ts b/src/common/front-end-routing/routes/welcome/welcome-route-config.global-override-for-injectable.ts new file mode 100644 index 0000000000..703c0798a2 --- /dev/null +++ b/src/common/front-end-routing/routes/welcome/welcome-route-config.global-override-for-injectable.ts @@ -0,0 +1,8 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ +import { getGlobalOverride } from "../../../test-utils/get-global-override"; +import welcomeRouteConfig from "./welcome-route-config.injectable"; + +export default getGlobalOverride(welcomeRouteConfig, () => "/welcome"); diff --git a/src/common/front-end-routing/routes/welcome/welcome-route-config.injectable.ts b/src/common/front-end-routing/routes/welcome/welcome-route-config.injectable.ts new file mode 100644 index 0000000000..53a61ab99f --- /dev/null +++ b/src/common/front-end-routing/routes/welcome/welcome-route-config.injectable.ts @@ -0,0 +1,18 @@ +/** + * 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 packageJsonInjectable from "../../../vars/package-json.injectable"; + +const welcomeRouteConfigInjectable = getInjectable({ + id: "welcome-route-config", + + instantiate: (di) => { + const packageJson = di.inject(packageJsonInjectable); + + return packageJson.config.welcomeRoute; + }, +}); + +export default welcomeRouteConfigInjectable; diff --git a/src/common/front-end-routing/routes/welcome/welcome-route.injectable.ts b/src/common/front-end-routing/routes/welcome/welcome-route.injectable.ts index 75d722ab46..839a7446c1 100644 --- a/src/common/front-end-routing/routes/welcome/welcome-route.injectable.ts +++ b/src/common/front-end-routing/routes/welcome/welcome-route.injectable.ts @@ -4,16 +4,21 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { computed } from "mobx"; +import welcomeRouteConfigInjectable from "./welcome-route-config.injectable"; import { frontEndRouteInjectionToken } from "../../front-end-route-injection-token"; const welcomeRouteInjectable = getInjectable({ id: "welcome-route", - instantiate: () => ({ - path: "/welcome", - clusterFrame: false, - isEnabled: computed(() => true), - }), + instantiate: (di) => { + const welcomeRoute = di.inject(welcomeRouteConfigInjectable); + + return { + path: welcomeRoute, + clusterFrame: false, + isEnabled: computed(() => true), + }; + }, injectionToken: frontEndRouteInjectionToken, }); diff --git a/src/common/front-end-routing/verify-that-all-routes-have-route-component.test.ts b/src/common/front-end-routing/verify-that-all-routes-have-route-component.test.ts index 4b6776bdaa..acd1d4401d 100644 --- a/src/common/front-end-routing/verify-that-all-routes-have-route-component.test.ts +++ b/src/common/front-end-routing/verify-that-all-routes-have-route-component.test.ts @@ -5,7 +5,7 @@ import { getDiForUnitTesting } from "../../renderer/getDiForUnitTesting"; import { routeSpecificComponentInjectionToken } from "../../renderer/routes/route-specific-component-injection-token"; import { frontEndRouteInjectionToken } from "./front-end-route-injection-token"; -import { filter, map, matches } from "lodash/fp"; +import { filter, map } from "lodash/fp"; import clusterStoreInjectable from "../cluster-store/cluster-store.injectable"; import type { ClusterStore } from "../cluster-store/cluster-store"; import { pipeline } from "@ogre-tools/fp"; @@ -27,9 +27,11 @@ describe("verify-that-all-routes-have-component", () => { routes, map( - (route) => ({ - path: route.path, - routeComponent: routeComponents.find(matches({ route })), + (currentRoute) => ({ + path: currentRoute.path, + routeComponent: routeComponents.find(({ route }) => ( + route.path === currentRoute.path + && route.clusterFrame === currentRoute.clusterFrame)), }), ), diff --git a/src/features/welcome/setting-welcome-page.test.tsx b/src/features/welcome/setting-welcome-page.test.tsx new file mode 100644 index 0000000000..fc5a0fe4a9 --- /dev/null +++ b/src/features/welcome/setting-welcome-page.test.tsx @@ -0,0 +1,99 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +import type { RenderResult } from "@testing-library/react"; +import React from "react"; +import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; +import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; +import type { FakeExtensionOptions } from "../../renderer/components/test-utils/get-extension-fake"; +import welcomeRouteConfigInjectable from "../../common/front-end-routing/routes/welcome/welcome-route-config.injectable"; +import welcomeRouteInjectable from "../../common/front-end-routing/routes/welcome/welcome-route.injectable"; +import type { Route } from "../../common/front-end-routing/front-end-route-injection-token"; + + +describe("setting-welcome-page", () => { + let applicationBuilder: ApplicationBuilder; + let rendered : RenderResult; + let welcomeRoute: Route; + + beforeEach(() => { + applicationBuilder = getApplicationBuilder(); + }); + + describe("given configuration of welcome page route is the default", () => { + beforeEach(async () => { + applicationBuilder.beforeApplicationStart((mainDi) => { + mainDi.override(welcomeRouteConfigInjectable, () => "/welcome"); + }); + + applicationBuilder.beforeWindowStart((windowDi) => { + windowDi.override(welcomeRouteConfigInjectable, () => "/welcome"); + }); + + // enable the extension even though the welcomeRoute is not overriden + applicationBuilder.extensions.enable(extensionWithWelcomePage); + rendered = await applicationBuilder.render(); + + const windowDi = applicationBuilder.applicationWindow.only.di; + + welcomeRoute = windowDi.inject(welcomeRouteInjectable); + }); + + it("sets the default welcome page", () => { + expect(welcomeRoute.path).toEqual("/welcome"); + }); + + it("launches to the default welcome page", () => { + const welcomePage = rendered.getByTestId("welcome-page"); // from the Welcome component (welcome.tsx) + + expect(welcomePage).toBeInTheDocument(); + }); + }); + + describe("given configuration of welcome page route is set to a custom page", () => { + beforeEach(async () => { + applicationBuilder.beforeApplicationStart((mainDi) => { + mainDi.override(welcomeRouteConfigInjectable, () => "/extension/some-extension-name/some-welcome-page"); + }); + + applicationBuilder.beforeWindowStart((windowDi) => { + windowDi.override(welcomeRouteConfigInjectable, () => "/extension/some-extension-name/some-welcome-page"); + }); + + applicationBuilder.extensions.enable(extensionWithWelcomePage); + rendered = await applicationBuilder.render(); + + const windowDi = applicationBuilder.applicationWindow.only.di; + + welcomeRoute = windowDi.inject(welcomeRouteInjectable); + }); + + it("sets the custom welcome page", () => { + expect(welcomeRoute.path).toEqual("/extension/some-extension-name/some-welcome-page"); + }); + + it("launches to the custom welcome page ", () => { + const welcomePage = rendered.getByTestId("some-welcome-test-id"); + + expect(welcomePage).toBeInTheDocument(); + }); + }); +}); + +const extensionWithWelcomePage: FakeExtensionOptions = { + id: "some-extension-id", + name: "some-extension-name", + + rendererOptions: { + globalPages: [ + { + id: "some-welcome-page", + components: { + Page: () =>
Welcome page
, + }, + }, + ], + }, +}; diff --git a/src/renderer/components/+welcome/welcome-route-component.injectable.ts b/src/renderer/components/+welcome/default-welcome-route-component.injectable.ts similarity index 58% rename from src/renderer/components/+welcome/welcome-route-component.injectable.ts rename to src/renderer/components/+welcome/default-welcome-route-component.injectable.ts index 65fa0dfb00..5472c49787 100644 --- a/src/renderer/components/+welcome/welcome-route-component.injectable.ts +++ b/src/renderer/components/+welcome/default-welcome-route-component.injectable.ts @@ -4,18 +4,18 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { Welcome } from "./welcome"; -import welcomeRouteInjectable from "../../../common/front-end-routing/routes/welcome/welcome-route.injectable"; +import defaultWelcomeRouteInjectable from "../../../common/front-end-routing/routes/welcome/default-welcome-route.injectable"; import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; -const welcomeRouteComponentInjectable = getInjectable({ - id: "welcome-route-component", +const defaultWelcomeRouteComponentInjectable = getInjectable({ + id: "default-welcome-route-component", instantiate: (di) => ({ - route: di.inject(welcomeRouteInjectable), + route: di.inject(defaultWelcomeRouteInjectable), Component: Welcome, }), injectionToken: routeSpecificComponentInjectionToken, }); -export default welcomeRouteComponentInjectable; +export default defaultWelcomeRouteComponentInjectable; diff --git a/src/renderer/components/cluster-manager/cluster-manager.scss b/src/renderer/components/cluster-manager/cluster-manager.scss index dec5a069a2..b5bfbbebae 100644 --- a/src/renderer/components/cluster-manager/cluster-manager.scss +++ b/src/renderer/components/cluster-manager/cluster-manager.scss @@ -25,6 +25,10 @@ grid-area: menu; } + .error { + z-index: 1; + } + #lens-views { position: absolute; left: 0; diff --git a/src/renderer/components/cluster-manager/cluster-manager.tsx b/src/renderer/components/cluster-manager/cluster-manager.tsx index 85fb8a80c0..ab418ec827 100644 --- a/src/renderer/components/cluster-manager/cluster-manager.tsx +++ b/src/renderer/components/cluster-manager/cluster-manager.tsx @@ -21,12 +21,14 @@ import { buildURL } from "../../../common/utils/buildUrl"; import type { StorageLayer } from "../../utils"; import type { WatchForGeneralEntityNavigation } from "../../api/helpers/watch-for-general-entity-navigation.injectable"; import watchForGeneralEntityNavigationInjectable from "../../api/helpers/watch-for-general-entity-navigation.injectable"; +import currentPathInjectable from "../../routes/current-path.injectable"; interface Dependencies { catalogPreviousActiveTabStorage: StorageLayer; currentRouteComponent: IComputedValue; welcomeUrl: string; watchForGeneralEntityNavigation: WatchForGeneralEntityNavigation; + currentPath: IComputedValue; } @observer @@ -37,19 +39,40 @@ class NonInjectedClusterManager extends React.Component { ]); } - render() { + renderMainComponent() { const Component = this.props.currentRouteComponent.get(); - if (!Component) { + if (Component) { + return ; + } + + const currentPath = this.props.currentPath.get(); + + if (currentPath !== this.props.welcomeUrl) { return ; } + return ( +
+

ERROR!!

+

+ No matching route for the current path: + {" "} + {currentPath} + {" "} + which is the welcomeUrl. This is a bug. +

+
+ ); + } + + render() { return (
- + {this.renderMainComponent()}
@@ -65,5 +88,6 @@ export const ClusterManager = withInjectables(NonInjectedClusterMa currentRouteComponent: di.inject(currentRouteComponentInjectable), welcomeUrl: buildURL(di.inject(welcomeRouteInjectable).path), watchForGeneralEntityNavigation: di.inject(watchForGeneralEntityNavigationInjectable), + currentPath: di.inject(currentPathInjectable), }), }); diff --git a/src/renderer/routes/current-route-component.injectable.ts b/src/renderer/routes/current-route-component.injectable.ts index 56b047c37b..a4a8133c4f 100644 --- a/src/renderer/routes/current-route-component.injectable.ts +++ b/src/renderer/routes/current-route-component.injectable.ts @@ -4,7 +4,6 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { computedInjectManyInjectable } from "@ogre-tools/injectable-extension-for-mobx"; -import { matches } from "lodash/fp"; import { computed } from "mobx"; import currentRouteInjectable from "./current-route.injectable"; import { routeSpecificComponentInjectionToken } from "./route-specific-component-injection-token"; @@ -24,11 +23,13 @@ const currentRouteComponentInjectable = getInjectable({ return undefined; } - const routeSpecificComponent = routeComponents + return routeComponents .get() - .find(matches({ route: currentRoute })); - - return routeSpecificComponent?.Component; + .find(({ route }) => ( + route.path === currentRoute.path + && route.clusterFrame === currentRoute.clusterFrame + )) + ?.Component; }); }, }); From 9918c6a4d970d21fcb16448539f3244a27b8c66f Mon Sep 17 00:00:00 2001 From: Ashley Nelson Date: Wed, 14 Sep 2022 08:55:30 -0500 Subject: [PATCH 021/280] Update link to "add-cluster" docs page (#6240) --- .../navigation-using-application-menu.test.tsx.snap | 2 +- src/renderer/components/+add-cluster/add-cluster.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/add-cluster/__snapshots__/navigation-using-application-menu.test.tsx.snap b/src/features/add-cluster/__snapshots__/navigation-using-application-menu.test.tsx.snap index 7dc6ae4c51..55572a5303 100644 --- a/src/features/add-cluster/__snapshots__/navigation-using-application-menu.test.tsx.snap +++ b/src/features/add-cluster/__snapshots__/navigation-using-application-menu.test.tsx.snap @@ -278,7 +278,7 @@ exports[`add-cluster - navigation using application menu when navigating to add file. diff --git a/src/renderer/components/+add-cluster/add-cluster.tsx b/src/renderer/components/+add-cluster/add-cluster.tsx index 6630420ad6..503632b51f 100644 --- a/src/renderer/components/+add-cluster/add-cluster.tsx +++ b/src/renderer/components/+add-cluster/add-cluster.tsx @@ -112,7 +112,7 @@ class NonInjectedAddCluster extends React.Component { ~/.kube/config {" file. "} From 3f194471f99baa20d832b393108a71c77a82662d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 23:16:39 -0400 Subject: [PATCH 022/280] Bump electron from 19.0.16 to 19.0.17 (#6252) Bumps [electron](https://github.com/electron/electron) from 19.0.16 to 19.0.17. - [Release notes](https://github.com/electron/electron/releases) - [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md) - [Commits](https://github.com/electron/electron/compare/v19.0.16...v19.0.17) --- updated-dependencies: - dependency-name: electron dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 46c6cb6f7f..0920e4fa69 100644 --- a/package.json +++ b/package.json @@ -376,7 +376,7 @@ "css-loader": "^6.7.1", "deepdash": "^5.3.9", "dompurify": "^2.4.0", - "electron": "^19.0.16", + "electron": "^19.0.17", "electron-builder": "^23.3.3", "electron-notarize": "^0.3.0", "esbuild": "^0.15.7", diff --git a/yarn.lock b/yarn.lock index 885cef647c..ca8f337c73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5242,10 +5242,10 @@ electron-window-state@^5.0.3: jsonfile "^4.0.0" mkdirp "^0.5.1" -electron@^19.0.16: - version "19.0.16" - resolved "https://registry.yarnpkg.com/electron/-/electron-19.0.16.tgz#9773478e2607e458e3a353beccdfaa5aee65a9c6" - integrity sha512-iL6Bnh+kmlZHam1s77dZZ31J0vbtkkUoR3Y/GXBfqbTinXupBtYmx0+SnvjGnpVzRYoZoSbJs6Qfrfn13BQoMw== +electron@^19.0.17: + version "19.0.17" + resolved "https://registry.yarnpkg.com/electron/-/electron-19.0.17.tgz#850d806e88b1ef141b88b491dc41661778691c27" + integrity sha512-3Offu61K+d19EZIc76MhKRsSCqfe3jDiqtD0p8jXr6p/TW7+7/jOQp407ZaZu0nQN6/xDIEi2sP4XQBom6GjTQ== dependencies: "@electron/get" "^1.14.1" "@types/node" "^16.11.26" From b4285188579300c0b1e4b6b29ca884d89220b2d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 07:51:18 -0400 Subject: [PATCH 023/280] Bump @swc/core from 1.3.0 to 1.3.1 (#6253) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 138 +++++++++++++++++++++++++-------------------------- 2 files changed, 70 insertions(+), 70 deletions(-) diff --git a/package.json b/package.json index 0920e4fa69..03d6b34a08 100644 --- a/package.json +++ b/package.json @@ -303,7 +303,7 @@ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7", "@sentry/types": "^6.19.7", "@swc/cli": "^0.1.57", - "@swc/core": "^1.3.0", + "@swc/core": "^1.3.1", "@swc/jest": "^0.2.22", "@testing-library/dom": "^7.31.2", "@testing-library/jest-dom": "^5.16.5", diff --git a/yarn.lock b/yarn.lock index ca8f337c73..26eee35640 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1616,101 +1616,101 @@ slash "3.0.0" source-map "^0.7.3" -"@swc/core-android-arm-eabi@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.3.0.tgz#6ff8c5020e13794b536d6f0fd89817f2f10e8250" - integrity sha512-1F/U0Vh78ZL7OUlCfaRWCtnYnIfsMA8WDtKyf3UT9b3C0L5HajB9TgMH4c0OKhjfP5Q2/M1/Pm00A+96nhKH8A== +"@swc/core-android-arm-eabi@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.3.1.tgz#2559b7a565a0a129ede27f15c86e744a021363a6" + integrity sha512-fZ6nTalHWYn1OHfU87yF8s24edgQ4COHydLlPcpU/pwSH90hCwy/fgna5PpUBw0rfzGBttX0/0yMorC7ZSar4Q== dependencies: "@swc/wasm" "1.2.122" -"@swc/core-android-arm64@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core-android-arm64/-/core-android-arm64-1.3.0.tgz#e09c3f6cc478f2c501d5441eb566a4e2c5b88368" - integrity sha512-dtryoOvQ27s9euAcLinExuaU+mMr8o0N8CBTH3f+JwKjQsIa9v0jPOjJ9jaWktnAdDy/FztB5iBCqTAwbqRG/w== +"@swc/core-android-arm64@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core-android-arm64/-/core-android-arm64-1.3.1.tgz#b415f8e989d26b7634f68caccc0a9135cbda893f" + integrity sha512-aDrV22ajQ4NYOwxEWvipPpdhHaLqU5W1rxRap5N1KSetzwGIk6NMd31o6Jotoxf7tB8qtLlo5VyNok4adJRVYg== dependencies: "@swc/wasm" "1.2.130" -"@swc/core-darwin-arm64@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.0.tgz#232e96f2a84da8698c1125684d489f8bec587d35" - integrity sha512-WSf29/wneQf5k7mdLKqaSRLDycIZaLATc6m7BKpFi34iCGSvXJfc375OrVG9BS0rReX5LT49XxXp6GQs9oFmVA== +"@swc/core-darwin-arm64@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.1.tgz#386fadc4025ed2d51343a8abbc0dc0a301cc6b06" + integrity sha512-yom8pqaDhsncQaqp+NdXk1YEtWoqPrfsyKJP3RriTbUjXS/20q/WNfkkJjxUuaFZC6PH/MuvrLzD6Z6ZuZvLaA== -"@swc/core-darwin-x64@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.0.tgz#37d89cfa54311db31302fed8888db03460ccd166" - integrity sha512-eDa1EZAnchMtkdZ52bWfseKla370c8BCj/RWAtHJcZMon3WVkWcZlMgZPPiPIxYz8hGtomqs+pkQv34hEVcx0A== +"@swc/core-darwin-x64@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.1.tgz#65d438b696bc47e204f655b1654c138fe396d9df" + integrity sha512-Q2kH2i5pS0dvauOiRR4s7atH+Qrhe1LmiCv1D2U+AghZMfDcxi3DBTxrae/YqmDYm3GxHH3ZSAFHR3E0SeiSSg== -"@swc/core-freebsd-x64@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core-freebsd-x64/-/core-freebsd-x64-1.3.0.tgz#652995139abe70d67e082168cbc44e726efdca61" - integrity sha512-ZV9rRmUZqJGCYqnV/3aIJUHELY/MFyABowDN8ijCvN67EjGfoNYx0jpd4hzFWwGC8LohthHNi6hiFfmnvGaKsw== +"@swc/core-freebsd-x64@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core-freebsd-x64/-/core-freebsd-x64-1.3.1.tgz#c29c22984ebe94e89b614694d6572fba9769f758" + integrity sha512-f2a+rPGrhAICF+Du/nHWZlYzltX1/fWyt+v0IP+r0Zh4drgTrt5G3sMYrQVTjsKvI8R6tV2Q7BfYvDIQXwE1pw== dependencies: "@swc/wasm" "1.2.130" -"@swc/core-linux-arm-gnueabihf@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.0.tgz#25a3260634527a678fa83d5e6aa9726fad6f1f32" - integrity sha512-3fPWh4SB3lz0ZlQWsHjqZFJK1SIkYqjLpm6mR1jzp/LJx4Oq1baid9CP1eiLd/rijSIgVdUJNMGfiOK9uymEbw== +"@swc/core-linux-arm-gnueabihf@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.1.tgz#3d2f86ea5bc84bda9e458c5f249d36108fa29dd6" + integrity sha512-Q1zGHJMvAEkFdW7A2dthFrswf/HezhC2kOSoOmitz+KxWBZ0YSj8k9ImLYGFf7S8Vi0KVzLUaE1jCGK2oePx/A== dependencies: "@swc/wasm" "1.2.130" -"@swc/core-linux-arm64-gnu@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.0.tgz#f9fd72628f19504a62d663e80fc0a306913c34bd" - integrity sha512-CavXNYHKaPTMOvRXh1u7ZfMS5hKDXNSWTdeo+1+2M2XLCP0r0+2Iaeg0IZJD8nIwAlwwP8+rskan2Ekq6jaIfw== +"@swc/core-linux-arm64-gnu@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.1.tgz#0bcbf91761fccf516f4ce6c4da7696177b9236d9" + integrity sha512-5OPkiU2A4Ijt2cRzi2FCGPkAC+wRvAb0TmUkL4Lj2PXPzM5RtEd2AoYmpQhV+YEOXO4XdnKwgBmdeiQV5K8eXA== -"@swc/core-linux-arm64-musl@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.0.tgz#a80dd31211d6d866139cee6237edd919393c5f08" - integrity sha512-/3UiX8jH+OWleJbqYiwJEf4GQKP6xnm/6gyBt7V0GdhM4/ETMvzTFUNRObgpmxYMhXmNGAlxekU8+0QuAvyRJQ== +"@swc/core-linux-arm64-musl@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.1.tgz#078c0b0fabbe4bd361a81f4afce6017387c686c8" + integrity sha512-oTIeS7kEKSUrTxavYBEfqjqoIiHtbwSdgp/rrn2hz7CDG1B1imRHnsjwdh4YaYLsm8RcCH9+GABnHxJd3Nd6qg== -"@swc/core-linux-x64-gnu@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.0.tgz#6463fc20af367391da3e612438e8f302b89c6d6b" - integrity sha512-Ds76Lu7vfE01rgFcf9O1OuNBwQSHBpGwGOKGnwob6T2SCR4DBQz4MD0jLw/tdCZGR8x7NVMteBzQAp3CsUORZw== +"@swc/core-linux-x64-gnu@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.1.tgz#14b17a0cc580977c42efafecb1811ef59e3de1b5" + integrity sha512-gNojY1qIKksK9kNdY4pqrlUILTxfqSWtXjX0qV2mlxgwRpnOATJnMx585q09cOZnkN2/QB+33pXnT8z/wxuGzQ== -"@swc/core-linux-x64-musl@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.0.tgz#534d1b5368d42fcf9901cbc33f144367b0961e45" - integrity sha512-fgGq/SyX6DsTgJIujBbopaEu17f8u+cyTsJBluc5cF7HxspB4wC72sdq4KGgUoEYObVTgFejnEBZkm8hLOCwYA== +"@swc/core-linux-x64-musl@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.1.tgz#641f601051a7c21eb54570075df619acc6c5fd71" + integrity sha512-WXNagCsjul7U9uYYP1JkUUVtvqXRDDWjvdegqrtQ99/De+HoWr+fCPgvENgOsSwb0clPTBuiGm2PTnK6kDQ0Sw== -"@swc/core-win32-arm64-msvc@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.0.tgz#1797b9d2729673fa5715315f671de2a52bbd6e37" - integrity sha512-7B7XggbCmm1oHeNvz5ekWmWmJP/WeGpmGZ10Qca3/zrVm+IRN4ZBT+jpWm+cuuYJh0Llr5UYgTFib3cyOLWkJg== +"@swc/core-win32-arm64-msvc@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.1.tgz#5a090bb3f70cd5fe0af83b5ca4204bf226ac925e" + integrity sha512-3LSDJtpYNgN4N/pd/YzHAWKaF2Y/1P9t83vHfPos77hQ+KzFaiyT7YIG1qfYy1AD8MGC28l2bJNH2gia3bcERA== dependencies: "@swc/wasm" "1.2.130" -"@swc/core-win32-ia32-msvc@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.0.tgz#835c3f41ff6e01a53cbcfebafe9784e135847f08" - integrity sha512-vDIu5FjoqB3G7awWCyNsUh5UAzTtJPMEwG75Cwx51fxMPxXrVPHP6XpRovIjQ5wiKL5lGqicckieduJkgBvp7Q== +"@swc/core-win32-ia32-msvc@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.1.tgz#6a808a610e946013ffe4eb81d01b414eec93d636" + integrity sha512-0VfPVkQx7jV7k71tTQY5HchDrALWjrHF8AcaaCojXQpb9ftktLxaCUdTWlQ+Y958GkgG7QX+HEo95ImZ+cYRHQ== dependencies: "@swc/wasm" "1.2.130" -"@swc/core-win32-x64-msvc@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.0.tgz#7197ac806ab0673268cbf394f9dcf0fcec160aa2" - integrity sha512-ZEgMvq01Ningz6IOD6ixrpsfA83u+B/1TwnYmWuRl9hMml9lnPwdg3o1P0pwbSO1moKlUhSwc8WVYmI0bXF+gA== +"@swc/core-win32-x64-msvc@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.1.tgz#03410b2b76c2441856094e8cb514a19eb0109d1d" + integrity sha512-jSeqI8+1PGp+lHtyQCieDQxSszOF6UlA3bC2cmC9LAD84xcvsqpt0hsg3GFaw6RR7FsVjMNl/St6y1EEW0mm6Q== -"@swc/core@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.0.tgz#4bc9006cdb5de8f63c4e5b280d89f71f3384b39a" - integrity sha512-0mshAzMvdhL0v3lNMJowzMd8Du0bJf+PUTxhVm4uIb/h8qCDQjFERXj0RGejcDFSL7fJzLI3MzS5WR45KDrrLA== +"@swc/core@^1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.1.tgz#d81cb0d8af1b0e48e91ee328d41ccbbf21d532c0" + integrity sha512-ztB5N63UGLIOM60Vg+deHVigEnDAEAttiTQk4T91/i11SoOO65P9z8Bey01XFTxF0Alc2OJxkt8TBcq+n5mMYQ== optionalDependencies: - "@swc/core-android-arm-eabi" "1.3.0" - "@swc/core-android-arm64" "1.3.0" - "@swc/core-darwin-arm64" "1.3.0" - "@swc/core-darwin-x64" "1.3.0" - "@swc/core-freebsd-x64" "1.3.0" - "@swc/core-linux-arm-gnueabihf" "1.3.0" - "@swc/core-linux-arm64-gnu" "1.3.0" - "@swc/core-linux-arm64-musl" "1.3.0" - "@swc/core-linux-x64-gnu" "1.3.0" - "@swc/core-linux-x64-musl" "1.3.0" - "@swc/core-win32-arm64-msvc" "1.3.0" - "@swc/core-win32-ia32-msvc" "1.3.0" - "@swc/core-win32-x64-msvc" "1.3.0" + "@swc/core-android-arm-eabi" "1.3.1" + "@swc/core-android-arm64" "1.3.1" + "@swc/core-darwin-arm64" "1.3.1" + "@swc/core-darwin-x64" "1.3.1" + "@swc/core-freebsd-x64" "1.3.1" + "@swc/core-linux-arm-gnueabihf" "1.3.1" + "@swc/core-linux-arm64-gnu" "1.3.1" + "@swc/core-linux-arm64-musl" "1.3.1" + "@swc/core-linux-x64-gnu" "1.3.1" + "@swc/core-linux-x64-musl" "1.3.1" + "@swc/core-win32-arm64-msvc" "1.3.1" + "@swc/core-win32-ia32-msvc" "1.3.1" + "@swc/core-win32-x64-msvc" "1.3.1" "@swc/jest@^0.2.22": version "0.2.22" From a784ca70b1788b0bedf2b98948dc5e3ea7903d40 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Thu, 15 Sep 2022 08:02:14 -0400 Subject: [PATCH 024/280] Fix beta->latest->beta upgrade loop (#6189) --- .../default-update-channel.injectable.ts | 15 +------ .../application-update/update-channels.ts | 2 +- src/common/vars/release-channel.injectable.ts | 26 +++++++++++ .../downgrading-version-update.test.ts | 45 ++++++++++++++++--- .../installing-update.test.ts | 2 +- .../selection-of-update-stability.test.ts | 8 ++-- ...pdates-starting-from-channel.injectable.ts | 5 +-- .../update-can-be-downgraded.injectable.ts | 17 +++---- 8 files changed, 81 insertions(+), 39 deletions(-) create mode 100644 src/common/vars/release-channel.injectable.ts diff --git a/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts b/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts index 90dc22457a..44d7ff364e 100644 --- a/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts +++ b/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts @@ -3,23 +3,12 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import appSemanticVersionInjectable from "../../vars/app-semantic-version.injectable"; -import type { UpdateChannelId } from "../update-channels"; +import releaseChannelInjectable from "../../vars/release-channel.injectable"; import { updateChannels } from "../update-channels"; const defaultUpdateChannelInjectable = getInjectable({ id: "default-update-channel", - - instantiate: (di) => { - const appSemanticVersion = di.inject(appSemanticVersionInjectable); - const currentReleaseChannel = appSemanticVersion.prerelease[0]?.toString(); - - if (currentReleaseChannel in updateChannels) { - return updateChannels[currentReleaseChannel as UpdateChannelId]; - } - - return updateChannels.latest; - }, + instantiate: (di) => updateChannels[di.inject(releaseChannelInjectable)], }); export default defaultUpdateChannelInjectable; diff --git a/src/common/application-update/update-channels.ts b/src/common/application-update/update-channels.ts index dff1e5879e..5d166eabdb 100644 --- a/src/common/application-update/update-channels.ts +++ b/src/common/application-update/update-channels.ts @@ -24,7 +24,7 @@ const alphaChannel: UpdateChannel = { moreStableUpdateChannel: betaChannel, }; -export const updateChannels: Record = { +export const updateChannels = { latest: latestChannel, beta: betaChannel, alpha: alphaChannel, diff --git a/src/common/vars/release-channel.injectable.ts b/src/common/vars/release-channel.injectable.ts new file mode 100644 index 0000000000..78cc79cdb4 --- /dev/null +++ b/src/common/vars/release-channel.injectable.ts @@ -0,0 +1,26 @@ +/** + * 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 type { UpdateChannelId } from "../application-update/update-channels"; +import appSemanticVersionInjectable from "./app-semantic-version.injectable"; + +const releaseChannelInjectable = getInjectable({ + id: "release-channel", + instantiate: (di): UpdateChannelId => { + const appSemanticVersion = di.inject(appSemanticVersionInjectable); + const currentReleaseChannel = appSemanticVersion.prerelease[0]; + + switch (currentReleaseChannel) { + case "latest": + case "beta": + case "alpha": + return currentReleaseChannel; + default: + return "latest"; + } + }, +}); + +export default releaseChannelInjectable; diff --git a/src/features/application-update/downgrading-version-update.test.ts b/src/features/application-update/downgrading-version-update.test.ts index 0462bee3d4..eb35e84be9 100644 --- a/src/features/application-update/downgrading-version-update.test.ts +++ b/src/features/application-update/downgrading-version-update.test.ts @@ -40,6 +40,36 @@ describe("downgrading version update", () => { }); [ + { + updateChannel: updateChannels.latest, + appVersion: "4.0.0", + downgradeIsAllowed: false, + }, + { + updateChannel: updateChannels.beta, + appVersion: "4.0.0", + downgradeIsAllowed: false, + }, + { + updateChannel: updateChannels.alpha, + appVersion: "4.0.0", + downgradeIsAllowed: false, + }, + { + updateChannel: updateChannels.latest, + appVersion: "4.0.0-latest", + downgradeIsAllowed: false, + }, + { + updateChannel: updateChannels.beta, + appVersion: "4.0.0-latest", + downgradeIsAllowed: false, + }, + { + updateChannel: updateChannels.alpha, + appVersion: "4.0.0-latest", + downgradeIsAllowed: false, + }, { updateChannel: updateChannels.latest, appVersion: "4.0.0-beta", @@ -50,16 +80,21 @@ describe("downgrading version update", () => { appVersion: "4.0.0-beta", downgradeIsAllowed: false, }, - { - updateChannel: updateChannels.beta, - appVersion: "4.0.0-beta.1", - downgradeIsAllowed: false, - }, { updateChannel: updateChannels.alpha, appVersion: "4.0.0-beta", + downgradeIsAllowed: false, + }, + { + updateChannel: updateChannels.latest, + appVersion: "4.0.0-alpha", downgradeIsAllowed: true, }, + { + updateChannel: updateChannels.beta, + appVersion: "4.0.0-alpha", + downgradeIsAllowed: false, + }, { updateChannel: updateChannels.alpha, appVersion: "4.0.0-alpha", diff --git a/src/features/application-update/installing-update.test.ts b/src/features/application-update/installing-update.test.ts index 7063fcfaa1..973095d72d 100644 --- a/src/features/application-update/installing-update.test.ts +++ b/src/features/application-update/installing-update.test.ts @@ -91,7 +91,7 @@ describe("installing update", () => { it("checks for updates", () => { expect(checkForPlatformUpdatesMock).toHaveBeenCalledWith( expect.any(Object), - { allowDowngrade: true }, + { allowDowngrade: false }, ); }); diff --git a/src/features/application-update/selection-of-update-stability.test.ts b/src/features/application-update/selection-of-update-stability.test.ts index 56937ab0b4..3e7ce4a893 100644 --- a/src/features/application-update/selection-of-update-stability.test.ts +++ b/src/features/application-update/selection-of-update-stability.test.ts @@ -105,7 +105,7 @@ describe("selection of update stability", () => { it('checks updates from update channel "alpha"', () => { expect(checkForPlatformUpdatesMock).toHaveBeenCalledWith( updateChannels.alpha, - { allowDowngrade: true }, + { allowDowngrade: false }, ); }); @@ -132,7 +132,7 @@ describe("selection of update stability", () => { it('checks updates from update channel "beta"', () => { expect(checkForPlatformUpdatesMock).toHaveBeenCalledWith( updateChannels.beta, - { allowDowngrade: true }, + { allowDowngrade: false }, ); }); @@ -159,7 +159,7 @@ describe("selection of update stability", () => { it('finally checks updates from update channel "latest"', () => { expect(checkForPlatformUpdatesMock).toHaveBeenCalledWith( updateChannels.latest, - { allowDowngrade: true }, + { allowDowngrade: false }, ); }); @@ -279,7 +279,7 @@ describe("selection of update stability", () => { expect(checkForPlatformUpdatesMock).toHaveBeenCalledWith( updateChannels.latest, - { allowDowngrade: true }, + { allowDowngrade: false }, ); }); diff --git a/src/main/application-update/check-for-updates/check-for-updates-starting-from-channel.injectable.ts b/src/main/application-update/check-for-updates/check-for-updates-starting-from-channel.injectable.ts index caf695ff80..0381c883a6 100644 --- a/src/main/application-update/check-for-updates/check-for-updates-starting-from-channel.injectable.ts +++ b/src/main/application-update/check-for-updates/check-for-updates-starting-from-channel.injectable.ts @@ -19,10 +19,7 @@ const checkForUpdatesStartingFromChannelInjectable = getInjectable({ id: "check-for-updates-starting-from-channel", instantiate: (di) => { - const checkForPlatformUpdates = di.inject( - checkForPlatformUpdatesInjectable, - ); - + const checkForPlatformUpdates = di.inject(checkForPlatformUpdatesInjectable); const updateCanBeDowngraded = di.inject(updateCanBeDowngradedInjectable); const _recursiveCheck = async ( diff --git a/src/main/application-update/check-for-updates/update-can-be-downgraded.injectable.ts b/src/main/application-update/check-for-updates/update-can-be-downgraded.injectable.ts index 08fd1d933d..aa8fb1b131 100644 --- a/src/main/application-update/check-for-updates/update-can-be-downgraded.injectable.ts +++ b/src/main/application-update/check-for-updates/update-can-be-downgraded.injectable.ts @@ -5,24 +5,19 @@ import { getInjectable } from "@ogre-tools/injectable"; import { computed } from "mobx"; import selectedUpdateChannelInjectable from "../../../common/application-update/selected-update-channel/selected-update-channel.injectable"; -import appVersionInjectable from "../../../common/vars/app-version.injectable"; -import { SemVer } from "semver"; +import releaseChannelInjectable from "../../../common/vars/release-channel.injectable"; const updateCanBeDowngradedInjectable = getInjectable({ id: "update-can-be-downgraded", instantiate: (di) => { const selectedUpdateChannel = di.inject(selectedUpdateChannelInjectable); - const appVersion = di.inject(appVersionInjectable); + const releaseChannel = di.inject(releaseChannelInjectable); - return computed(() => { - const semVer = new SemVer(appVersion); - - return ( - semVer.prerelease[0] !== - selectedUpdateChannel.value.get().id - ); - }); + return computed(() => ( + selectedUpdateChannel.value.get().id === "latest" + && releaseChannel !== "latest" + )); }, }); From cfe35ded908a43d795f4fae76f216ad991792bc1 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Thu, 15 Sep 2022 15:56:41 -0400 Subject: [PATCH 025/280] Fix overflow on main layout not being scrolled (#6258) --- src/renderer/components/cluster-manager/cluster-manager.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer/components/cluster-manager/cluster-manager.scss b/src/renderer/components/cluster-manager/cluster-manager.scss index b5bfbbebae..7644d1f4d3 100644 --- a/src/renderer/components/cluster-manager/cluster-manager.scss +++ b/src/renderer/components/cluster-manager/cluster-manager.scss @@ -19,6 +19,7 @@ position: relative; display: flex; flex-direction: column; + overflow-y: auto; } .HotbarMenu { From 67ac1692b260c0d18be74c878520375c2e324ad4 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Thu, 15 Sep 2022 17:20:58 -0400 Subject: [PATCH 026/280] Clean up versioning and packageJson uses (#6196) --- package.json | 3 +- src/common/__tests__/cluster-store.test.ts | 4 +- src/common/__tests__/hotbar-store.test.ts | 4 +- src/common/__tests__/user-store.test.ts | 13 +-- src/common/app-paths/app-paths.test.ts | 11 +-- .../default-update-channel.injectable.ts | 6 +- .../selected-update-channel.injectable.ts | 10 +- .../application-update/update-channels.ts | 4 +- src/common/base-store.ts | 4 +- src/common/catalog-entities/web-link.ts | 6 +- ...eporting.global-override-for-injectable.ts | 9 ++ .../initialize-sentry-reporting.injectable.ts | 65 +++++++++++++ ...e-config.global-override-for-injectable.ts | 8 -- .../welcome-route-config.injectable.ts | 8 +- src/common/initializable-state/create.test.ts | 77 +++++++++++++++ src/common/initializable-state/create.ts | 62 +++++++++++++ src/common/k8s/resource-stack.ts | 5 +- src/common/sentry.ts | 67 ------------- src/common/user-store/user-store.ts | 19 +--- src/common/utils/app-version.ts | 9 -- src/common/vars.ts | 12 --- .../vars}/app-name.injectable.ts | 4 +- .../vars/app-semantic-version.injectable.ts | 14 --- src/common/vars/app-version.injectable.ts | 13 --- .../vars/application-copyright.injectable.ts | 13 +++ .../application-description.injectable.ts | 13 +++ ...ormation.global-override-for-injectable.ts | 23 +++++ .../application-information.injectable.ts | 22 +++++ .../vars/build-semantic-version.injectable.ts | 30 ++++++ .../bundled-kubectl-version.injectable.ts | 13 +++ .../content-security-policy.injectable.ts | 13 +++ .../vars/extension-api-version.injectable.ts | 18 ++++ ...-package.global-override-for-injectable.ts | 9 ++ ...table.ts => is-snap-package.injectable.ts} | 9 +- .../vars}/product-name.injectable.ts | 5 +- src/common/vars/release-channel.injectable.ts | 10 +- src/common/vars/sentry-dsn-url.injectable.ts | 13 +++ .../store-migration-version.injectable.ts | 13 +++ .../__tests__/is-compatible-extension.test.ts | 34 +++---- src/extensions/common-api/app.ts | 63 +++++++++++-- src/extensions/common-api/index.ts | 4 +- src/extensions/common-api/user-preferences.ts | 15 +-- src/extensions/common-api/utils.ts | 36 +++++-- .../extension-discovery.injectable.ts | 29 +++--- .../extension-discovery.test.ts | 4 +- .../is-compatible-extension.injectable.ts | 4 +- .../is-compatible-extension.ts | 9 +- ...acters-in-page-registrations.test.tsx.snap | 2 +- .../navigate-to-extension-page.test.tsx.snap | 2 +- ...ation-using-application-menu.test.tsx.snap | 2 +- ...e-since-update-was-downloaded.test.ts.snap | 6 +- ...g-update-using-topbar-button.test.tsx.snap | 4 +- .../installing-update-using-tray.test.ts.snap | 12 +-- .../installing-update.test.ts.snap | 12 +-- ...eriodical-checking-of-updates.test.ts.snap | 2 +- ...selection-of-update-stability.test.ts.snap | 2 +- .../analytics-for-installing-update.test.ts | 4 +- .../downgrading-version-update.test.ts | 4 +- .../selection-of-update-stability.test.ts | 52 ++++------- .../keyboard-shortcuts.test.tsx.snap | 16 ++-- ...gation-using-application-menu.test.ts.snap | 2 +- ...gation-using-application-menu.test.ts.snap | 2 +- .../navigation-using-tray.test.ts.snap | 2 +- ...vigation-to-telemetry-preferences.test.tsx | 6 +- ...-originating-from-extensions.test.tsx.snap | 2 +- ...gation-using-application-menu.test.ts.snap | 4 +- .../app-paths/setup-app-paths.injectable.ts | 2 +- .../check-for-platform-updates.test.ts | 4 +- ...current-version-to-analytics.injectable.ts | 6 +- .../publish-is-configured.injectable.ts | 11 +-- .../build-version/setup-channel.injectable.ts | 23 +++++ ...ron-app.global-override-for-injectable.ts} | 6 +- .../setup-application-name.injectable.ts | 2 +- src/main/getDiForUnitTesting.ts | 9 -- .../kubectl/bundled-kubectl.injectable.ts | 5 +- src/main/kubectl/create-kubectl.injectable.ts | 4 + src/main/kubectl/kubectl.ts | 30 +----- src/main/kubectl/version-map.injectable.ts | 35 +++++++ src/main/lens-proxy/lens-proxy.injectable.ts | 26 ++---- src/main/lens-proxy/lens-proxy.ts | 16 ++-- .../menu/application-menu-items.injectable.ts | 6 +- src/main/menu/build-version.injectable.ts | 13 --- src/main/menu/menu.ts | 26 ------ src/main/menu/show-about.injectable.ts | 41 ++++++-- .../routes/static-file-route.injectable.ts | 93 +++++++++++-------- .../versions/get-version-route.injectable.ts | 22 +++-- src/main/shell-sync.ts | 40 -------- .../create-application-window.injectable.ts | 2 +- ...-on-main.global-override-for-injectable.ts | 9 ++ .../sentry/initialize-on-main.injectable.ts | 14 +++ .../runnables/sentry/setup.injectable.ts | 23 +++++ .../runnables/setup-lens-proxy.injectable.ts | 6 +- .../runnables/setup-sentry.injectable.ts | 24 ----- .../runnables/setup-shell.injectable.ts | 30 +++++- .../electron-tray/electron-tray.injectable.ts | 6 +- .../about-app-tray-item.injectable.ts | 11 +-- .../open-app-tray-item.injectable.ts | 12 +-- .../build-version/build-version.injectable.ts | 19 ++++ .../get-build-version.injectable.ts | 17 ++++ .../vars/build-version/init.injectable.ts | 21 +++++ .../default-update-channel/init.injectable.ts | 23 +++++ .../semantic-build-version/init.injectable.ts | 23 +++++ src/migrations/cluster-store/snap.ts | 5 +- .../weblinks-store/currentVersion.ts | 5 +- src/renderer/bootstrap.tsx | 6 +- ...-preferences-navigation-item.injectable.ts | 6 +- .../+preferences/sentry-dns-url.injectable.ts | 13 --- .../components/+preferences/telemetry.tsx | 4 +- src/renderer/components/+welcome/welcome.tsx | 11 ++- .../components/cluster-prometheus-setting.tsx | 20 +++- src/renderer/getDiForUnitTesting.tsx | 3 - src/renderer/utils/prevDefault.ts | 2 +- .../build-version/build-version.injectable.ts | 19 ++++ .../vars/build-version/init.injectable.ts | 21 +++++ .../default-update-channel/init.injectable.ts | 23 +++++ .../semantic-build-version/init.injectable.ts | 23 +++++ 116 files changed, 1154 insertions(+), 644 deletions(-) create mode 100644 src/common/error-reporting/initialize-sentry-reporting.global-override-for-injectable.ts create mode 100644 src/common/error-reporting/initialize-sentry-reporting.injectable.ts delete mode 100644 src/common/front-end-routing/routes/welcome/welcome-route-config.global-override-for-injectable.ts create mode 100644 src/common/initializable-state/create.test.ts create mode 100644 src/common/initializable-state/create.ts delete mode 100644 src/common/sentry.ts rename src/{main/app-paths/app-name => common/vars}/app-name.injectable.ts (83%) delete mode 100644 src/common/vars/app-semantic-version.injectable.ts delete mode 100644 src/common/vars/app-version.injectable.ts create mode 100644 src/common/vars/application-copyright.injectable.ts create mode 100644 src/common/vars/application-description.injectable.ts create mode 100644 src/common/vars/application-information.global-override-for-injectable.ts create mode 100644 src/common/vars/application-information.injectable.ts create mode 100644 src/common/vars/build-semantic-version.injectable.ts create mode 100644 src/common/vars/bundled-kubectl-version.injectable.ts create mode 100644 src/common/vars/content-security-policy.injectable.ts create mode 100644 src/common/vars/extension-api-version.injectable.ts create mode 100644 src/common/vars/is-snap-package.global-override-for-injectable.ts rename src/common/vars/{package-json.injectable.ts => is-snap-package.injectable.ts} (55%) rename src/{main/app-paths/app-name => common/vars}/product-name.injectable.ts (65%) create mode 100644 src/common/vars/sentry-dsn-url.injectable.ts create mode 100644 src/common/vars/store-migration-version.injectable.ts create mode 100644 src/main/build-version/setup-channel.injectable.ts rename src/main/{menu/build-version.global-override-for-injectable.ts => electron-app/electron-app.global-override-for-injectable.ts} (56%) create mode 100644 src/main/kubectl/version-map.injectable.ts delete mode 100644 src/main/menu/build-version.injectable.ts delete mode 100644 src/main/shell-sync.ts create mode 100644 src/main/start-main-application/runnables/sentry/initialize-on-main.global-override-for-injectable.ts create mode 100644 src/main/start-main-application/runnables/sentry/initialize-on-main.injectable.ts create mode 100644 src/main/start-main-application/runnables/sentry/setup.injectable.ts delete mode 100644 src/main/start-main-application/runnables/setup-sentry.injectable.ts create mode 100644 src/main/vars/build-version/build-version.injectable.ts create mode 100644 src/main/vars/build-version/get-build-version.injectable.ts create mode 100644 src/main/vars/build-version/init.injectable.ts create mode 100644 src/main/vars/default-update-channel/init.injectable.ts create mode 100644 src/main/vars/semantic-build-version/init.injectable.ts delete mode 100644 src/renderer/components/+preferences/sentry-dns-url.injectable.ts create mode 100644 src/renderer/vars/build-version/build-version.injectable.ts create mode 100644 src/renderer/vars/build-version/init.injectable.ts create mode 100644 src/renderer/vars/default-update-channel/init.injectable.ts create mode 100644 src/renderer/vars/semantic-build-version/init.injectable.ts diff --git a/package.json b/package.json index 03d6b34a08..2bc0d9ff26 100644 --- a/package.json +++ b/package.json @@ -208,7 +208,8 @@ "lens" ], "role": "Viewer" - } + }, + "publish": [] }, "resolutions": { "@astronautlabs/jsonpath/underscore": "^1.12.1" diff --git a/src/common/__tests__/cluster-store.test.ts b/src/common/__tests__/cluster-store.test.ts index b74659aea0..2253c7662f 100644 --- a/src/common/__tests__/cluster-store.test.ts +++ b/src/common/__tests__/cluster-store.test.ts @@ -18,13 +18,13 @@ import { createClusterInjectionToken } from "../cluster/create-cluster-injection import directoryForUserDataInjectable from "../app-paths/directory-for-user-data/directory-for-user-data.injectable"; import { getDiForUnitTesting } from "../../main/getDiForUnitTesting"; import getConfigurationFileModelInjectable from "../get-configuration-file-model/get-configuration-file-model.injectable"; -import appVersionInjectable from "../vars/app-version.injectable"; import assert from "assert"; import directoryForTempInjectable from "../app-paths/directory-for-temp/directory-for-temp.injectable"; import kubectlBinaryNameInjectable from "../../main/kubectl/binary-name.injectable"; import kubectlDownloadingNormalizedArchInjectable from "../../main/kubectl/normalized-arch.injectable"; import normalizedPlatformInjectable from "../vars/normalized-platform.injectable"; import fsInjectable from "../fs/fs.injectable"; +import storeMigrationVersionInjectable from "../vars/store-migration-version.injectable"; console = new Console(stdout, stderr); @@ -372,7 +372,7 @@ users: mockFs(mockOpts); - mainDi.override(appVersionInjectable, () => "3.6.0"); + mainDi.override(storeMigrationVersionInjectable, () => "3.6.0"); createCluster = mainDi.inject(createClusterInjectionToken); diff --git a/src/common/__tests__/hotbar-store.test.ts b/src/common/__tests__/hotbar-store.test.ts index d847ac76dc..0e1b3e27a2 100644 --- a/src/common/__tests__/hotbar-store.test.ts +++ b/src/common/__tests__/hotbar-store.test.ts @@ -8,7 +8,6 @@ import mockFs from "mock-fs"; import type { CatalogEntity, CatalogEntityData, CatalogEntityKindData } from "../catalog"; import { getDiForUnitTesting } from "../../main/getDiForUnitTesting"; import getConfigurationFileModelInjectable from "../get-configuration-file-model/get-configuration-file-model.injectable"; -import appVersionInjectable from "../vars/app-version.injectable"; import type { DiContainer } from "@ogre-tools/injectable"; import hotbarStoreInjectable from "../hotbars/store.injectable"; import type { HotbarStore } from "../hotbars/store"; @@ -19,6 +18,7 @@ import catalogCatalogEntityInjectable from "../catalog-entities/general-catalog- import loggerInjectable from "../logger.injectable"; import type { Logger } from "../logger"; import directoryForUserDataInjectable from "../app-paths/directory-for-user-data/directory-for-user-data.injectable"; +import storeMigrationVersionInjectable from "../vars/store-migration-version.injectable"; function getMockCatalogEntity(data: Partial & CatalogEntityKindData): CatalogEntity { return { @@ -348,7 +348,7 @@ describe("HotbarStore", () => { mockFs(configurationToBeMigrated); - di.override(appVersionInjectable, () => "5.0.0-beta.10"); + di.override(storeMigrationVersionInjectable, () => "5.0.0-beta.10"); hotbarStore = di.inject(hotbarStoreInjectable); diff --git a/src/common/__tests__/user-store.test.ts b/src/common/__tests__/user-store.test.ts index 23740c5457..e6fa7b4189 100644 --- a/src/common/__tests__/user-store.test.ts +++ b/src/common/__tests__/user-store.test.ts @@ -23,8 +23,6 @@ jest.mock("electron", () => ({ import type { UserStore } from "../user-store"; import { Console } from "console"; -import { SemVer } from "semver"; -import electron from "electron"; import { stdout, stderr } from "process"; import userStoreInjectable from "../user-store/user-store.injectable"; import type { DiContainer } from "@ogre-tools/injectable"; @@ -34,7 +32,7 @@ import { defaultThemeId } from "../vars"; import writeFileInjectable from "../fs/write-file.injectable"; import { getDiForUnitTesting } from "../../main/getDiForUnitTesting"; import getConfigurationFileModelInjectable from "../get-configuration-file-model/get-configuration-file-model.injectable"; -import appVersionInjectable from "../vars/app-version.injectable"; +import storeMigrationVersionInjectable from "../vars/store-migration-version.injectable"; console = new Console(stdout, stderr); @@ -86,13 +84,6 @@ describe("user store tests", () => { userStore.resetTheme(); expect(userStore.colorTheme).toBe(defaultThemeId); }); - - it("correctly calculates if the last seen version is an old release", () => { - expect(userStore.isNewVersion).toBe(true); - - userStore.lastSeenAppVersion = (new SemVer(electron.app.getVersion())).inc("major").format(); - expect(userStore.isNewVersion).toBe(false); - }); }); describe("migrations", () => { @@ -125,7 +116,7 @@ describe("user store tests", () => { }, }); - di.override(appVersionInjectable, () => "10.0.0"); + di.override(storeMigrationVersionInjectable, () => "10.0.0"); userStore = di.inject(userStoreInjectable); }); diff --git a/src/common/app-paths/app-paths.test.ts b/src/common/app-paths/app-paths.test.ts index b5ec33059c..ff4bd88988 100644 --- a/src/common/app-paths/app-paths.test.ts +++ b/src/common/app-paths/app-paths.test.ts @@ -7,7 +7,6 @@ import { appPathsInjectionToken } from "./app-path-injection-token"; import getElectronAppPathInjectable from "../../main/app-paths/get-electron-app-path/get-electron-app-path.injectable"; import type { PathName } from "./app-path-names"; import setElectronAppPathInjectable from "../../main/app-paths/set-electron-app-path/set-electron-app-path.injectable"; -import appNameInjectable from "../../main/app-paths/app-name/app-name.injectable"; import directoryForIntegrationTestingInjectable from "../../main/app-paths/directory-for-integration-testing/directory-for-integration-testing.injectable"; import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; @@ -53,8 +52,6 @@ describe("app-paths", () => { defaultAppPathsStub[key] = path; }, ); - - mainDi.override(appNameInjectable, () => "some-app-name"); }); }); @@ -88,7 +85,7 @@ describe("app-paths", () => { recent: "some-recent", temp: "some-temp", videos: "some-videos", - userData: "some-app-data/some-app-name", + userData: "some-app-data/some-product-name", }); }); @@ -111,7 +108,7 @@ describe("app-paths", () => { recent: "some-recent", temp: "some-temp", videos: "some-videos", - userData: "some-app-data/some-app-name", + userData: "some-app-data/some-product-name", }); }); }); @@ -137,7 +134,7 @@ describe("app-paths", () => { expect({ appData, userData }).toEqual({ appData: "some-integration-testing-app-data", - userData: `some-integration-testing-app-data/some-app-name`, + userData: `some-integration-testing-app-data/some-product-name`, }); }); @@ -146,7 +143,7 @@ describe("app-paths", () => { expect({ appData, userData }).toEqual({ appData: "some-integration-testing-app-data", - userData: "some-integration-testing-app-data/some-app-name", + userData: "some-integration-testing-app-data/some-product-name", }); }); }); diff --git a/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts b/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts index 44d7ff364e..ff4fe32e4e 100644 --- a/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts +++ b/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts @@ -2,13 +2,13 @@ * 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 { createInitializableState } from "../../initializable-state/create"; import releaseChannelInjectable from "../../vars/release-channel.injectable"; import { updateChannels } from "../update-channels"; -const defaultUpdateChannelInjectable = getInjectable({ +const defaultUpdateChannelInjectable = createInitializableState({ id: "default-update-channel", - instantiate: (di) => updateChannels[di.inject(releaseChannelInjectable)], + init: (di) => updateChannels[di.inject(releaseChannelInjectable)], }); export default defaultUpdateChannelInjectable; diff --git a/src/common/application-update/selected-update-channel/selected-update-channel.injectable.ts b/src/common/application-update/selected-update-channel/selected-update-channel.injectable.ts index ceb47aee5e..8ca31e00aa 100644 --- a/src/common/application-update/selected-update-channel/selected-update-channel.injectable.ts +++ b/src/common/application-update/selected-update-channel/selected-update-channel.injectable.ts @@ -5,13 +5,13 @@ import { getInjectable } from "@ogre-tools/injectable"; import type { IComputedValue } from "mobx"; import { action, computed, observable } from "mobx"; -import type { UpdateChannel, UpdateChannelId } from "../update-channels"; +import type { UpdateChannel, ReleaseChannel } from "../update-channels"; import { updateChannels } from "../update-channels"; import defaultUpdateChannelInjectable from "./default-update-channel.injectable"; export interface SelectedUpdateChannel { value: IComputedValue; - setValue: (channelId?: UpdateChannelId) => void; + setValue: (channelId?: ReleaseChannel) => void; } const selectedUpdateChannelInjectable = getInjectable({ @@ -19,16 +19,16 @@ const selectedUpdateChannelInjectable = getInjectable({ instantiate: (di): SelectedUpdateChannel => { const defaultUpdateChannel = di.inject(defaultUpdateChannelInjectable); - const state = observable.box(defaultUpdateChannel); + const state = observable.box(); return { - value: computed(() => state.get()), + value: computed(() => state.get() ?? defaultUpdateChannel.get()), setValue: action((channelId) => { const targetUpdateChannel = channelId && updateChannels[channelId] ? updateChannels[channelId] - : defaultUpdateChannel; + : defaultUpdateChannel.get(); state.set(targetUpdateChannel); }), diff --git a/src/common/application-update/update-channels.ts b/src/common/application-update/update-channels.ts index 5d166eabdb..1a38974946 100644 --- a/src/common/application-update/update-channels.ts +++ b/src/common/application-update/update-channels.ts @@ -4,7 +4,7 @@ */ -export type UpdateChannelId = "alpha" | "beta" | "latest"; +export type ReleaseChannel = "alpha" | "beta" | "latest"; const latestChannel: UpdateChannel = { id: "latest", @@ -31,7 +31,7 @@ export const updateChannels = { }; export interface UpdateChannel { - readonly id: UpdateChannelId; + readonly id: ReleaseChannel; readonly label: string; readonly moreStableUpdateChannel: UpdateChannel | null; } diff --git a/src/common/base-store.ts b/src/common/base-store.ts index 2c2f66dd23..92383b328d 100644 --- a/src/common/base-store.ts +++ b/src/common/base-store.ts @@ -19,7 +19,7 @@ import { kebabCase } from "lodash"; import { getLegacyGlobalDiForExtensionApi } from "../extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api"; import directoryForUserDataInjectable from "./app-paths/directory-for-user-data/directory-for-user-data.injectable"; import getConfigurationFileModelInjectable from "./get-configuration-file-model/get-configuration-file-model.injectable"; -import appVersionInjectable from "./vars/app-version.injectable"; +import storeMigrationVersionInjectable from "./vars/store-migration-version.injectable"; export interface BaseStoreParams extends ConfOptions { syncOptions?: { @@ -60,7 +60,7 @@ export abstract class BaseStore extends Singleton { this.storeConfig = getConfigurationFileModel({ projectName: "lens", - projectVersion: di.inject(appVersionInjectable), + projectVersion: di.inject(storeMigrationVersionInjectable), cwd: this.cwd(), ...this.params, }); diff --git a/src/common/catalog-entities/web-link.ts b/src/common/catalog-entities/web-link.ts index 35dc86be57..dade63af16 100644 --- a/src/common/catalog-entities/web-link.ts +++ b/src/common/catalog-entities/web-link.ts @@ -3,9 +3,10 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ +import { getLegacyGlobalDiForExtensionApi } from "../../extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api"; import type { CatalogEntityContextMenuContext, CatalogEntityMetadata, CatalogEntityStatus } from "../catalog"; import { CatalogCategory, CatalogEntity, categoryVersion } from "../catalog/catalog-entity"; -import { productName } from "../vars"; +import productNameInjectable from "../vars/product-name.injectable"; import { WeblinkStore } from "../weblink-store"; export type WebLinkStatusPhase = "available" | "unavailable"; @@ -30,6 +31,9 @@ export class WebLink extends CatalogEntity () => {}); diff --git a/src/common/error-reporting/initialize-sentry-reporting.injectable.ts b/src/common/error-reporting/initialize-sentry-reporting.injectable.ts new file mode 100644 index 0000000000..d34005f374 --- /dev/null +++ b/src/common/error-reporting/initialize-sentry-reporting.injectable.ts @@ -0,0 +1,65 @@ +/** + * 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 type { ElectronMainOptions } from "@sentry/electron/main"; +import type { BrowserOptions } from "@sentry/electron/renderer"; +import isProductionInjectable from "../vars/is-production.injectable"; +import sentryDataSourceNameInjectable from "../vars/sentry-dsn-url.injectable"; +import { Dedupe, Offline } from "@sentry/integrations"; +import { inspect } from "util"; +import userStoreInjectable from "../user-store/user-store.injectable"; + +export type InitializeSentryReportingWith = (initSentry: (opts: BrowserOptions | ElectronMainOptions) => void) => void; + +const mapProcessName = (type: "browser" | "renderer" | "worker") => type === "browser" ? "main" : type; + +const initializeSentryReportingWithInjectable = getInjectable({ + id: "initialize-sentry-reporting-with", + instantiate: (di): InitializeSentryReportingWith => { + const sentryDataSourceName = di.inject(sentryDataSourceNameInjectable); + const isProduction = di.inject(isProductionInjectable); + + if (!sentryDataSourceName) { + return () => {}; + } + + return (initSentry) => initSentry({ + beforeSend: (event) => { + // TODO: remove loading from userStoreInjectable so that this can be moved out + const userStore = di.inject(userStoreInjectable); + + if (userStore.allowErrorReporting) { + return event; + } + + /** + * Directly write to stdout so that no other integrations capture this and create an infinite loop + */ + process.stdout.write(`🔒 [SENTRY-BEFORE-SEND-HOOK]: Sentry event is caught but not sent to server.`); + process.stdout.write("🔒 [SENTRY-BEFORE-SEND-HOOK]: === START OF SENTRY EVENT ==="); + process.stdout.write(inspect(event, false, null, true)); + process.stdout.write("🔒 [SENTRY-BEFORE-SEND-HOOK]: === END OF SENTRY EVENT ==="); + + // if return null, the event won't be sent + // ref https://github.com/getsentry/sentry-javascript/issues/2039 + return null; + }, + dsn: sentryDataSourceName, + integrations: [ + new Dedupe(), + new Offline(), + ], + initialScope: { + tags: { + "process": mapProcessName(process.type), + }, + }, + environment: isProduction ? "production" : "development", + }); + }, + causesSideEffects: true, +}); + +export default initializeSentryReportingWithInjectable; diff --git a/src/common/front-end-routing/routes/welcome/welcome-route-config.global-override-for-injectable.ts b/src/common/front-end-routing/routes/welcome/welcome-route-config.global-override-for-injectable.ts deleted file mode 100644 index 703c0798a2..0000000000 --- a/src/common/front-end-routing/routes/welcome/welcome-route-config.global-override-for-injectable.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) OpenLens Authors. All rights reserved. - * Licensed under MIT License. See LICENSE in root directory for more information. - */ -import { getGlobalOverride } from "../../../test-utils/get-global-override"; -import welcomeRouteConfig from "./welcome-route-config.injectable"; - -export default getGlobalOverride(welcomeRouteConfig, () => "/welcome"); diff --git a/src/common/front-end-routing/routes/welcome/welcome-route-config.injectable.ts b/src/common/front-end-routing/routes/welcome/welcome-route-config.injectable.ts index 53a61ab99f..4e16df5bb4 100644 --- a/src/common/front-end-routing/routes/welcome/welcome-route-config.injectable.ts +++ b/src/common/front-end-routing/routes/welcome/welcome-route-config.injectable.ts @@ -3,16 +3,12 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import packageJsonInjectable from "../../../vars/package-json.injectable"; +import applicationInformationInjectable from "../../../vars/application-information.injectable"; const welcomeRouteConfigInjectable = getInjectable({ id: "welcome-route-config", - instantiate: (di) => { - const packageJson = di.inject(packageJsonInjectable); - - return packageJson.config.welcomeRoute; - }, + instantiate: (di) => di.inject(applicationInformationInjectable).config.welcomeRoute, }); export default welcomeRouteConfigInjectable; diff --git a/src/common/initializable-state/create.test.ts b/src/common/initializable-state/create.test.ts new file mode 100644 index 0000000000..38980b0a41 --- /dev/null +++ b/src/common/initializable-state/create.test.ts @@ -0,0 +1,77 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +import type { AsyncFnMock } from "@async-fn/jest"; +import asyncFn from "@async-fn/jest"; +import type { DiContainer, Injectable } from "@ogre-tools/injectable"; +import { runInAction } from "mobx"; +import { getDiForUnitTesting } from "../../main/getDiForUnitTesting"; +import type { InitializableState } from "./create"; +import { createInitializableState } from "./create"; + +describe("InitializableState tests", () => { + let di: DiContainer; + + beforeEach(() => { + di = getDiForUnitTesting({ doGeneralOverrides: true }); + }); + + describe("when created", () => { + let stateInjectable: Injectable, unknown, void>; + let initMock: AsyncFnMock<() => number>; + + beforeEach(() => { + initMock = asyncFn(); + stateInjectable = createInitializableState({ + id: "my-state", + init: initMock, + }); + + runInAction(() => { + di.register(stateInjectable); + }); + }); + + describe("when injected", () => { + let state: InitializableState; + + beforeEach(() => { + state = di.inject(stateInjectable); + }); + + it("when get is called, throw", () => { + expect(() => state.get()).toThrowError("InitializableState(my-state) has not been initialized yet"); + }); + + describe("when init is called", () => { + beforeEach(() => { + state.init(); + }); + + it("should call provided initialization function", () => { + expect(initMock).toBeCalled(); + }); + + it("when get is called, throw", () => { + expect(() => state.get()).toThrowError("InitializableState(my-state) has not finished initializing"); + }); + + describe("when initialization resolves", () => { + beforeEach(async () => { + await initMock.resolve(42); + }); + + it("when get is called, returns value", () => { + expect(state.get()).toBe(42); + }); + + it("when init is called again, throws", async () => { + await expect(() => state.init()).rejects.toThrow("Cannot initialize InitializableState(my-state) more than once"); + }); + }); + }); + }); + }); +}); diff --git a/src/common/initializable-state/create.ts b/src/common/initializable-state/create.ts new file mode 100644 index 0000000000..829de57d94 --- /dev/null +++ b/src/common/initializable-state/create.ts @@ -0,0 +1,62 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +import type { DiContainerForInjection, Injectable, InjectionToken } from "@ogre-tools/injectable"; +import { getInjectable } from "@ogre-tools/injectable"; + +export interface CreateInitializableStateArgs { + id: string; + init: (di: DiContainerForInjection) => Promise | T; + injectionToken?: InjectionToken, void>; +} + +export interface InitializableState { + get: () => T; + init: () => Promise; +} + +type InitializableStateValue = + | { set: false } + | { set: true; value: T } ; + +export function createInitializableState(args: CreateInitializableStateArgs): Injectable, unknown, void> { + const { id, init, injectionToken } = args; + + return getInjectable({ + id, + instantiate: (di) => { + let box: InitializableStateValue = { + set: false, + }; + let initCalled = false; + + return { + init: async () => { + if (initCalled) { + throw new Error(`Cannot initialize InitializableState(${id}) more than once`); + } + + initCalled = true; + box = { + set: true, + value: await init(di), + }; + }, + get: () => { + if (!initCalled) { + throw new Error(`InitializableState(${id}) has not been initialized yet`); + } + + if (box.set === false) { + throw new Error(`InitializableState(${id}) has not finished initializing`); + } + + return box.value; + }, + }; + }, + injectionToken, + }); +} diff --git a/src/common/k8s/resource-stack.ts b/src/common/k8s/resource-stack.ts index d289a375b3..96ecf2e39c 100644 --- a/src/common/k8s/resource-stack.ts +++ b/src/common/k8s/resource-stack.ts @@ -11,8 +11,9 @@ import logger from "../../main/logger"; import { app } from "electron"; import { ClusterStore } from "../cluster-store/cluster-store"; import yaml from "js-yaml"; -import { productName } from "../vars"; import { requestKubectlApplyAll, requestKubectlDeleteAll } from "../../renderer/ipc"; +import { getLegacyGlobalDiForExtensionApi } from "../../extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api"; +import productNameInjectable from "../vars/product-name.injectable"; export class ResourceStack { constructor(protected cluster: KubernetesCluster, protected name: string) {} @@ -97,6 +98,8 @@ export class ResourceStack { protected async renderTemplates(folderPath: string, templateContext: any): Promise { const resources: string[] = []; + const di = getLegacyGlobalDiForExtensionApi(); + const productName = di.inject(productNameInjectable); logger.info(`[RESOURCE-STACK]: render templates from ${folderPath}`); const files = await fse.readdir(folderPath); diff --git a/src/common/sentry.ts b/src/common/sentry.ts deleted file mode 100644 index 282afa6f32..0000000000 --- a/src/common/sentry.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) OpenLens Authors. All rights reserved. - * Licensed under MIT License. See LICENSE in root directory for more information. - */ - -import { Dedupe, Offline } from "@sentry/integrations"; -import { sentryDsn, isProduction } from "./vars"; -import { UserStore } from "./user-store"; -import { inspect } from "util"; -import type { BrowserOptions } from "@sentry/electron/renderer"; -import type { ElectronMainOptions } from "@sentry/electron/main"; - -/** - * "Translate" 'browser' to 'main' as Lens developer more familiar with the term 'main' - */ -function mapProcessName(processType: string) { - if (processType === "browser") { - return "main"; - } - - return processType; -} - -/** - * Initialize Sentry for the current process so to send errors for debugging. - */ -export function initializeSentryReporting(init: (opts: BrowserOptions | ElectronMainOptions) => void) { - const processName = mapProcessName(process.type); - - if (!sentryDsn) { - return; // do nothing if not configured to avoid uncaught error in dev mode - } - - init({ - beforeSend: (event) => { - // default to false, in case instance of UserStore is not created (yet) - const allowErrorReporting = UserStore.getInstance(false)?.allowErrorReporting ?? false; - - if (allowErrorReporting) { - return event; - } - - /** - * Directly write to stdout so that no other integrations capture this and create an infinite loop - */ - process.stdout.write(`🔒 [SENTRY-BEFORE-SEND-HOOK]: allowErrorReporting: ${allowErrorReporting}. Sentry event is caught but not sent to server.`); - process.stdout.write("🔒 [SENTRY-BEFORE-SEND-HOOK]: === START OF SENTRY EVENT ==="); - process.stdout.write(inspect(event, false, null, true)); - process.stdout.write("🔒 [SENTRY-BEFORE-SEND-HOOK]: === END OF SENTRY EVENT ==="); - - // if return null, the event won't be sent - // ref https://github.com/getsentry/sentry-javascript/issues/2039 - return null; - }, - dsn: sentryDsn, - integrations: [ - new Dedupe(), - new Offline(), - ], - initialScope: { - tags: { - "process": processName, - }, - }, - environment: isProduction ? "production" : "development", - }); -} diff --git a/src/common/user-store/user-store.ts b/src/common/user-store/user-store.ts index b806732735..7457548436 100644 --- a/src/common/user-store/user-store.ts +++ b/src/common/user-store/user-store.ts @@ -4,19 +4,16 @@ */ import { app } from "electron"; -import semver from "semver"; import { action, computed, observable, reaction, makeObservable, isObservableArray, isObservableSet, isObservableMap } from "mobx"; import { BaseStore } from "../base-store"; import migrations from "../../migrations/user-store"; -import { getAppVersion } from "../utils/app-version"; import { kubeConfigDefaultPath } from "../kube-helpers"; -import { appEventBus } from "../app-event-bus/event-bus"; import { getOrInsertSet, toggle, toJS, object } from "../../renderer/utils"; import { DESCRIPTORS } from "./preferences-helpers"; import type { UserPreferencesModel, StoreType } from "./preferences-helpers"; import logger from "../../main/logger"; import type { SelectedUpdateChannel } from "../application-update/selected-update-channel/selected-update-channel.injectable"; -import type { UpdateChannelId } from "../application-update/update-channels"; +import type { ReleaseChannel } from "../application-update/update-channels"; export interface UserStoreModel { lastSeenAppVersion: string; @@ -24,7 +21,7 @@ export interface UserStoreModel { } interface Dependencies { - selectedUpdateChannel: SelectedUpdateChannel; + readonly selectedUpdateChannel: SelectedUpdateChannel; } export class UserStore extends BaseStore /* implements UserStoreFlatModel (when strict null is enabled) */ { @@ -98,10 +95,6 @@ export class UserStore extends BaseStore /* implements UserStore */ @observable syncKubeconfigEntries!: StoreType; - @computed get isNewVersion() { - return semver.gt(getAppVersion(), this.lastSeenAppVersion); - } - @computed get resolvedShell(): string | undefined { return this.shell || process.env.SHELL || process.env.PTYSHELL; } @@ -151,12 +144,6 @@ export class UserStore extends BaseStore /* implements UserStore this.colorTheme = DESCRIPTORS.colorTheme.fromStore(undefined); } - @action - saveLastSeenAppVersion() { - appEventBus.emit({ name: "app", action: "whats-new-seen" }); - this.lastSeenAppVersion = getAppVersion(); - } - @action protected fromStore({ lastSeenAppVersion, preferences }: Partial = {}) { logger.debug("UserStore.fromStore()", { lastSeenAppVersion, preferences }); @@ -180,7 +167,7 @@ export class UserStore extends BaseStore /* implements UserStore // TODO: Switch to action-based saving instead saving stores by reaction if (preferences?.updateChannel) { - this.dependencies.selectedUpdateChannel.setValue(preferences?.updateChannel as UpdateChannelId); + this.dependencies.selectedUpdateChannel.setValue(preferences?.updateChannel as ReleaseChannel); } } diff --git a/src/common/utils/app-version.ts b/src/common/utils/app-version.ts index 28882e092b..183cc3e6b2 100644 --- a/src/common/utils/app-version.ts +++ b/src/common/utils/app-version.ts @@ -4,15 +4,6 @@ */ import requestPromise from "request-promise-native"; -import packageInfo from "../../../package.json"; - -export function getAppVersion(): string { - return packageInfo.version; -} - -export function getBundledKubectlVersion(): string { - return packageInfo.config.bundledKubectlVersion; -} export async function getAppVersionFromProxyServer(proxyPort: number): Promise { const response = await requestPromise({ diff --git a/src/common/vars.ts b/src/common/vars.ts index be8b472a5d..a5507e1ee6 100644 --- a/src/common/vars.ts +++ b/src/common/vars.ts @@ -5,7 +5,6 @@ // App's common configuration for any process (main, renderer, build pipeline, etc.) import path from "path"; -import packageInfo from "../../package.json"; import type { ThemeId } from "../renderer/themes/store"; import { lazyInitialized } from "./utils/lazy-initialized"; @@ -25,7 +24,6 @@ export const isWindows = process.platform === "win32"; export const isLinux = process.platform === "linux"; export const isDebugging = ["true", "1", "yes", "y", "on"].includes((process.env.DEBUG ?? "").toLowerCase()); -export const isSnap = !!process.env.SNAP; /** * @deprecated Switch to using isTestEnvInjectable @@ -42,13 +40,6 @@ export const isProduction = process.env.NODE_ENV === "production"; */ export const isDevelopment = !isTestEnv && !isProduction; -export const productName = packageInfo.productName; - -/** - * @deprecated Switch to using appNameInjectable - */ -export const appName = `${packageInfo.productName}${isDevelopment ? "Dev" : ""}`; - export const publicPath = "/build/" as string; export const defaultThemeId: ThemeId = "lens-dark"; export const defaultFontSize = 12; @@ -139,6 +130,3 @@ export const lensBlogWeblinkId = "lens-blog-link"; export const kubernetesDocumentationWeblinkId = "kubernetes-documentation-link"; export const docsUrl = "https://docs.k8slens.dev/main" as string; - -export const sentryDsn = packageInfo.config?.sentryDsn ?? ""; -export const contentSecurityPolicy = packageInfo.config?.contentSecurityPolicy ?? ""; diff --git a/src/main/app-paths/app-name/app-name.injectable.ts b/src/common/vars/app-name.injectable.ts similarity index 83% rename from src/main/app-paths/app-name/app-name.injectable.ts rename to src/common/vars/app-name.injectable.ts index 0a1db468d8..4d6d87421c 100644 --- a/src/main/app-paths/app-name/app-name.injectable.ts +++ b/src/common/vars/app-name.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import isDevelopmentInjectable from "../../../common/vars/is-development.injectable"; +import isDevelopmentInjectable from "./is-development.injectable"; import productNameInjectable from "./product-name.injectable"; const appNameInjectable = getInjectable({ @@ -15,8 +15,6 @@ const appNameInjectable = getInjectable({ return `${productName}${isDevelopment ? "Dev" : ""}`; }, - - causesSideEffects: true, }); export default appNameInjectable; diff --git a/src/common/vars/app-semantic-version.injectable.ts b/src/common/vars/app-semantic-version.injectable.ts deleted file mode 100644 index ae68ea828d..0000000000 --- a/src/common/vars/app-semantic-version.injectable.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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 { SemVer } from "semver"; -import appVersionInjectable from "./app-version.injectable"; - -const appSemanticVersionInjectable = getInjectable({ - id: "app-semantic-version", - instantiate: (di) => new SemVer(di.inject(appVersionInjectable)), -}); - -export default appSemanticVersionInjectable; diff --git a/src/common/vars/app-version.injectable.ts b/src/common/vars/app-version.injectable.ts deleted file mode 100644 index d7647f8318..0000000000 --- a/src/common/vars/app-version.injectable.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 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 packageJsonInjectable from "./package-json.injectable"; - -const appVersionInjectable = getInjectable({ - id: "app-version", - instantiate: (di) => di.inject(packageJsonInjectable).version, -}); - -export default appVersionInjectable; diff --git a/src/common/vars/application-copyright.injectable.ts b/src/common/vars/application-copyright.injectable.ts new file mode 100644 index 0000000000..cdac64855c --- /dev/null +++ b/src/common/vars/application-copyright.injectable.ts @@ -0,0 +1,13 @@ +/** + * 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 applicationInformationInjectable from "./application-information.injectable"; + +const applicationCopyrightInjectable = getInjectable({ + id: "application-copyright", + instantiate: (di) => di.inject(applicationInformationInjectable).copyright, +}); + +export default applicationCopyrightInjectable; diff --git a/src/common/vars/application-description.injectable.ts b/src/common/vars/application-description.injectable.ts new file mode 100644 index 0000000000..d6c4c9f79b --- /dev/null +++ b/src/common/vars/application-description.injectable.ts @@ -0,0 +1,13 @@ +/** + * 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 applicationInformationInjectable from "./application-information.injectable"; + +const applicationDescriptionInjectable = getInjectable({ + id: "application-description", + instantiate: (di) => di.inject(applicationInformationInjectable).description, +}); + +export default applicationDescriptionInjectable; diff --git a/src/common/vars/application-information.global-override-for-injectable.ts b/src/common/vars/application-information.global-override-for-injectable.ts new file mode 100644 index 0000000000..ac53b9f341 --- /dev/null +++ b/src/common/vars/application-information.global-override-for-injectable.ts @@ -0,0 +1,23 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +import { getGlobalOverride } from "../test-utils/get-global-override"; +import applicationInformationInjectable from "./application-information.injectable"; + +export default getGlobalOverride(applicationInformationInjectable, () => ({ + productName: "some-product-name", + version: "6.0.0", + build: {}, + config: { + k8sProxyVersion: "0.2.1", + bundledKubectlVersion: "1.23.3", + bundledHelmVersion: "3.7.2", + sentryDsn: "", + contentSecurityPolicy: "script-src 'unsafe-eval' 'self'; frame-src http://*.localhost:*/; img-src * data:", + welcomeRoute: "/welcome", + }, + copyright: "some-copyright-information", + description: "some-descriptive-text", +})); diff --git a/src/common/vars/application-information.injectable.ts b/src/common/vars/application-information.injectable.ts new file mode 100644 index 0000000000..f3a8c27321 --- /dev/null +++ b/src/common/vars/application-information.injectable.ts @@ -0,0 +1,22 @@ +/** + * 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 packageJson from "../../../package.json"; + +export type ApplicationInformation = Pick & { + build: Partial; +}; + +const applicationInformationInjectable = getInjectable({ + id: "application-information", + instantiate: (): ApplicationInformation => { + const { version, config, productName, build, copyright, description } = packageJson; + + return { version, config, productName, build, copyright, description }; + }, + causesSideEffects: true, +}); + +export default applicationInformationInjectable; diff --git a/src/common/vars/build-semantic-version.injectable.ts b/src/common/vars/build-semantic-version.injectable.ts new file mode 100644 index 0000000000..a41efb0bd7 --- /dev/null +++ b/src/common/vars/build-semantic-version.injectable.ts @@ -0,0 +1,30 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +import { getInjectionToken } from "@ogre-tools/injectable"; +import { SemVer } from "semver"; +import type { InitializableState } from "../initializable-state/create"; +import { createInitializableState } from "../initializable-state/create"; +import type { RequestChannel } from "../utils/channel/request-channel-injection-token"; + +export const buildVersionInjectionToken = getInjectionToken>({ + id: "build-version-token", +}); + +export const buildVersionChannel: RequestChannel = { + id: "build-version", +}; + +const buildSemanticVersionInjectable = createInitializableState({ + id: "build-semantic-version", + init: (di) => { + const buildVersion = di.inject(buildVersionInjectionToken); + + return new SemVer(buildVersion.get()); + }, +}); + +export default buildSemanticVersionInjectable; + diff --git a/src/common/vars/bundled-kubectl-version.injectable.ts b/src/common/vars/bundled-kubectl-version.injectable.ts new file mode 100644 index 0000000000..9542a79834 --- /dev/null +++ b/src/common/vars/bundled-kubectl-version.injectable.ts @@ -0,0 +1,13 @@ +/** + * 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 applicationInformationInjectable from "./application-information.injectable"; + +const bundledKubectlVersionInjectable = getInjectable({ + id: "bundled-kubectl-version", + instantiate: (di) => di.inject(applicationInformationInjectable).config.bundledKubectlVersion, +}); + +export default bundledKubectlVersionInjectable; diff --git a/src/common/vars/content-security-policy.injectable.ts b/src/common/vars/content-security-policy.injectable.ts new file mode 100644 index 0000000000..b6e1e0eb30 --- /dev/null +++ b/src/common/vars/content-security-policy.injectable.ts @@ -0,0 +1,13 @@ +/** + * 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 applicationInformationInjectable from "./application-information.injectable"; + +const contentSecurityPolicyInjectable = getInjectable({ + id: "content-security-policy", + instantiate: (di) => di.inject(applicationInformationInjectable).config.contentSecurityPolicy, +}); + +export default contentSecurityPolicyInjectable; diff --git a/src/common/vars/extension-api-version.injectable.ts b/src/common/vars/extension-api-version.injectable.ts new file mode 100644 index 0000000000..4f7f4d9930 --- /dev/null +++ b/src/common/vars/extension-api-version.injectable.ts @@ -0,0 +1,18 @@ +/** + * 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 { SemVer } from "semver"; +import applicationInformationInjectable from "./application-information.injectable"; + +const extensionApiVersionInjectable = getInjectable({ + id: "extension-api-version", + instantiate: (di) => { + const { major, minor, patch } = new SemVer(di.inject(applicationInformationInjectable).version); + + return `${major}.${minor}.${patch}`; + }, +}); + +export default extensionApiVersionInjectable; diff --git a/src/common/vars/is-snap-package.global-override-for-injectable.ts b/src/common/vars/is-snap-package.global-override-for-injectable.ts new file mode 100644 index 0000000000..cb3ff0a6e9 --- /dev/null +++ b/src/common/vars/is-snap-package.global-override-for-injectable.ts @@ -0,0 +1,9 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +import { getGlobalOverride } from "../test-utils/get-global-override"; +import isSnapPackageInjectable from "./is-snap-package.injectable"; + +export default getGlobalOverride(isSnapPackageInjectable, () => false); diff --git a/src/common/vars/package-json.injectable.ts b/src/common/vars/is-snap-package.injectable.ts similarity index 55% rename from src/common/vars/package-json.injectable.ts rename to src/common/vars/is-snap-package.injectable.ts index fa132be518..a2c545870b 100644 --- a/src/common/vars/package-json.injectable.ts +++ b/src/common/vars/is-snap-package.injectable.ts @@ -3,12 +3,11 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import packageJson from "../../../package.json"; -const packageJsonInjectable = getInjectable({ - id: "package-json", - instantiate: () => packageJson, +const isSnapPackageInjectable = getInjectable({ + id: "is-snap", + instantiate: () => Boolean(process.env.SNAP), causesSideEffects: true, }); -export default packageJsonInjectable; +export default isSnapPackageInjectable; diff --git a/src/main/app-paths/app-name/product-name.injectable.ts b/src/common/vars/product-name.injectable.ts similarity index 65% rename from src/main/app-paths/app-name/product-name.injectable.ts rename to src/common/vars/product-name.injectable.ts index 8c5c53bfba..910c6afa48 100644 --- a/src/main/app-paths/app-name/product-name.injectable.ts +++ b/src/common/vars/product-name.injectable.ts @@ -3,12 +3,11 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import packageInfo from "../../../../package.json"; +import applicationInformationInjectable from "./application-information.injectable"; const productNameInjectable = getInjectable({ id: "product-name", - instantiate: () => packageInfo.productName, - causesSideEffects: true, + instantiate: (di) => di.inject(applicationInformationInjectable).productName, }); export default productNameInjectable; diff --git a/src/common/vars/release-channel.injectable.ts b/src/common/vars/release-channel.injectable.ts index 78cc79cdb4..33dd26432a 100644 --- a/src/common/vars/release-channel.injectable.ts +++ b/src/common/vars/release-channel.injectable.ts @@ -3,14 +3,14 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import type { UpdateChannelId } from "../application-update/update-channels"; -import appSemanticVersionInjectable from "./app-semantic-version.injectable"; +import type { ReleaseChannel } from "../application-update/update-channels"; +import buildSemanticVersionInjectable from "./build-semantic-version.injectable"; const releaseChannelInjectable = getInjectable({ id: "release-channel", - instantiate: (di): UpdateChannelId => { - const appSemanticVersion = di.inject(appSemanticVersionInjectable); - const currentReleaseChannel = appSemanticVersion.prerelease[0]; + instantiate: (di): ReleaseChannel => { + const buildSemanticVersion = di.inject(buildSemanticVersionInjectable); + const currentReleaseChannel = buildSemanticVersion.get().prerelease[0]; switch (currentReleaseChannel) { case "latest": diff --git a/src/common/vars/sentry-dsn-url.injectable.ts b/src/common/vars/sentry-dsn-url.injectable.ts new file mode 100644 index 0000000000..e33c2fd0de --- /dev/null +++ b/src/common/vars/sentry-dsn-url.injectable.ts @@ -0,0 +1,13 @@ +/** + * 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 applicationInformationInjectable from "./application-information.injectable"; + +const sentryDataSourceNameInjectable = getInjectable({ + id: "sentry-data-source-name", + instantiate: (di) => di.inject(applicationInformationInjectable).config.sentryDsn, +}); + +export default sentryDataSourceNameInjectable; diff --git a/src/common/vars/store-migration-version.injectable.ts b/src/common/vars/store-migration-version.injectable.ts new file mode 100644 index 0000000000..79ab1578a3 --- /dev/null +++ b/src/common/vars/store-migration-version.injectable.ts @@ -0,0 +1,13 @@ +/** + * 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 applicationInformationInjectable from "./application-information.injectable"; + +const storeMigrationVersionInjectable = getInjectable({ + id: "store-migration-version", + instantiate: (di) => di.inject(applicationInformationInjectable).version, +}); + +export default storeMigrationVersionInjectable; diff --git a/src/extensions/__tests__/is-compatible-extension.test.ts b/src/extensions/__tests__/is-compatible-extension.test.ts index d581722139..f2ca144681 100644 --- a/src/extensions/__tests__/is-compatible-extension.test.ts +++ b/src/extensions/__tests__/is-compatible-extension.test.ts @@ -3,65 +3,53 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ -import assert from "assert"; -import semver from "semver"; import { isCompatibleExtension } from "../extension-discovery/is-compatible-extension/is-compatible-extension"; import type { LensExtensionManifest } from "../lens-extension"; describe("Extension/App versions compatibility checks", () => { it("is compatible with exact version matching", () => { - expect(isCompatible({ extLensEngineVersion: "5.5.0", appVersion: "5.5.0" })).toBeTruthy(); + expect(isCompatible({ extLensEngineVersion: "5.5.0", extensionApiVersion: "5.5.0" })).toBeTruthy(); }); it("is compatible with upper %PATCH versions of base app", () => { - expect(isCompatible({ extLensEngineVersion: "5.5.0", appVersion: "5.5.5" })).toBeTruthy(); + expect(isCompatible({ extLensEngineVersion: "5.5.0", extensionApiVersion: "5.5.5" })).toBeTruthy(); }); it("is compatible with higher %MINOR version of base app", () => { - expect(isCompatible({ extLensEngineVersion: "5.5.0", appVersion: "5.6.0" })).toBeTruthy(); + expect(isCompatible({ extLensEngineVersion: "5.5.0", extensionApiVersion: "5.6.0" })).toBeTruthy(); }); it("is not compatible with higher %MAJOR version of base app", () => { - expect(isCompatible({ extLensEngineVersion: "5.6.0", appVersion: "6.0.0" })).toBeFalsy(); // extension for lens@5 not compatible with lens@6 - expect(isCompatible({ extLensEngineVersion: "6.0.0", appVersion: "5.6.0" })).toBeFalsy(); - }); - - it("is compatible with lensEngine with prerelease", () => { - expect(isCompatible({ - extLensEngineVersion: "^5.4.0-alpha.0", - appVersion: "5.5.0-alpha.0", - })).toBeTruthy(); + expect(isCompatible({ extLensEngineVersion: "5.6.0", extensionApiVersion: "6.0.0" })).toBeFalsy(); // extension for lens@5 not compatible with lens@6 + expect(isCompatible({ extLensEngineVersion: "6.0.0", extensionApiVersion: "5.6.0" })).toBeFalsy(); }); it("supports short version format for manifest.engines.lens", () => { - expect(isCompatible({ extLensEngineVersion: "5.5", appVersion: "5.5.1" })).toBeTruthy(); + expect(isCompatible({ extLensEngineVersion: "5.5", extensionApiVersion: "5.5.1" })).toBeTruthy(); }); it("throws for incorrect or not supported version format", () => { expect(() => isCompatible({ extLensEngineVersion: ">=2.0", - appVersion: "2.0", + extensionApiVersion: "2.0", })).toThrow(/Invalid format/i); expect(() => isCompatible({ extLensEngineVersion: "~2.0", - appVersion: "2.0", + extensionApiVersion: "2.0", })).toThrow(/Invalid format/i); expect(() => isCompatible({ extLensEngineVersion: "*", - appVersion: "1.0", + extensionApiVersion: "1.0", })).toThrow(/Invalid format/i); }); }); -function isCompatible({ extLensEngineVersion = "^1.0", appVersion = "1.0" } = {}): boolean { - const appSemVer = semver.coerce(appVersion); +function isCompatible({ extLensEngineVersion = "^1.0", extensionApiVersion = "1.0" } = {}): boolean { const extensionManifestMock = getExtensionManifestMock(extLensEngineVersion); - assert(appSemVer); - - return isCompatibleExtension({ appSemVer })(extensionManifestMock); + return isCompatibleExtension({ extensionApiVersion })(extensionManifestMock); } function getExtensionManifestMock(lensEngine = "1.0"): LensExtensionManifest { diff --git a/src/extensions/common-api/app.ts b/src/extensions/common-api/app.ts index 6be9a193d1..92ecd19ef9 100644 --- a/src/extensions/common-api/app.ts +++ b/src/extensions/common-api/app.ts @@ -3,14 +3,65 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getAppVersion } from "../../common/utils"; +import appNameInjectable from "../../common/vars/app-name.injectable"; +import isLinuxInjectable from "../../common/vars/is-linux.injectable"; +import isMacInjectable from "../../common/vars/is-mac.injectable"; +import isSnapPackageInjectable from "../../common/vars/is-snap-package.injectable"; +import isWindowsInjectable from "../../common/vars/is-windows.injectable"; import { asLegacyGlobalFunctionForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api"; +import { getLegacyGlobalDiForExtensionApi } from "../as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api"; import getEnabledExtensionsInjectable from "./get-enabled-extensions/get-enabled-extensions.injectable"; -import * as Preferences from "./user-preferences"; +import type { UserPreferenceExtensionItems } from "./user-preferences"; +import { Preferences } from "./user-preferences"; +import { slackUrl, issuesTrackerUrl } from "../../common/vars"; +import { buildVersionInjectionToken } from "../../common/vars/build-semantic-version.injectable"; -export const version = getAppVersion(); -export { isSnap, isWindows, isMac, isLinux, appName, slackUrl, issuesTrackerUrl } from "../../common/vars"; +export interface AppExtensionItems { + readonly Preferences: UserPreferenceExtensionItems; + readonly version: string; + readonly appName: string; + readonly slackUrl: string; + readonly issuesTrackerUrl: string; + readonly isSnap: boolean; + readonly isWindows: boolean; + readonly isMac: boolean; + readonly isLinux: boolean; + getEnabledExtensions: () => string[]; +} -export const getEnabledExtensions = asLegacyGlobalFunctionForExtensionApi(getEnabledExtensionsInjectable); +export const App: AppExtensionItems = { + Preferences, + getEnabledExtensions: asLegacyGlobalFunctionForExtensionApi(getEnabledExtensionsInjectable), + get version() { + const di = getLegacyGlobalDiForExtensionApi(); -export { Preferences }; + return di.inject(buildVersionInjectionToken).get(); + }, + get appName() { + const di = getLegacyGlobalDiForExtensionApi(); + + return di.inject(appNameInjectable); + }, + get isSnap() { + const di = getLegacyGlobalDiForExtensionApi(); + + return di.inject(isSnapPackageInjectable); + }, + get isWindows() { + const di = getLegacyGlobalDiForExtensionApi(); + + return di.inject(isWindowsInjectable); + }, + get isMac() { + const di = getLegacyGlobalDiForExtensionApi(); + + return di.inject(isMacInjectable); + }, + get isLinux() { + const di = getLegacyGlobalDiForExtensionApi(); + + return di.inject(isLinuxInjectable); + }, + slackUrl, + issuesTrackerUrl, +}; diff --git a/src/extensions/common-api/index.ts b/src/extensions/common-api/index.ts index 0d07220d1d..6e4b39b1b7 100644 --- a/src/extensions/common-api/index.ts +++ b/src/extensions/common-api/index.ts @@ -4,10 +4,10 @@ */ // APIs -import * as App from "./app"; +import { App } from "./app"; import * as EventBus from "./event-bus"; import * as Store from "./stores"; -import * as Util from "./utils"; +import { Util } from "./utils"; import * as Catalog from "./catalog"; import * as Types from "./types"; import * as Proxy from "./proxy"; diff --git a/src/extensions/common-api/user-preferences.ts b/src/extensions/common-api/user-preferences.ts index 2c44f6f604..3a0a93793b 100644 --- a/src/extensions/common-api/user-preferences.ts +++ b/src/extensions/common-api/user-preferences.ts @@ -4,10 +4,13 @@ */ import { UserStore } from "../../common/user-store"; - -/** - * Get the configured kubectl binaries path. - */ -export function getKubectlPath(): string | undefined { - return UserStore.getInstance().kubectlBinariesPath; +export interface UserPreferenceExtensionItems { + /** + * Get the configured kubectl binaries path. + */ + getKubectlPath: () => string | undefined; } + +export const Preferences: UserPreferenceExtensionItems = { + getKubectlPath: () => UserStore.getInstance().kubectlBinariesPath, +}; diff --git a/src/extensions/common-api/utils.ts b/src/extensions/common-api/utils.ts index 3dea165238..12c9daf988 100644 --- a/src/extensions/common-api/utils.ts +++ b/src/extensions/common-api/utils.ts @@ -4,14 +4,34 @@ */ import openLinkInBrowserInjectable from "../../common/utils/open-link-in-browser.injectable"; +import buildVersionInjectable from "../../main/vars/build-version/build-version.injectable"; import { asLegacyGlobalFunctionForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api"; +import { getLegacyGlobalDiForExtensionApi } from "../as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api"; +import { Singleton } from "../../common/utils"; +import { prevDefault, stopPropagation } from "../../renderer/utils/prevDefault"; +import type { IClassName } from "../../renderer/utils/cssNames"; +import { cssNames } from "../../renderer/utils/cssNames"; -export { Singleton, getAppVersion } from "../../common/utils"; -export { prevDefault, stopPropagation } from "../../renderer/utils/prevDefault"; -export { cssNames } from "../../renderer/utils/cssNames"; +export interface UtilsExtensionItems { + Singleton: Singleton; + prevDefault: (callback: (evt: E) => R) => (evt: E) => R; + stopPropagation: (evt: Event | React.SyntheticEvent) => void; + cssNames: (...classNames: IClassName[]) => string; + openExternal: (url: string) => Promise; + openBrowser: (url: string) => Promise; + getAppVersion: () => string; +} -/** - * @deprecated Use {@link openBrowser} instead - */ -export const openExternal = asLegacyGlobalFunctionForExtensionApi(openLinkInBrowserInjectable); -export const openBrowser = asLegacyGlobalFunctionForExtensionApi(openLinkInBrowserInjectable); +export const Util: UtilsExtensionItems = { + Singleton, + prevDefault, + stopPropagation, + cssNames, + openExternal: asLegacyGlobalFunctionForExtensionApi(openLinkInBrowserInjectable), + openBrowser: asLegacyGlobalFunctionForExtensionApi(openLinkInBrowserInjectable), + getAppVersion: () => { + const di = getLegacyGlobalDiForExtensionApi(); + + return di.inject(buildVersionInjectable).get(); + }, +}; diff --git a/src/extensions/extension-discovery/extension-discovery.injectable.ts b/src/extensions/extension-discovery/extension-discovery.injectable.ts index 48e9b225a0..df5efadaf6 100644 --- a/src/extensions/extension-discovery/extension-discovery.injectable.ts +++ b/src/extensions/extension-discovery/extension-discovery.injectable.ts @@ -20,21 +20,20 @@ import watchInjectable from "../../common/fs/watch/watch.injectable"; const extensionDiscoveryInjectable = getInjectable({ id: "extension-discovery", - instantiate: (di) => - new ExtensionDiscovery({ - extensionLoader: di.inject(extensionLoaderInjectable), - extensionsStore: di.inject(extensionsStoreInjectable), - extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable), - isCompatibleExtension: di.inject(isCompatibleExtensionInjectable), - installExtension: di.inject(installExtensionInjectable), - installExtensions: di.inject(installExtensionsInjectable), - extensionPackageRootDirectory: di.inject(extensionPackageRootDirectoryInjectable), - staticFilesDirectory: di.inject(staticFilesDirectoryInjectable), - readJsonFile: di.inject(readJsonFileInjectable), - pathExists: di.inject(pathExistsInjectable), - watch: di.inject(watchInjectable), - logger: di.inject(loggerInjectable), - }), + instantiate: (di) => new ExtensionDiscovery({ + extensionLoader: di.inject(extensionLoaderInjectable), + extensionsStore: di.inject(extensionsStoreInjectable), + extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable), + isCompatibleExtension: di.inject(isCompatibleExtensionInjectable), + installExtension: di.inject(installExtensionInjectable), + installExtensions: di.inject(installExtensionsInjectable), + extensionPackageRootDirectory: di.inject(extensionPackageRootDirectoryInjectable), + staticFilesDirectory: di.inject(staticFilesDirectoryInjectable), + readJsonFile: di.inject(readJsonFileInjectable), + pathExists: di.inject(pathExistsInjectable), + watch: di.inject(watchInjectable), + logger: di.inject(loggerInjectable), + }), }); export default extensionDiscoveryInjectable; diff --git a/src/extensions/extension-discovery/extension-discovery.test.ts b/src/extensions/extension-discovery/extension-discovery.test.ts index 7feca8f99d..e5a04bd5eb 100644 --- a/src/extensions/extension-discovery/extension-discovery.test.ts +++ b/src/extensions/extension-discovery/extension-discovery.test.ts @@ -15,10 +15,10 @@ import directoryForUserDataInjectable from "../../common/app-paths/directory-for import mockFs from "mock-fs"; import { delay } from "../../renderer/utils"; import { observable, when } from "mobx"; -import appVersionInjectable from "../../common/vars/app-version.injectable"; import readJsonFileInjectable from "../../common/fs/read-json-file.injectable"; import pathExistsInjectable from "../../common/fs/path-exists.injectable"; import watchInjectable from "../../common/fs/watch/watch.injectable"; +import extensionApiVersionInjectable from "../../common/vars/extension-api-version.injectable"; console = new Console(process.stdout, process.stderr); // fix mockFS @@ -33,7 +33,7 @@ describe("ExtensionDiscovery", () => { di.override(directoryForUserDataInjectable, () => "some-directory-for-user-data"); di.override(installExtensionInjectable, () => () => Promise.resolve()); - di.override(appVersionInjectable, () => "5.0.0"); + di.override(extensionApiVersionInjectable, () => "5.0.0"); readJsonFileMock = jest.fn(); di.override(readJsonFileInjectable, () => readJsonFileMock); diff --git a/src/extensions/extension-discovery/is-compatible-extension/is-compatible-extension.injectable.ts b/src/extensions/extension-discovery/is-compatible-extension/is-compatible-extension.injectable.ts index 75e2f45d4a..de2fd4390f 100644 --- a/src/extensions/extension-discovery/is-compatible-extension/is-compatible-extension.injectable.ts +++ b/src/extensions/extension-discovery/is-compatible-extension/is-compatible-extension.injectable.ts @@ -3,13 +3,13 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import appSemanticVersionInjectable from "../../../common/vars/app-semantic-version.injectable"; +import extensionApiVersionInjectable from "../../../common/vars/extension-api-version.injectable"; import { isCompatibleExtension } from "./is-compatible-extension"; const isCompatibleExtensionInjectable = getInjectable({ id: "is-compatible-extension", instantiate: (di) => isCompatibleExtension({ - appSemVer: di.inject(appSemanticVersionInjectable), + extensionApiVersion: di.inject(extensionApiVersionInjectable), }), }); diff --git a/src/extensions/extension-discovery/is-compatible-extension/is-compatible-extension.ts b/src/extensions/extension-discovery/is-compatible-extension/is-compatible-extension.ts index 717effa1c6..74cbb4fd0c 100644 --- a/src/extensions/extension-discovery/is-compatible-extension/is-compatible-extension.ts +++ b/src/extensions/extension-discovery/is-compatible-extension/is-compatible-extension.ts @@ -2,16 +2,15 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import semver, { type SemVer } from "semver"; +import semver from "semver"; import type { LensExtensionManifest } from "../../lens-extension"; interface Dependencies { - appSemVer: SemVer; + extensionApiVersion: string; } -export const isCompatibleExtension = ({ appSemVer }: Dependencies): ((manifest: LensExtensionManifest) => boolean) => { +export const isCompatibleExtension = ({ extensionApiVersion }: Dependencies): ((manifest: LensExtensionManifest) => boolean) => { return (manifest: LensExtensionManifest): boolean => { - const appVersion = appSemVer.raw.split("-")[0]; // drop prerelease version if any, e.g. "-alpha.0" const manifestLensEngine = manifest.engines.lens; const validVersion = manifestLensEngine.match(/^[\^0-9]\d*\.\d+\b/); // must start from ^ or number @@ -30,7 +29,7 @@ export const isCompatibleExtension = ({ appSemVer }: Dependencies): ((manifest: }) as semver.SemVer; const supportedVersionsByExtension = semver.validRange(`^${extMajor}.${extMinor}`) as string; - return semver.satisfies(appVersion, supportedVersionsByExtension, { + return semver.satisfies(extensionApiVersion, supportedVersionsByExtension, { loose: true, includePrerelease: false, }); diff --git a/src/features/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap b/src/features/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap index d4cda2d767..dab11ecc9b 100644 --- a/src/features/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap +++ b/src/features/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap @@ -76,7 +76,7 @@ exports[`extension special characters in page registrations renders 1`] = ` style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/__snapshots__/navigate-to-extension-page.test.tsx.snap b/src/features/__snapshots__/navigate-to-extension-page.test.tsx.snap index 85d8746662..9dbfb50aea 100644 --- a/src/features/__snapshots__/navigate-to-extension-page.test.tsx.snap +++ b/src/features/__snapshots__/navigate-to-extension-page.test.tsx.snap @@ -76,7 +76,7 @@ exports[`navigate to extension page renders 1`] = ` style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/add-cluster/__snapshots__/navigation-using-application-menu.test.tsx.snap b/src/features/add-cluster/__snapshots__/navigation-using-application-menu.test.tsx.snap index 55572a5303..132ef5e0b0 100644 --- a/src/features/add-cluster/__snapshots__/navigation-using-application-menu.test.tsx.snap +++ b/src/features/add-cluster/__snapshots__/navigation-using-application-menu.test.tsx.snap @@ -76,7 +76,7 @@ exports[`add-cluster - navigation using application menu renders 1`] = ` style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/application-update/__snapshots__/force-user-to-update-when-too-long-time-since-update-was-downloaded.test.ts.snap b/src/features/application-update/__snapshots__/force-user-to-update-when-too-long-time-since-update-was-downloaded.test.ts.snap index 5ca948badb..93808e443c 100644 --- a/src/features/application-update/__snapshots__/force-user-to-update-when-too-long-time-since-update-was-downloaded.test.ts.snap +++ b/src/features/application-update/__snapshots__/force-user-to-update-when-too-long-time-since-update-was-downloaded.test.ts.snap @@ -95,7 +95,7 @@ exports[`force user to update when too long since update was downloaded when app style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -314,7 +314,7 @@ exports[`force user to update when too long since update was downloaded when app style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -580,7 +580,7 @@ exports[`force user to update when too long since update was downloaded when app style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/application-update/__snapshots__/installing-update-using-topbar-button.test.tsx.snap b/src/features/application-update/__snapshots__/installing-update-using-topbar-button.test.tsx.snap index 340122ba28..f136545fc1 100644 --- a/src/features/application-update/__snapshots__/installing-update-using-topbar-button.test.tsx.snap +++ b/src/features/application-update/__snapshots__/installing-update-using-topbar-button.test.tsx.snap @@ -95,7 +95,7 @@ exports[`encourage user to update when sufficient time passed since update was d style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -296,7 +296,7 @@ exports[`encourage user to update when sufficient time passed since update was d style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/application-update/__snapshots__/installing-update-using-tray.test.ts.snap b/src/features/application-update/__snapshots__/installing-update-using-tray.test.ts.snap index 748ffce692..85da39aa60 100644 --- a/src/features/application-update/__snapshots__/installing-update-using-tray.test.ts.snap +++ b/src/features/application-update/__snapshots__/installing-update-using-tray.test.ts.snap @@ -77,7 +77,7 @@ exports[`installing update using tray when started renders 1`] = ` style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -278,7 +278,7 @@ exports[`installing update using tray when started when user checks for updates style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -479,7 +479,7 @@ exports[`installing update using tray when started when user checks for updates style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -698,7 +698,7 @@ exports[`installing update using tray when started when user checks for updates style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -917,7 +917,7 @@ exports[`installing update using tray when started when user checks for updates style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -1118,7 +1118,7 @@ exports[`installing update using tray when started when user checks for updates style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/application-update/__snapshots__/installing-update.test.ts.snap b/src/features/application-update/__snapshots__/installing-update.test.ts.snap index 56de9ab127..8d589d432a 100644 --- a/src/features/application-update/__snapshots__/installing-update.test.ts.snap +++ b/src/features/application-update/__snapshots__/installing-update.test.ts.snap @@ -77,7 +77,7 @@ exports[`installing update when started renders 1`] = ` style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -278,7 +278,7 @@ exports[`installing update when started when user checks for updates renders 1`] style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -479,7 +479,7 @@ exports[`installing update when started when user checks for updates when new up style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -698,7 +698,7 @@ exports[`installing update when started when user checks for updates when new up style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -917,7 +917,7 @@ exports[`installing update when started when user checks for updates when new up style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -1118,7 +1118,7 @@ exports[`installing update when started when user checks for updates when no new style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/application-update/__snapshots__/periodical-checking-of-updates.test.ts.snap b/src/features/application-update/__snapshots__/periodical-checking-of-updates.test.ts.snap index a20988e3c3..25483ce178 100644 --- a/src/features/application-update/__snapshots__/periodical-checking-of-updates.test.ts.snap +++ b/src/features/application-update/__snapshots__/periodical-checking-of-updates.test.ts.snap @@ -77,7 +77,7 @@ exports[`periodical checking of updates given updater is enabled and configurati style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/application-update/__snapshots__/selection-of-update-stability.test.ts.snap b/src/features/application-update/__snapshots__/selection-of-update-stability.test.ts.snap index 0bb7a1f07a..6c0e7da36c 100644 --- a/src/features/application-update/__snapshots__/selection-of-update-stability.test.ts.snap +++ b/src/features/application-update/__snapshots__/selection-of-update-stability.test.ts.snap @@ -77,7 +77,7 @@ exports[`selection of update stability when started renders 1`] = ` style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/application-update/analytics-for-installing-update.test.ts b/src/features/application-update/analytics-for-installing-update.test.ts index 60523c5e49..625022b040 100644 --- a/src/features/application-update/analytics-for-installing-update.test.ts +++ b/src/features/application-update/analytics-for-installing-update.test.ts @@ -16,10 +16,10 @@ import processCheckingForUpdatesInjectable from "../../main/application-update/c import type { DownloadPlatformUpdate } from "../../main/application-update/download-platform-update/download-platform-update.injectable"; import downloadPlatformUpdateInjectable from "../../main/application-update/download-platform-update/download-platform-update.injectable"; import quitAndInstallUpdateInjectable from "../../main/application-update/quit-and-install-update.injectable"; -import appVersionInjectable from "../../common/vars/app-version.injectable"; import periodicalCheckForUpdatesInjectable from "../../main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable"; import { advanceFakeTime, useFakeTime } from "../../common/test-utils/use-fake-time"; import emitEventInjectable from "../../common/app-event-bus/emit-event.injectable"; +import getBuildVersionInjectable from "../../main/vars/build-version/get-build-version.injectable"; describe("analytics for installing update", () => { let builder: ApplicationBuilder; @@ -36,7 +36,7 @@ describe("analytics for installing update", () => { analyticsListenerMock = jest.fn(); builder.beforeApplicationStart(mainDi => { - mainDi.override(appVersionInjectable, () => "42.0.0"); + mainDi.override(getBuildVersionInjectable, () => () => "42.0.0"); checkForPlatformUpdatesMock = asyncFn(); diff --git a/src/features/application-update/downgrading-version-update.test.ts b/src/features/application-update/downgrading-version-update.test.ts index eb35e84be9..8f56ebd15c 100644 --- a/src/features/application-update/downgrading-version-update.test.ts +++ b/src/features/application-update/downgrading-version-update.test.ts @@ -13,8 +13,8 @@ import checkForPlatformUpdatesInjectable from "../../main/application-update/che import processCheckingForUpdatesInjectable from "../../main/application-update/check-for-updates/process-checking-for-updates.injectable"; import selectedUpdateChannelInjectable from "../../common/application-update/selected-update-channel/selected-update-channel.injectable"; import type { DiContainer } from "@ogre-tools/injectable"; -import appVersionInjectable from "../../common/vars/app-version.injectable"; import { updateChannels } from "../../common/application-update/update-channels"; +import getBuildVersionInjectable from "../../main/vars/build-version/get-build-version.injectable"; describe("downgrading version update", () => { let applicationBuilder: ApplicationBuilder; @@ -102,7 +102,7 @@ describe("downgrading version update", () => { }, ].forEach(({ appVersion, updateChannel, downgradeIsAllowed }) => { it(`given application version "${appVersion}" and update channel "${updateChannel.id}", when checking for updates, can${downgradeIsAllowed ? "": "not"} downgrade`, async () => { - mainDi.override(appVersionInjectable, () => appVersion); + mainDi.override(getBuildVersionInjectable, () => () => appVersion); await applicationBuilder.render(); diff --git a/src/features/application-update/selection-of-update-stability.test.ts b/src/features/application-update/selection-of-update-stability.test.ts index 3e7ce4a893..d948573dcd 100644 --- a/src/features/application-update/selection-of-update-stability.test.ts +++ b/src/features/application-update/selection-of-update-stability.test.ts @@ -12,7 +12,7 @@ import type { CheckForPlatformUpdates } from "../../main/application-update/chec import checkForPlatformUpdatesInjectable from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; import type { AsyncFnMock } from "@async-fn/jest"; import asyncFn from "@async-fn/jest"; -import type { UpdateChannel, UpdateChannelId } from "../../common/application-update/update-channels"; +import type { UpdateChannel, ReleaseChannel } from "../../common/application-update/update-channels"; import { updateChannels } from "../../common/application-update/update-channels"; import type { DownloadPlatformUpdate } from "../../main/application-update/download-platform-update/download-platform-update.injectable"; import downloadPlatformUpdateInjectable from "../../main/application-update/download-platform-update/download-platform-update.injectable"; @@ -21,8 +21,8 @@ import type { IComputedValue } from "mobx"; import setUpdateOnQuitInjectable from "../../main/electron-app/features/set-update-on-quit.injectable"; import showInfoNotificationInjectable from "../../renderer/components/notifications/show-info-notification.injectable"; import processCheckingForUpdatesInjectable from "../../main/application-update/check-for-updates/process-checking-for-updates.injectable"; -import appVersionInjectable from "../../common/vars/app-version.injectable"; import type { DiContainer } from "@ogre-tools/injectable"; +import getBuildVersionInjectable from "../../main/vars/build-version/get-build-version.injectable"; describe("selection of update stability", () => { let builder: ApplicationBuilder; @@ -89,7 +89,7 @@ describe("selection of update stability", () => { describe('given update channel "alpha" is selected, when checking for updates', () => { let selectedUpdateChannel: { value: IComputedValue; - setValue: (channelId: UpdateChannelId) => void; + setValue: (channelId: ReleaseChannel) => void; }; beforeEach(() => { @@ -180,7 +180,7 @@ describe("selection of update stability", () => { describe('given update channel "beta" is selected', () => { let selectedUpdateChannel: { value: IComputedValue; - setValue: (channelId: UpdateChannelId) => void; + setValue: (channelId: ReleaseChannel) => void; }; beforeEach(() => { @@ -231,16 +231,12 @@ describe("selection of update stability", () => { }); it("given valid update channel selection is stored, when checking for updates, checks for updates from the update channel", async () => { - builder.beforeApplicationStart((mainDi) => { - // TODO: Switch to more natural way of setting initial value - // TODO: UserStore is currently responsible for getting and setting initial value - const selectedUpdateChannel = mainDi.inject(selectedUpdateChannelInjectable); - - selectedUpdateChannel.setValue(updateChannels.beta.id); - }); - await builder.render(); + // TODO: Switch to more natural way of setting initial value + // TODO: UserStore is currently responsible for getting and setting initial value + mainDi.inject(selectedUpdateChannelInjectable).setValue(updateChannels.beta.id); + const processCheckingForUpdates = mainDi.inject(processCheckingForUpdatesInjectable); processCheckingForUpdates("irrelevant"); @@ -249,16 +245,12 @@ describe("selection of update stability", () => { }); it("given invalid update channel selection is stored, when checking for updates, checks for updates from the update channel", async () => { - builder.beforeApplicationStart((mainDi) => { - // TODO: Switch to more natural way of setting initial value - // TODO: UserStore is currently responsible for getting and setting initial value - const selectedUpdateChannel = mainDi.inject(selectedUpdateChannelInjectable); - - selectedUpdateChannel.setValue("something-invalid" as UpdateChannelId); - }); - await builder.render(); + // TODO: Switch to more natural way of setting initial value + // TODO: UserStore is currently responsible for getting and setting initial value + mainDi.inject(selectedUpdateChannelInjectable).setValue("something-invalid" as ReleaseChannel); + const processCheckingForUpdates = mainDi.inject(processCheckingForUpdatesInjectable); processCheckingForUpdates("irrelevant"); @@ -268,7 +260,7 @@ describe("selection of update stability", () => { it('given no update channel selection is stored and currently using stable release, when user checks for updates, checks for updates from "latest" update channel by default', async () => { builder.beforeApplicationStart((mainDi) => { - mainDi.override(appVersionInjectable, () => "1.0.0"); + mainDi.override(getBuildVersionInjectable, () => () => "1.0.0"); }); await builder.render(); @@ -285,7 +277,7 @@ describe("selection of update stability", () => { it('given no update channel selection is stored and currently using alpha release, when checking for updates, checks for updates from "alpha" channel', async () => { builder.beforeApplicationStart((mainDi) => { - mainDi.override(appVersionInjectable, () => "1.0.0-alpha"); + mainDi.override(getBuildVersionInjectable, () => () => "1.0.0-alpha"); }); await builder.render(); @@ -299,7 +291,7 @@ describe("selection of update stability", () => { it('given no update channel selection is stored and currently using beta release, when checking for updates, checks for updates from "beta" channel', async () => { builder.beforeApplicationStart((mainDi) => { - mainDi.override(appVersionInjectable, () => "1.0.0-beta"); + mainDi.override(getBuildVersionInjectable, () => () => "1.0.0-beta"); }); await builder.render(); @@ -312,18 +304,12 @@ describe("selection of update stability", () => { }); it("given update channel selection is stored and currently using prerelease, when checking for updates, checks for updates from stored channel", async () => { - builder.beforeApplicationStart((mainDi) => { - mainDi.override(appVersionInjectable, () => "1.0.0-alpha"); - - // TODO: Switch to more natural way of setting initial value - // TODO: UserStore is currently responsible for getting and setting initial value - const selectedUpdateChannel = mainDi.inject(selectedUpdateChannelInjectable); - - selectedUpdateChannel.setValue(updateChannels.beta.id); - }); - await builder.render(); + // TODO: Switch to more natural way of setting initial value + // TODO: UserStore is currently responsible for getting and setting initial value + mainDi.inject(selectedUpdateChannelInjectable).setValue(updateChannels.beta.id); + const processCheckingForUpdates = mainDi.inject(processCheckingForUpdatesInjectable); processCheckingForUpdates("irrelevant"); diff --git a/src/features/command-pallet/__snapshots__/keyboard-shortcuts.test.tsx.snap b/src/features/command-pallet/__snapshots__/keyboard-shortcuts.test.tsx.snap index 574a757319..6704a798ae 100644 --- a/src/features/command-pallet/__snapshots__/keyboard-shortcuts.test.tsx.snap +++ b/src/features/command-pallet/__snapshots__/keyboard-shortcuts.test.tsx.snap @@ -158,7 +158,7 @@ exports[`Command Pallet: keyboard shortcut tests when on linux renders 1`] = ` style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -440,7 +440,7 @@ exports[`Command Pallet: keyboard shortcut tests when on linux when pressing ESC style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -722,7 +722,7 @@ exports[`Command Pallet: keyboard shortcut tests when on linux when pressing SHI style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -1016,7 +1016,7 @@ exports[`Command Pallet: keyboard shortcut tests when on linux when pressing SHI style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -1217,7 +1217,7 @@ exports[`Command Pallet: keyboard shortcut tests when on macOS renders 1`] = ` style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -1418,7 +1418,7 @@ exports[`Command Pallet: keyboard shortcut tests when on macOS when pressing ESC style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -1619,7 +1619,7 @@ exports[`Command Pallet: keyboard shortcut tests when on macOS when pressing SHI style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -1832,7 +1832,7 @@ exports[`Command Pallet: keyboard shortcut tests when on macOS when pressing SHI style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/extensions/__snapshots__/navigation-using-application-menu.test.ts.snap b/src/features/extensions/__snapshots__/navigation-using-application-menu.test.ts.snap index 689d9267e3..66a49f4355 100644 --- a/src/features/extensions/__snapshots__/navigation-using-application-menu.test.ts.snap +++ b/src/features/extensions/__snapshots__/navigation-using-application-menu.test.ts.snap @@ -76,7 +76,7 @@ exports[`extensions - navigation using application menu renders 1`] = ` style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/preferences/__snapshots__/navigation-using-application-menu.test.ts.snap b/src/features/preferences/__snapshots__/navigation-using-application-menu.test.ts.snap index 201cf9ec74..df792b6e42 100644 --- a/src/features/preferences/__snapshots__/navigation-using-application-menu.test.ts.snap +++ b/src/features/preferences/__snapshots__/navigation-using-application-menu.test.ts.snap @@ -76,7 +76,7 @@ exports[`preferences - navigation using application menu renders 1`] = ` style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/preferences/__snapshots__/navigation-using-tray.test.ts.snap b/src/features/preferences/__snapshots__/navigation-using-tray.test.ts.snap index 1c243cc2b9..b34af2b18c 100644 --- a/src/features/preferences/__snapshots__/navigation-using-tray.test.ts.snap +++ b/src/features/preferences/__snapshots__/navigation-using-tray.test.ts.snap @@ -77,7 +77,7 @@ exports[`show-about-using-tray renders 1`] = ` style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/preferences/navigation-to-telemetry-preferences.test.tsx b/src/features/preferences/navigation-to-telemetry-preferences.test.tsx index c4a76bed81..f424165364 100644 --- a/src/features/preferences/navigation-to-telemetry-preferences.test.tsx +++ b/src/features/preferences/navigation-to-telemetry-preferences.test.tsx @@ -7,7 +7,7 @@ import React from "react"; import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import navigateToTelemetryPreferencesInjectable from "../../common/front-end-routing/routes/preferences/telemetry/navigate-to-telemetry-preferences.injectable"; -import sentryDnsUrlInjectable from "../../renderer/components/+preferences/sentry-dns-url.injectable"; +import sentryDataSourceNameInjectable from "../../common/vars/sentry-dsn-url.injectable"; import type { FakeExtensionOptions } from "../../renderer/components/test-utils/get-extension-fake"; describe("preferences - navigation to telemetry preferences", () => { @@ -114,7 +114,7 @@ describe("preferences - navigation to telemetry preferences", () => { beforeEach(async () => { builder.beforeWindowStart((windowDi) => { - windowDi.override(sentryDnsUrlInjectable, () => "some-sentry-dns-url"); + windowDi.override(sentryDataSourceNameInjectable, () => "some-sentry-dns-url"); }); rendered = await builder.render(); @@ -144,7 +144,7 @@ describe("preferences - navigation to telemetry preferences", () => { beforeEach(async () => { builder.beforeWindowStart((windowDi) => { - windowDi.override(sentryDnsUrlInjectable, () => null); + windowDi.override(sentryDataSourceNameInjectable, () => null); }); rendered = await builder.render(); diff --git a/src/features/status-bar/__snapshots__/status-bar-items-originating-from-extensions.test.tsx.snap b/src/features/status-bar/__snapshots__/status-bar-items-originating-from-extensions.test.tsx.snap index af828132d2..3272b6688f 100644 --- a/src/features/status-bar/__snapshots__/status-bar-items-originating-from-extensions.test.tsx.snap +++ b/src/features/status-bar/__snapshots__/status-bar-items-originating-from-extensions.test.tsx.snap @@ -77,7 +77,7 @@ exports[`status-bar-items-originating-from-extensions when application starts wh style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/features/welcome/__snapshots__/navigation-using-application-menu.test.ts.snap b/src/features/welcome/__snapshots__/navigation-using-application-menu.test.ts.snap index f1188dbf9d..fe3b7f7d61 100644 --- a/src/features/welcome/__snapshots__/navigation-using-application-menu.test.ts.snap +++ b/src/features/welcome/__snapshots__/navigation-using-application-menu.test.ts.snap @@ -76,7 +76,7 @@ exports[`welcome - navigation using application menu renders 1`] = ` style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your @@ -915,7 +915,7 @@ exports[`welcome - navigation using application menu when navigated somewhere el style="width: 320px;" >

- Welcome to OpenLens! + Welcome to some-product-name!

To get you started we have auto-detected your clusters in your diff --git a/src/main/app-paths/setup-app-paths.injectable.ts b/src/main/app-paths/setup-app-paths.injectable.ts index 816c58db8b..3626bbd9c0 100644 --- a/src/main/app-paths/setup-app-paths.injectable.ts +++ b/src/main/app-paths/setup-app-paths.injectable.ts @@ -6,7 +6,6 @@ import { getInjectable } from "@ogre-tools/injectable"; import type { AppPaths } from "../../common/app-paths/app-path-injection-token"; import getElectronAppPathInjectable from "./get-electron-app-path/get-electron-app-path.injectable"; import setElectronAppPathInjectable from "./set-electron-app-path/set-electron-app-path.injectable"; -import appNameInjectable from "./app-name/app-name.injectable"; import directoryForIntegrationTestingInjectable from "./directory-for-integration-testing/directory-for-integration-testing.injectable"; import appPathsStateInjectable from "../../common/app-paths/app-paths-state.injectable"; import { pathNames } from "../../common/app-paths/app-path-names"; @@ -14,6 +13,7 @@ import { fromPairs, map } from "lodash/fp"; import { pipeline } from "@ogre-tools/fp"; import joinPathsInjectable from "../../common/path/join-paths.injectable"; import { beforeElectronIsReadyInjectionToken } from "../start-main-application/runnable-tokens/before-electron-is-ready-injection-token"; +import appNameInjectable from "../../common/vars/app-name.injectable"; const setupAppPathsInjectable = getInjectable({ id: "setup-app-paths", diff --git a/src/main/application-update/check-for-platform-updates/check-for-platform-updates.test.ts b/src/main/application-update/check-for-platform-updates/check-for-platform-updates.test.ts index b826a1a5a7..17e750c52e 100644 --- a/src/main/application-update/check-for-platform-updates/check-for-platform-updates.test.ts +++ b/src/main/application-update/check-for-platform-updates/check-for-platform-updates.test.ts @@ -9,7 +9,7 @@ import asyncFn from "@async-fn/jest"; import type { AppUpdater, UpdateCheckResult } from "electron-updater"; import type { CheckForPlatformUpdates } from "./check-for-platform-updates.injectable"; import checkForPlatformUpdatesInjectable from "./check-for-platform-updates.injectable"; -import type { UpdateChannel, UpdateChannelId } from "../../../common/application-update/update-channels"; +import type { UpdateChannel, ReleaseChannel } from "../../../common/application-update/update-channels"; import { getPromiseStatus } from "../../../common/test-utils/get-promise-status"; import loggerInjectable from "../../../common/logger.injectable"; import type { Logger } from "../../../common/logger"; @@ -47,7 +47,7 @@ describe("check-for-platform-updates", () => { beforeEach(() => { const testUpdateChannel: UpdateChannel = { - id: "some-update-channel" as UpdateChannelId, + id: "some-update-channel" as ReleaseChannel, label: "Some update channel", moreStableUpdateChannel: null, }; diff --git a/src/main/application-update/emit-current-version-to-analytics.injectable.ts b/src/main/application-update/emit-current-version-to-analytics.injectable.ts index 7ec8d0b3b5..61dd38ea87 100644 --- a/src/main/application-update/emit-current-version-to-analytics.injectable.ts +++ b/src/main/application-update/emit-current-version-to-analytics.injectable.ts @@ -6,14 +6,14 @@ import { getInjectable } from "@ogre-tools/injectable"; import { afterApplicationIsLoadedInjectionToken } from "../start-main-application/runnable-tokens/after-application-is-loaded-injection-token"; import emitEventInjectable from "../../common/app-event-bus/emit-event.injectable"; import { getCurrentDateTime } from "../../common/utils/date/get-current-date-time"; -import appVersionInjectable from "../../common/vars/app-version.injectable"; +import buildVersionInjectable from "../vars/build-version/build-version.injectable"; const emitCurrentVersionToAnalyticsInjectable = getInjectable({ id: "emit-current-version-to-analytics", instantiate: (di) => { const emitEvent = di.inject(emitEventInjectable); - const appVersion = di.inject(appVersionInjectable); + const buildVersion = di.inject(buildVersionInjectable); return { run: () => { @@ -22,7 +22,7 @@ const emitCurrentVersionToAnalyticsInjectable = getInjectable({ action: "current-version", params: { - version: appVersion, + version: buildVersion.get(), currentDateTime: getCurrentDateTime(), }, }); diff --git a/src/main/application-update/publish-is-configured.injectable.ts b/src/main/application-update/publish-is-configured.injectable.ts index 321adc8a22..6a3fca2f7f 100644 --- a/src/main/application-update/publish-is-configured.injectable.ts +++ b/src/main/application-update/publish-is-configured.injectable.ts @@ -3,18 +3,11 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import packageJsonInjectable from "../../common/vars/package-json.injectable"; -import { has } from "lodash/fp"; +import applicationInformationInjectable from "../../common/vars/application-information.injectable"; -// TOOO: Rename to something less technical const publishIsConfiguredInjectable = getInjectable({ id: "publish-is-configured", - - instantiate: (di) => { - const packageJson = di.inject(packageJsonInjectable); - - return has("build.publish", packageJson); - }, + instantiate: (di) => Boolean(di.inject(applicationInformationInjectable).build.publish?.length), }); export default publishIsConfiguredInjectable; diff --git a/src/main/build-version/setup-channel.injectable.ts b/src/main/build-version/setup-channel.injectable.ts new file mode 100644 index 0000000000..a34edc0eac --- /dev/null +++ b/src/main/build-version/setup-channel.injectable.ts @@ -0,0 +1,23 @@ +/** + * 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 { requestChannelListenerInjectionToken } from "../../common/utils/channel/request-channel-listener-injection-token"; +import { buildVersionChannel } from "../../common/vars/build-semantic-version.injectable"; +import buildVersionInjectable from "../vars/build-version/build-version.injectable"; + +const setupBuildVersionRequestChannelInjectable = getInjectable({ + id: "setup-build-version-request-channel", + instantiate: (di) => { + const buildVersion = di.inject(buildVersionInjectable); + + return { + channel: buildVersionChannel, + handler: () => buildVersion.get(), + }; + }, + injectionToken: requestChannelListenerInjectionToken, +}); + +export default setupBuildVersionRequestChannelInjectable; diff --git a/src/main/menu/build-version.global-override-for-injectable.ts b/src/main/electron-app/electron-app.global-override-for-injectable.ts similarity index 56% rename from src/main/menu/build-version.global-override-for-injectable.ts rename to src/main/electron-app/electron-app.global-override-for-injectable.ts index 9c2331f72d..eeaa1765b7 100644 --- a/src/main/menu/build-version.global-override-for-injectable.ts +++ b/src/main/electron-app/electron-app.global-override-for-injectable.ts @@ -4,6 +4,8 @@ */ import { getGlobalOverride } from "../../common/test-utils/get-global-override"; -import buildVersionInjectable from "./build-version.injectable"; +import electronAppInjectable from "./electron-app.injectable"; -export default getGlobalOverride(buildVersionInjectable, () => "6.0.0"); +export default getGlobalOverride(electronAppInjectable, () => ({ + getVersion: () => "6.0.0", +} as Electron.App)); diff --git a/src/main/electron-app/runnables/setup-application-name.injectable.ts b/src/main/electron-app/runnables/setup-application-name.injectable.ts index a5f85301c0..3a8efdfe05 100644 --- a/src/main/electron-app/runnables/setup-application-name.injectable.ts +++ b/src/main/electron-app/runnables/setup-application-name.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import appNameInjectable from "../../app-paths/app-name/app-name.injectable"; +import appNameInjectable from "../../../common/vars/app-name.injectable"; import { beforeElectronIsReadyInjectionToken } from "../../start-main-application/runnable-tokens/before-electron-is-ready-injection-token"; import electronAppInjectable from "../electron-app.injectable"; diff --git a/src/main/getDiForUnitTesting.ts b/src/main/getDiForUnitTesting.ts index f63e6f0518..579e5eafec 100644 --- a/src/main/getDiForUnitTesting.ts +++ b/src/main/getDiForUnitTesting.ts @@ -7,7 +7,6 @@ import { kebabCase, noop, chunk } from "lodash/fp"; import type { DiContainer, Injectable } from "@ogre-tools/injectable"; import { createContainer } from "@ogre-tools/injectable"; import { Environments, setLegacyGlobalDiForExtensionApi } from "../extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api"; -import appNameInjectable from "./app-paths/app-name/app-name.injectable"; import writeJsonFileInjectable from "../common/fs/write-json-file.injectable"; import readJsonFileInjectable from "../common/fs/read-json-file.injectable"; import readFileInjectable from "../common/fs/read-file.injectable"; @@ -33,7 +32,6 @@ import lensResourcesDirInjectable from "../common/vars/lens-resources-dir.inject import environmentVariablesInjectable from "../common/utils/environment-variables.injectable"; import setupIpcMainHandlersInjectable from "./electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.injectable"; import setupLensProxyInjectable from "./start-main-application/runnables/setup-lens-proxy.injectable"; -import setupSentryInjectable from "./start-main-application/runnables/setup-sentry.injectable"; import setupShellInjectable from "./start-main-application/runnables/setup-shell.injectable"; import setupSyncingOfWeblinksInjectable from "./start-main-application/runnables/setup-syncing-of-weblinks.injectable"; import stopServicesAndExitAppInjectable from "./stop-services-and-exit-app.injectable"; @@ -63,7 +61,6 @@ import broadcastMessageInjectable from "../common/ipc/broadcast-message.injectab import getElectronThemeInjectable from "./electron-app/features/get-electron-theme.injectable"; import syncThemeFromOperatingSystemInjectable from "./electron-app/features/sync-theme-from-operating-system.injectable"; import platformInjectable from "../common/vars/platform.injectable"; -import productNameInjectable from "./app-paths/app-name/product-name.injectable"; import electronQuitAndInstallUpdateInjectable from "./electron-app/features/electron-quit-and-install-update.injectable"; import electronUpdaterIsActiveInjectable from "./electron-app/features/electron-updater-is-active.injectable"; import publishIsConfiguredInjectable from "./application-update/publish-is-configured.injectable"; @@ -73,7 +70,6 @@ import setUpdateOnQuitInjectable from "./electron-app/features/set-update-on-qui import downloadPlatformUpdateInjectable from "./application-update/download-platform-update/download-platform-update.injectable"; import startCatalogSyncInjectable from "./catalog-sync-to-renderer/start-catalog-sync.injectable"; import startKubeConfigSyncInjectable from "./start-main-application/runnables/kube-config-sync/start-kube-config-sync.injectable"; -import appVersionInjectable from "../common/vars/app-version.injectable"; import getRandomIdInjectable from "../common/utils/get-random-id.injectable"; import periodicalCheckForUpdatesInjectable from "./application-update/periodical-check-for-updates/periodical-check-for-updates.injectable"; import execFileInjectable from "../common/fs/exec-file.injectable"; @@ -148,9 +144,6 @@ export function getDiForUnitTesting(opts: { doGeneralOverrides?: boolean } = {}) di.override(environmentVariablesInjectable, () => ({})); di.override(commandLineArgumentsInjectable, () => []); - di.override(productNameInjectable, () => "some-product-name"); - di.override(appVersionInjectable, () => "1.0.0"); - di.override(clusterFramesInjectable, () => observable.map()); di.override(stopServicesAndExitAppInjectable, () => () => {}); @@ -179,7 +172,6 @@ export function getDiForUnitTesting(opts: { doGeneralOverrides?: boolean } = {}) // TODO: Remove usages of globally exported appEventBus to get rid of this di.override(appEventBusInjectable, () => new EventEmitter<[AppEvent]>()); - di.override(appNameInjectable, () => "some-app-name"); di.override(broadcastMessageInjectable, () => (channel) => { throw new Error(`Tried to broadcast message to channel "${channel}" over IPC without explicit override.`); }); @@ -210,7 +202,6 @@ const overrideRunnablesHavingSideEffects = (di: DiContainer) => { initializeExtensionsInjectable, setupIpcMainHandlersInjectable, setupLensProxyInjectable, - setupSentryInjectable, setupShellInjectable, setupSyncingOfWeblinksInjectable, setupSystemCaInjectable, diff --git a/src/main/kubectl/bundled-kubectl.injectable.ts b/src/main/kubectl/bundled-kubectl.injectable.ts index a06cbedff9..e7ecb7c7f8 100644 --- a/src/main/kubectl/bundled-kubectl.injectable.ts +++ b/src/main/kubectl/bundled-kubectl.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { getBundledKubectlVersion } from "../../common/utils"; +import bundledKubectlVersionInjectable from "../../common/vars/bundled-kubectl-version.injectable"; import createKubectlInjectable from "./create-kubectl.injectable"; const bundledKubectlInjectable = getInjectable({ @@ -11,8 +11,7 @@ const bundledKubectlInjectable = getInjectable({ instantiate: (di) => { const createKubectl = di.inject(createKubectlInjectable); - - const bundledKubectlVersion = getBundledKubectlVersion(); + const bundledKubectlVersion = di.inject(bundledKubectlVersionInjectable); return createKubectl(bundledKubectlVersion); }, diff --git a/src/main/kubectl/create-kubectl.injectable.ts b/src/main/kubectl/create-kubectl.injectable.ts index 1e13b7d02c..d0187f7ba4 100644 --- a/src/main/kubectl/create-kubectl.injectable.ts +++ b/src/main/kubectl/create-kubectl.injectable.ts @@ -12,6 +12,8 @@ import normalizedPlatformInjectable from "../../common/vars/normalized-platform. import kubectlBinaryNameInjectable from "./binary-name.injectable"; import bundledKubectlBinaryPathInjectable from "./bundled-binary-path.injectable"; import baseBundledBinariesDirectoryInjectable from "../../common/vars/base-bundled-binaries-dir.injectable"; +import bundledKubectlVersionInjectable from "../../common/vars/bundled-kubectl-version.injectable"; +import kubectlVersionMapInjectable from "./version-map.injectable"; const createKubectlInjectable = getInjectable({ id: "create-kubectl", @@ -25,6 +27,8 @@ const createKubectlInjectable = getInjectable({ kubectlBinaryName: di.inject(kubectlBinaryNameInjectable), bundledKubectlBinaryPath: di.inject(bundledKubectlBinaryPathInjectable), baseBundeledBinariesDirectory: di.inject(baseBundledBinariesDirectoryInjectable), + bundledKubectlVersion: di.inject(bundledKubectlVersionInjectable), + kubectlVersionMap: di.inject(kubectlVersionMapInjectable), }; return (clusterVersion: string) => new Kubectl(dependencies, clusterVersion); diff --git a/src/main/kubectl/kubectl.ts b/src/main/kubectl/kubectl.ts index 2e70f3c7ee..182d540692 100644 --- a/src/main/kubectl/kubectl.ts +++ b/src/main/kubectl/kubectl.ts @@ -9,7 +9,6 @@ import { promiseExecFile } from "../../common/utils/promise-exec"; import logger from "../logger"; import { ensureDir, pathExists } from "fs-extra"; import * as lockFile from "proper-lockfile"; -import { getBundledKubectlVersion } from "../../common/utils/app-version"; import { SemVer } from "semver"; import { defaultPackageMirror, packageMirrors } from "../../common/user-store/preferences-helpers"; import got from "got/dist/source"; @@ -17,26 +16,6 @@ import { promisify } from "util"; import stream from "stream"; import { noop } from "lodash/fp"; -const bundledVersion = getBundledKubectlVersion(); -const kubectlMap: Map = new Map([ - ["1.7", "1.8.15"], - ["1.8", "1.9.10"], - ["1.9", "1.10.13"], - ["1.10", "1.11.10"], - ["1.11", "1.12.10"], - ["1.12", "1.13.12"], - ["1.13", "1.13.12"], - ["1.14", "1.14.10"], - ["1.15", "1.15.11"], - ["1.16", "1.16.15"], - ["1.17", "1.17.17"], - ["1.18", "1.18.20"], - ["1.19", "1.19.12"], - ["1.20", "1.20.8"], - ["1.21", "1.21.9"], - ["1.22", "1.22.6"], - ["1.23", bundledVersion], -]); const initScriptVersionString = "# lens-initscript v3"; export interface KubectlDependencies { @@ -52,6 +31,8 @@ export interface KubectlDependencies { readonly downloadKubectlBinaries: boolean; readonly downloadMirror: string; }; + readonly bundledKubectlVersion: string; + readonly kubectlVersionMap: Map; } export class Kubectl { @@ -60,7 +41,6 @@ export class Kubectl { protected readonly path: string; protected readonly dirname: string; - public static readonly bundledKubectlVersion = bundledVersion; public static invalidBundle = false; constructor(protected readonly dependencies: KubectlDependencies, clusterVersion: string) { @@ -69,10 +49,10 @@ export class Kubectl { try { version = new SemVer(clusterVersion); } catch { - version = new SemVer(Kubectl.bundledKubectlVersion); + version = new SemVer(this.dependencies.bundledKubectlVersion); } - const fromMajorMinor = kubectlMap.get(`${version.major}.${version.minor}`); + const fromMajorMinor = this.dependencies.kubectlVersionMap.get(`${version.major}.${version.minor}`); /** * minorVersion is the first two digits of kube server version if the version map includes that, @@ -189,7 +169,7 @@ export class Kubectl { } protected async checkBundled(): Promise { - if (this.kubectlVersion === Kubectl.bundledKubectlVersion) { + if (this.kubectlVersion === this.dependencies.bundledKubectlVersion) { try { const exist = await pathExists(this.path); diff --git a/src/main/kubectl/version-map.injectable.ts b/src/main/kubectl/version-map.injectable.ts new file mode 100644 index 0000000000..2beee76e0c --- /dev/null +++ b/src/main/kubectl/version-map.injectable.ts @@ -0,0 +1,35 @@ +/** + * 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 bundledKubectlVersionInjectable from "../../common/vars/bundled-kubectl-version.injectable"; + +const kubectlVersionMapInjectable = getInjectable({ + id: "kubectl-version-map", + instantiate: (di) => { + const bundledKubectlVersion = di.inject(bundledKubectlVersionInjectable); + + return new Map([ + ["1.7", "1.8.15"], + ["1.8", "1.9.10"], + ["1.9", "1.10.13"], + ["1.10", "1.11.10"], + ["1.11", "1.12.10"], + ["1.12", "1.13.12"], + ["1.13", "1.13.12"], + ["1.14", "1.14.10"], + ["1.15", "1.15.11"], + ["1.16", "1.16.15"], + ["1.17", "1.17.17"], + ["1.18", "1.18.20"], + ["1.19", "1.19.12"], + ["1.20", "1.20.8"], + ["1.21", "1.21.9"], + ["1.22", "1.22.6"], + ["1.23", bundledKubectlVersion], + ]); + }, +}); + +export default kubectlVersionMapInjectable; diff --git a/src/main/lens-proxy/lens-proxy.injectable.ts b/src/main/lens-proxy/lens-proxy.injectable.ts index 34cb327339..5138ac191e 100644 --- a/src/main/lens-proxy/lens-proxy.injectable.ts +++ b/src/main/lens-proxy/lens-proxy.injectable.ts @@ -10,26 +10,20 @@ import httpProxy from "http-proxy"; import clusterManagerInjectable from "../cluster-manager.injectable"; import shellApiRequestInjectable from "./proxy-functions/shell-api-request/shell-api-request.injectable"; import lensProxyPortInjectable from "./lens-proxy-port.injectable"; +import contentSecurityPolicyInjectable from "../../common/vars/content-security-policy.injectable"; const lensProxyInjectable = getInjectable({ id: "lens-proxy", - instantiate: (di) => { - const clusterManager = di.inject(clusterManagerInjectable); - const router = di.inject(routerInjectable); - const shellApiRequest = di.inject(shellApiRequestInjectable); - const proxy = httpProxy.createProxy(); - const lensProxyPort = di.inject(lensProxyPortInjectable); - - return new LensProxy({ - router, - proxy, - kubeApiUpgradeRequest, - shellApiRequest, - getClusterForRequest: clusterManager.getClusterForRequest, - lensProxyPort, - }); - }, + instantiate: (di) => new LensProxy({ + router: di.inject(routerInjectable), + proxy: httpProxy.createProxy(), + kubeApiUpgradeRequest, + shellApiRequest: di.inject(shellApiRequestInjectable), + getClusterForRequest: di.inject(clusterManagerInjectable).getClusterForRequest, + lensProxyPort: di.inject(lensProxyPortInjectable), + contentSecurityPolicy: di.inject(contentSecurityPolicyInjectable), + }), }); export default lensProxyInjectable; diff --git a/src/main/lens-proxy/lens-proxy.ts b/src/main/lens-proxy/lens-proxy.ts index 5e58104d60..2a75470154 100644 --- a/src/main/lens-proxy/lens-proxy.ts +++ b/src/main/lens-proxy/lens-proxy.ts @@ -7,7 +7,7 @@ import net from "net"; import type http from "http"; import spdy from "spdy"; import type httpProxy from "http-proxy"; -import { apiPrefix, apiKubePrefix, contentSecurityPolicy } from "../../common/vars"; +import { apiPrefix, apiKubePrefix } from "../../common/vars"; import type { Router } from "../router/router"; import type { ClusterContextHandler } from "../context-handler/context-handler"; import logger from "../logger"; @@ -26,9 +26,10 @@ interface Dependencies { getClusterForRequest: GetClusterForRequest; shellApiRequest: (args: ProxyApiRequestArgs) => void | Promise; kubeApiUpgradeRequest: (args: ProxyApiRequestArgs) => void | Promise; - router: Router; - proxy: httpProxy; - lensProxyPort: { set: (portNumber: number) => void }; + readonly router: Router; + readonly proxy: httpProxy; + readonly lensProxyPort: { set: (portNumber: number) => void }; + readonly contentSecurityPolicy: string; } const watchParam = "watch"; @@ -63,7 +64,7 @@ export class LensProxy { protected closed = false; protected retryCounters = new Map(); - constructor(private dependencies: Dependencies) { + constructor(private readonly dependencies: Dependencies) { this.configureProxy(dependencies.proxy); this.proxyServer = spdy.createServer({ @@ -239,10 +240,7 @@ export class LensProxy { } } - if (contentSecurityPolicy) { - res.setHeader("Content-Security-Policy", contentSecurityPolicy); - } - + res.setHeader("Content-Security-Policy", this.dependencies.contentSecurityPolicy); this.dependencies.router.route(cluster, req, res); } } diff --git a/src/main/menu/application-menu-items.injectable.ts b/src/main/menu/application-menu-items.injectable.ts index 34d0955d77..bf1197ac1f 100644 --- a/src/main/menu/application-menu-items.injectable.ts +++ b/src/main/menu/application-menu-items.injectable.ts @@ -3,12 +3,11 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { docsUrl, productName, supportUrl } from "../../common/vars"; +import { docsUrl, supportUrl } from "../../common/vars"; import { broadcastMessage } from "../../common/ipc"; import type { MenuItemConstructorOptions } from "electron"; import { webContents } from "electron"; import loggerInjectable from "../../common/logger.injectable"; -import appNameInjectable from "../app-paths/app-name/app-name.injectable"; import electronMenuItemsInjectable from "./electron-menu-items.injectable"; import updatingIsEnabledInjectable from "../application-update/updating-is-enabled.injectable"; import navigateToPreferencesInjectable from "../../common/front-end-routing/routes/preferences/navigate-to-preferences.injectable"; @@ -24,6 +23,8 @@ import reloadCurrentApplicationWindowInjectable from "../start-main-application/ import showApplicationWindowInjectable from "../start-main-application/lens-window/show-application-window.injectable"; import processCheckingForUpdatesInjectable from "../application-update/check-for-updates/process-checking-for-updates.injectable"; import openLinkInBrowserInjectable from "../../common/utils/open-link-in-browser.injectable"; +import appNameInjectable from "../../common/vars/app-name.injectable"; +import productNameInjectable from "../../common/vars/product-name.injectable"; function ignoreIf(check: boolean, menuItems: MenuItemOpts[]) { return check ? [] : menuItems; @@ -39,6 +40,7 @@ const applicationMenuItemsInjectable = getInjectable({ instantiate: (di) => { const logger = di.inject(loggerInjectable); const appName = di.inject(appNameInjectable); + const productName = di.inject(productNameInjectable); const isMac = di.inject(isMacInjectable); const updatingIsEnabled = di.inject(updatingIsEnabledInjectable); const electronMenuItems = di.inject(electronMenuItemsInjectable); diff --git a/src/main/menu/build-version.injectable.ts b/src/main/menu/build-version.injectable.ts deleted file mode 100644 index d94594cc84..0000000000 --- a/src/main/menu/build-version.injectable.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 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 electronAppInjectable from "../electron-app/electron-app.injectable"; - -const buildVersionInjectable = getInjectable({ - id: "build-version", - instantiate: (di) => di.inject(electronAppInjectable).getVersion(), -}); - -export default buildVersionInjectable; diff --git a/src/main/menu/menu.ts b/src/main/menu/menu.ts index 1454f38999..2082a35ed8 100644 --- a/src/main/menu/menu.ts +++ b/src/main/menu/menu.ts @@ -3,36 +3,10 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { Menu } from "electron"; -import { appName, isWindows, productName } from "../../common/vars"; -import packageJson from "../../../package.json"; import type { MenuItemOpts } from "./application-menu-items.injectable"; -import type { ShowMessagePopup } from "../electron-app/features/show-message-popup.injectable"; export type MenuTopId = "mac" | "file" | "edit" | "view" | "help"; -interface Dependencies { - appVersion: string; - extensionApiVersion: string; - showMessagePopup: ShowMessagePopup; -} - -export const showAbout = ({ showMessagePopup, extensionApiVersion, appVersion }: Dependencies) => async () => { - const appInfo = [ - `${appName}: ${appVersion}`, - `Extension API: ${extensionApiVersion}`, - `Electron: ${process.versions.electron}`, - `Chrome: ${process.versions.chrome}`, - `Node: ${process.versions.node}`, - packageJson.copyright, - ]; - - await showMessagePopup( - `${isWindows ? " ".repeat(2) : ""}${appName}`, - productName, - appInfo.join("\r\n"), - ); -}; - export function buildMenu(applicationMenuItems: MenuItemOpts[]) { Menu.setApplicationMenu( Menu.buildFromTemplate(applicationMenuItems), diff --git a/src/main/menu/show-about.injectable.ts b/src/main/menu/show-about.injectable.ts index b65530261d..e19c2b0bfa 100644 --- a/src/main/menu/show-about.injectable.ts +++ b/src/main/menu/show-about.injectable.ts @@ -3,20 +3,43 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { showAbout } from "./menu"; import showMessagePopupInjectable from "../electron-app/features/show-message-popup.injectable"; -import appVersionInjectable from "../../common/vars/app-version.injectable"; -import buildVersionInjectable from "./build-version.injectable"; +import isWindowsInjectable from "../../common/vars/is-windows.injectable"; +import appNameInjectable from "../../common/vars/app-name.injectable"; +import productNameInjectable from "../../common/vars/product-name.injectable"; +import buildVersionInjectable from "../vars/build-version/build-version.injectable"; +import extensionApiVersionInjectable from "../../common/vars/extension-api-version.injectable"; +import applicationCopyrightInjectable from "../../common/vars/application-copyright.injectable"; const showAboutInjectable = getInjectable({ id: "show-about", - instantiate: (di) => - showAbout({ - appVersion: di.inject(buildVersionInjectable), - extensionApiVersion: di.inject(appVersionInjectable), - showMessagePopup: di.inject(showMessagePopupInjectable), - }), + instantiate: (di) => { + const buildVersion = di.inject(buildVersionInjectable); + const extensionApiVersion = di.inject(extensionApiVersionInjectable); + const showMessagePopup = di.inject(showMessagePopupInjectable); + const isWindows = di.inject(isWindowsInjectable); + const appName = di.inject(appNameInjectable); + const productName = di.inject(productNameInjectable); + const applicationCopyright = di.inject(applicationCopyrightInjectable); + + return () => { + const appInfo = [ + `${appName}: ${buildVersion.get()}`, + `Extension API: ${extensionApiVersion}`, + `Electron: ${process.versions.electron}`, + `Chrome: ${process.versions.chrome}`, + `Node: ${process.versions.node}`, + applicationCopyright, + ]; + + showMessagePopup( + `${isWindows ? " ".repeat(2) : ""}${appName}`, + productName, + appInfo.join("\r\n"), + ); + }; + }, }); export default showAboutInjectable; diff --git a/src/main/routes/static-file-route.injectable.ts b/src/main/routes/static-file-route.injectable.ts index 86fa4b2fc5..2650410d0b 100644 --- a/src/main/routes/static-file-route.injectable.ts +++ b/src/main/routes/static-file-route.injectable.ts @@ -6,7 +6,7 @@ import type { SupportedFileExtension } from "../router/router-content-types"; import { contentTypes } from "../router/router-content-types"; import logger from "../logger"; import { getRouteInjectable } from "../router/router.injectable"; -import { appName, publicPath } from "../../common/vars"; +import { publicPath } from "../../common/vars"; import path from "path"; import isDevelopmentInjectable from "../../common/vars/is-development.injectable"; import httpProxy from "http-proxy"; @@ -19,66 +19,78 @@ import { webpackDevServerPort } from "../../../webpack/vars"; import type { LensApiRequest, RouteResponse } from "../router/route"; import { route } from "../router/route"; import staticFilesDirectoryInjectable from "../../common/vars/static-files-directory.injectable"; +import appNameInjectable from "../../common/vars/app-name.injectable"; interface ProductionDependencies { readFileBuffer: (path: string) => Promise; getAbsolutePath: GetAbsolutePath; joinPaths: JoinPaths; staticFilesDirectory: string; + appName: string; } -const handleStaticFileInProduction = - ({ readFileBuffer, getAbsolutePath, joinPaths, staticFilesDirectory }: ProductionDependencies) => - async ({ params }: LensApiRequest<"/{path*}">): Promise> => { - let filePath = params.path; +const handleStaticFileInProduction = ({ + readFileBuffer, + getAbsolutePath, + joinPaths, + staticFilesDirectory, + appName, +}: ProductionDependencies) => ( + async ({ params }: LensApiRequest<"/{path*}">): Promise> => { + let filePath = params.path; - for (let retryCount = 0; retryCount < 5; retryCount += 1) { - const asset = joinPaths(staticFilesDirectory, filePath); - const normalizedFilePath = getAbsolutePath(asset); + for (let retryCount = 0; retryCount < 5; retryCount += 1) { + const asset = joinPaths(staticFilesDirectory, filePath); + const normalizedFilePath = getAbsolutePath(asset); + + if (!normalizedFilePath.startsWith(staticFilesDirectory)) { + return { statusCode: 404 }; + } + + try { + const fileExtension = path + .extname(asset) + .slice(1) as SupportedFileExtension; + + const contentType = contentTypes[fileExtension] || contentTypes.txt; + + return { response: await readFileBuffer(asset), contentType }; + } catch (err) { + if (retryCount > 5) { + logger.error("handleStaticFile:", String(err)); - if (!normalizedFilePath.startsWith(staticFilesDirectory)) { return { statusCode: 404 }; } - try { - const fileExtension = path - .extname(asset) - .slice(1) as SupportedFileExtension; - - const contentType = contentTypes[fileExtension] || contentTypes.txt; - - return { response: await readFileBuffer(asset), contentType }; - } catch (err) { - if (retryCount > 5) { - logger.error("handleStaticFile:", String(err)); - - return { statusCode: 404 }; - } - - filePath = `${publicPath}/${appName}.html`; - } + filePath = `${publicPath}/${appName}.html`; } + } - return { statusCode: 404 }; - }; + return { statusCode: 404 }; + } +); interface DevelopmentDependencies { proxy: httpProxy; + appName: string; } -const handleStaticFileInDevelopment = - ({ proxy }: DevelopmentDependencies) => - ({ raw: { req, res }}: LensApiRequest<"/{path*}">): RouteResponse => { - if (req.url === "/" || !req.url?.startsWith("/build/")) { - req.url = `${publicPath}/${appName}.html`; - } +const handleStaticFileInDevelopment = ({ + proxy, + appName, +}: DevelopmentDependencies) => ( + ({ raw: { req, res }}: LensApiRequest<"/{path*}">): RouteResponse => { + if (req.url === "/" || !req.url?.startsWith("/build/")) { + req.url = `${publicPath}/${appName}.html`; + } - proxy.web(req, res, { - target: `http://127.0.0.1:${webpackDevServerPort}`, - }); + proxy.web(req, res, { + target: `http://127.0.0.1:${webpackDevServerPort}`, + }); - return { proxy }; - }; + return { proxy }; + } +); const staticFileRouteInjectable = getRouteInjectable({ id: "static-file-route", @@ -89,6 +101,7 @@ const staticFileRouteInjectable = getRouteInjectable({ const getAbsolutePath = di.inject(getAbsolutePathInjectable); const joinPaths = di.inject(joinPathsInjectable); const staticFilesDirectory = di.inject(staticFilesDirectoryInjectable); + const appName = di.inject(appNameInjectable); return route({ method: "get", @@ -97,12 +110,14 @@ const staticFileRouteInjectable = getRouteInjectable({ isDevelopment ? handleStaticFileInDevelopment({ proxy: httpProxy.createProxy(), + appName, }) : handleStaticFileInProduction({ readFileBuffer, getAbsolutePath, joinPaths, staticFilesDirectory, + appName, }), ); }, diff --git a/src/main/routes/versions/get-version-route.injectable.ts b/src/main/routes/versions/get-version-route.injectable.ts index aa846c171c..d132e242d6 100644 --- a/src/main/routes/versions/get-version-route.injectable.ts +++ b/src/main/routes/versions/get-version-route.injectable.ts @@ -3,20 +3,24 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getRouteInjectable } from "../../router/router.injectable"; -import { getAppVersion } from "../../../common/utils"; import { route } from "../../router/route"; +import buildVersionInjectable from "../../vars/build-version/build-version.injectable"; const getVersionRouteInjectable = getRouteInjectable({ id: "get-version-route", - instantiate: () => route({ - method: "get", - path: `/version`, - })(() => ({ - response: { - version: getAppVersion(), - }, - })), + instantiate: (di) => { + const buildVersion = di.inject(buildVersionInjectable); + + return route({ + method: "get", + path: `/version`, + })(() => ({ + response: { + version: buildVersion.get(), + }, + })); + }, }); export default getVersionRouteInjectable; diff --git a/src/main/shell-sync.ts b/src/main/shell-sync.ts deleted file mode 100644 index d2c58d0abe..0000000000 --- a/src/main/shell-sync.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) OpenLens Authors. All rights reserved. - * Licensed under MIT License. See LICENSE in root directory for more information. - */ - -import { shellEnv } from "./utils/shell-env"; -import os from "os"; -import { app } from "electron"; -import logger from "./logger"; -import { isSnap } from "../common/vars"; -import { unionPATHs } from "../common/utils/union-env-path"; - -/** - * shellSync loads what would have been the environment if this application was - * run from the command line, into the process.env object. This is especially - * useful on macos where this always needs to be done. - */ -export async function shellSync() { - const env = await shellEnv(os.userInfo().shell); - - if (!env.LANG) { - // the LANG env var expects an underscore instead of electron's dash - env.LANG = `${app.getLocale().replace("-", "_")}.UTF-8`; - } else if (!env.LANG.endsWith(".UTF-8")) { - env.LANG += ".UTF-8"; - } - - if (!isSnap) { - // Prefer the synced PATH over the initial one - process.env.PATH = unionPATHs(env.PATH ?? "", process.env.PATH ?? ""); - } - - // The spread operator allows joining of objects. The precedence is last to first. - process.env = { - ...env, - ...process.env, - }; - - logger.debug(`[SHELL-SYNC]: Synced shell env, and updating`, env, process.env); -} diff --git a/src/main/start-main-application/lens-window/application-window/create-application-window.injectable.ts b/src/main/start-main-application/lens-window/application-window/create-application-window.injectable.ts index 1652b67f9b..fcc46ff7a3 100644 --- a/src/main/start-main-application/lens-window/application-window/create-application-window.injectable.ts +++ b/src/main/start-main-application/lens-window/application-window/create-application-window.injectable.ts @@ -6,11 +6,11 @@ import { getInjectable } from "@ogre-tools/injectable"; import createLensWindowInjectable from "./create-lens-window.injectable"; import lensProxyPortInjectable from "../../../lens-proxy/lens-proxy-port.injectable"; import isMacInjectable from "../../../../common/vars/is-mac.injectable"; -import appNameInjectable from "../../../app-paths/app-name/app-name.injectable"; import appEventBusInjectable from "../../../../common/app-event-bus/app-event-bus.injectable"; import waitUntilBundledExtensionsAreLoadedInjectable from "./wait-until-bundled-extensions-are-loaded.injectable"; import { applicationWindowInjectionToken } from "./application-window-injection-token"; import { runInAction } from "mobx"; +import appNameInjectable from "../../../../common/vars/app-name.injectable"; const createApplicationWindowInjectable = getInjectable({ id: "create-application-window", diff --git a/src/main/start-main-application/runnables/sentry/initialize-on-main.global-override-for-injectable.ts b/src/main/start-main-application/runnables/sentry/initialize-on-main.global-override-for-injectable.ts new file mode 100644 index 0000000000..3850c736a0 --- /dev/null +++ b/src/main/start-main-application/runnables/sentry/initialize-on-main.global-override-for-injectable.ts @@ -0,0 +1,9 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +import { getGlobalOverride } from "../../../../common/test-utils/get-global-override"; +import initializeSentryOnMainInjectable from "./initialize-on-main.injectable"; + +export default getGlobalOverride(initializeSentryOnMainInjectable, () => () => {}); diff --git a/src/main/start-main-application/runnables/sentry/initialize-on-main.injectable.ts b/src/main/start-main-application/runnables/sentry/initialize-on-main.injectable.ts new file mode 100644 index 0000000000..e60f16ff46 --- /dev/null +++ b/src/main/start-main-application/runnables/sentry/initialize-on-main.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 { init } from "@sentry/electron/main"; + +const initializeSentryOnMainInjectable = getInjectable({ + id: "initialize-sentry-on-main", + instantiate: () => init, + causesSideEffects: true, +}); + +export default initializeSentryOnMainInjectable; diff --git a/src/main/start-main-application/runnables/sentry/setup.injectable.ts b/src/main/start-main-application/runnables/sentry/setup.injectable.ts new file mode 100644 index 0000000000..59eacc4199 --- /dev/null +++ b/src/main/start-main-application/runnables/sentry/setup.injectable.ts @@ -0,0 +1,23 @@ +/** + * 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 { beforeElectronIsReadyInjectionToken } from "../../runnable-tokens/before-electron-is-ready-injection-token"; +import initializeSentryReportingWithInjectable from "../../../../common/error-reporting/initialize-sentry-reporting.injectable"; +import initializeSentryOnMainInjectable from "./initialize-on-main.injectable"; + +const setupSentryInjectable = getInjectable({ + id: "setup-sentry", + instantiate: (di) => { + const initializeSentryReportingWith = di.inject(initializeSentryReportingWithInjectable); + const initializeSentryOnMain = di.inject(initializeSentryOnMainInjectable); + + return { + run: () => initializeSentryReportingWith(initializeSentryOnMain), + }; + }, + injectionToken: beforeElectronIsReadyInjectionToken, +}); + +export default setupSentryInjectable; diff --git a/src/main/start-main-application/runnables/setup-lens-proxy.injectable.ts b/src/main/start-main-application/runnables/setup-lens-proxy.injectable.ts index 8b90bcf5e3..a75f55ec72 100644 --- a/src/main/start-main-application/runnables/setup-lens-proxy.injectable.ts +++ b/src/main/start-main-application/runnables/setup-lens-proxy.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { getAppVersion, getAppVersionFromProxyServer } from "../../../common/utils"; +import { getAppVersionFromProxyServer } from "../../../common/utils"; import exitAppInjectable from "../../electron-app/features/exit-app.injectable"; import lensProxyInjectable from "../../lens-proxy/lens-proxy.injectable"; import loggerInjectable from "../../../common/logger.injectable"; @@ -11,6 +11,7 @@ import lensProxyPortInjectable from "../../lens-proxy/lens-proxy-port.injectable import isWindowsInjectable from "../../../common/vars/is-windows.injectable"; import showErrorPopupInjectable from "../../electron-app/features/show-error-popup.injectable"; import { beforeApplicationIsLoadingInjectionToken } from "../runnable-tokens/before-application-is-loading-injection-token"; +import buildVersionInjectable from "../../vars/build-version/build-version.injectable"; const setupLensProxyInjectable = getInjectable({ id: "setup-lens-proxy", @@ -22,6 +23,7 @@ const setupLensProxyInjectable = getInjectable({ const lensProxyPort = di.inject(lensProxyPortInjectable); const isWindows = di.inject(isWindowsInjectable); const showErrorPopup = di.inject(showErrorPopupInjectable); + const buildVersion = di.inject(buildVersionInjectable); return { run: async () => { @@ -41,7 +43,7 @@ const setupLensProxyInjectable = getInjectable({ lensProxyPort.get(), ); - if (getAppVersion() !== versionFromProxy) { + if (buildVersion.get() !== versionFromProxy) { logger.error("Proxy server responded with invalid response"); return exitApp(); diff --git a/src/main/start-main-application/runnables/setup-sentry.injectable.ts b/src/main/start-main-application/runnables/setup-sentry.injectable.ts deleted file mode 100644 index 4ba3763a16..0000000000 --- a/src/main/start-main-application/runnables/setup-sentry.injectable.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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 { initializeSentryReporting } from "../../../common/sentry"; -import { init } from "@sentry/electron/main"; -import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/before-electron-is-ready-injection-token"; - -const setupSentryInjectable = getInjectable({ - id: "setup-sentry", - - instantiate: () => ({ - run: () => { - initializeSentryReporting(init); - }, - }), - - causesSideEffects: true, - - injectionToken: beforeElectronIsReadyInjectionToken, -}); - -export default setupSentryInjectable; diff --git a/src/main/start-main-application/runnables/setup-shell.injectable.ts b/src/main/start-main-application/runnables/setup-shell.injectable.ts index 0f23e0f2e8..80800e8073 100644 --- a/src/main/start-main-application/runnables/setup-shell.injectable.ts +++ b/src/main/start-main-application/runnables/setup-shell.injectable.ts @@ -3,21 +3,47 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { shellSync } from "../../shell-sync"; import loggerInjectable from "../../../common/logger.injectable"; import { onLoadOfApplicationInjectionToken } from "../runnable-tokens/on-load-of-application-injection-token"; +import { shellEnv } from "../../utils/shell-env"; +import os from "os"; +import { unionPATHs } from "../../../common/utils/union-env-path"; +import isSnapPackageInjectable from "../../../common/vars/is-snap-package.injectable"; +import electronAppInjectable from "../../electron-app/electron-app.injectable"; const setupShellInjectable = getInjectable({ id: "setup-shell", instantiate: (di) => { const logger = di.inject(loggerInjectable); + const isSnapPackage = di.inject(isSnapPackageInjectable); + const electronApp = di.inject(electronAppInjectable); return { run: async () => { logger.info("🐚 Syncing shell environment"); - await shellSync(); + const env = await shellEnv(os.userInfo().shell); + + if (!env.LANG) { + // the LANG env var expects an underscore instead of electron's dash + env.LANG = `${electronApp.getLocale().replace("-", "_")}.UTF-8`; + } else if (!env.LANG.endsWith(".UTF-8")) { + env.LANG += ".UTF-8"; + } + + if (!isSnapPackage) { + // Prefer the synced PATH over the initial one + process.env.PATH = unionPATHs(env.PATH ?? "", process.env.PATH ?? ""); + } + + // The spread operator allows joining of objects. The precedence is last to first. + process.env = { + ...env, + ...process.env, + }; + + logger.debug(`[SHELL-SYNC]: Synced shell env, and updating`, env, process.env); }, }; }, diff --git a/src/main/tray/electron-tray/electron-tray.injectable.ts b/src/main/tray/electron-tray/electron-tray.injectable.ts index d8b264060a..96add28ac7 100644 --- a/src/main/tray/electron-tray/electron-tray.injectable.ts +++ b/src/main/tray/electron-tray/electron-tray.injectable.ts @@ -4,12 +4,12 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { Menu, Tray } from "electron"; -import packageJsonInjectable from "../../../common/vars/package-json.injectable"; import showApplicationWindowInjectable from "../../start-main-application/lens-window/show-application-window.injectable"; import isWindowsInjectable from "../../../common/vars/is-windows.injectable"; import loggerInjectable from "../../../common/logger.injectable"; import { convertToElectronMenuTemplate } from "../reactive-tray-menu-items/converters"; import trayIconInjectable from "../menu-icon/tray-icon.injectable"; +import applicationDescriptionInjectable from "../../../common/vars/application-description.injectable"; const TRAY_LOG_PREFIX = "[TRAY]"; @@ -34,7 +34,7 @@ const electronTrayInjectable = getInjectable({ id: "electron-tray", instantiate: (di): ElectronTray => { - const packageJson = di.inject(packageJsonInjectable); + const applicationDescription = di.inject(applicationDescriptionInjectable); const showApplicationWindow = di.inject(showApplicationWindowInjectable); const isWindows = di.inject(isWindowsInjectable); const logger = di.inject(loggerInjectable); @@ -46,7 +46,7 @@ const electronTrayInjectable = getInjectable({ start: () => { tray = new Tray(trayIcon.get().iconPath); - tray.setToolTip(packageJson.description); + tray.setToolTip(applicationDescription); tray.setIgnoreDoubleClickEvents(true); if (isWindows) { diff --git a/src/main/tray/tray-menu-item/implementations/about-app-tray-item.injectable.ts b/src/main/tray/tray-menu-item/implementations/about-app-tray-item.injectable.ts index 5fb1a9f34f..5f2432966d 100644 --- a/src/main/tray/tray-menu-item/implementations/about-app-tray-item.injectable.ts +++ b/src/main/tray/tray-menu-item/implementations/about-app-tray-item.injectable.ts @@ -3,7 +3,6 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import productNameInjectable from "../../../app-paths/app-name/product-name.injectable"; import showApplicationWindowInjectable from "../../../start-main-application/lens-window/show-application-window.injectable"; import showAboutInjectable from "../../../menu/show-about.injectable"; import { trayMenuItemInjectionToken } from "../tray-menu-item-injection-token"; @@ -11,6 +10,7 @@ import { computed } from "mobx"; import withErrorLoggingInjectable from "../../../../common/utils/with-error-logging/with-error-logging.injectable"; import { withErrorSuppression } from "../../../../common/utils/with-error-suppression/with-error-suppression"; import { pipeline } from "@ogre-tools/fp"; +import productNameInjectable from "../../../../common/vars/product-name.injectable"; const aboutAppTrayItemInjectable = getInjectable({ id: "about-app-tray-item", @@ -32,15 +32,10 @@ const aboutAppTrayItemInjectable = getInjectable({ click: pipeline( async () => { await showApplicationWindow(); - - await showAbout(); + showAbout(); }, - withErrorLoggingFor(() => "[TRAY]: Opening of show about failed."), - - // TODO: Find out how to improve typing so that instead of - // x => withErrorSuppression(x) there could only be withErrorSuppression - (x) => withErrorSuppression(x), + withErrorSuppression, ), }; }, diff --git a/src/main/tray/tray-menu-item/implementations/open-app-tray-item.injectable.ts b/src/main/tray/tray-menu-item/implementations/open-app-tray-item.injectable.ts index ff19d7718a..9958448796 100644 --- a/src/main/tray/tray-menu-item/implementations/open-app-tray-item.injectable.ts +++ b/src/main/tray/tray-menu-item/implementations/open-app-tray-item.injectable.ts @@ -4,12 +4,12 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { trayMenuItemInjectionToken } from "../tray-menu-item-injection-token"; -import productNameInjectable from "../../../app-paths/app-name/product-name.injectable"; import showApplicationWindowInjectable from "../../../start-main-application/lens-window/show-application-window.injectable"; import { computed } from "mobx"; import withErrorLoggingInjectable from "../../../../common/utils/with-error-logging/with-error-logging.injectable"; import { withErrorSuppression } from "../../../../common/utils/with-error-suppression/with-error-suppression"; import { pipeline } from "@ogre-tools/fp"; +import productNameInjectable from "../../../../common/vars/product-name.injectable"; const openAppTrayItemInjectable = getInjectable({ id: "open-app-tray-item", @@ -28,15 +28,9 @@ const openAppTrayItemInjectable = getInjectable({ visible: computed(() => true), click: pipeline( - async () => { - await showApplicationWindow(); - }, - + showApplicationWindow, withErrorLoggingFor(() => "[TRAY]: Opening of application window failed."), - - // TODO: Find out how to improve typing so that instead of - // x => withErrorSuppression(x) there could only be withErrorSuppression - (x) => withErrorSuppression(x), + withErrorSuppression, ), }; }, diff --git a/src/main/vars/build-version/build-version.injectable.ts b/src/main/vars/build-version/build-version.injectable.ts new file mode 100644 index 0000000000..5e560282b9 --- /dev/null +++ b/src/main/vars/build-version/build-version.injectable.ts @@ -0,0 +1,19 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ +import { createInitializableState } from "../../../common/initializable-state/create"; +import { buildVersionInjectionToken } from "../../../common/vars/build-semantic-version.injectable"; +import getBuildVersionInjectable from "./get-build-version.injectable"; + +const buildVersionInjectable = createInitializableState({ + id: "build-version", + init: (di) => { + const getBuildVersion = di.inject(getBuildVersionInjectable); + + return getBuildVersion(); + }, + injectionToken: buildVersionInjectionToken, +}); + +export default buildVersionInjectable; diff --git a/src/main/vars/build-version/get-build-version.injectable.ts b/src/main/vars/build-version/get-build-version.injectable.ts new file mode 100644 index 0000000000..ddbef55262 --- /dev/null +++ b/src/main/vars/build-version/get-build-version.injectable.ts @@ -0,0 +1,17 @@ +/** + * 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 electronAppInjectable from "../../electron-app/electron-app.injectable"; + +const getBuildVersionInjectable = getInjectable({ + id: "get-build-version", + instantiate: (di) => { + const electronApp = di.inject(electronAppInjectable); + + return () => electronApp.getVersion(); + }, +}); + +export default getBuildVersionInjectable; diff --git a/src/main/vars/build-version/init.injectable.ts b/src/main/vars/build-version/init.injectable.ts new file mode 100644 index 0000000000..0d879715a4 --- /dev/null +++ b/src/main/vars/build-version/init.injectable.ts @@ -0,0 +1,21 @@ +/** + * 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 { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/before-application-is-loading-injection-token"; +import buildVersionInjectable from "./build-version.injectable"; + +const initializeBuildVersionAsyncSyncBoxInjectable = getInjectable({ + id: "initialize-build-version-async-sync-box", + instantiate: (di) => { + const buildVersion = di.inject(buildVersionInjectable); + + return { + run: () => buildVersion.init(), + }; + }, + injectionToken: beforeApplicationIsLoadingInjectionToken, +}); + +export default initializeBuildVersionAsyncSyncBoxInjectable; diff --git a/src/main/vars/default-update-channel/init.injectable.ts b/src/main/vars/default-update-channel/init.injectable.ts new file mode 100644 index 0000000000..e63b12bac1 --- /dev/null +++ b/src/main/vars/default-update-channel/init.injectable.ts @@ -0,0 +1,23 @@ +/** + * 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 defaultUpdateChannelInjectable from "../../../common/application-update/selected-update-channel/default-update-channel.injectable"; +import initSemanticBuildVersionInjectable from "../../../renderer/vars/semantic-build-version/init.injectable"; +import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/before-application-is-loading-injection-token"; + +const initDefaultUpdateChannelInjectableInjectable = getInjectable({ + id: "init-default-update-channel-injectable", + instantiate: (di) => { + const defaultUpdateChannel = di.inject(defaultUpdateChannelInjectable); + + return { + run: () => defaultUpdateChannel.init(), + runAfter: di.inject(initSemanticBuildVersionInjectable), + }; + }, + injectionToken: beforeApplicationIsLoadingInjectionToken, +}); + +export default initDefaultUpdateChannelInjectableInjectable; diff --git a/src/main/vars/semantic-build-version/init.injectable.ts b/src/main/vars/semantic-build-version/init.injectable.ts new file mode 100644 index 0000000000..8b33e27576 --- /dev/null +++ b/src/main/vars/semantic-build-version/init.injectable.ts @@ -0,0 +1,23 @@ +/** + * 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 buildSemanticVersionInjectable from "../../../common/vars/build-semantic-version.injectable"; +import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/before-application-is-loading-injection-token"; +import initializeBuildVersionInjectable from "../build-version/init.injectable"; + +const initSemanticBuildVersionInjectable = getInjectable({ + id: "init-semantic-build-version", + instantiate: (di) => { + const buildSemanticVersion = di.inject(buildSemanticVersionInjectable); + + return { + run: () => buildSemanticVersion.init(), + runAfter: di.inject(initializeBuildVersionInjectable), + }; + }, + injectionToken: beforeApplicationIsLoadingInjectionToken, +}); + +export default initSemanticBuildVersionInjectable; diff --git a/src/migrations/cluster-store/snap.ts b/src/migrations/cluster-store/snap.ts index 9128dca82a..eb02cac81c 100644 --- a/src/migrations/cluster-store/snap.ts +++ b/src/migrations/cluster-store/snap.ts @@ -6,13 +6,14 @@ // Fix embedded kubeconfig paths under snap config import type { ClusterModel } from "../../common/cluster-types"; -import { getAppVersion } from "../../common/utils/app-version"; import fs from "fs"; import type { MigrationDeclaration } from "../helpers"; import { migrationLog } from "../helpers"; +import packageJson from "../../../package.json"; export default { - version: getAppVersion(), // Run always after upgrade + // TODO: replace with injection once migrations are made as injectables + version: packageJson.version, // Run always after upgrade run(store) { if (!process.env["SNAP"]) return; diff --git a/src/migrations/weblinks-store/currentVersion.ts b/src/migrations/weblinks-store/currentVersion.ts index 6a319bc286..40025e64cb 100644 --- a/src/migrations/weblinks-store/currentVersion.ts +++ b/src/migrations/weblinks-store/currentVersion.ts @@ -3,13 +3,14 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getAppVersion } from "../../common/utils"; import { lensSlackWeblinkId, slackUrl } from "../../common/vars"; import type { WeblinkData } from "../../common/weblink-store"; import type { MigrationDeclaration } from "../helpers"; +import packageJson from "../../../package.json"; export default { - version: getAppVersion(), // Run always after upgrade + // TODO: replace with injection once migrations are made as injectables + version: packageJson.version, // Run always after upgrade run(store) { const weblinksRaw: any = store.get("weblinks"); const weblinks = (Array.isArray(weblinksRaw) ? weblinksRaw : []) as WeblinkData[]; diff --git a/src/renderer/bootstrap.tsx b/src/renderer/bootstrap.tsx index 5573dbdbd2..2ebd849805 100644 --- a/src/renderer/bootstrap.tsx +++ b/src/renderer/bootstrap.tsx @@ -20,7 +20,6 @@ import configurePackages from "../common/configure-packages"; import * as initializers from "./initializers"; import logger from "../common/logger"; import { WeblinkStore } from "../common/weblink-store"; -import { initializeSentryReporting } from "../common/sentry"; import { registerCustomThemes } from "./components/monaco-editor"; import { getDi } from "./getDi"; import { DiContextProvider } from "@ogre-tools/injectable-react"; @@ -46,6 +45,7 @@ import kubernetesClusterCategoryInjectable from "../common/catalog/categories/ku import autoRegistrationInjectable from "../common/k8s-api/api-manager/auto-registration.injectable"; import assert from "assert"; import startFrameInjectable from "./start-frame/start-frame.injectable"; +import initializeSentryReportingWithInjectable from "../common/error-reporting/initialize-sentry-reporting.injectable"; configurePackages(); // global packages registerCustomThemes(); // monaco editor themes @@ -62,8 +62,10 @@ async function attachChromeDebugger() { } export async function bootstrap(di: DiContainer) { + const initializeSentryReportingWith = di.inject(initializeSentryReportingWithInjectable); + if (process.isMainFrame) { - initializeSentryReporting(init); + initializeSentryReportingWith(init); } const startFrame = di.inject(startFrameInjectable); diff --git a/src/renderer/components/+preferences/preferences-navigation/telemetry-preferences-navigation-item.injectable.ts b/src/renderer/components/+preferences/preferences-navigation/telemetry-preferences-navigation-item.injectable.ts index 1f95c74a0d..6840c360cd 100644 --- a/src/renderer/components/+preferences/preferences-navigation/telemetry-preferences-navigation-item.injectable.ts +++ b/src/renderer/components/+preferences/preferences-navigation/telemetry-preferences-navigation-item.injectable.ts @@ -8,14 +8,14 @@ import routeIsActiveInjectable from "../../../routes/route-is-active.injectable" import { computed } from "mobx"; import telemetryPreferenceItemsInjectable from "../telemetry-preference-items.injectable"; import telemetryPreferencesRouteInjectable from "../../../../common/front-end-routing/routes/preferences/telemetry/telemetry-preferences-route.injectable"; -import sentryDnsUrlInjectable from "../sentry-dns-url.injectable"; +import sentryDataSourceNameInjectable from "../../../../common/vars/sentry-dsn-url.injectable"; import navigateToPreferenceTabInjectable from "./navigate-to-preference-tab.injectable"; const terminalPreferencesNavigationItemInjectable = getInjectable({ id: "telemetry-preferences-navigation-item", instantiate: (di) => { - const sentryDnsUrl = di.inject(sentryDnsUrlInjectable); + const sentryDataSourceName = di.inject(sentryDataSourceNameInjectable); const telemetryPreferenceItems = di.inject( telemetryPreferenceItemsInjectable, @@ -37,7 +37,7 @@ const terminalPreferencesNavigationItemInjectable = getInjectable({ isActive: routeIsActive, isVisible: computed( - () => !!sentryDnsUrl || telemetryPreferenceItems.get().length > 0, + () => !!sentryDataSourceName || telemetryPreferenceItems.get().length > 0, ), orderNumber: 60, diff --git a/src/renderer/components/+preferences/sentry-dns-url.injectable.ts b/src/renderer/components/+preferences/sentry-dns-url.injectable.ts deleted file mode 100644 index 5f337436fc..0000000000 --- a/src/renderer/components/+preferences/sentry-dns-url.injectable.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 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 { sentryDsn } from "../../../common/vars"; - -const sentryDnsUrlInjectable = getInjectable({ - id: "sentry-dns-url", - instantiate: () => sentryDsn, -}); - -export default sentryDnsUrlInjectable; diff --git a/src/renderer/components/+preferences/telemetry.tsx b/src/renderer/components/+preferences/telemetry.tsx index 26809ee2f2..6367042c61 100644 --- a/src/renderer/components/+preferences/telemetry.tsx +++ b/src/renderer/components/+preferences/telemetry.tsx @@ -12,7 +12,7 @@ import type { IComputedValue } from "mobx"; import { withInjectables } from "@ogre-tools/injectable-react"; import { Preferences } from "./preferences"; import telemetryPreferenceItemsInjectable from "./telemetry-preference-items.injectable"; -import sentryDnsUrlInjectable from "./sentry-dns-url.injectable"; +import sentryDataSourceNameInjectable from "../../../common/vars/sentry-dsn-url.injectable"; import userStoreInjectable from "../../../common/user-store/user-store.injectable"; import type { AppPreferenceRegistration } from "./app-preferences/app-preference-registration"; @@ -74,7 +74,7 @@ export const Telemetry = withInjectables( { getProps: (di) => ({ telemetryPreferenceItems: di.inject(telemetryPreferenceItemsInjectable), - sentryDnsUrl: di.inject(sentryDnsUrlInjectable), + sentryDnsUrl: di.inject(sentryDataSourceNameInjectable), userStore: di.inject(userStoreInjectable), }), }, diff --git a/src/renderer/components/+welcome/welcome.tsx b/src/renderer/components/+welcome/welcome.tsx index 4be617ae73..cf413748bc 100644 --- a/src/renderer/components/+welcome/welcome.tsx +++ b/src/renderer/components/+welcome/welcome.tsx @@ -10,12 +10,13 @@ import type { IComputedValue } from "mobx"; import type { CarouselProps } from "react-material-ui-carousel"; import LegacyCarousel from "react-material-ui-carousel"; import { Icon } from "../icon"; -import { productName, slackUrl } from "../../../common/vars"; +import { slackUrl } from "../../../common/vars"; import { withInjectables } from "@ogre-tools/injectable-react"; import welcomeMenuItemsInjectable from "./welcome-menu-items/welcome-menu-items.injectable"; import type { WelcomeMenuRegistration } from "./welcome-menu-items/welcome-menu-registration"; import welcomeBannerItemsInjectable from "./welcome-banner-items/welcome-banner-items.injectable"; import type { WelcomeBannerRegistration } from "./welcome-banner-items/welcome-banner-registration"; +import productNameInjectable from "../../../common/vars/product-name.injectable"; export const defaultWidth = 320; @@ -25,9 +26,14 @@ const Carousel = LegacyCarousel as React.ComponentType; interface Dependencies { welcomeMenuItems: IComputedValue; welcomeBannerItems: IComputedValue; + productName: string; } -const NonInjectedWelcome = observer(({ welcomeMenuItems, welcomeBannerItems }: Dependencies) => { +const NonInjectedWelcome = observer(({ + welcomeMenuItems, + welcomeBannerItems, + productName, +}: Dependencies) => { const welcomeBanners = welcomeBannerItems.get(); // if there is banner with specified width, use it to calculate the width of the container @@ -129,5 +135,6 @@ export const Welcome = withInjectables(NonInjectedWelcome, { getProps: (di) => ({ welcomeMenuItems: di.inject(welcomeMenuItemsInjectable), welcomeBannerItems: di.inject(welcomeBannerItemsInjectable), + productName: di.inject(productNameInjectable), }), }); diff --git a/src/renderer/components/cluster-settings/components/cluster-prometheus-setting.tsx b/src/renderer/components/cluster-settings/components/cluster-prometheus-setting.tsx index ad777248ad..c4f689bb58 100644 --- a/src/renderer/components/cluster-settings/components/cluster-prometheus-setting.tsx +++ b/src/renderer/components/cluster-settings/components/cluster-prometheus-setting.tsx @@ -11,10 +11,11 @@ import type { SelectOption } from "../../select"; import { Select } from "../../select"; import { Input } from "../../input"; import { observable, computed, autorun, makeObservable } from "mobx"; -import { productName } from "../../../../common/vars"; import type { MetricProviderInfo } from "../../../../common/k8s-api/endpoints/metrics.api"; import { metricsApi } from "../../../../common/k8s-api/endpoints/metrics.api"; import { Spinner } from "../../spinner"; +import { withInjectables } from "@ogre-tools/injectable-react"; +import productNameInjectable from "../../../../common/vars/product-name.injectable"; export interface ClusterPrometheusSettingProps { cluster: Cluster; @@ -24,8 +25,12 @@ const autoDetectPrometheus = Symbol("auto-detect-prometheus"); type ProviderValue = typeof autoDetectPrometheus | string; +interface Dependencies { + productName: string; +} + @observer -export class ClusterPrometheusSetting extends React.Component { +class NonInjectedClusterPrometheusSetting extends React.Component { @observable path = ""; @observable selectedOption: ProviderValue = autoDetectPrometheus; @observable loading = true; @@ -46,7 +51,7 @@ export class ClusterPrometheusSetting extends React.Component - {`An address to an existing Prometheus installation (/:). ${productName} tries to auto-detect address if left empty.`} + {`An address to an existing Prometheus installation (/:). ${this.props.productName} tries to auto-detect address if left empty.`} @@ -164,3 +169,10 @@ export class ClusterPrometheusSetting extends React.Component(NonInjectedClusterPrometheusSetting, { + getProps: (di, props) => ({ + ...props, + productName: di.inject(productNameInjectable), + }), +}); diff --git a/src/renderer/getDiForUnitTesting.tsx b/src/renderer/getDiForUnitTesting.tsx index 469de713b0..5d45d4d3e3 100644 --- a/src/renderer/getDiForUnitTesting.tsx +++ b/src/renderer/getDiForUnitTesting.tsx @@ -35,7 +35,6 @@ import apiManagerInjectable from "../common/k8s-api/api-manager/manager.injectab import setupOnApiErrorListenersInjectable from "./api/setup-on-api-errors.injectable"; import { observable, computed, runInAction } from "mobx"; import defaultShellInjectable from "./components/+preferences/default-shell.injectable"; -import appVersionInjectable from "../common/vars/app-version.injectable"; import requestAnimationFrameInjectable from "./components/animate/request-animation-frame.injectable"; import getRandomIdInjectable from "../common/utils/get-random-id.injectable"; import getFilePathsInjectable from "./components/+preferences/kubernetes/helm-charts/adding-of-custom-helm-repository/helm-file-input/get-file-paths.injectable"; @@ -114,8 +113,6 @@ export const getDiForUnitTesting = ( di.override(getAbsolutePathInjectable, () => getAbsolutePathFake); di.override(joinPathsInjectable, () => joinPathsFake); - di.override(appVersionInjectable, () => "1.0.0"); - di.override(historyInjectable, () => createMemoryHistory()); di.override(legacyOnChannelListenInjectable, () => () => noop); diff --git a/src/renderer/utils/prevDefault.ts b/src/renderer/utils/prevDefault.ts index 3706c04721..73bb834021 100644 --- a/src/renderer/utils/prevDefault.ts +++ b/src/renderer/utils/prevDefault.ts @@ -17,7 +17,7 @@ import type React from "react"; // console.log('stay on the page and open dialog'))}/> // -export function prevDefault(callback: (evt: E) => any) { +export function prevDefault(callback: (evt: E) => R): (event: E) => R { return function (evt: E) { evt.preventDefault(); evt.stopPropagation(); diff --git a/src/renderer/vars/build-version/build-version.injectable.ts b/src/renderer/vars/build-version/build-version.injectable.ts new file mode 100644 index 0000000000..a63a4102b0 --- /dev/null +++ b/src/renderer/vars/build-version/build-version.injectable.ts @@ -0,0 +1,19 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ +import { createInitializableState } from "../../../common/initializable-state/create"; +import { requestFromChannelInjectionToken } from "../../../common/utils/channel/request-from-channel-injection-token"; +import { buildVersionChannel, buildVersionInjectionToken } from "../../../common/vars/build-semantic-version.injectable"; + +const buildVersionInjectable = createInitializableState({ + id: "build-version", + init: (di) => { + const requestFromChannel = di.inject(requestFromChannelInjectionToken); + + return requestFromChannel(buildVersionChannel); + }, + injectionToken: buildVersionInjectionToken, +}); + +export default buildVersionInjectable; diff --git a/src/renderer/vars/build-version/init.injectable.ts b/src/renderer/vars/build-version/init.injectable.ts new file mode 100644 index 0000000000..0dc867f0ca --- /dev/null +++ b/src/renderer/vars/build-version/init.injectable.ts @@ -0,0 +1,21 @@ +/** + * 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 { beforeFrameStartsInjectionToken } from "../../before-frame-starts/before-frame-starts-injection-token"; +import buildVersionInjectable from "./build-version.injectable"; + +const initializeBuildVersionInjectable = getInjectable({ + id: "initialize-build-version", + instantiate: (di) => { + const buildVersion = di.inject(buildVersionInjectable); + + return { + run: () => buildVersion.init(), + }; + }, + injectionToken: beforeFrameStartsInjectionToken, +}); + +export default initializeBuildVersionInjectable; diff --git a/src/renderer/vars/default-update-channel/init.injectable.ts b/src/renderer/vars/default-update-channel/init.injectable.ts new file mode 100644 index 0000000000..fb737c766b --- /dev/null +++ b/src/renderer/vars/default-update-channel/init.injectable.ts @@ -0,0 +1,23 @@ +/** + * 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 defaultUpdateChannelInjectable from "../../../common/application-update/selected-update-channel/default-update-channel.injectable"; +import initSemanticBuildVersionInjectable from "../../../renderer/vars/semantic-build-version/init.injectable"; +import { beforeFrameStartsInjectionToken } from "../../before-frame-starts/before-frame-starts-injection-token"; + +const initDefaultUpdateChannelInjectableInjectable = getInjectable({ + id: "init-default-update-channel-injectable", + instantiate: (di) => { + const defaultUpdateChannel = di.inject(defaultUpdateChannelInjectable); + + return { + run: () => defaultUpdateChannel.init(), + runAfter: di.inject(initSemanticBuildVersionInjectable), + }; + }, + injectionToken: beforeFrameStartsInjectionToken, +}); + +export default initDefaultUpdateChannelInjectableInjectable; diff --git a/src/renderer/vars/semantic-build-version/init.injectable.ts b/src/renderer/vars/semantic-build-version/init.injectable.ts new file mode 100644 index 0000000000..572ccc63ac --- /dev/null +++ b/src/renderer/vars/semantic-build-version/init.injectable.ts @@ -0,0 +1,23 @@ +/** + * 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 buildSemanticVersionInjectable from "../../../common/vars/build-semantic-version.injectable"; +import { beforeFrameStartsInjectionToken } from "../../before-frame-starts/before-frame-starts-injection-token"; +import initializeBuildVersionInjectable from "../build-version/init.injectable"; + +const initSemanticBuildVersionInjectable = getInjectable({ + id: "init-semantic-build-version", + instantiate: (di) => { + const buildSemanticVersion = di.inject(buildSemanticVersionInjectable); + + return { + run: () => buildSemanticVersion.init(), + runAfter: di.inject(initializeBuildVersionInjectable), + }; + }, + injectionToken: beforeFrameStartsInjectionToken, +}); + +export default initSemanticBuildVersionInjectable; From 480899c0b62db1882bd749ead2a387364310c811 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Fri, 16 Sep 2022 08:32:33 -0400 Subject: [PATCH 027/280] Revert KubeJsonApi removal from extension api (#6260) --- src/extensions/common-api/k8s-api.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/extensions/common-api/k8s-api.ts b/src/extensions/common-api/k8s-api.ts index b09f977b1d..7fd25b08a1 100644 --- a/src/extensions/common-api/k8s-api.ts +++ b/src/extensions/common-api/k8s-api.ts @@ -35,6 +35,7 @@ export { } from "../../common/k8s-api/kube-object"; export { + KubeJsonApi, type KubeJsonApiData, } from "../../common/k8s-api/kube-json-api"; From 14e0af2d8f4835c5c19279945f1c9dc93659adf5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Sep 2022 09:17:37 -0400 Subject: [PATCH 028/280] Bump adr from 1.4.1 to 1.4.2 (#6261) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2bc0d9ff26..6138a6e520 100644 --- a/package.json +++ b/package.json @@ -366,7 +366,7 @@ "@types/webpack-node-externals": "^2.5.3", "@typescript-eslint/eslint-plugin": "^5.37.0", "@typescript-eslint/parser": "^5.37.0", - "adr": "^1.4.1", + "adr": "^1.4.2", "ansi_up": "^5.1.0", "chart.js": "^2.9.4", "circular-dependency-plugin": "^5.2.2", diff --git a/yarn.lock b/yarn.lock index 26eee35640..e5a7cf070e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3017,10 +3017,10 @@ acorn@^8.8.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== -adr@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/adr/-/adr-1.4.1.tgz#78fd4aaaa3fd7c739f3caf89fa30202a6230e855" - integrity sha512-WRgljcIOPkWqEWaDTTd4mKmhpiUbucrUmc+gmXyFg2gF2EiQefJhBK0hhEKSIE+Ga+lDhDdk94qROvmG7gCdAQ== +adr@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/adr/-/adr-1.4.2.tgz#61fae2edbe2c9d53b35aebcd6b159612075aaf3d" + integrity sha512-/ZYxh/y4na56zyY+1M+9CkKEpw8abWWrr2ZsixoifdUaFppMDO7NYUiFQSudE6TVnsf18SxjRHrDb9n7LY4slw== dependencies: colors "^1.3.3" commander "^5.1.0" From a52e7be27227074df407168a11db6a080ad3319c Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Fri, 16 Sep 2022 09:19:06 -0400 Subject: [PATCH 029/280] Fix typing issue with missing build.publish field (#6264) --- package.json | 3 +-- src/common/vars/application-information.injectable.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6138a6e520..841e302a61 100644 --- a/package.json +++ b/package.json @@ -208,8 +208,7 @@ "lens" ], "role": "Viewer" - }, - "publish": [] + } }, "resolutions": { "@astronautlabs/jsonpath/underscore": "^1.12.1" diff --git a/src/common/vars/application-information.injectable.ts b/src/common/vars/application-information.injectable.ts index f3a8c27321..559b15294b 100644 --- a/src/common/vars/application-information.injectable.ts +++ b/src/common/vars/application-information.injectable.ts @@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable"; import packageJson from "../../../package.json"; export type ApplicationInformation = Pick & { - build: Partial; + build: Partial & { publish?: unknown[] }; }; const applicationInformationInjectable = getInjectable({ From 45a6c4681eac284ee9d4e2a3c364c4077f5ee5bb Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Fri, 16 Sep 2022 14:48:20 -0400 Subject: [PATCH 030/280] Release 6.1.0-alpha.1 (#6268) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 841e302a61..bb23b25606 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "OpenLens", "description": "OpenLens - Open Source IDE for Kubernetes", "homepage": "https://github.com/lensapp/lens", - "version": "6.1.0-alpha.0", + "version": "6.1.0-alpha.1", "main": "static/build/main.js", "copyright": "© 2022 OpenLens Authors", "license": "MIT", From 02e03ac626fd253bc9130e625343aea9883fbf2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Sep 2022 15:07:01 -0400 Subject: [PATCH 031/280] Bump jose from 4.8.3 to 4.9.3 (#6266) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e5a7cf070e..5184d88236 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8017,9 +8017,9 @@ joi@^17.6.0: "@sideway/pinpoint" "^2.0.0" jose@^4.1.4: - version "4.8.3" - resolved "https://registry.yarnpkg.com/jose/-/jose-4.8.3.tgz#5a754fb4aa5f2806608d083f438e6916b11087da" - integrity sha512-7rySkpW78d8LBp4YU70Wb7+OTgE3OwAALNVZxhoIhp4Kscp+p/fBkdpxGAMKxvCAMV4QfXBU9m6l9nX/vGwd2g== + version "4.9.3" + resolved "https://registry.yarnpkg.com/jose/-/jose-4.9.3.tgz#890abd3f26725fe0f2aa720bc2f7835702b624db" + integrity sha512-f8E/z+T3Q0kA9txzH2DKvH/ds2uggcw0m3vVPSB9HrSkrQ7mojjifvS7aR8cw+lQl2Fcmx9npwaHpM/M3GD8UQ== joycon@^3.0.1: version "3.1.1" From dad6dcacda56d667a1b5825dbd9a1a2cae89d27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Mon, 19 Sep 2022 07:08:07 +0200 Subject: [PATCH 032/280] Download arm64 linux binaries (#6223) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan-Otto Kröpke Signed-off-by: Jan-Otto Kröpke --- build/download_binaries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/download_binaries.ts b/build/download_binaries.ts index ff26a8fb2b..4b8d38904c 100644 --- a/build/download_binaries.ts +++ b/build/download_binaries.ts @@ -194,7 +194,7 @@ async function main() { }, multiBar), ]; - if (normalizedPlatform === "darwin") { + if (normalizedPlatform !== "windows") { downloaders.push( new LensK8sProxyDownloader({ version: packageInfo.config.k8sProxyVersion, From 4c49134dbcc0b598e25c030616bf6e85de3ed159 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 20 Sep 2022 02:19:09 -0400 Subject: [PATCH 033/280] Fix crash on clean startup (#6276) * Convert ReleaseChannel into an InitializableState Signed-off-by: Sebastian Malton * Fix init timing for DefaultUpdateChannel Signed-off-by: Sebastian Malton * Make UserStore loading seperate from creation to fix initialization timing errors Signed-off-by: Sebastian Malton * Fix overrides of UserStore Signed-off-by: Sebastian Malton * Fix UserStore tests Signed-off-by: Sebastian Malton * Move userStoreFileMigration call to the init runnable Signed-off-by: Sebastian Malton * Add global override for userStoreFileMigratiom Signed-off-by: Sebastian Malton Signed-off-by: Sebastian Malton --- src/common/__tests__/user-store.test.ts | 12 ++++++- .../default-update-channel.injectable.ts | 2 +- .../initialize-sentry-reporting.injectable.ts | 4 +-- ...igration.global-override-for-injectable.ts | 9 ++++++ .../file-name-migration.injectable.ts | 31 +++++++++++-------- .../user-store/user-store.injectable.ts | 6 ---- src/common/user-store/user-store.ts | 1 - src/common/vars/release-channel.injectable.ts | 6 ++-- .../update-can-be-downgraded.injectable.ts | 2 +- src/main/getDiForUnitTesting.ts | 6 +++- src/main/stores/init-user-store.injectable.ts | 28 +++++++++++++++++ .../default-update-channel/init.injectable.ts | 4 +-- .../vars/release-channel/init.injectable.ts | 23 ++++++++++++++ src/renderer/bootstrap.tsx | 4 --- src/renderer/getDiForUnitTesting.tsx | 20 ++++++------ .../stores/init-user-store.injectable.ts | 23 ++++++++++++++ .../default-update-channel/init.injectable.ts | 4 +-- .../vars/release-channel/init.injectable.ts | 23 ++++++++++++++ 18 files changed, 159 insertions(+), 49 deletions(-) create mode 100644 src/common/user-store/file-name-migration.global-override-for-injectable.ts create mode 100644 src/main/stores/init-user-store.injectable.ts create mode 100644 src/main/vars/release-channel/init.injectable.ts create mode 100644 src/renderer/stores/init-user-store.injectable.ts create mode 100644 src/renderer/vars/release-channel/init.injectable.ts diff --git a/src/common/__tests__/user-store.test.ts b/src/common/__tests__/user-store.test.ts index e6fa7b4189..a90e03c75f 100644 --- a/src/common/__tests__/user-store.test.ts +++ b/src/common/__tests__/user-store.test.ts @@ -33,6 +33,8 @@ import writeFileInjectable from "../fs/write-file.injectable"; import { getDiForUnitTesting } from "../../main/getDiForUnitTesting"; import getConfigurationFileModelInjectable from "../get-configuration-file-model/get-configuration-file-model.injectable"; import storeMigrationVersionInjectable from "../vars/store-migration-version.injectable"; +import releaseChannelInjectable from "../vars/release-channel.injectable"; +import defaultUpdateChannelInjectable from "../application-update/selected-update-channel/default-update-channel.injectable"; console = new Console(stdout, stderr); @@ -40,7 +42,7 @@ describe("user store tests", () => { let userStore: UserStore; let di: DiContainer; - beforeEach(() => { + beforeEach(async () => { di = getDiForUnitTesting({ doGeneralOverrides: true }); mockFs(); @@ -50,6 +52,12 @@ describe("user store tests", () => { di.permitSideEffects(getConfigurationFileModelInjectable); di.permitSideEffects(userStoreInjectable); + di.override(releaseChannelInjectable, () => ({ + get: () => "latest" as const, + init: async () => {}, + })); + await di.inject(defaultUpdateChannelInjectable).init(); + di.unoverride(userStoreInjectable); }); @@ -62,6 +70,7 @@ describe("user store tests", () => { mockFs({ "some-directory-for-user-data": { "config.json": "{}", "kube_config": "{}" }}); userStore = di.inject(userStoreInjectable); + userStore.load(); }); it("allows setting and retrieving lastSeenAppVersion", () => { @@ -119,6 +128,7 @@ describe("user store tests", () => { di.override(storeMigrationVersionInjectable, () => "10.0.0"); userStore = di.inject(userStoreInjectable); + userStore.load(); }); it("sets last seen app version to 0.0.0", () => { diff --git a/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts b/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts index ff4fe32e4e..9c00efa204 100644 --- a/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts +++ b/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts @@ -8,7 +8,7 @@ import { updateChannels } from "../update-channels"; const defaultUpdateChannelInjectable = createInitializableState({ id: "default-update-channel", - init: (di) => updateChannels[di.inject(releaseChannelInjectable)], + init: (di) => updateChannels[di.inject(releaseChannelInjectable).get()], }); export default defaultUpdateChannelInjectable; diff --git a/src/common/error-reporting/initialize-sentry-reporting.injectable.ts b/src/common/error-reporting/initialize-sentry-reporting.injectable.ts index d34005f374..778f959739 100644 --- a/src/common/error-reporting/initialize-sentry-reporting.injectable.ts +++ b/src/common/error-reporting/initialize-sentry-reporting.injectable.ts @@ -20,6 +20,7 @@ const initializeSentryReportingWithInjectable = getInjectable({ instantiate: (di): InitializeSentryReportingWith => { const sentryDataSourceName = di.inject(sentryDataSourceNameInjectable); const isProduction = di.inject(isProductionInjectable); + const userStore = di.inject(userStoreInjectable); if (!sentryDataSourceName) { return () => {}; @@ -27,9 +28,6 @@ const initializeSentryReportingWithInjectable = getInjectable({ return (initSentry) => initSentry({ beforeSend: (event) => { - // TODO: remove loading from userStoreInjectable so that this can be moved out - const userStore = di.inject(userStoreInjectable); - if (userStore.allowErrorReporting) { return event; } diff --git a/src/common/user-store/file-name-migration.global-override-for-injectable.ts b/src/common/user-store/file-name-migration.global-override-for-injectable.ts new file mode 100644 index 0000000000..bb0ac054f3 --- /dev/null +++ b/src/common/user-store/file-name-migration.global-override-for-injectable.ts @@ -0,0 +1,9 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +import { getGlobalOverride } from "../test-utils/get-global-override"; +import userStoreFileNameMigrationInjectable from "./file-name-migration.injectable"; + +export default getGlobalOverride(userStoreFileNameMigrationInjectable, () => async () => {}); diff --git a/src/common/user-store/file-name-migration.injectable.ts b/src/common/user-store/file-name-migration.injectable.ts index 8f2dcf1e23..caf94dc491 100644 --- a/src/common/user-store/file-name-migration.injectable.ts +++ b/src/common/user-store/file-name-migration.injectable.ts @@ -9,27 +9,32 @@ import directoryForUserDataInjectable from "../app-paths/directory-for-user-data import { isErrnoException } from "../utils"; import { getInjectable } from "@ogre-tools/injectable"; +export type UserStoreFileNameMigration = () => Promise; + const userStoreFileNameMigrationInjectable = getInjectable({ id: "user-store-file-name-migration", - instantiate: (di) => { + instantiate: (di): UserStoreFileNameMigration => { const userDataPath = di.inject(directoryForUserDataInjectable); const configJsonPath = path.join(userDataPath, "config.json"); const lensUserStoreJsonPath = path.join(userDataPath, "lens-user-store.json"); - try { - fse.moveSync(configJsonPath, lensUserStoreJsonPath); - } catch (error) { - if (error instanceof Error && error.message === "dest already exists.") { - fse.removeSync(configJsonPath); - } else if (isErrnoException(error) && error.code === "ENOENT" && error.path === configJsonPath) { - // (No such file or directory) - return; // file already moved - } else { - // pass other errors along - throw error; + return async () => { + try { + await fse.move(configJsonPath, lensUserStoreJsonPath); + } catch (error) { + if (error instanceof Error && error.message === "dest already exists.") { + await fse.remove(configJsonPath); + } else if (isErrnoException(error) && error.code === "ENOENT" && error.path === configJsonPath) { + // (No such file or directory) + return; // file already moved + } else { + // pass other errors along + throw error; + } } - } + }; }, + causesSideEffects: true, }); export default userStoreFileNameMigrationInjectable; diff --git a/src/common/user-store/user-store.injectable.ts b/src/common/user-store/user-store.injectable.ts index 3b4aba0b56..ffd2310886 100644 --- a/src/common/user-store/user-store.injectable.ts +++ b/src/common/user-store/user-store.injectable.ts @@ -3,8 +3,6 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { ipcMain } from "electron"; -import userStoreFileNameMigrationInjectable from "./file-name-migration.injectable"; import { UserStore } from "./user-store"; import selectedUpdateChannelInjectable from "../application-update/selected-update-channel/selected-update-channel.injectable"; @@ -14,10 +12,6 @@ const userStoreInjectable = getInjectable({ instantiate: (di) => { UserStore.resetInstance(); - if (ipcMain) { - di.inject(userStoreFileNameMigrationInjectable); - } - return UserStore.createInstance({ selectedUpdateChannel: di.inject(selectedUpdateChannelInjectable), }); diff --git a/src/common/user-store/user-store.ts b/src/common/user-store/user-store.ts index 7457548436..6c995996bf 100644 --- a/src/common/user-store/user-store.ts +++ b/src/common/user-store/user-store.ts @@ -34,7 +34,6 @@ export class UserStore extends BaseStore /* implements UserStore }); makeObservable(this); - this.load(); } @observable lastSeenAppVersion = "0.0.0"; diff --git a/src/common/vars/release-channel.injectable.ts b/src/common/vars/release-channel.injectable.ts index 33dd26432a..d8275ff1cb 100644 --- a/src/common/vars/release-channel.injectable.ts +++ b/src/common/vars/release-channel.injectable.ts @@ -2,13 +2,13 @@ * 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 type { ReleaseChannel } from "../application-update/update-channels"; +import { createInitializableState } from "../initializable-state/create"; import buildSemanticVersionInjectable from "./build-semantic-version.injectable"; -const releaseChannelInjectable = getInjectable({ +const releaseChannelInjectable = createInitializableState({ id: "release-channel", - instantiate: (di): ReleaseChannel => { + init: (di): ReleaseChannel => { const buildSemanticVersion = di.inject(buildSemanticVersionInjectable); const currentReleaseChannel = buildSemanticVersion.get().prerelease[0]; diff --git a/src/main/application-update/check-for-updates/update-can-be-downgraded.injectable.ts b/src/main/application-update/check-for-updates/update-can-be-downgraded.injectable.ts index aa8fb1b131..b5bdfe2cba 100644 --- a/src/main/application-update/check-for-updates/update-can-be-downgraded.injectable.ts +++ b/src/main/application-update/check-for-updates/update-can-be-downgraded.injectable.ts @@ -16,7 +16,7 @@ const updateCanBeDowngradedInjectable = getInjectable({ return computed(() => ( selectedUpdateChannel.value.get().id === "latest" - && releaseChannel !== "latest" + && releaseChannel.get() !== "latest" )); }, }); diff --git a/src/main/getDiForUnitTesting.ts b/src/main/getDiForUnitTesting.ts index 579e5eafec..8e08c9b86c 100644 --- a/src/main/getDiForUnitTesting.ts +++ b/src/main/getDiForUnitTesting.ts @@ -132,7 +132,11 @@ export function getDiForUnitTesting(opts: { doGeneralOverrides?: boolean } = {}) getDisplayIndex: () => "0", }) as unknown as HotbarStore); - di.override(userStoreInjectable, () => ({ startMainReactions: () => {}, extensionRegistryUrl: { customUrl: "some-custom-url" }}) as UserStore); + di.override(userStoreInjectable, () => ({ + startMainReactions: () => {}, + extensionRegistryUrl: { customUrl: "some-custom-url" }, + load: () => {}, + }) as Partial as UserStore); di.override(extensionsStoreInjectable, () => ({ isEnabled: (opts) => (void opts, false) }) as ExtensionsStore); di.override(fileSystemProvisionerStoreInjectable, () => ({}) as FileSystemProvisionerStore); diff --git a/src/main/stores/init-user-store.injectable.ts b/src/main/stores/init-user-store.injectable.ts new file mode 100644 index 0000000000..572c0154e4 --- /dev/null +++ b/src/main/stores/init-user-store.injectable.ts @@ -0,0 +1,28 @@ +/** + * 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 userStoreFileNameMigrationInjectable from "../../common/user-store/file-name-migration.injectable"; +import userStoreInjectable from "../../common/user-store/user-store.injectable"; +import { beforeApplicationIsLoadingInjectionToken } from "../start-main-application/runnable-tokens/before-application-is-loading-injection-token"; +import initDefaultUpdateChannelInjectableInjectable from "../vars/default-update-channel/init.injectable"; + +const initUserStoreInjectable = getInjectable({ + id: "init-user-store", + instantiate: (di) => { + const userStore = di.inject(userStoreInjectable); + const userStoreFileNameMigration = di.inject(userStoreFileNameMigrationInjectable); + + return { + run: async () => { + await userStoreFileNameMigration(); + userStore.load(); + }, + runAfter: di.inject(initDefaultUpdateChannelInjectableInjectable), + }; + }, + injectionToken: beforeApplicationIsLoadingInjectionToken, +}); + +export default initUserStoreInjectable; diff --git a/src/main/vars/default-update-channel/init.injectable.ts b/src/main/vars/default-update-channel/init.injectable.ts index e63b12bac1..e1680efa39 100644 --- a/src/main/vars/default-update-channel/init.injectable.ts +++ b/src/main/vars/default-update-channel/init.injectable.ts @@ -4,8 +4,8 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import defaultUpdateChannelInjectable from "../../../common/application-update/selected-update-channel/default-update-channel.injectable"; -import initSemanticBuildVersionInjectable from "../../../renderer/vars/semantic-build-version/init.injectable"; import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/before-application-is-loading-injection-token"; +import initReleaseChannelInjectable from "../release-channel/init.injectable"; const initDefaultUpdateChannelInjectableInjectable = getInjectable({ id: "init-default-update-channel-injectable", @@ -14,7 +14,7 @@ const initDefaultUpdateChannelInjectableInjectable = getInjectable({ return { run: () => defaultUpdateChannel.init(), - runAfter: di.inject(initSemanticBuildVersionInjectable), + runAfter: di.inject(initReleaseChannelInjectable), }; }, injectionToken: beforeApplicationIsLoadingInjectionToken, diff --git a/src/main/vars/release-channel/init.injectable.ts b/src/main/vars/release-channel/init.injectable.ts new file mode 100644 index 0000000000..ed358af550 --- /dev/null +++ b/src/main/vars/release-channel/init.injectable.ts @@ -0,0 +1,23 @@ +/** + * 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 releaseChannelInjectable from "../../../common/vars/release-channel.injectable"; +import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/before-application-is-loading-injection-token"; +import initSemanticBuildVersionInjectable from "../semantic-build-version/init.injectable"; + +const initReleaseChannelInjectable = getInjectable({ + id: "init-release-channel", + instantiate: (di) => { + const releaseChannel = di.inject(releaseChannelInjectable); + + return { + run: () => releaseChannel.init(), + runAfter: di.inject(initSemanticBuildVersionInjectable), + }; + }, + injectionToken: beforeApplicationIsLoadingInjectionToken, +}); + +export default initReleaseChannelInjectable; diff --git a/src/renderer/bootstrap.tsx b/src/renderer/bootstrap.tsx index 2ebd849805..53e2913583 100644 --- a/src/renderer/bootstrap.tsx +++ b/src/renderer/bootstrap.tsx @@ -28,7 +28,6 @@ import extensionLoaderInjectable from "../extensions/extension-loader/extension- import extensionDiscoveryInjectable from "../extensions/extension-discovery/extension-discovery.injectable"; import extensionInstallationStateStoreInjectable from "../extensions/extension-installation-state-store/extension-installation-state-store.injectable"; import clusterStoreInjectable from "../common/cluster-store/cluster-store.injectable"; -import userStoreInjectable from "../common/user-store/user-store.injectable"; import initRootFrameInjectable from "./frames/root-frame/init-root-frame/init-root-frame.injectable"; import initClusterFrameInjectable from "./frames/cluster-frame/init-cluster-frame/init-cluster-frame.injectable"; import commandOverlayInjectable from "./components/command-palette/command-overlay.injectable"; @@ -92,9 +91,6 @@ export async function bootstrap(di: DiContainer) { */ di.inject(autoRegistrationInjectable); - // TODO: Remove temporal dependencies to make timing of initialization not important - di.inject(userStoreInjectable); - await attachChromeDebugger(); rootElem.classList.toggle("is-mac", isMac); diff --git a/src/renderer/getDiForUnitTesting.tsx b/src/renderer/getDiForUnitTesting.tsx index 5d45d4d3e3..58b17b7eaf 100644 --- a/src/renderer/getDiForUnitTesting.tsx +++ b/src/renderer/getDiForUnitTesting.tsx @@ -66,6 +66,7 @@ import legacyOnChannelListenInjectable from "./ipc/legacy-channel-listen.injecta import getEntitySettingCommandsInjectable from "./components/command-palette/registered-commands/get-entity-setting-commands.injectable"; import storageSaveDelayInjectable from "./utils/create-storage/storage-save-delay.injectable"; import type { GlobalOverride } from "../common/test-utils/get-global-override"; +import type { PartialDeep } from "type-fest"; export const getDiForUnitTesting = ( opts: { doGeneralOverrides?: boolean } = {}, @@ -184,17 +185,14 @@ export const getDiForUnitTesting = ( di.override(defaultShellInjectable, () => "some-default-shell"); - di.override( - userStoreInjectable, - () => - ({ - isTableColumnHidden: () => false, - extensionRegistryUrl: { customUrl: "some-custom-url" }, - syncKubeconfigEntries: observable.map(), - terminalConfig: { fontSize: 42 }, - editorConfiguration: { minimap: {}, tabSize: 42, fontSize: 42 }, - } as unknown as UserStore), - ); + di.override(userStoreInjectable, () => ({ + isTableColumnHidden: () => false, + extensionRegistryUrl: { customUrl: "some-custom-url" }, + syncKubeconfigEntries: observable.map(), + terminalConfig: { fontSize: 42 }, + editorConfiguration: { minimap: {}, tabSize: 42, fontSize: 42 }, + load: () => {}, + } as PartialDeep as UserStore)); di.override(apiManagerInjectable, () => new ApiManager()); diff --git a/src/renderer/stores/init-user-store.injectable.ts b/src/renderer/stores/init-user-store.injectable.ts new file mode 100644 index 0000000000..36f2caf015 --- /dev/null +++ b/src/renderer/stores/init-user-store.injectable.ts @@ -0,0 +1,23 @@ +/** + * 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 userStoreInjectable from "../../common/user-store/user-store.injectable"; +import { beforeFrameStartsInjectionToken } from "../before-frame-starts/before-frame-starts-injection-token"; +import initDefaultUpdateChannelInjectableInjectable from "../vars/default-update-channel/init.injectable"; + +const initUserStoreInjectable = getInjectable({ + id: "init-user-store", + instantiate: (di) => { + const userStore = di.inject(userStoreInjectable); + + return { + run: () => userStore.load(), + runAfter: di.inject(initDefaultUpdateChannelInjectableInjectable), + }; + }, + injectionToken: beforeFrameStartsInjectionToken, +}); + +export default initUserStoreInjectable; diff --git a/src/renderer/vars/default-update-channel/init.injectable.ts b/src/renderer/vars/default-update-channel/init.injectable.ts index fb737c766b..e486be0aaf 100644 --- a/src/renderer/vars/default-update-channel/init.injectable.ts +++ b/src/renderer/vars/default-update-channel/init.injectable.ts @@ -4,8 +4,8 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import defaultUpdateChannelInjectable from "../../../common/application-update/selected-update-channel/default-update-channel.injectable"; -import initSemanticBuildVersionInjectable from "../../../renderer/vars/semantic-build-version/init.injectable"; import { beforeFrameStartsInjectionToken } from "../../before-frame-starts/before-frame-starts-injection-token"; +import initReleaseChannelInjectable from "../release-channel/init.injectable"; const initDefaultUpdateChannelInjectableInjectable = getInjectable({ id: "init-default-update-channel-injectable", @@ -14,7 +14,7 @@ const initDefaultUpdateChannelInjectableInjectable = getInjectable({ return { run: () => defaultUpdateChannel.init(), - runAfter: di.inject(initSemanticBuildVersionInjectable), + runAfter: di.inject(initReleaseChannelInjectable), }; }, injectionToken: beforeFrameStartsInjectionToken, diff --git a/src/renderer/vars/release-channel/init.injectable.ts b/src/renderer/vars/release-channel/init.injectable.ts new file mode 100644 index 0000000000..f384fd2716 --- /dev/null +++ b/src/renderer/vars/release-channel/init.injectable.ts @@ -0,0 +1,23 @@ +/** + * 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 releaseChannelInjectable from "../../../common/vars/release-channel.injectable"; +import { beforeFrameStartsInjectionToken } from "../../before-frame-starts/before-frame-starts-injection-token"; +import initSemanticBuildVersionInjectable from "../semantic-build-version/init.injectable"; + +const initReleaseChannelInjectable = getInjectable({ + id: "init-release-channel", + instantiate: (di) => { + const releaseChannel = di.inject(releaseChannelInjectable); + + return { + run: () => releaseChannel.init(), + runAfter: di.inject(initSemanticBuildVersionInjectable), + }; + }, + injectionToken: beforeFrameStartsInjectionToken, +}); + +export default initReleaseChannelInjectable; From 2e437c34c7ece6a95ab4906eadfd27d152ada112 Mon Sep 17 00:00:00 2001 From: Lauri Nevala Date: Tue, 20 Sep 2022 10:27:30 +0300 Subject: [PATCH 034/280] Release 6.1.0 (#6275) Signed-off-by: Lauri Nevala Signed-off-by: Lauri Nevala --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bb23b25606..48260cdfff 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "OpenLens", "description": "OpenLens - Open Source IDE for Kubernetes", "homepage": "https://github.com/lensapp/lens", - "version": "6.1.0-alpha.1", + "version": "6.1.0", "main": "static/build/main.js", "copyright": "© 2022 OpenLens Authors", "license": "MIT", From 333517eaa0b4f73e01aec5844be9a061817ffe2d Mon Sep 17 00:00:00 2001 From: Juho Heikka Date: Wed, 21 Sep 2022 15:49:18 +0300 Subject: [PATCH 035/280] Remove telemetry from resource tab (#6284) --- .../telemetry-white-list-for-functions.injectable.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/features/telemetry/renderer/telemetry-white-list-for-functions.injectable.ts b/src/features/telemetry/renderer/telemetry-white-list-for-functions.injectable.ts index 00c6dcf03b..7520fbe084 100644 --- a/src/features/telemetry/renderer/telemetry-white-list-for-functions.injectable.ts +++ b/src/features/telemetry/renderer/telemetry-white-list-for-functions.injectable.ts @@ -104,11 +104,6 @@ const logs = [ "get-logs", ]; -const resourceEditor = [ - "create-edit-resource-tab", - "clear-edit-resource-tab", -]; - const telemetryWhiteListForFunctionsInjectable = getInjectable({ id: "telemetry-white-list-for-functions", instantiate: () => [ @@ -120,7 +115,6 @@ const telemetryWhiteListForFunctionsInjectable = getInjectable({ ...uiInteraction, ...terminal, ...logs, - ...resourceEditor, ], decorable: false, }); From f594f961c646d56617adf872a0cb2091af75f788 Mon Sep 17 00:00:00 2001 From: Panu Horsmalahti Date: Wed, 28 Sep 2022 13:42:38 +0300 Subject: [PATCH 036/280] Fix Singleton type in exports. (#6291) Signed-off-by: Panu Horsmalahti Signed-off-by: Panu Horsmalahti --- src/extensions/common-api/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/common-api/utils.ts b/src/extensions/common-api/utils.ts index 12c9daf988..a6dfdee447 100644 --- a/src/extensions/common-api/utils.ts +++ b/src/extensions/common-api/utils.ts @@ -13,7 +13,7 @@ import type { IClassName } from "../../renderer/utils/cssNames"; import { cssNames } from "../../renderer/utils/cssNames"; export interface UtilsExtensionItems { - Singleton: Singleton; + Singleton: typeof Singleton; prevDefault: (callback: (evt: E) => R) => (evt: E) => R; stopPropagation: (evt: Event | React.SyntheticEvent) => void; cssNames: (...classNames: IClassName[]) => string; From e8f691ab0e54b5a9d178fdbcc4e3e0848b550bf5 Mon Sep 17 00:00:00 2001 From: Juho Heikka Date: Thu, 29 Sep 2022 10:48:22 +0200 Subject: [PATCH 037/280] Remove get-logs telemetry event (#6296) Signed-off-by: Juho Heikka Signed-off-by: Juho Heikka --- .../telemetry-white-list-for-functions.injectable.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/features/telemetry/renderer/telemetry-white-list-for-functions.injectable.ts b/src/features/telemetry/renderer/telemetry-white-list-for-functions.injectable.ts index 7520fbe084..38f0bb6ca6 100644 --- a/src/features/telemetry/renderer/telemetry-white-list-for-functions.injectable.ts +++ b/src/features/telemetry/renderer/telemetry-white-list-for-functions.injectable.ts @@ -100,10 +100,6 @@ const terminal = [ "create-terminal-tab", ]; -const logs = [ - "get-logs", -]; - const telemetryWhiteListForFunctionsInjectable = getInjectable({ id: "telemetry-white-list-for-functions", instantiate: () => [ @@ -114,7 +110,6 @@ const telemetryWhiteListForFunctionsInjectable = getInjectable({ ...externalActions, ...uiInteraction, ...terminal, - ...logs, ], decorable: false, }); From e763786d4b71fed9822099be862bdf4ac50d8d05 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 08:11:16 -0400 Subject: [PATCH 038/280] Bump esbuild from 0.15.7 to 0.15.10 (#6300) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 224 ++++++++++++++++++++++++++------------------------- 2 files changed, 116 insertions(+), 110 deletions(-) diff --git a/package.json b/package.json index 48260cdfff..aa31560b0c 100644 --- a/package.json +++ b/package.json @@ -379,7 +379,7 @@ "electron": "^19.0.17", "electron-builder": "^23.3.3", "electron-notarize": "^0.3.0", - "esbuild": "^0.15.7", + "esbuild": "^0.15.10", "esbuild-loader": "^2.20.0", "eslint": "^8.23.1", "eslint-plugin-header": "^3.1.1", diff --git a/yarn.lock b/yarn.lock index 5184d88236..797ada9be1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -598,10 +598,15 @@ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz#8eed982e2ee6f7f4e44c253e12962980791efd46" integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA== -"@esbuild/linux-loong64@0.15.7": - version "0.15.7" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.15.7.tgz#1ec4af4a16c554cbd402cc557ccdd874e3f7be53" - integrity sha512-IKznSJOsVUuyt7cDzzSZyqBEcZe+7WlBqTVXiF1OXP/4Nm387ToaXZ0fyLwI1iBlI/bzpxVq411QE2/Bt2XWWw== +"@esbuild/android-arm@0.15.10": + version "0.15.10" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.15.10.tgz#a5f9432eb221afc243c321058ef25fe899886892" + integrity sha512-FNONeQPy/ox+5NBkcSbYJxoXj9GWu8gVGJTVmUyoOCKQFDTrHVKgNSzChdNt0I8Aj/iKcsDf2r9BFwv+FSNUXg== + +"@esbuild/linux-loong64@0.15.10": + version "0.15.10" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.15.10.tgz#78a42897c2cf8db9fd5f1811f7590393b77774c7" + integrity sha512-w0Ou3Z83LOYEkwaui2M8VwIp+nLi/NA60lBLMvaJ+vXVMcsARYdEzLNE7RSm4+lSg4zq4d7fAVuzk7PNQ5JFgg== "@eslint/eslintrc@^1.3.2": version "1.3.2" @@ -5414,75 +5419,75 @@ es6-error@^4.1.1: resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== -esbuild-android-64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.15.7.tgz#a521604d8c4c6befc7affedc897df8ccde189bea" - integrity sha512-p7rCvdsldhxQr3YHxptf1Jcd86dlhvc3EQmQJaZzzuAxefO9PvcI0GLOa5nCWem1AJ8iMRu9w0r5TG8pHmbi9w== +esbuild-android-64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.15.10.tgz#8a59a84acbf2eca96996cadc35642cf055c494f0" + integrity sha512-UI7krF8OYO1N7JYTgLT9ML5j4+45ra3amLZKx7LO3lmLt1Ibn8t3aZbX5Pu4BjWiqDuJ3m/hsvhPhK/5Y/YpnA== -esbuild-android-arm64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.15.7.tgz#307b81f1088bf1e81dfe5f3d1d63a2d2a2e3e68e" - integrity sha512-L775l9ynJT7rVqRM5vo+9w5g2ysbOCfsdLV4CWanTZ1k/9Jb3IYlQ06VCI1edhcosTYJRECQFJa3eAvkx72eyQ== +esbuild-android-arm64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.15.10.tgz#f453851dc1d8c5409a38cf7613a33852faf4915d" + integrity sha512-EOt55D6xBk5O05AK8brXUbZmoFj4chM8u3riGflLa6ziEoVvNjRdD7Cnp82NHQGfSHgYR06XsPI8/sMuA/cUwg== -esbuild-darwin-64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.15.7.tgz#270117b0c4ec6bcbc5cf3a297a7d11954f007e11" - integrity sha512-KGPt3r1c9ww009t2xLB6Vk0YyNOXh7hbjZ3EecHoVDxgtbUlYstMPDaReimKe6eOEfyY4hBEEeTvKwPsiH5WZg== +esbuild-darwin-64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.15.10.tgz#778bd29c8186ff47b176c8af58c08cf0fb8e6b86" + integrity sha512-hbDJugTicqIm+WKZgp208d7FcXcaK8j2c0l+fqSJ3d2AzQAfjEYDRM3Z2oMeqSJ9uFxyj/muSACLdix7oTstRA== -esbuild-darwin-arm64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.7.tgz#97851eacd11dacb7719713602e3319e16202fc77" - integrity sha512-kBIHvtVqbSGajN88lYMnR3aIleH3ABZLLFLxwL2stiuIGAjGlQW741NxVTpUHQXUmPzxi6POqc9npkXa8AcSZQ== +esbuild-darwin-arm64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.10.tgz#b30bbefb46dc3c5d4708b0435e52f6456578d6df" + integrity sha512-M1t5+Kj4IgSbYmunf2BB6EKLkWUq+XlqaFRiGOk8bmBapu9bCDrxjf4kUnWn59Dka3I27EiuHBKd1rSO4osLFQ== -esbuild-freebsd-64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.7.tgz#1de15ffaf5ae916aa925800aa6d02579960dd8c4" - integrity sha512-hESZB91qDLV5MEwNxzMxPfbjAhOmtfsr9Wnuci7pY6TtEh4UDuevmGmkUIjX/b+e/k4tcNBMf7SRQ2mdNuK/HQ== +esbuild-freebsd-64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.10.tgz#ab301c5f6ded5110dbdd611140bef1a7c2e99236" + integrity sha512-KMBFMa7C8oc97nqDdoZwtDBX7gfpolkk6Bcmj6YFMrtCMVgoU/x2DI1p74DmYl7CSS6Ppa3xgemrLrr5IjIn0w== -esbuild-freebsd-arm64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.7.tgz#0f160dbf5c9a31a1d8dd87acbbcb1a04b7031594" - integrity sha512-dLFR0ChH5t+b3J8w0fVKGvtwSLWCv7GYT2Y2jFGulF1L5HftQLzVGN+6pi1SivuiVSmTh28FwUhi9PwQicXI6Q== +esbuild-freebsd-arm64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.10.tgz#a5b09b867a6ff49110f52343b6f12265db63d43f" + integrity sha512-m2KNbuCX13yQqLlbSojFMHpewbn8wW5uDS6DxRpmaZKzyq8Dbsku6hHvh2U+BcLwWY4mpgXzFUoENEf7IcioGg== -esbuild-linux-32@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.15.7.tgz#422eb853370a5e40bdce8b39525380de11ccadec" - integrity sha512-v3gT/LsONGUZcjbt2swrMjwxo32NJzk+7sAgtxhGx1+ZmOFaTRXBAi1PPfgpeo/J//Un2jIKm/I+qqeo4caJvg== +esbuild-linux-32@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.15.10.tgz#5282fe9915641caf9c8070e4ba2c3e16d358f837" + integrity sha512-guXrwSYFAvNkuQ39FNeV4sNkNms1bLlA5vF1H0cazZBOLdLFIny6BhT+TUbK/hdByMQhtWQ5jI9VAmPKbVPu1w== -esbuild-linux-64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.15.7.tgz#f89c468453bb3194b14f19dc32e0b99612e81d2b" - integrity sha512-LxXEfLAKwOVmm1yecpMmWERBshl+Kv5YJ/1KnyAr6HRHFW8cxOEsEfisD3sVl/RvHyW//lhYUVSuy9jGEfIRAQ== +esbuild-linux-64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.15.10.tgz#f3726e85a00149580cb19f8abfabcbb96f5d52bb" + integrity sha512-jd8XfaSJeucMpD63YNMO1JCrdJhckHWcMv6O233bL4l6ogQKQOxBYSRP/XLWP+6kVTu0obXovuckJDcA0DKtQA== -esbuild-linux-arm64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.7.tgz#68a79d6eb5e032efb9168a0f340ccfd33d6350a1" - integrity sha512-P3cfhudpzWDkglutWgXcT2S7Ft7o2e3YDMrP1n0z2dlbUZghUkKCyaWw0zhp4KxEEzt/E7lmrtRu/pGWnwb9vw== +esbuild-linux-arm64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.10.tgz#2f0056e9d5286edb0185b56655caa8c574d8dbe7" + integrity sha512-GByBi4fgkvZFTHFDYNftu1DQ1GzR23jws0oWyCfhnI7eMOe+wgwWrc78dbNk709Ivdr/evefm2PJiUBMiusS1A== -esbuild-linux-arm@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.15.7.tgz#2b7c784d0b3339878013dfa82bf5eaf82c7ce7d3" - integrity sha512-JKgAHtMR5f75wJTeuNQbyznZZa+pjiUHV7sRZp42UNdyXC6TiUYMW/8z8yIBAr2Fpad8hM1royZKQisqPABPvQ== +esbuild-linux-arm@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.15.10.tgz#40a9270da3c8ffa32cf72e24a79883e323dff08d" + integrity sha512-6N8vThLL/Lysy9y4Ex8XoLQAlbZKUyExCWyayGi2KgTBelKpPgj6RZnUaKri0dHNPGgReJriKVU6+KDGQwn10A== -esbuild-linux-mips64le@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.7.tgz#bb8330a50b14aa84673816cb63cc6c8b9beb62cc" - integrity sha512-T7XKuxl0VpeFLCJXub6U+iybiqh0kM/bWOTb4qcPyDDwNVhLUiPcGdG2/0S7F93czUZOKP57YiLV8YQewgLHKw== +esbuild-linux-mips64le@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.10.tgz#90ce1c4ee0202edb4ac69807dea77f7e5804abc4" + integrity sha512-BxP+LbaGVGIdQNJUNF7qpYjEGWb0YyHVSKqYKrn+pTwH/SiHUxFyJYSP3pqkku61olQiSBnSmWZ+YUpj78Tw7Q== -esbuild-linux-ppc64le@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.7.tgz#52544e7fa992811eb996674090d0bc41f067a14b" - integrity sha512-6mGuC19WpFN7NYbecMIJjeQgvDb5aMuvyk0PDYBJrqAEMkTwg3Z98kEKuCm6THHRnrgsdr7bp4SruSAxEM4eJw== +esbuild-linux-ppc64le@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.10.tgz#782837ae7bd5b279178106c9dd801755a21fabdf" + integrity sha512-LoSQCd6498PmninNgqd/BR7z3Bsk/mabImBWuQ4wQgmQEeanzWd5BQU2aNi9mBURCLgyheuZS6Xhrw5luw3OkQ== -esbuild-linux-riscv64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.7.tgz#a43ae60697992b957e454cbb622f7ee5297e8159" - integrity sha512-uUJsezbswAYo/X7OU/P+PuL/EI9WzxsEQXDekfwpQ23uGiooxqoLFAPmXPcRAt941vjlY9jtITEEikWMBr+F/g== +esbuild-linux-riscv64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.10.tgz#d7420d806ece5174f24f4634303146f915ab4207" + integrity sha512-Lrl9Cr2YROvPV4wmZ1/g48httE8z/5SCiXIyebiB5N8VT7pX3t6meI7TQVHw/wQpqP/AF4SksDuFImPTM7Z32Q== -esbuild-linux-s390x@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.7.tgz#8c76a125dd10a84c166294d77416caaf5e1c7b64" - integrity sha512-+tO+xOyTNMc34rXlSxK7aCwJgvQyffqEM5MMdNDEeMU3ss0S6wKvbBOQfgd5jRPblfwJ6b+bKiz0g5nABpY0QQ== +esbuild-linux-s390x@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.10.tgz#21fdf0cb3494a7fb520a71934e4dffce67fe47be" + integrity sha512-ReP+6q3eLVVP2lpRrvl5EodKX7EZ1bS1/z5j6hsluAlZP5aHhk6ghT6Cq3IANvvDdscMMCB4QEbI+AjtvoOFpA== esbuild-loader@^2.20.0: version "2.20.0" @@ -5496,62 +5501,63 @@ esbuild-loader@^2.20.0: tapable "^2.2.0" webpack-sources "^2.2.0" -esbuild-netbsd-64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.7.tgz#19b2e75449d7d9c32b5d8a222bac2f1e0c3b08fd" - integrity sha512-yVc4Wz+Pu3cP5hzm5kIygNPrjar/v5WCSoRmIjCPWfBVJkZNb5brEGKUlf+0Y759D48BCWa0WHrWXaNy0DULTQ== +esbuild-netbsd-64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.10.tgz#6c06b3107e3df53de381e6299184d4597db0440f" + integrity sha512-iGDYtJCMCqldMskQ4eIV+QSS/CuT7xyy9i2/FjpKvxAuCzrESZXiA1L64YNj6/afuzfBe9i8m/uDkFHy257hTw== -esbuild-openbsd-64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.7.tgz#1357b2bf72fd037d9150e751420a1fe4c8618ad7" - integrity sha512-GsimbwC4FSR4lN3wf8XmTQ+r8/0YSQo21rWDL0XFFhLHKlzEA4SsT1Tl8bPYu00IU6UWSJ+b3fG/8SB69rcuEQ== +esbuild-openbsd-64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.10.tgz#4daef5f5d8e74bbda53b65160029445d582570cf" + integrity sha512-ftMMIwHWrnrYnvuJQRJs/Smlcb28F9ICGde/P3FUTCgDDM0N7WA0o9uOR38f5Xe2/OhNCgkjNeb7QeaE3cyWkQ== -esbuild-sunos-64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.15.7.tgz#87ab2c604592a9c3c763e72969da0d72bcde91d2" - integrity sha512-8CDI1aL/ts0mDGbWzjEOGKXnU7p3rDzggHSBtVryQzkSOsjCHRVe0iFYUuhczlxU1R3LN/E7HgUO4NXzGGP/Ag== +esbuild-sunos-64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.15.10.tgz#5fe7bef267a02f322fd249a8214d0274937388a7" + integrity sha512-mf7hBL9Uo2gcy2r3rUFMjVpTaGpFJJE5QTDDqUFf1632FxteYANffDZmKbqX0PfeQ2XjUDE604IcE7OJeoHiyg== -esbuild-windows-32@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.15.7.tgz#c81e688c0457665a8d463a669e5bf60870323e99" - integrity sha512-cOnKXUEPS8EGCzRSFa1x6NQjGhGsFlVgjhqGEbLTPsA7x4RRYiy2RKoArNUU4iR2vHmzqS5Gr84MEumO/wxYKA== +esbuild-windows-32@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.15.10.tgz#48e3dde25ab0135579a288b30ab6ddef6d1f0b28" + integrity sha512-ttFVo+Cg8b5+qHmZHbEc8Vl17kCleHhLzgT8X04y8zudEApo0PxPg9Mz8Z2cKH1bCYlve1XL8LkyXGFjtUYeGg== -esbuild-windows-64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.15.7.tgz#2421d1ae34b0561a9d6767346b381961266c4eff" - integrity sha512-7MI08Ec2sTIDv+zH6StNBKO+2hGUYIT42GmFyW6MBBWWtJhTcQLinKS6ldIN1d52MXIbiJ6nXyCJ+LpL4jBm3Q== +esbuild-windows-64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.15.10.tgz#387a9515bef3fee502d277a5d0a2db49a4ecda05" + integrity sha512-2H0gdsyHi5x+8lbng3hLbxDWR7mKHWh5BXZGKVG830KUmXOOWFE2YKJ4tHRkejRduOGDrBvHBriYsGtmTv3ntA== -esbuild-windows-arm64@0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.7.tgz#7d5e9e060a7b454cb2f57f84a3f3c23c8f30b7d2" - integrity sha512-R06nmqBlWjKHddhRJYlqDd3Fabx9LFdKcjoOy08YLimwmsswlFBJV4rXzZCxz/b7ZJXvrZgj8DDv1ewE9+StMw== +esbuild-windows-arm64@0.15.10: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.10.tgz#5a6fcf2fa49e895949bf5495cf088ab1b43ae879" + integrity sha512-S+th4F+F8VLsHLR0zrUcG+Et4hx0RKgK1eyHc08kztmLOES8BWwMiaGdoW9hiXuzznXQ0I/Fg904MNbr11Nktw== -esbuild@^0.15.6, esbuild@^0.15.7: - version "0.15.7" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.15.7.tgz#8a1f1aff58671a3199dd24df95314122fc1ddee8" - integrity sha512-7V8tzllIbAQV1M4QoE52ImKu8hT/NLGlGXkiDsbEU5PS6K8Mn09ZnYoS+dcmHxOS9CRsV4IRAMdT3I67IyUNXw== +esbuild@^0.15.10, esbuild@^0.15.6: + version "0.15.10" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.15.10.tgz#85c2f8446e9b1fe04fae68daceacba033eedbd42" + integrity sha512-N7wBhfJ/E5fzn/SpNgX+oW2RLRjwaL8Y0ezqNqhjD6w0H2p0rDuEz2FKZqpqLnO8DCaWumKe8dsC/ljvVSSxng== optionalDependencies: - "@esbuild/linux-loong64" "0.15.7" - esbuild-android-64 "0.15.7" - esbuild-android-arm64 "0.15.7" - esbuild-darwin-64 "0.15.7" - esbuild-darwin-arm64 "0.15.7" - esbuild-freebsd-64 "0.15.7" - esbuild-freebsd-arm64 "0.15.7" - esbuild-linux-32 "0.15.7" - esbuild-linux-64 "0.15.7" - esbuild-linux-arm "0.15.7" - esbuild-linux-arm64 "0.15.7" - esbuild-linux-mips64le "0.15.7" - esbuild-linux-ppc64le "0.15.7" - esbuild-linux-riscv64 "0.15.7" - esbuild-linux-s390x "0.15.7" - esbuild-netbsd-64 "0.15.7" - esbuild-openbsd-64 "0.15.7" - esbuild-sunos-64 "0.15.7" - esbuild-windows-32 "0.15.7" - esbuild-windows-64 "0.15.7" - esbuild-windows-arm64 "0.15.7" + "@esbuild/android-arm" "0.15.10" + "@esbuild/linux-loong64" "0.15.10" + esbuild-android-64 "0.15.10" + esbuild-android-arm64 "0.15.10" + esbuild-darwin-64 "0.15.10" + esbuild-darwin-arm64 "0.15.10" + esbuild-freebsd-64 "0.15.10" + esbuild-freebsd-arm64 "0.15.10" + esbuild-linux-32 "0.15.10" + esbuild-linux-64 "0.15.10" + esbuild-linux-arm "0.15.10" + esbuild-linux-arm64 "0.15.10" + esbuild-linux-mips64le "0.15.10" + esbuild-linux-ppc64le "0.15.10" + esbuild-linux-riscv64 "0.15.10" + esbuild-linux-s390x "0.15.10" + esbuild-netbsd-64 "0.15.10" + esbuild-openbsd-64 "0.15.10" + esbuild-sunos-64 "0.15.10" + esbuild-windows-32 "0.15.10" + esbuild-windows-64 "0.15.10" + esbuild-windows-arm64 "0.15.10" escalade@^3.1.1: version "3.1.1" From 773ee900b8016dde3e03cb7dbf8268e3ef904c84 Mon Sep 17 00:00:00 2001 From: Billy Tobon Date: Mon, 3 Oct 2022 08:17:06 -0400 Subject: [PATCH 039/280] Adding asc provider (#6302) --- build/notarize.js | 1 + 1 file changed, 1 insertion(+) diff --git a/build/notarize.js b/build/notarize.js index ded81f6dd1..0bf1903e59 100644 --- a/build/notarize.js +++ b/build/notarize.js @@ -22,5 +22,6 @@ exports.default = async function notarizing(context) { appPath: `${appOutDir}/${appName}.app`, appleId: process.env.APPLEID, appleIdPassword: process.env.APPLEIDPASS, + ascProvider:process.env.ASCPROVIDER, }); }; From 88f62040ecf1a1d38c0d7eb03a9ffbd2a16af115 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 08:17:48 -0400 Subject: [PATCH 040/280] Bump @types/sharp from 0.30.5 to 0.31.0 (#6271) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index aa31560b0c..c96d585bae 100644 --- a/package.json +++ b/package.json @@ -350,7 +350,7 @@ "@types/request": "^2.48.7", "@types/request-promise-native": "^1.0.18", "@types/semver": "^7.3.12", - "@types/sharp": "^0.30.5", + "@types/sharp": "^0.31.0", "@types/spdy": "^3.4.5", "@types/tar": "^4.0.5", "@types/tar-stream": "^2.2.2", diff --git a/yarn.lock b/yarn.lock index 797ada9be1..49f991786c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2518,10 +2518,10 @@ "@types/mime" "^1" "@types/node" "*" -"@types/sharp@^0.30.5": - version "0.30.5" - resolved "https://registry.yarnpkg.com/@types/sharp/-/sharp-0.30.5.tgz#d75d91f7acf5260525aeae229845046dcff6d17a" - integrity sha512-EhO29617AIBqxoVtpd1qdBanWpspk/kD2B6qTFRJ31Q23Rdf+DNU1xlHSwtqvwq1vgOqBwq1i38SX+HGCymIQg== +"@types/sharp@^0.31.0": + version "0.31.0" + resolved "https://registry.yarnpkg.com/@types/sharp/-/sharp-0.31.0.tgz#c4af03a7e1d126f0d428a265e126fabd86ab6d0f" + integrity sha512-nwivOU101fYInCwdDcH/0/Ru6yIRXOpORx25ynEOc6/IakuCmjOAGpaO5VfUl4QkDtUC6hj+Z2eCQvgXOioknw== dependencies: "@types/node" "*" From 364e7bf9ce6ff65f318eb0a0ef208a8d8c6b9b19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 08:18:11 -0400 Subject: [PATCH 041/280] Bump typedoc from 0.23.14 to 0.23.15 (#6270) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c96d585bae..e9dce9c84d 100644 --- a/package.json +++ b/package.json @@ -428,7 +428,7 @@ "ts-node": "^10.9.1", "type-fest": "^2.14.0", "typed-emitter": "^1.4.0", - "typedoc": "0.23.14", + "typedoc": "0.23.15", "typedoc-plugin-markdown": "^3.13.1", "typescript": "^4.8.3", "typescript-plugin-css-modules": "^3.4.0", diff --git a/yarn.lock b/yarn.lock index 49f991786c..1ea73b44c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12587,10 +12587,10 @@ typedoc-plugin-markdown@^3.13.1: dependencies: handlebars "^4.7.7" -typedoc@0.23.14: - version "0.23.14" - resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.23.14.tgz#d3af50b38fe98210ac39e112b5892f9d88546c93" - integrity sha512-s2I+ZKBET38EctZvbXp2GooHrNaKjWZkrwGEK/sttnOGiKJqU0vHrsdcwLgKZGuo2aedNL3RRPj1LnAAeYscig== +typedoc@0.23.15: + version "0.23.15" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.23.15.tgz#6d995c47d34e5785dadffe0ebc28372bd019e5e5" + integrity sha512-x9Zu+tTnwxb9YdVr+zvX7LYzyBl1nieOr6lrSHbHsA22/RJK2m4Y525WIg5Mj4jWCmfL47v6f4hUzY7EIuwS5w== dependencies: lunr "^2.3.9" marked "^4.0.19" From 52b4c45e46f6586280bf2c007b08a7ad6e0be5a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 08:18:52 -0400 Subject: [PATCH 042/280] Bump nodemon from 2.0.19 to 2.0.20 (#6269) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index e9dce9c84d..b3161a2cec 100644 --- a/package.json +++ b/package.json @@ -404,7 +404,7 @@ "mock-http": "^1.1.0", "node-gyp": "^8.3.0", "node-loader": "^2.0.0", - "nodemon": "^2.0.19", + "nodemon": "^2.0.20", "playwright": "^1.25.2", "postcss": "^8.4.16", "postcss-loader": "^6.2.1", diff --git a/yarn.lock b/yarn.lock index 1ea73b44c6..466c535612 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9414,15 +9414,15 @@ node-releases@^2.0.3: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.4.tgz#f38252370c43854dc48aa431c766c6c398f40476" integrity sha512-gbMzqQtTtDz/00jQzZ21PQzdI9PyLYqUSvD0p3naOhX4odFji0ZxYdnVwPTxmSwkmxhcFImpozceidSG+AgoPQ== -nodemon@^2.0.19: - version "2.0.19" - resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.19.tgz#cac175f74b9cb8b57e770d47841995eebe4488bd" - integrity sha512-4pv1f2bMDj0Eeg/MhGqxrtveeQ5/G/UVe9iO6uTZzjnRluSA4PVWf8CW99LUPwGB3eNIA7zUFoP77YuI7hOc0A== +nodemon@^2.0.20: + version "2.0.20" + resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.20.tgz#e3537de768a492e8d74da5c5813cb0c7486fc701" + integrity sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw== dependencies: chokidar "^3.5.2" debug "^3.2.7" ignore-by-default "^1.0.1" - minimatch "^3.0.4" + minimatch "^3.1.2" pstree.remy "^1.1.8" semver "^5.7.1" simple-update-notifier "^1.0.7" From 34750f368f690f7d31fdc5de0b658d70aa78df6a Mon Sep 17 00:00:00 2001 From: Juho Heikka Date: Mon, 3 Oct 2022 16:51:39 +0300 Subject: [PATCH 043/280] Delete old extensions when app is updated on Windows (#6301) --- build/installer.nsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/installer.nsh b/build/installer.nsh index 8ff35b5e4f..d0fe18809a 100644 --- a/build/installer.nsh +++ b/build/installer.nsh @@ -1,4 +1,7 @@ !macro customInit + ; Make sure all old extensions are removed + RMDir /r "$INSTDIR\resources\extensions" + ; Workaround for installer handing when the app directory is removed manually ${ifNot} ${FileExists} "$INSTDIR" DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\{${UNINSTALL_APP_KEY}}" From 159670026cf936bff0773d1ce63fab8e56307151 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 09:51:54 -0400 Subject: [PATCH 044/280] Bump @types/node from 16.11.59 to 16.11.63 (#6305) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b3161a2cec..f6d262791d 100644 --- a/package.json +++ b/package.json @@ -333,7 +333,7 @@ "@types/md5-file": "^4.0.2", "@types/mini-css-extract-plugin": "^2.4.0", "@types/mock-fs": "^4.13.1", - "@types/node": "^16.11.59", + "@types/node": "^16.11.63", "@types/node-fetch": "^2.6.2", "@types/npm": "^2.0.32", "@types/proper-lockfile": "^4.1.2", diff --git a/yarn.lock b/yarn.lock index 466c535612..fbdab6c0d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2289,10 +2289,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.24.tgz#20ba1bf69c1b4ab405c7a01e950c4f446b05029f" integrity sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g== -"@types/node@^16.11.26", "@types/node@^16.11.59": - version "16.11.59" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.59.tgz#823f238b9063ccc3b3b7f13186f143a57926c4f6" - integrity sha512-6u+36Dj3aDzhfBVUf/mfmc92OEdzQ2kx2jcXGdigfl70E/neV21ZHE6UCz4MDzTRcVqGAM27fk+DLXvyDsn3Jw== +"@types/node@^16.11.26", "@types/node@^16.11.63": + version "16.11.63" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.63.tgz#af57f6d2c3fb17a571230d527003dd734a9109b2" + integrity sha512-3OxnrEQLBz8EIIaHpg3CibmTAEGkDBcHY4fL5cnBwg2vd2yvHrUDGWxK+MlYPeXWWIoJJW79dGtU+oeBr6166Q== "@types/npm@^2.0.32": version "2.0.32" From d91251ceaa195dc998be3028842539671b53816c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 09:52:11 -0400 Subject: [PATCH 045/280] Bump electron from 19.0.17 to 19.1.1 (#6306) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f6d262791d..b90d33e8be 100644 --- a/package.json +++ b/package.json @@ -376,7 +376,7 @@ "css-loader": "^6.7.1", "deepdash": "^5.3.9", "dompurify": "^2.4.0", - "electron": "^19.0.17", + "electron": "^19.1.1", "electron-builder": "^23.3.3", "electron-notarize": "^0.3.0", "esbuild": "^0.15.10", diff --git a/yarn.lock b/yarn.lock index fbdab6c0d0..d38f5d65e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5247,10 +5247,10 @@ electron-window-state@^5.0.3: jsonfile "^4.0.0" mkdirp "^0.5.1" -electron@^19.0.17: - version "19.0.17" - resolved "https://registry.yarnpkg.com/electron/-/electron-19.0.17.tgz#850d806e88b1ef141b88b491dc41661778691c27" - integrity sha512-3Offu61K+d19EZIc76MhKRsSCqfe3jDiqtD0p8jXr6p/TW7+7/jOQp407ZaZu0nQN6/xDIEi2sP4XQBom6GjTQ== +electron@^19.1.1: + version "19.1.1" + resolved "https://registry.yarnpkg.com/electron/-/electron-19.1.1.tgz#f2b7b0dbc02701091a451e2f807097f387231455" + integrity sha512-cVjX+vYH431iNdIpDXU1cfx83heS/lkPVorpaiERSPcycwiZYFtE5xjL8XAARV11TG+AmN4gxBFMSb9R7DhStw== dependencies: "@electron/get" "^1.14.1" "@types/node" "^16.11.26" From e10e965c68b53aa082184f663e870c0bcdf208fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 09:52:23 -0400 Subject: [PATCH 046/280] Bump marked from 4.1.0 to 4.1.1 (#6304) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b90d33e8be..180c053186 100644 --- a/package.json +++ b/package.json @@ -252,7 +252,7 @@ "jsdom": "^16.7.0", "lodash": "^4.17.15", "mac-ca": "^1.0.6", - "marked": "^4.1.0", + "marked": "^4.1.1", "md5-file": "^5.0.0", "mobx": "^6.6.2", "mobx-observable-history": "^2.0.3", diff --git a/yarn.lock b/yarn.lock index d38f5d65e4..75dac24b1d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8885,10 +8885,10 @@ markdown@^0.5.0: dependencies: nopt "~2.1.1" -marked@^4.0.19, marked@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/marked/-/marked-4.1.0.tgz#3fc6e7485f21c1ca5d6ec4a39de820e146954796" - integrity sha512-+Z6KDjSPa6/723PQYyc1axYZpYYpDnECDaU6hkaf5gqBieBkMKYReL5hteF2QizhlMbgbo8umXl/clZ67+GlsA== +marked@^4.0.19, marked@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.1.1.tgz#2f709a4462abf65a283f2453dc1c42ab177d302e" + integrity sha512-0cNMnTcUJPxbA6uWmCmjWz4NJRe/0Xfk2NhXCUHjew9qJzFN20krFnsUe7QynwqOwa5m1fZ4UDg0ycKFVC0ccw== matcher-collection@^2.0.0: version "2.0.1" From f04d592b0c2458b6957c5b9ed93a6b7f7046ca2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 09:52:40 -0400 Subject: [PATCH 047/280] Bump ws from 8.8.1 to 8.9.0 (#6307) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 180c053186..e34cfefcfd 100644 --- a/package.json +++ b/package.json @@ -292,7 +292,7 @@ "winston": "^3.8.2", "winston-console-format": "^1.0.8", "winston-transport-browserconsole": "^1.0.5", - "ws": "^8.8.1", + "ws": "^8.9.0", "xterm-link-provider": "^1.3.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 75dac24b1d..ba4964ea7f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13300,10 +13300,10 @@ ws@^7.3.1, ws@^7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67" integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A== -ws@^8.2.3, ws@^8.4.2, ws@^8.8.1: - version "8.8.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.1.tgz#5dbad0feb7ade8ecc99b830c1d77c913d4955ff0" - integrity sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA== +ws@^8.2.3, ws@^8.4.2, ws@^8.9.0: + version "8.9.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.9.0.tgz#2a994bb67144be1b53fe2d23c53c028adeb7f45e" + integrity sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg== xdg-basedir@^4.0.0: version "4.0.0" From 55960ef65343aebdea379edc474d98c5a2f8038b Mon Sep 17 00:00:00 2001 From: Andy Hall Date: Mon, 3 Oct 2022 09:53:06 -0400 Subject: [PATCH 048/280] Add missing space in "Remove x items" (#6290) --- src/renderer/components/item-object-list/content.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/item-object-list/content.tsx b/src/renderer/components/item-object-list/content.tsx index 07756760a9..0b8aa9ca28 100644 --- a/src/renderer/components/item-object-list/content.tsx +++ b/src/renderer/components/item-object-list/content.tsx @@ -195,7 +195,7 @@ class NonInjectedItemListLayoutContent< ) : (

- Remove + {"Remove "} {selectedCount} {" items "} {selectedNames} From e6396b7314507242e12c495704f0b4290ded726a Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 3 Oct 2022 11:36:47 -0300 Subject: [PATCH 049/280] Stop overriding intree extension versions on build (#6239) --- Makefile | 7 +- build/set_build_version.ts | 68 - .../kube-object-event-status/package.json | 2 +- .../metrics-cluster-feature/package.json | 2 +- extensions/node-menu/package.json | 2 +- extensions/pod-menu/package.json | 2 +- package.json | 1 - .../npm/extensions/package-lock.json | 2288 ----------------- src/extensions/npm/extensions/package.json | 4 +- 9 files changed, 7 insertions(+), 2369 deletions(-) delete mode 100644 build/set_build_version.ts delete mode 100644 src/extensions/npm/extensions/package-lock.json diff --git a/Makefile b/Makefile index d04b3febe1..81dd3a732e 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,6 @@ integration: build .PHONY: build build: node_modules binaries/client - yarn run npm:fix-build-version $(MAKE) build-extensions -B yarn run build:tray-icons yarn run compile @@ -63,10 +62,6 @@ ifeq "$(DETECTED_OS)" "Windows" endif yarn run electron-builder --publish onTag $(ELECTRON_BUILDER_EXTRA_ARGS) -.PHONY: update-extension-locks -update-extension-locks: - $(foreach dir, $(extensions), (cd $(dir) && rm package-lock.json && ../../node_modules/.bin/npm install --package-lock-only);) - .NOTPARALLEL: $(extension_node_modules) $(extension_node_modules): node_modules cd $(@:/node_modules=) && ../../node_modules/.bin/npm install --no-audit --no-fund --no-save @@ -92,7 +87,7 @@ src/extensions/npm/extensions/dist: src/extensions/npm/extensions/node_modules yarn compile:extension-types src/extensions/npm/extensions/node_modules: src/extensions/npm/extensions/package.json - cd src/extensions/npm/extensions/ && ../../../../node_modules/.bin/npm install --no-audit --no-fund + cd src/extensions/npm/extensions/ && ../../../../node_modules/.bin/npm install --no-audit --no-fund --no-save .PHONY: build-npm build-npm: build-extension-types src/extensions/npm/extensions/__mocks__ diff --git a/build/set_build_version.ts b/build/set_build_version.ts deleted file mode 100644 index 4df7ad4b96..0000000000 --- a/build/set_build_version.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) OpenLens Authors. All rights reserved. - * Licensed under MIT License. See LICENSE in root directory for more information. - */ -import * as fse from "fs-extra"; -import * as path from "path"; -import appInfo from "../package.json"; -import semver from "semver"; -import fastGlob from "fast-glob"; - -const packagePath = path.join(__dirname, "../package.json"); -const versionInfo = semver.parse(appInfo.version); -const buildNumber = process.env.BUILD_NUMBER || Date.now().toString(); - -function getBuildChannel(): string { - const preRelease = versionInfo.prerelease?.[0]; - - switch (preRelease) { - case "alpha": - case "beta": - case "rc": - return preRelease; - case undefined: - case "latest": - return "latest"; // needed because electron-updater does not take build information into account when resolving if update is available - default: - throw new Error(`invalid pre-release ${preRelease}`); - } -} - -async function writeOutExtensionVersion(manifestPath: string) { - const extensionPackageJson = await fse.readJson(manifestPath); - - extensionPackageJson.version = appInfo.version; - - return fse.writeJson(manifestPath, extensionPackageJson, { - spaces: 2, - }); -} - -async function writeOutNewVersions() { - await Promise.all([ - fse.writeJson(packagePath, appInfo, { - spaces: 2, - }), - ...(await fastGlob(["extensions/*/package.json"])).map(writeOutExtensionVersion), - ]); -} - -function main() { - const prereleaseParts: string[] = [getBuildChannel()]; - - if (versionInfo.prerelease && versionInfo.prerelease.length > 1) { - prereleaseParts.push(versionInfo.prerelease[1].toString()); - } - - prereleaseParts.push(buildNumber); - - appInfo.version = `${versionInfo.major}.${versionInfo.minor}.${versionInfo.patch}-${prereleaseParts.join(".")}`; - - writeOutNewVersions() - .catch((error) => { - console.error(error); - process.exit(1); - }); -} - -main(); diff --git a/extensions/kube-object-event-status/package.json b/extensions/kube-object-event-status/package.json index 53db719a83..d833d2b188 100644 --- a/extensions/kube-object-event-status/package.json +++ b/extensions/kube-object-event-status/package.json @@ -1,6 +1,6 @@ { "name": "kube-object-event-status", - "version": "0.0.1", + "version": "6.1.0", "description": "Adds kube object status from events", "renderer": "dist/renderer.js", "lens": { diff --git a/extensions/metrics-cluster-feature/package.json b/extensions/metrics-cluster-feature/package.json index 41da8f3f86..03ad0df7a5 100644 --- a/extensions/metrics-cluster-feature/package.json +++ b/extensions/metrics-cluster-feature/package.json @@ -1,6 +1,6 @@ { "name": "lens-metrics-cluster-feature", - "version": "0.0.1", + "version": "6.1.0", "description": "Lens metrics cluster feature", "renderer": "dist/renderer.js", "lens": { diff --git a/extensions/node-menu/package.json b/extensions/node-menu/package.json index 7705b4f606..3b56dc6e62 100644 --- a/extensions/node-menu/package.json +++ b/extensions/node-menu/package.json @@ -1,6 +1,6 @@ { "name": "lens-node-menu", - "version": "0.0.1", + "version": "6.1.0", "description": "Lens node menu", "renderer": "dist/renderer.js", "lens": { diff --git a/extensions/pod-menu/package.json b/extensions/pod-menu/package.json index 79e4278b32..ba3f107f80 100644 --- a/extensions/pod-menu/package.json +++ b/extensions/pod-menu/package.json @@ -1,6 +1,6 @@ { "name": "lens-pod-menu", - "version": "0.0.1", + "version": "6.1.0", "description": "Lens pod menu", "renderer": "dist/renderer.js", "lens": { diff --git a/package.json b/package.json index e34cfefcfd..7d26f9b4a1 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "compile:main": "yarn run webpack --config webpack/main.ts", "compile:renderer": "yarn run webpack --config webpack/renderer.ts", "compile:extension-types": "yarn run webpack --config webpack/extensions.ts", - "npm:fix-build-version": "yarn run ts-node build/set_build_version.ts", "npm:fix-package-version": "yarn run ts-node build/set_npm_version.ts", "build:linux": "yarn run compile && electron-builder --linux --dir", "build:mac": "yarn run compile && electron-builder --mac --dir", diff --git a/src/extensions/npm/extensions/package-lock.json b/src/extensions/npm/extensions/package-lock.json deleted file mode 100644 index dd8bade7d9..0000000000 --- a/src/extensions/npm/extensions/package-lock.json +++ /dev/null @@ -1,2288 +0,0 @@ -{ - "name": "@k8slens/extensions", - "version": "0.0.1", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "@k8slens/extensions", - "version": "0.0.1", - "license": "MIT", - "dependencies": { - "@material-ui/core": "4.12.3", - "@types/node": "14.17.14", - "@types/react": "^17.0.45", - "@types/react-dom": "^17.0.16", - "@types/react-router": "^5.1.18", - "@types/react-router-dom": "^5.3.3", - "conf": "^7.0.1", - "mobx": "^6.5.0", - "mobx-react": "^7.3.0", - "react-select": "^5.3.2", - "typed-emitter": "^1.3.1" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", - "dependencies": { - "@babel/highlight": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", - "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", - "dependencies": { - "@babel/types": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.17.12", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.17.12.tgz", - "integrity": "sha512-JDkf04mqtN3y4iAbO1hv9U2ARpPyPL1zqyWs/2WG1pgSq9llHFjStX5jdxb84himgJm+8Ng+x0oiWF/nw/XQKA==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.17.12", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz", - "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==", - "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.17.12", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.17.12.tgz", - "integrity": "sha512-spyY3E3AURfxh/RHtjx5j6hs8am5NbUBGfcZ2vB3uShSpZdQyXSf5rR5Mk76vbtlAZOelyVQ71Fg0x9SG4fsog==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.17.12" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/runtime": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.9.tgz", - "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==", - "dependencies": { - "regenerator-runtime": "^0.13.4" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types": { - "version": "7.18.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.4.tgz", - "integrity": "sha512-ThN1mBcMq5pG/Vm2IcBmPPfyPXbd8S02rS+OBIDENdufvqC7Z/jHPCv9IcP01277aKtDI8g/2XysBN4hA8niiw==", - "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@emotion/babel-plugin": { - "version": "11.9.2", - "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.9.2.tgz", - "integrity": "sha512-Pr/7HGH6H6yKgnVFNEj2MVlreu3ADqftqjqwUvDy/OJzKFgxKeTQ+eeUf20FOTuHVkDON2iNa25rAXVYtWJCjw==", - "dependencies": { - "@babel/helper-module-imports": "^7.12.13", - "@babel/plugin-syntax-jsx": "^7.12.13", - "@babel/runtime": "^7.13.10", - "@emotion/hash": "^0.8.0", - "@emotion/memoize": "^0.7.5", - "@emotion/serialize": "^1.0.2", - "babel-plugin-macros": "^2.6.1", - "convert-source-map": "^1.5.0", - "escape-string-regexp": "^4.0.0", - "find-root": "^1.1.0", - "source-map": "^0.5.7", - "stylis": "4.0.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@emotion/cache": { - "version": "11.9.3", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.9.3.tgz", - "integrity": "sha512-0dgkI/JKlCXa+lEXviaMtGBL0ynpx4osh7rjOXE71q9bIF8G+XhJgvi+wDu0B0IdCVx37BffiwXlN9I3UuzFvg==", - "dependencies": { - "@emotion/memoize": "^0.7.4", - "@emotion/sheet": "^1.1.1", - "@emotion/utils": "^1.0.0", - "@emotion/weak-memoize": "^0.2.5", - "stylis": "4.0.13" - } - }, - "node_modules/@emotion/hash": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz", - "integrity": "sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==" - }, - "node_modules/@emotion/memoize": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.5.tgz", - "integrity": "sha512-igX9a37DR2ZPGYtV6suZ6whr8pTFtyHL3K/oLUotxpSVO2ASaprmAe2Dkq7tBo7CRY7MMDrAa9nuQP9/YG8FxQ==" - }, - "node_modules/@emotion/react": { - "version": "11.9.3", - "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.9.3.tgz", - "integrity": "sha512-g9Q1GcTOlzOEjqwuLF/Zd9LC+4FljjPjDfxSM7KmEakm+hsHXk+bYZ2q+/hTJzr0OUNkujo72pXLQvXj6H+GJQ==", - "dependencies": { - "@babel/runtime": "^7.13.10", - "@emotion/babel-plugin": "^11.7.1", - "@emotion/cache": "^11.9.3", - "@emotion/serialize": "^1.0.4", - "@emotion/utils": "^1.1.0", - "@emotion/weak-memoize": "^0.2.5", - "hoist-non-react-statics": "^3.3.1" - }, - "peerDependencies": { - "@babel/core": "^7.0.0", - "react": ">=16.8.0" - }, - "peerDependenciesMeta": { - "@babel/core": { - "optional": true - }, - "@types/react": { - "optional": true - } - } - }, - "node_modules/@emotion/serialize": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.0.4.tgz", - "integrity": "sha512-1JHamSpH8PIfFwAMryO2bNka+y8+KA5yga5Ocf2d7ZEiJjb7xlLW7aknBGZqJLajuLOvJ+72vN+IBSwPlXD1Pg==", - "dependencies": { - "@emotion/hash": "^0.8.0", - "@emotion/memoize": "^0.7.4", - "@emotion/unitless": "^0.7.5", - "@emotion/utils": "^1.0.0", - "csstype": "^3.0.2" - } - }, - "node_modules/@emotion/serialize/node_modules/csstype": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", - "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==" - }, - "node_modules/@emotion/sheet": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.1.1.tgz", - "integrity": "sha512-J3YPccVRMiTZxYAY0IOq3kd+hUP8idY8Kz6B/Cyo+JuXq52Ek+zbPbSQUrVQp95aJ+lsAW7DPL1P2Z+U1jGkKA==" - }, - "node_modules/@emotion/unitless": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", - "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" - }, - "node_modules/@emotion/utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.1.0.tgz", - "integrity": "sha512-iRLa/Y4Rs5H/f2nimczYmS5kFJEbpiVvgN3XVfZ022IYhuNA1IRSHEizcof88LtCTXtl9S2Cxt32KgaXEu72JQ==" - }, - "node_modules/@emotion/weak-memoize": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz", - "integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==" - }, - "node_modules/@material-ui/core": { - "version": "4.12.3", - "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.12.3.tgz", - "integrity": "sha512-sdpgI/PL56QVsEJldwEe4FFaFTLUqN+rd7sSZiRCdx2E/C7z5yK0y/khAWVBH24tXwto7I1hCzNWfJGZIYJKnw==", - "deprecated": "You can now upgrade to @mui/material. See the guide: https://mui.com/guides/migration-v4/", - "dependencies": { - "@babel/runtime": "^7.4.4", - "@material-ui/styles": "^4.11.4", - "@material-ui/system": "^4.12.1", - "@material-ui/types": "5.1.0", - "@material-ui/utils": "^4.11.2", - "@types/react-transition-group": "^4.2.0", - "clsx": "^1.0.4", - "hoist-non-react-statics": "^3.3.2", - "popper.js": "1.16.1-lts", - "prop-types": "^15.7.2", - "react-is": "^16.8.0 || ^17.0.0", - "react-transition-group": "^4.4.0" - }, - "engines": { - "node": ">=8.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/material-ui" - }, - "peerDependencies": { - "@types/react": "^16.8.6 || ^17.0.0", - "react": "^16.8.0 || ^17.0.0", - "react-dom": "^16.8.0 || ^17.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@material-ui/styles": { - "version": "4.11.5", - "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.11.5.tgz", - "integrity": "sha512-o/41ot5JJiUsIETME9wVLAJrmIWL3j0R0Bj2kCOLbSfqEkKf0fmaPt+5vtblUh5eXr2S+J/8J3DaCb10+CzPGA==", - "dependencies": { - "@babel/runtime": "^7.4.4", - "@emotion/hash": "^0.8.0", - "@material-ui/types": "5.1.0", - "@material-ui/utils": "^4.11.3", - "clsx": "^1.0.4", - "csstype": "^2.5.2", - "hoist-non-react-statics": "^3.3.2", - "jss": "^10.5.1", - "jss-plugin-camel-case": "^10.5.1", - "jss-plugin-default-unit": "^10.5.1", - "jss-plugin-global": "^10.5.1", - "jss-plugin-nested": "^10.5.1", - "jss-plugin-props-sort": "^10.5.1", - "jss-plugin-rule-value-function": "^10.5.1", - "jss-plugin-vendor-prefixer": "^10.5.1", - "prop-types": "^15.7.2" - }, - "engines": { - "node": ">=8.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/material-ui" - }, - "peerDependencies": { - "@types/react": "^16.8.6 || ^17.0.0", - "react": "^16.8.0 || ^17.0.0", - "react-dom": "^16.8.0 || ^17.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@material-ui/system": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/@material-ui/system/-/system-4.12.2.tgz", - "integrity": "sha512-6CSKu2MtmiJgcCGf6nBQpM8fLkuB9F55EKfbdTC80NND5wpTmKzwdhLYLH3zL4cLlK0gVaaltW7/wMuyTnN0Lw==", - "dependencies": { - "@babel/runtime": "^7.4.4", - "@material-ui/utils": "^4.11.3", - "csstype": "^2.5.2", - "prop-types": "^15.7.2" - }, - "engines": { - "node": ">=8.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/material-ui" - }, - "peerDependencies": { - "@types/react": "^16.8.6 || ^17.0.0", - "react": "^16.8.0 || ^17.0.0", - "react-dom": "^16.8.0 || ^17.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@material-ui/types": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@material-ui/types/-/types-5.1.0.tgz", - "integrity": "sha512-7cqRjrY50b8QzRSYyhSpx4WRw2YuO0KKIGQEVk5J8uoz2BanawykgZGoWEqKm7pVIbzFDN0SpPcVV4IhOFkl8A==", - "peerDependencies": { - "@types/react": "*" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@material-ui/utils": { - "version": "4.11.3", - "resolved": "https://registry.npmjs.org/@material-ui/utils/-/utils-4.11.3.tgz", - "integrity": "sha512-ZuQPV4rBK/V1j2dIkSSEcH5uT6AaHuKWFfotADHsC0wVL1NLd2WkFCm4ZZbX33iO4ydl6V0GPngKm8HZQ2oujg==", - "dependencies": { - "@babel/runtime": "^7.4.4", - "prop-types": "^15.7.2", - "react-is": "^16.8.0 || ^17.0.0" - }, - "engines": { - "node": ">=8.0.0" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0", - "react-dom": "^16.8.0 || ^17.0.0" - } - }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, - "node_modules/@types/node": { - "version": "14.17.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.14.tgz", - "integrity": "sha512-rsAj2u8Xkqfc332iXV12SqIsjVi07H479bOP4q94NAcjzmAvapumEhuVIt53koEf7JFrpjgNKjBga5Pnn/GL8A==" - }, - "node_modules/@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==" - }, - "node_modules/@types/prop-types": { - "version": "15.7.5", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", - "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" - }, - "node_modules/@types/react": { - "version": "17.0.45", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.45.tgz", - "integrity": "sha512-YfhQ22Lah2e3CHPsb93tRwIGNiSwkuz1/blk4e6QrWS0jQzCSNbGLtOEYhPg02W0yGTTmpajp7dCTbBAMN3qsg==", - "dependencies": { - "@types/prop-types": "*", - "@types/scheduler": "*", - "csstype": "^3.0.2" - } - }, - "node_modules/@types/react-dom": { - "version": "17.0.16", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.16.tgz", - "integrity": "sha512-DWcXf8EbMrO/gWnQU7Z88Ws/p16qxGpPyjTKTpmBSFKeE+HveVubqGO1CVK7FrwlWD5MuOcvh8gtd0/XO38NdQ==", - "dependencies": { - "@types/react": "^17" - } - }, - "node_modules/@types/react-router": { - "version": "5.1.18", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.18.tgz", - "integrity": "sha512-YYknwy0D0iOwKQgz9v8nOzt2J6l4gouBmDnWqUUznltOTaon+r8US8ky8HvN0tXvc38U9m6z/t2RsVsnd1zM0g==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, - "node_modules/@types/react-transition-group": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.4.tgz", - "integrity": "sha512-7gAPz7anVK5xzbeQW9wFBDg7G++aPLAFY0QaSMOou9rJZpbuI58WAuJrgu+qR92l61grlnCUe7AFX8KGahAgug==", - "dependencies": { - "@types/react": "*" - } - }, - "node_modules/@types/react/node_modules/csstype": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.11.tgz", - "integrity": "sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==" - }, - "node_modules/@types/scheduler": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", - "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/atomically": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/atomically/-/atomically-1.7.0.tgz", - "integrity": "sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w==", - "engines": { - "node": ">=10.12.0" - } - }, - "node_modules/babel-plugin-macros": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz", - "integrity": "sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg==", - "dependencies": { - "@babel/runtime": "^7.7.2", - "cosmiconfig": "^6.0.0", - "resolve": "^1.12.0" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chalk/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/clsx": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz", - "integrity": "sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "node_modules/conf": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/conf/-/conf-7.1.2.tgz", - "integrity": "sha512-r8/HEoWPFn4CztjhMJaWNAe5n+gPUCSaJ0oufbqDLFKsA1V8JjAG7G+p0pgoDFAws9Bpk2VtVLLXqOBA7WxLeg==", - "dependencies": { - "ajv": "^6.12.2", - "atomically": "^1.3.1", - "debounce-fn": "^4.0.0", - "dot-prop": "^5.2.0", - "env-paths": "^2.2.0", - "json-schema-typed": "^7.0.3", - "make-dir": "^3.1.0", - "onetime": "^5.1.0", - "pkg-up": "^3.1.0", - "semver": "^7.3.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dependencies": { - "safe-buffer": "~5.1.1" - } - }, - "node_modules/cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", - "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.7.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/css-vendor": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/css-vendor/-/css-vendor-2.0.8.tgz", - "integrity": "sha512-x9Aq0XTInxrkuFeHKbYC7zWY8ai7qJ04Kxd9MnvbC1uO5DagxoHQjm4JvG+vCdXOoFtCjbL2XSZfxmoYa9uQVQ==", - "dependencies": { - "@babel/runtime": "^7.8.3", - "is-in-browser": "^1.0.2" - } - }, - "node_modules/csstype": { - "version": "2.6.20", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.20.tgz", - "integrity": "sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==" - }, - "node_modules/debounce-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/debounce-fn/-/debounce-fn-4.0.0.tgz", - "integrity": "sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ==", - "dependencies": { - "mimic-fn": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/dom-helpers": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", - "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", - "dependencies": { - "@babel/runtime": "^7.8.7", - "csstype": "^3.0.2" - } - }, - "node_modules/dom-helpers/node_modules/csstype": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.11.tgz", - "integrity": "sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==" - }, - "node_modules/dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "engines": { - "node": ">=6" - } - }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "node_modules/find-root": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", - "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==" - }, - "node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, - "node_modules/hyphenate-style-name": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz", - "integrity": "sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ==" - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" - }, - "node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-in-browser": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-in-browser/-/is-in-browser-1.1.3.tgz", - "integrity": "sha1-Vv9NtoOgeMYILrldrX3GLh0E+DU=" - }, - "node_modules/is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/json-schema-typed": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-7.0.3.tgz", - "integrity": "sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A==" - }, - "node_modules/jss": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss/-/jss-10.9.0.tgz", - "integrity": "sha512-YpzpreB6kUunQBbrlArlsMpXYyndt9JATbt95tajx0t4MTJJcCJdd4hdNpHmOIDiUJrF/oX5wtVFrS3uofWfGw==", - "dependencies": { - "@babel/runtime": "^7.3.1", - "csstype": "^3.0.2", - "is-in-browser": "^1.1.3", - "tiny-warning": "^1.0.2" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/jss" - } - }, - "node_modules/jss-plugin-camel-case": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-camel-case/-/jss-plugin-camel-case-10.9.0.tgz", - "integrity": "sha512-UH6uPpnDk413/r/2Olmw4+y54yEF2lRIV8XIZyuYpgPYTITLlPOsq6XB9qeqv+75SQSg3KLocq5jUBXW8qWWww==", - "dependencies": { - "@babel/runtime": "^7.3.1", - "hyphenate-style-name": "^1.0.3", - "jss": "10.9.0" - } - }, - "node_modules/jss-plugin-default-unit": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-default-unit/-/jss-plugin-default-unit-10.9.0.tgz", - "integrity": "sha512-7Ju4Q9wJ/MZPsxfu4T84mzdn7pLHWeqoGd/D8O3eDNNJ93Xc8PxnLmV8s8ZPNRYkLdxZqKtm1nPQ0BM4JRlq2w==", - "dependencies": { - "@babel/runtime": "^7.3.1", - "jss": "10.9.0" - } - }, - "node_modules/jss-plugin-global": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-global/-/jss-plugin-global-10.9.0.tgz", - "integrity": "sha512-4G8PHNJ0x6nwAFsEzcuVDiBlyMsj2y3VjmFAx/uHk/R/gzJV+yRHICjT4MKGGu1cJq2hfowFWCyrr/Gg37FbgQ==", - "dependencies": { - "@babel/runtime": "^7.3.1", - "jss": "10.9.0" - } - }, - "node_modules/jss-plugin-nested": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-nested/-/jss-plugin-nested-10.9.0.tgz", - "integrity": "sha512-2UJnDrfCZpMYcpPYR16oZB7VAC6b/1QLsRiAutOt7wJaaqwCBvNsosLEu/fUyKNQNGdvg2PPJFDO5AX7dwxtoA==", - "dependencies": { - "@babel/runtime": "^7.3.1", - "jss": "10.9.0", - "tiny-warning": "^1.0.2" - } - }, - "node_modules/jss-plugin-props-sort": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-props-sort/-/jss-plugin-props-sort-10.9.0.tgz", - "integrity": "sha512-7A76HI8bzwqrsMOJTWKx/uD5v+U8piLnp5bvru7g/3ZEQOu1+PjHvv7bFdNO3DwNPC9oM0a//KwIJsIcDCjDzw==", - "dependencies": { - "@babel/runtime": "^7.3.1", - "jss": "10.9.0" - } - }, - "node_modules/jss-plugin-rule-value-function": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-rule-value-function/-/jss-plugin-rule-value-function-10.9.0.tgz", - "integrity": "sha512-IHJv6YrEf8pRzkY207cPmdbBstBaE+z8pazhPShfz0tZSDtRdQua5jjg6NMz3IbTasVx9FdnmptxPqSWL5tyJg==", - "dependencies": { - "@babel/runtime": "^7.3.1", - "jss": "10.9.0", - "tiny-warning": "^1.0.2" - } - }, - "node_modules/jss-plugin-vendor-prefixer": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-vendor-prefixer/-/jss-plugin-vendor-prefixer-10.9.0.tgz", - "integrity": "sha512-MbvsaXP7iiVdYVSEoi+blrW+AYnTDvHTW6I6zqi7JcwXdc6I9Kbm234nEblayhF38EftoenbM+5218pidmC5gA==", - "dependencies": { - "@babel/runtime": "^7.3.1", - "css-vendor": "^2.0.8", - "jss": "10.9.0" - } - }, - "node_modules/jss/node_modules/csstype": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.11.tgz", - "integrity": "sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==" - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" - }, - "node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/memoize-one": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", - "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==" - }, - "node_modules/mimic-fn": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", - "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/mobx": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.5.0.tgz", - "integrity": "sha512-pHZ/cySF00FVENDWIDzJyoObFahK6Eg4d0papqm6d7yMkxWTZ/S/csqJX1A3PsYy4t5k3z2QnlwuCfMW5lSEwA==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mobx" - } - }, - "node_modules/mobx-react": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/mobx-react/-/mobx-react-7.4.0.tgz", - "integrity": "sha512-gbUwaKZK09SiAleTMxNMKs1MYKTpoIEWJLTLRIR/xnALuuHET8wkL8j1nbc1/6cDkOWVyKz/ReftILx0Pdh2PQ==", - "dependencies": { - "mobx-react-lite": "^3.4.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mobx" - }, - "peerDependencies": { - "mobx": "^6.1.0", - "react": "^16.8.0 || ^17 || ^18" - }, - "peerDependenciesMeta": { - "react-dom": { - "optional": true - }, - "react-native": { - "optional": true - } - } - }, - "node_modules/mobx-react-lite": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-3.4.0.tgz", - "integrity": "sha512-bRuZp3C0itgLKHu/VNxi66DN/XVkQG7xtoBVWxpvC5FhAqbOCP21+nPhULjnzEqd7xBMybp6KwytdUpZKEgpIQ==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mobx" - }, - "peerDependencies": { - "mobx": "^6.1.0", - "react": "^16.8.0 || ^17 || ^18" - }, - "peerDependenciesMeta": { - "react-dom": { - "optional": true - }, - "react-native": { - "optional": true - } - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/onetime/node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "engines": { - "node": ">=4" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-up": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", - "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==", - "dependencies": { - "find-up": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/popper.js": { - "version": "1.16.1-lts", - "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1-lts.tgz", - "integrity": "sha512-Kjw8nKRl1m+VrSFCoVGPph93W/qrSO7ZkqPpTf7F4bk/sqcfWK019dWBUpE/fBOsOQY1dks/Bmcbfn1heM/IsA==" - }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "engines": { - "node": ">=6" - } - }, - "node_modules/react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" - }, - "node_modules/react-select": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.3.2.tgz", - "integrity": "sha512-W6Irh7U6Ha7p5uQQ2ZnemoCQ8mcfgOtHfw3wuMzG6FAu0P+CYicgofSLOq97BhjMx8jS+h+wwWdCBeVVZ9VqlQ==", - "dependencies": { - "@babel/runtime": "^7.12.0", - "@emotion/cache": "^11.4.0", - "@emotion/react": "^11.8.1", - "@types/react-transition-group": "^4.4.0", - "memoize-one": "^5.0.0", - "prop-types": "^15.6.0", - "react-transition-group": "^4.3.0" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - } - }, - "node_modules/react-transition-group": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.2.tgz", - "integrity": "sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg==", - "dependencies": { - "@babel/runtime": "^7.5.5", - "dom-helpers": "^5.0.1", - "loose-envify": "^1.4.0", - "prop-types": "^15.6.2" - }, - "peerDependencies": { - "react": ">=16.6.0", - "react-dom": ">=16.6.0" - } - }, - "node_modules/regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" - }, - "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "dependencies": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "engines": { - "node": ">=4" - } - }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stylis": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.0.13.tgz", - "integrity": "sha512-xGPXiFVl4YED9Jh7Euv2V220mriG9u4B2TA6Ybjc1catrstKD2PpIdU3U0RKpkVBC2EhmL/F0sPCr9vrFTNRag==" - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "engines": { - "node": ">=4" - } - }, - "node_modules/typed-emitter": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/typed-emitter/-/typed-emitter-1.4.0.tgz", - "integrity": "sha512-weBmoo3HhpKGgLBOYwe8EB31CzDFuaK7CCL+axXhUYhn4jo6DSkHnbefboCF5i4DQ2aMFe0C/FdTWcPdObgHyg==" - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, - "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "engines": { - "node": ">= 6" - } - } - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", - "requires": { - "@babel/highlight": "^7.16.7" - } - }, - "@babel/helper-module-imports": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", - "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", - "requires": { - "@babel/types": "^7.16.7" - } - }, - "@babel/helper-plugin-utils": { - "version": "7.17.12", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.17.12.tgz", - "integrity": "sha512-JDkf04mqtN3y4iAbO1hv9U2ARpPyPL1zqyWs/2WG1pgSq9llHFjStX5jdxb84himgJm+8Ng+x0oiWF/nw/XQKA==" - }, - "@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==" - }, - "@babel/highlight": { - "version": "7.17.12", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz", - "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==", - "requires": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "@babel/plugin-syntax-jsx": { - "version": "7.17.12", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.17.12.tgz", - "integrity": "sha512-spyY3E3AURfxh/RHtjx5j6hs8am5NbUBGfcZ2vB3uShSpZdQyXSf5rR5Mk76vbtlAZOelyVQ71Fg0x9SG4fsog==", - "requires": { - "@babel/helper-plugin-utils": "^7.17.12" - } - }, - "@babel/runtime": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.9.tgz", - "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==", - "requires": { - "regenerator-runtime": "^0.13.4" - } - }, - "@babel/types": { - "version": "7.18.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.4.tgz", - "integrity": "sha512-ThN1mBcMq5pG/Vm2IcBmPPfyPXbd8S02rS+OBIDENdufvqC7Z/jHPCv9IcP01277aKtDI8g/2XysBN4hA8niiw==", - "requires": { - "@babel/helper-validator-identifier": "^7.16.7", - "to-fast-properties": "^2.0.0" - } - }, - "@emotion/babel-plugin": { - "version": "11.9.2", - "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.9.2.tgz", - "integrity": "sha512-Pr/7HGH6H6yKgnVFNEj2MVlreu3ADqftqjqwUvDy/OJzKFgxKeTQ+eeUf20FOTuHVkDON2iNa25rAXVYtWJCjw==", - "requires": { - "@babel/helper-module-imports": "^7.12.13", - "@babel/plugin-syntax-jsx": "^7.12.13", - "@babel/runtime": "^7.13.10", - "@emotion/hash": "^0.8.0", - "@emotion/memoize": "^0.7.5", - "@emotion/serialize": "^1.0.2", - "babel-plugin-macros": "^2.6.1", - "convert-source-map": "^1.5.0", - "escape-string-regexp": "^4.0.0", - "find-root": "^1.1.0", - "source-map": "^0.5.7", - "stylis": "4.0.13" - } - }, - "@emotion/cache": { - "version": "11.9.3", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.9.3.tgz", - "integrity": "sha512-0dgkI/JKlCXa+lEXviaMtGBL0ynpx4osh7rjOXE71q9bIF8G+XhJgvi+wDu0B0IdCVx37BffiwXlN9I3UuzFvg==", - "requires": { - "@emotion/memoize": "^0.7.4", - "@emotion/sheet": "^1.1.1", - "@emotion/utils": "^1.0.0", - "@emotion/weak-memoize": "^0.2.5", - "stylis": "4.0.13" - } - }, - "@emotion/hash": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz", - "integrity": "sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==" - }, - "@emotion/memoize": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.5.tgz", - "integrity": "sha512-igX9a37DR2ZPGYtV6suZ6whr8pTFtyHL3K/oLUotxpSVO2ASaprmAe2Dkq7tBo7CRY7MMDrAa9nuQP9/YG8FxQ==" - }, - "@emotion/react": { - "version": "11.9.3", - "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.9.3.tgz", - "integrity": "sha512-g9Q1GcTOlzOEjqwuLF/Zd9LC+4FljjPjDfxSM7KmEakm+hsHXk+bYZ2q+/hTJzr0OUNkujo72pXLQvXj6H+GJQ==", - "requires": { - "@babel/runtime": "^7.13.10", - "@emotion/babel-plugin": "^11.7.1", - "@emotion/cache": "^11.9.3", - "@emotion/serialize": "^1.0.4", - "@emotion/utils": "^1.1.0", - "@emotion/weak-memoize": "^0.2.5", - "hoist-non-react-statics": "^3.3.1" - } - }, - "@emotion/serialize": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.0.4.tgz", - "integrity": "sha512-1JHamSpH8PIfFwAMryO2bNka+y8+KA5yga5Ocf2d7ZEiJjb7xlLW7aknBGZqJLajuLOvJ+72vN+IBSwPlXD1Pg==", - "requires": { - "@emotion/hash": "^0.8.0", - "@emotion/memoize": "^0.7.4", - "@emotion/unitless": "^0.7.5", - "@emotion/utils": "^1.0.0", - "csstype": "^3.0.2" - }, - "dependencies": { - "csstype": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", - "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==" - } - } - }, - "@emotion/sheet": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.1.1.tgz", - "integrity": "sha512-J3YPccVRMiTZxYAY0IOq3kd+hUP8idY8Kz6B/Cyo+JuXq52Ek+zbPbSQUrVQp95aJ+lsAW7DPL1P2Z+U1jGkKA==" - }, - "@emotion/unitless": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", - "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" - }, - "@emotion/utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.1.0.tgz", - "integrity": "sha512-iRLa/Y4Rs5H/f2nimczYmS5kFJEbpiVvgN3XVfZ022IYhuNA1IRSHEizcof88LtCTXtl9S2Cxt32KgaXEu72JQ==" - }, - "@emotion/weak-memoize": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz", - "integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==" - }, - "@material-ui/core": { - "version": "4.12.3", - "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.12.3.tgz", - "integrity": "sha512-sdpgI/PL56QVsEJldwEe4FFaFTLUqN+rd7sSZiRCdx2E/C7z5yK0y/khAWVBH24tXwto7I1hCzNWfJGZIYJKnw==", - "requires": { - "@babel/runtime": "^7.4.4", - "@material-ui/styles": "^4.11.4", - "@material-ui/system": "^4.12.1", - "@material-ui/types": "5.1.0", - "@material-ui/utils": "^4.11.2", - "@types/react-transition-group": "^4.2.0", - "clsx": "^1.0.4", - "hoist-non-react-statics": "^3.3.2", - "popper.js": "1.16.1-lts", - "prop-types": "^15.7.2", - "react-is": "^16.8.0 || ^17.0.0", - "react-transition-group": "^4.4.0" - } - }, - "@material-ui/styles": { - "version": "4.11.5", - "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.11.5.tgz", - "integrity": "sha512-o/41ot5JJiUsIETME9wVLAJrmIWL3j0R0Bj2kCOLbSfqEkKf0fmaPt+5vtblUh5eXr2S+J/8J3DaCb10+CzPGA==", - "requires": { - "@babel/runtime": "^7.4.4", - "@emotion/hash": "^0.8.0", - "@material-ui/types": "5.1.0", - "@material-ui/utils": "^4.11.3", - "clsx": "^1.0.4", - "csstype": "^2.5.2", - "hoist-non-react-statics": "^3.3.2", - "jss": "^10.5.1", - "jss-plugin-camel-case": "^10.5.1", - "jss-plugin-default-unit": "^10.5.1", - "jss-plugin-global": "^10.5.1", - "jss-plugin-nested": "^10.5.1", - "jss-plugin-props-sort": "^10.5.1", - "jss-plugin-rule-value-function": "^10.5.1", - "jss-plugin-vendor-prefixer": "^10.5.1", - "prop-types": "^15.7.2" - } - }, - "@material-ui/system": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/@material-ui/system/-/system-4.12.2.tgz", - "integrity": "sha512-6CSKu2MtmiJgcCGf6nBQpM8fLkuB9F55EKfbdTC80NND5wpTmKzwdhLYLH3zL4cLlK0gVaaltW7/wMuyTnN0Lw==", - "requires": { - "@babel/runtime": "^7.4.4", - "@material-ui/utils": "^4.11.3", - "csstype": "^2.5.2", - "prop-types": "^15.7.2" - } - }, - "@material-ui/types": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@material-ui/types/-/types-5.1.0.tgz", - "integrity": "sha512-7cqRjrY50b8QzRSYyhSpx4WRw2YuO0KKIGQEVk5J8uoz2BanawykgZGoWEqKm7pVIbzFDN0SpPcVV4IhOFkl8A==", - "requires": {} - }, - "@material-ui/utils": { - "version": "4.11.3", - "resolved": "https://registry.npmjs.org/@material-ui/utils/-/utils-4.11.3.tgz", - "integrity": "sha512-ZuQPV4rBK/V1j2dIkSSEcH5uT6AaHuKWFfotADHsC0wVL1NLd2WkFCm4ZZbX33iO4ydl6V0GPngKm8HZQ2oujg==", - "requires": { - "@babel/runtime": "^7.4.4", - "prop-types": "^15.7.2", - "react-is": "^16.8.0 || ^17.0.0" - } - }, - "@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, - "@types/node": { - "version": "14.17.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.14.tgz", - "integrity": "sha512-rsAj2u8Xkqfc332iXV12SqIsjVi07H479bOP4q94NAcjzmAvapumEhuVIt53koEf7JFrpjgNKjBga5Pnn/GL8A==" - }, - "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==" - }, - "@types/prop-types": { - "version": "15.7.5", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", - "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" - }, - "@types/react": { - "version": "17.0.45", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.45.tgz", - "integrity": "sha512-YfhQ22Lah2e3CHPsb93tRwIGNiSwkuz1/blk4e6QrWS0jQzCSNbGLtOEYhPg02W0yGTTmpajp7dCTbBAMN3qsg==", - "requires": { - "@types/prop-types": "*", - "@types/scheduler": "*", - "csstype": "^3.0.2" - }, - "dependencies": { - "csstype": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.11.tgz", - "integrity": "sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==" - } - } - }, - "@types/react-dom": { - "version": "17.0.16", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.16.tgz", - "integrity": "sha512-DWcXf8EbMrO/gWnQU7Z88Ws/p16qxGpPyjTKTpmBSFKeE+HveVubqGO1CVK7FrwlWD5MuOcvh8gtd0/XO38NdQ==", - "requires": { - "@types/react": "^17" - } - }, - "@types/react-router": { - "version": "5.1.18", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.18.tgz", - "integrity": "sha512-YYknwy0D0iOwKQgz9v8nOzt2J6l4gouBmDnWqUUznltOTaon+r8US8ky8HvN0tXvc38U9m6z/t2RsVsnd1zM0g==", - "requires": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "requires": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, - "@types/react-transition-group": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.4.tgz", - "integrity": "sha512-7gAPz7anVK5xzbeQW9wFBDg7G++aPLAFY0QaSMOou9rJZpbuI58WAuJrgu+qR92l61grlnCUe7AFX8KGahAgug==", - "requires": { - "@types/react": "*" - } - }, - "@types/scheduler": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", - "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "atomically": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/atomically/-/atomically-1.7.0.tgz", - "integrity": "sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w==" - }, - "babel-plugin-macros": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz", - "integrity": "sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg==", - "requires": { - "@babel/runtime": "^7.7.2", - "cosmiconfig": "^6.0.0", - "resolve": "^1.12.0" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" - } - } - }, - "clsx": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz", - "integrity": "sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==" - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "conf": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/conf/-/conf-7.1.2.tgz", - "integrity": "sha512-r8/HEoWPFn4CztjhMJaWNAe5n+gPUCSaJ0oufbqDLFKsA1V8JjAG7G+p0pgoDFAws9Bpk2VtVLLXqOBA7WxLeg==", - "requires": { - "ajv": "^6.12.2", - "atomically": "^1.3.1", - "debounce-fn": "^4.0.0", - "dot-prop": "^5.2.0", - "env-paths": "^2.2.0", - "json-schema-typed": "^7.0.3", - "make-dir": "^3.1.0", - "onetime": "^5.1.0", - "pkg-up": "^3.1.0", - "semver": "^7.3.2" - } - }, - "convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.7.2" - } - }, - "css-vendor": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/css-vendor/-/css-vendor-2.0.8.tgz", - "integrity": "sha512-x9Aq0XTInxrkuFeHKbYC7zWY8ai7qJ04Kxd9MnvbC1uO5DagxoHQjm4JvG+vCdXOoFtCjbL2XSZfxmoYa9uQVQ==", - "requires": { - "@babel/runtime": "^7.8.3", - "is-in-browser": "^1.0.2" - } - }, - "csstype": { - "version": "2.6.20", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.20.tgz", - "integrity": "sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==" - }, - "debounce-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/debounce-fn/-/debounce-fn-4.0.0.tgz", - "integrity": "sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ==", - "requires": { - "mimic-fn": "^3.0.0" - } - }, - "dom-helpers": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", - "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", - "requires": { - "@babel/runtime": "^7.8.7", - "csstype": "^3.0.2" - }, - "dependencies": { - "csstype": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.11.tgz", - "integrity": "sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==" - } - } - }, - "dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "requires": { - "is-obj": "^2.0.0" - } - }, - "env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==" - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "find-root": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", - "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==" - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "requires": { - "locate-path": "^3.0.0" - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" - }, - "hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "requires": { - "react-is": "^16.7.0" - }, - "dependencies": { - "react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - } - } - }, - "hyphenate-style-name": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz", - "integrity": "sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ==" - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" - }, - "is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", - "requires": { - "has": "^1.0.3" - } - }, - "is-in-browser": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-in-browser/-/is-in-browser-1.1.3.tgz", - "integrity": "sha1-Vv9NtoOgeMYILrldrX3GLh0E+DU=" - }, - "is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-schema-typed": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-7.0.3.tgz", - "integrity": "sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A==" - }, - "jss": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss/-/jss-10.9.0.tgz", - "integrity": "sha512-YpzpreB6kUunQBbrlArlsMpXYyndt9JATbt95tajx0t4MTJJcCJdd4hdNpHmOIDiUJrF/oX5wtVFrS3uofWfGw==", - "requires": { - "@babel/runtime": "^7.3.1", - "csstype": "^3.0.2", - "is-in-browser": "^1.1.3", - "tiny-warning": "^1.0.2" - }, - "dependencies": { - "csstype": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.11.tgz", - "integrity": "sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==" - } - } - }, - "jss-plugin-camel-case": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-camel-case/-/jss-plugin-camel-case-10.9.0.tgz", - "integrity": "sha512-UH6uPpnDk413/r/2Olmw4+y54yEF2lRIV8XIZyuYpgPYTITLlPOsq6XB9qeqv+75SQSg3KLocq5jUBXW8qWWww==", - "requires": { - "@babel/runtime": "^7.3.1", - "hyphenate-style-name": "^1.0.3", - "jss": "10.9.0" - } - }, - "jss-plugin-default-unit": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-default-unit/-/jss-plugin-default-unit-10.9.0.tgz", - "integrity": "sha512-7Ju4Q9wJ/MZPsxfu4T84mzdn7pLHWeqoGd/D8O3eDNNJ93Xc8PxnLmV8s8ZPNRYkLdxZqKtm1nPQ0BM4JRlq2w==", - "requires": { - "@babel/runtime": "^7.3.1", - "jss": "10.9.0" - } - }, - "jss-plugin-global": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-global/-/jss-plugin-global-10.9.0.tgz", - "integrity": "sha512-4G8PHNJ0x6nwAFsEzcuVDiBlyMsj2y3VjmFAx/uHk/R/gzJV+yRHICjT4MKGGu1cJq2hfowFWCyrr/Gg37FbgQ==", - "requires": { - "@babel/runtime": "^7.3.1", - "jss": "10.9.0" - } - }, - "jss-plugin-nested": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-nested/-/jss-plugin-nested-10.9.0.tgz", - "integrity": "sha512-2UJnDrfCZpMYcpPYR16oZB7VAC6b/1QLsRiAutOt7wJaaqwCBvNsosLEu/fUyKNQNGdvg2PPJFDO5AX7dwxtoA==", - "requires": { - "@babel/runtime": "^7.3.1", - "jss": "10.9.0", - "tiny-warning": "^1.0.2" - } - }, - "jss-plugin-props-sort": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-props-sort/-/jss-plugin-props-sort-10.9.0.tgz", - "integrity": "sha512-7A76HI8bzwqrsMOJTWKx/uD5v+U8piLnp5bvru7g/3ZEQOu1+PjHvv7bFdNO3DwNPC9oM0a//KwIJsIcDCjDzw==", - "requires": { - "@babel/runtime": "^7.3.1", - "jss": "10.9.0" - } - }, - "jss-plugin-rule-value-function": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-rule-value-function/-/jss-plugin-rule-value-function-10.9.0.tgz", - "integrity": "sha512-IHJv6YrEf8pRzkY207cPmdbBstBaE+z8pazhPShfz0tZSDtRdQua5jjg6NMz3IbTasVx9FdnmptxPqSWL5tyJg==", - "requires": { - "@babel/runtime": "^7.3.1", - "jss": "10.9.0", - "tiny-warning": "^1.0.2" - } - }, - "jss-plugin-vendor-prefixer": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/jss-plugin-vendor-prefixer/-/jss-plugin-vendor-prefixer-10.9.0.tgz", - "integrity": "sha512-MbvsaXP7iiVdYVSEoi+blrW+AYnTDvHTW6I6zqi7JcwXdc6I9Kbm234nEblayhF38EftoenbM+5218pidmC5gA==", - "requires": { - "@babel/runtime": "^7.3.1", - "css-vendor": "^2.0.8", - "jss": "10.9.0" - } - }, - "lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - } - } - }, - "memoize-one": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", - "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==" - }, - "mimic-fn": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", - "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==" - }, - "mobx": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.5.0.tgz", - "integrity": "sha512-pHZ/cySF00FVENDWIDzJyoObFahK6Eg4d0papqm6d7yMkxWTZ/S/csqJX1A3PsYy4t5k3z2QnlwuCfMW5lSEwA==" - }, - "mobx-react": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/mobx-react/-/mobx-react-7.4.0.tgz", - "integrity": "sha512-gbUwaKZK09SiAleTMxNMKs1MYKTpoIEWJLTLRIR/xnALuuHET8wkL8j1nbc1/6cDkOWVyKz/ReftILx0Pdh2PQ==", - "requires": { - "mobx-react-lite": "^3.4.0" - } - }, - "mobx-react-lite": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-3.4.0.tgz", - "integrity": "sha512-bRuZp3C0itgLKHu/VNxi66DN/XVkQG7xtoBVWxpvC5FhAqbOCP21+nPhULjnzEqd7xBMybp6KwytdUpZKEgpIQ==", - "requires": {} - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "requires": { - "mimic-fn": "^2.1.0" - }, - "dependencies": { - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" - } - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "requires": { - "callsites": "^3.0.0" - } - }, - "parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" - }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" - }, - "pkg-up": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", - "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==", - "requires": { - "find-up": "^3.0.0" - } - }, - "popper.js": { - "version": "1.16.1-lts", - "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1-lts.tgz", - "integrity": "sha512-Kjw8nKRl1m+VrSFCoVGPph93W/qrSO7ZkqPpTf7F4bk/sqcfWK019dWBUpE/fBOsOQY1dks/Bmcbfn1heM/IsA==" - }, - "prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "requires": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - }, - "dependencies": { - "react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - } - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" - }, - "react-select": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.3.2.tgz", - "integrity": "sha512-W6Irh7U6Ha7p5uQQ2ZnemoCQ8mcfgOtHfw3wuMzG6FAu0P+CYicgofSLOq97BhjMx8jS+h+wwWdCBeVVZ9VqlQ==", - "requires": { - "@babel/runtime": "^7.12.0", - "@emotion/cache": "^11.4.0", - "@emotion/react": "^11.8.1", - "@types/react-transition-group": "^4.4.0", - "memoize-one": "^5.0.0", - "prop-types": "^15.6.0", - "react-transition-group": "^4.3.0" - } - }, - "react-transition-group": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.2.tgz", - "integrity": "sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg==", - "requires": { - "@babel/runtime": "^7.5.5", - "dom-helpers": "^5.0.1", - "loose-envify": "^1.4.0", - "prop-types": "^15.6.2" - } - }, - "regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" - }, - "resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "requires": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "requires": { - "lru-cache": "^6.0.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==" - }, - "stylis": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.0.13.tgz", - "integrity": "sha512-xGPXiFVl4YED9Jh7Euv2V220mriG9u4B2TA6Ybjc1catrstKD2PpIdU3U0RKpkVBC2EhmL/F0sPCr9vrFTNRag==" - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - }, - "supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" - }, - "tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==" - }, - "typed-emitter": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/typed-emitter/-/typed-emitter-1.4.0.tgz", - "integrity": "sha512-weBmoo3HhpKGgLBOYwe8EB31CzDFuaK7CCL+axXhUYhn4jo6DSkHnbefboCF5i4DQ2aMFe0C/FdTWcPdObgHyg==" - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "requires": { - "punycode": "^2.1.0" - } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, - "yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==" - } - } -} diff --git a/src/extensions/npm/extensions/package.json b/src/extensions/npm/extensions/package.json index 2afda96cf2..6ed1bd2f19 100644 --- a/src/extensions/npm/extensions/package.json +++ b/src/extensions/npm/extensions/package.json @@ -16,8 +16,8 @@ "name": "OpenLens Authors" }, "dependencies": { - "@material-ui/core": "4.12.3", - "@types/node": "14.17.14", + "@material-ui/core": "^4.12.3", + "@types/node": "^16.11.58", "@types/react": "^17.0.45", "@types/react-dom": "^17.0.16", "@types/react-router": "^5.1.18", From b9cc0d5687b2b414b9022eedd28439c715670478 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 3 Oct 2022 11:38:41 -0300 Subject: [PATCH 050/280] Fix kubeconfig-sync sometimes producing multiple identical entities (#5855) --- .../cluster-store/get-by-id.injectable.ts | 21 ++ .../fs/create-read-file-stream.injectable.ts | 30 ++ src/common/fs/stat/stat.injectable.ts | 6 +- src/common/fs/watch/watch.injectable.ts | 152 +++++++- .../logger/prefixed-logger.injectable.ts | 37 ++ src/common/runnable/run-many-for.test.ts | 23 +- src/common/runnable/run-many-for.ts | 5 +- src/common/runnable/run-many-sync-for.test.ts | 23 +- src/common/runnable/run-many-sync-for.ts | 10 +- .../throw-with-incorrect-hierarchy-for.ts | 16 +- .../user-store/kubeconfig-syncs.injectable.ts | 17 + src/common/utils/iter.ts | 2 + ...ing-the-app-using-application-menu.test.ts | 4 +- .../app-paths/setup-app-paths.injectable.ts | 1 + ...current-version-to-analytics.injectable.ts | 1 + .../start-checking-for-updates.injectable.ts | 1 + .../stop-checking-for-updates.injectable.ts | 1 + ...update-should-happen-on-quit.injectable.ts | 1 + ...update-should-happen-on-quit.injectable.ts | 1 + .../__test__/kubeconfig-sync.test.ts | 282 ++++++++++---- .../compute-diff.injectable.ts | 102 +++++ .../config-to-models.injectable.ts | 42 +++ .../diff-changed-kubeconfig.injectable.ts | 90 +++++ .../kubeconfig-sync/logger.injectable.ts | 13 + .../kubeconfig-sync/manager.injectable.ts | 12 +- .../kubeconfig-sync/manager.ts | 351 ++---------------- .../watch-file-changes.injectable.ts | 134 +++++++ .../start-catalog-sync.injectable.ts | 1 + .../stop-catalog-sync.injectable.ts | 1 + src/main/cluster-manager.injectable.ts | 25 -- .../cluster/are-being-deleted.injectable.ts | 14 + .../cluster/initialize-manager.injectable.ts | 25 ++ src/main/cluster/manager.injectable.ts | 21 ++ .../manager.ts} | 36 +- .../clean-up-deep-linking.injectable.ts | 1 + ...-dock-for-last-closed-window.injectable.ts | 1 + ...dock-for-first-opened-window.injectable.ts | 1 + ...-single-application-instance.injectable.ts | 1 + .../setup-application-name.injectable.ts | 1 + .../setup-deep-linking.injectable.ts | 1 + ...s-in-development-environment.injectable.ts | 1 + .../setup-device-shutdown.injectable.ts | 1 + .../setup-ipc-main-handlers.injectable.ts | 6 +- .../setup-ipc-main-handlers.ts | 21 +- ...-visibility-after-activation.injectable.ts | 1 + ...ables-after-window-is-opened.injectable.ts | 1 + ...efore-closing-of-application.injectable.ts | 1 + src/main/getDiForUnitTesting.ts | 34 +- src/main/lens-proxy/lens-proxy.injectable.ts | 2 +- .../shell-api-request.injectable.ts | 2 +- .../shell-api-request/shell-api-request.ts | 2 +- .../menu/start-application-menu.injectable.ts | 1 + .../menu/stop-application-menu.injectable.ts | 1 + ...er-for-current-cluster-frame.injectable.ts | 1 + .../clean-up-shell-sessions.injectable.ts | 1 + .../emit-close-to-event-bus.injectable.ts | 1 + ...t-service-start-to-event-bus.injectable.ts | 1 + .../flag-renderer-as-loaded.injectable.ts | 1 + .../flag-renderer-as-not-loaded.injectable.ts | 1 + .../initialize-extensions.injectable.ts | 1 + .../kube-config-sync/add-source.injectable.ts | 26 ++ .../start-kube-config-sync.injectable.ts | 3 + .../stop-kube-config-sync.injectable.ts | 1 + .../runnables/sentry/setup.injectable.ts | 1 + .../setup-detector-registry.injectable.ts | 1 + .../setup-hardware-acceleration.injectable.ts | 1 + .../setup-hotbar-store.injectable.ts | 1 + .../runnables/setup-immer.injectable.ts | 1 + .../runnables/setup-lens-proxy.injectable.ts | 1 + .../runnables/setup-mobx.injectable.ts | 1 + .../setup-prometheus-registry.injectable.ts | 1 + .../runnables/setup-proxy-env.injectable.ts | 1 + ...etup-reactions-in-user-store.injectable.ts | 1 + .../runnables/setup-shell.injectable.ts | 1 + ...-of-general-catalog-entities.injectable.ts | 1 + .../setup-syncing-of-weblinks.injectable.ts | 1 + .../runnables/setup-system-ca.injectable.ts | 1 + .../stop-cluster-manager.injectable.ts | 3 +- .../stop-services-and-exit-app.injectable.ts | 2 +- src/main/stores/init-user-store.injectable.ts | 5 +- ...rt-broadcasting-theme-change.injectable.ts | 1 + ...op-broadcasting-theme-change.injectable.ts | 1 + ...-theme-from-operating-system.injectable.ts | 1 + ...-theme-from-operating-system.injectable.ts | 1 + .../electron-tray/start-tray.injectable.ts | 1 + .../electron-tray/stop-tray.injectable.ts | 1 + .../menu-icon/start-reactivity.injectable.ts | 1 + .../menu-icon/stop-reactivity.injectable.ts | 1 + ...art-reactive-tray-menu-items.injectable.ts | 1 + ...top-reactive-tray-menu-items.injectable.ts | 1 + .../start-listening-of-channels.injectable.ts | 1 + .../vars/build-version/init.injectable.ts | 7 +- .../default-update-channel/init.injectable.ts | 7 +- .../vars/release-channel/init.injectable.ts | 1 + .../semantic-build-version/init.injectable.ts | 1 + .../api/setup-on-api-errors.injectable.ts | 1 + .../app-paths/setup-app-paths.injectable.ts | 1 + .../components/hotbar/hotbar-entity-icon.tsx | 15 +- .../top-bar/start-state-sync.injectable.ts | 1 + .../test-utils/get-application-builder.tsx | 2 +- .../root-frame/setup-system-ca.injectable.ts | 1 + src/renderer/getDiForUnitTesting.tsx | 17 +- .../stores/init-user-store.injectable.ts | 5 +- .../start-listening-of-channels.injectable.ts | 1 + ...nitial-values-for-sync-boxes.injectable.ts | 1 + .../vars/build-version/init.injectable.ts | 1 + .../default-update-channel/init.injectable.ts | 7 +- .../vars/release-channel/init.injectable.ts | 1 + .../semantic-build-version/init.injectable.ts | 1 + 109 files changed, 1219 insertions(+), 505 deletions(-) create mode 100644 src/common/cluster-store/get-by-id.injectable.ts create mode 100644 src/common/fs/create-read-file-stream.injectable.ts create mode 100644 src/common/logger/prefixed-logger.injectable.ts create mode 100644 src/common/user-store/kubeconfig-syncs.injectable.ts create mode 100644 src/main/catalog-sources/kubeconfig-sync/compute-diff.injectable.ts create mode 100644 src/main/catalog-sources/kubeconfig-sync/config-to-models.injectable.ts create mode 100644 src/main/catalog-sources/kubeconfig-sync/diff-changed-kubeconfig.injectable.ts create mode 100644 src/main/catalog-sources/kubeconfig-sync/logger.injectable.ts create mode 100644 src/main/catalog-sources/kubeconfig-sync/watch-file-changes.injectable.ts delete mode 100644 src/main/cluster-manager.injectable.ts create mode 100644 src/main/cluster/are-being-deleted.injectable.ts create mode 100644 src/main/cluster/initialize-manager.injectable.ts create mode 100644 src/main/cluster/manager.injectable.ts rename src/main/{cluster-manager.ts => cluster/manager.ts} (89%) create mode 100644 src/main/start-main-application/runnables/kube-config-sync/add-source.injectable.ts diff --git a/src/common/cluster-store/get-by-id.injectable.ts b/src/common/cluster-store/get-by-id.injectable.ts new file mode 100644 index 0000000000..534bdb5e76 --- /dev/null +++ b/src/common/cluster-store/get-by-id.injectable.ts @@ -0,0 +1,21 @@ +/** + * 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 type { ClusterId } from "../cluster-types"; +import type { Cluster } from "../cluster/cluster"; +import clusterStoreInjectable from "./cluster-store.injectable"; + +export type GetClusterById = (id: ClusterId) => Cluster | undefined; + +const getClusterByIdInjectable = getInjectable({ + id: "get-cluster-by-id", + instantiate: (di): GetClusterById => { + const store = di.inject(clusterStoreInjectable); + + return (id) => store.getById(id); + }, +}); + +export default getClusterByIdInjectable; diff --git a/src/common/fs/create-read-file-stream.injectable.ts b/src/common/fs/create-read-file-stream.injectable.ts new file mode 100644 index 0000000000..8714e1cdcd --- /dev/null +++ b/src/common/fs/create-read-file-stream.injectable.ts @@ -0,0 +1,30 @@ +/** + * 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 type { ReadStream } from "fs"; +import fsInjectable from "./fs.injectable"; + +export interface CreateReadStreamOptions { + mode?: number; + end?: number | undefined; + flags?: string | undefined; + encoding?: BufferEncoding | undefined; + autoClose?: boolean | undefined; + /** + * @default false + */ + emitClose?: boolean | undefined; + start?: number | undefined; + highWaterMark?: number | undefined; +} + +export type CreateReadFileStream = (filePath: string, options?: CreateReadStreamOptions) => ReadStream; + +const createReadFileStreamInjectable = getInjectable({ + id: "create-read-file-stream", + instantiate: (di): CreateReadFileStream => di.inject(fsInjectable).createReadStream, +}); + +export default createReadFileStreamInjectable; diff --git a/src/common/fs/stat/stat.injectable.ts b/src/common/fs/stat/stat.injectable.ts index aa1ce44447..e9924fc088 100644 --- a/src/common/fs/stat/stat.injectable.ts +++ b/src/common/fs/stat/stat.injectable.ts @@ -3,12 +3,14 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; +import type { Stats } from "fs"; import fsInjectable from "../fs.injectable"; +export type Stat = (path: string) => Promise; + const statInjectable = getInjectable({ id: "stat", - - instantiate: (di) => di.inject(fsInjectable).stat, + instantiate: (di): Stat => di.inject(fsInjectable).stat, }); export default statInjectable; diff --git a/src/common/fs/watch/watch.injectable.ts b/src/common/fs/watch/watch.injectable.ts index 44d34f20f5..50f96cdf57 100644 --- a/src/common/fs/watch/watch.injectable.ts +++ b/src/common/fs/watch/watch.injectable.ts @@ -3,15 +3,161 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import type { FSWatcher, WatchOptions } from "chokidar"; import { watch } from "chokidar"; +import type { Stats } from "fs"; +import type TypedEventEmitter from "typed-emitter"; +import type { SingleOrMany } from "../../utils"; -export type Watch = (path: string, options?: WatchOptions) => FSWatcher; +export interface AlwaysStatWatcherEvents { + add: (path: string, stats: Stats) => void; + addDir: (path: string, stats: Stats) => void; + change: (path: string, stats: Stats) => void; +} + +export interface MaybeStatWatcherEvents { + add: (path: string, stats?: Stats) => void; + addDir: (path: string, stats?: Stats) => void; + change: (path: string, stats?: Stats) => void; +} + +export type WatcherEvents = BaseWatcherEvents + & ( + AlwaysStat extends true + ? AlwaysStatWatcherEvents + : MaybeStatWatcherEvents + ); + +export interface BaseWatcherEvents { + error: (error: Error) => void; + ready: () => void; + unlink: (path: string) => void; + unlinkDir: (path: string) => void; +} + +export interface Watcher extends TypedEventEmitter> { + close: () => Promise; +} + +export type WatcherOptions = { + /** + * Indicates whether the process should continue to run as long as files are being watched. If + * set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`, + * even if the process continues to run. + */ + persistent?: boolean; + + /** + * ([anymatch](https://github.com/micromatch/anymatch)-compatible definition) Defines files/paths to + * be ignored. The whole relative or absolute path is tested, not just filename. If a function + * with two arguments is provided, it gets called twice per path - once with a single argument + * (the path), second time with two arguments (the path and the + * [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path). + */ + ignored?: SingleOrMany boolean)>; + + /** + * If set to `false` then `add`/`addDir` events are also emitted for matching paths while + * instantiating the watching as chokidar discovers these file paths (before the `ready` event). + */ + ignoreInitial?: boolean; + + /** + * When `false`, only the symlinks themselves will be watched for changes instead of following + * the link references and bubbling events through the link's path. + */ + followSymlinks?: boolean; + + /** + * The base directory from which watch `paths` are to be derived. Paths emitted with events will + * be relative to this. + */ + cwd?: string; + + /** + * If set to true then the strings passed to .watch() and .add() are treated as literal path + * names, even if they look like globs. Default: false. + */ + disableGlobbing?: boolean; + + /** + * Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU + * utilization, consider setting this to `false`. It is typically necessary to **set this to + * `true` to successfully watch files over a network**, and it may be necessary to successfully + * watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides + * the `useFsEvents` default. + */ + usePolling?: boolean; + + /** + * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly + * and `fsevents` is available this supercedes the `usePolling` setting. When set to `false` on + * OS X, `usePolling: true` becomes the default. + */ + useFsEvents?: boolean; + + /** + * If set, limits how many levels of subdirectories will be traversed. + */ + depth?: number; + + /** + * Interval of file system polling. + */ + interval?: number; + + /** + * Interval of file system polling for binary files. ([see list of binary extensions](https://gi + * thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json)) + */ + binaryInterval?: number; + + /** + * Indicates whether to watch files that don't have read permissions if possible. If watching + * fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed + * silently. + */ + ignorePermissionErrors?: boolean; + + /** + * `true` if `useFsEvents` and `usePolling` are `false`). Automatically filters out artifacts + * that occur when using editors that use "atomic writes" instead of writing directly to the + * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change` + * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you, + * you can override it by setting `atomic` to a custom value, in milliseconds. + */ + atomic?: boolean | number; + + /** + * can be set to an object in order to adjust timing params: + */ + awaitWriteFinish?: AwaitWriteFinishOptions | boolean; +} & (AlwaysStat extends true + ? { + alwaysStat: true; + } + : { + alwaysStat?: false; + } +); + +export interface AwaitWriteFinishOptions { + /** + * Amount of time in milliseconds for a file size to remain constant before emitting its event. + */ + stabilityThreshold?: number; + + /** + * File size polling interval. + */ + pollInterval?: number; +} + +export type Watch = (path: string, options?: WatcherOptions) => Watcher; // TODO: Introduce wrapper to allow simpler API const watchInjectable = getInjectable({ id: "watch", - instantiate: (): Watch => watch, + instantiate: () => watch as Watch, causesSideEffects: true, }); diff --git a/src/common/logger/prefixed-logger.injectable.ts b/src/common/logger/prefixed-logger.injectable.ts new file mode 100644 index 0000000000..36f86c532f --- /dev/null +++ b/src/common/logger/prefixed-logger.injectable.ts @@ -0,0 +1,37 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ +import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; +import type { Logger } from "../logger"; +import loggerInjectable from "../logger.injectable"; + +const prefixedLoggerInjectable = getInjectable({ + id: "prefixed-logger", + instantiate: (di, prefix): Logger => { + const logger = di.inject(loggerInjectable); + + return { + debug: (message, ...args) => { + logger.debug(`[${prefix}]: ${message}`, ...args); + }, + error: (message, ...args) => { + logger.error(`[${prefix}]: ${message}`, ...args); + }, + info: (message, ...args) => { + logger.info(`[${prefix}]: ${message}`, ...args); + }, + silly: (message, ...args) => { + logger.silly(`[${prefix}]: ${message}`, ...args); + }, + warn: (message, ...args) => { + logger.warn(`[${prefix}]: ${message}`, ...args); + }, + }; + }, + lifecycle: lifecycleEnum.keyedSingleton({ + getInstanceKey: (di, prefix: string) => prefix, + }), +}); + +export default prefixedLoggerInjectable; diff --git a/src/common/runnable/run-many-for.test.ts b/src/common/runnable/run-many-for.test.ts index 35db17952a..c73f448dd2 100644 --- a/src/common/runnable/run-many-for.test.ts +++ b/src/common/runnable/run-many-for.test.ts @@ -25,13 +25,19 @@ describe("runManyFor", () => { const someInjectable = getInjectable({ id: "some-injectable", - instantiate: () => ({ run: () => runMock("some-call") }), + instantiate: () => ({ + id: "some-injectable", + run: () => runMock("some-call"), + }), injectionToken: someInjectionTokenForRunnables, }); const someOtherInjectable = getInjectable({ id: "some-other-injectable", - instantiate: () => ({ run: () => runMock("some-other-call") }), + instantiate: () => ({ + id: "some-other-injectable", + run: () => runMock("some-other-call"), + }), injectionToken: someInjectionTokenForRunnables, }); @@ -79,6 +85,7 @@ describe("runManyFor", () => { id: "some-injectable-1", instantiate: (di) => ({ + id: "some-injectable-1", run: () => runMock("third-level-run"), runAfter: di.inject(someInjectable2), }), @@ -90,6 +97,7 @@ describe("runManyFor", () => { id: "some-injectable-2", instantiate: (di) => ({ + id: "some-injectable-2", run: () => runMock("second-level-run"), runAfter: di.inject(someInjectable3), }), @@ -99,7 +107,10 @@ describe("runManyFor", () => { const someInjectable3 = getInjectable({ id: "some-injectable-3", - instantiate: () => ({ run: () => runMock("first-level-run") }), + instantiate: () => ({ + id: "some-injectable-3", + run: () => runMock("first-level-run"), + }), injectionToken: someInjectionTokenForRunnables, }); @@ -186,6 +197,7 @@ describe("runManyFor", () => { id: "some-runnable-1", instantiate: (di) => ({ + id: "some-runnable-1", run: () => runMock("some-runnable-1"), runAfter: di.inject(someOtherInjectable), }), @@ -197,6 +209,7 @@ describe("runManyFor", () => { id: "some-runnable-2", instantiate: () => ({ + id: "some-runnable-2", run: () => runMock("some-runnable-2"), }), @@ -210,7 +223,7 @@ describe("runManyFor", () => { ); return expect(() => runMany()).rejects.toThrow( - "Tried to run runnable after other runnable which does not same injection token.", + 'Tried to run runnable "some-runnable-1" after the runnable "some-runnable-2" which does not share the "some-injection-token" injection token.', ); }); @@ -232,6 +245,7 @@ describe("runManyFor", () => { id: "some-runnable-1", instantiate: () => ({ + id: "some-runnable-1", run: (parameter) => runMock("run-of-some-runnable-1", parameter), }), @@ -242,6 +256,7 @@ describe("runManyFor", () => { id: "some-runnable-2", instantiate: () => ({ + id: "some-runnable-2", run: (parameter) => runMock("run-of-some-runnable-2", parameter), }), diff --git a/src/common/runnable/run-many-for.ts b/src/common/runnable/run-many-for.ts index f2c1a4ae56..478d7f84a4 100644 --- a/src/common/runnable/run-many-for.ts +++ b/src/common/runnable/run-many-for.ts @@ -11,8 +11,9 @@ import { filter, forEach, map, tap } from "lodash/fp"; import { throwWithIncorrectHierarchyFor } from "./throw-with-incorrect-hierarchy-for"; export interface Runnable { + id: string; run: Run; - runAfter?: this; + runAfter?: Runnable; } type Run = (parameter: Param) => Promise | void; @@ -25,7 +26,7 @@ export function runManyFor(di: DiContainerForInjection): RunMany { return (injectionToken) => async (parameter) => { const allRunnables = di.injectMany(injectionToken); - const throwWithIncorrectHierarchy = throwWithIncorrectHierarchyFor(allRunnables); + const throwWithIncorrectHierarchy = throwWithIncorrectHierarchyFor((injectionToken as any).id, allRunnables); const recursedRun = async ( runAfterRunnable: Runnable | undefined = undefined, diff --git a/src/common/runnable/run-many-sync-for.test.ts b/src/common/runnable/run-many-sync-for.test.ts index fe47516725..43d2832663 100644 --- a/src/common/runnable/run-many-sync-for.test.ts +++ b/src/common/runnable/run-many-sync-for.test.ts @@ -21,13 +21,19 @@ describe("runManySyncFor", () => { const someInjectable = getInjectable({ id: "some-injectable", - instantiate: () => ({ run: () => runMock("some-call") }), + instantiate: () => ({ + id: "some-injectable", + run: () => runMock("some-call"), + }), injectionToken: someInjectionTokenForRunnables, }); const someOtherInjectable = getInjectable({ id: "some-other-injectable", - instantiate: () => ({ run: () => runMock("some-other-call") }), + instantiate: () => ({ + id: "some-other-injectable", + run: () => runMock("some-other-call"), + }), injectionToken: someInjectionTokenForRunnables, }); @@ -62,6 +68,7 @@ describe("runManySyncFor", () => { id: "some-injectable-1", instantiate: (di) => ({ + id: "some-injectable-1", run: () => runMock("third-level-run"), runAfter: di.inject(someInjectable2), }), @@ -73,6 +80,7 @@ describe("runManySyncFor", () => { id: "some-injectable-2", instantiate: (di) => ({ + id: "some-injectable-2", run: () => runMock("second-level-run"), runAfter: di.inject(someInjectable3), }), @@ -82,7 +90,10 @@ describe("runManySyncFor", () => { const someInjectable3 = getInjectable({ id: "some-injectable-3", - instantiate: () => ({ run: () => runMock("first-level-run") }), + instantiate: () => ({ + id: "some-injectable-3", + run: () => runMock("first-level-run"), + }), injectionToken: someInjectionTokenForRunnables, }); @@ -115,6 +126,7 @@ describe("runManySyncFor", () => { id: "some-runnable-1", instantiate: (di) => ({ + id: "some-runnable-1", run: () => runMock("some-runnable-1"), runAfter: di.inject(someOtherInjectable), }), @@ -126,6 +138,7 @@ describe("runManySyncFor", () => { id: "some-runnable-2", instantiate: () => ({ + id: "some-runnable-2", run: () => runMock("some-runnable-2"), }), @@ -139,7 +152,7 @@ describe("runManySyncFor", () => { ); return expect(() => runMany()).rejects.toThrow( - "Tried to run runnable after other runnable which does not same injection token.", + 'Tried to run runnable "some-runnable-1" after the runnable "some-runnable-2" which does not share the "some-injection-token" injection token.', ); }); @@ -161,6 +174,7 @@ describe("runManySyncFor", () => { id: "some-runnable-1", instantiate: () => ({ + id: "some-runnable-1", run: (parameter) => runMock("run-of-some-runnable-1", parameter), }), @@ -171,6 +185,7 @@ describe("runManySyncFor", () => { id: "some-runnable-2", instantiate: () => ({ + id: "some-runnable-2", run: (parameter) => runMock("run-of-some-runnable-2", parameter), }), diff --git a/src/common/runnable/run-many-sync-for.ts b/src/common/runnable/run-many-sync-for.ts index cfe93fa4b3..1d3dcec2c5 100644 --- a/src/common/runnable/run-many-sync-for.ts +++ b/src/common/runnable/run-many-sync-for.ts @@ -3,17 +3,15 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { pipeline } from "@ogre-tools/fp"; -import type { - DiContainerForInjection, - InjectionToken, -} from "@ogre-tools/injectable"; +import type { DiContainerForInjection, InjectionToken } from "@ogre-tools/injectable"; import { filter, forEach, map, tap } from "lodash/fp"; import type { Runnable } from "./run-many-for"; import { throwWithIncorrectHierarchyFor } from "./throw-with-incorrect-hierarchy-for"; export interface RunnableSync { + id: string; run: RunSync; - runAfter?: this; + runAfter?: RunnableSync; } type RunSync = (parameter: Param) => void; @@ -26,7 +24,7 @@ export function runManySyncFor(di: DiContainerForInjection): RunManySync { return (injectionToken) => async (parameter) => { const allRunnables = di.injectMany(injectionToken); - const throwWithIncorrectHierarchy = throwWithIncorrectHierarchyFor(allRunnables); + const throwWithIncorrectHierarchy = throwWithIncorrectHierarchyFor((injectionToken as any).id, allRunnables); const recursedRun = ( runAfterRunnable: RunnableSync | undefined = undefined, diff --git a/src/common/runnable/throw-with-incorrect-hierarchy-for.ts b/src/common/runnable/throw-with-incorrect-hierarchy-for.ts index 03073c4044..bddf8037c2 100644 --- a/src/common/runnable/throw-with-incorrect-hierarchy-for.ts +++ b/src/common/runnable/throw-with-incorrect-hierarchy-for.ts @@ -5,12 +5,10 @@ import type { Runnable } from "./run-many-for"; import type { RunnableSync } from "./run-many-sync-for"; -export const throwWithIncorrectHierarchyFor = - (allRunnables: Runnable[] | RunnableSync[]) => - (runnable: Runnable | RunnableSync) => { - if (runnable.runAfter && !allRunnables.includes(runnable.runAfter)) { - throw new Error( - "Tried to run runnable after other runnable which does not same injection token.", - ); - } - }; +export const throwWithIncorrectHierarchyFor = (injectionTokenId: string, allRunnables: Runnable[] | RunnableSync[]) => ( + (runnable: Runnable | RunnableSync) => { + if (runnable.runAfter && !allRunnables.includes(runnable.runAfter)) { + throw new Error(`Tried to run runnable "${runnable.id}" after the runnable "${runnable.runAfter.id}" which does not share the "${injectionTokenId}" injection token.`); + } + } +); diff --git a/src/common/user-store/kubeconfig-syncs.injectable.ts b/src/common/user-store/kubeconfig-syncs.injectable.ts new file mode 100644 index 0000000000..bbe02fffad --- /dev/null +++ b/src/common/user-store/kubeconfig-syncs.injectable.ts @@ -0,0 +1,17 @@ +/** + * 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 userStoreInjectable from "./user-store.injectable"; + +const kubeconfigSyncsInjectable = getInjectable({ + id: "kubeconfig-syncs", + instantiate: (di) => { + const store = di.inject(userStoreInjectable); + + return store.syncKubeconfigEntries; + }, +}); + +export default kubeconfigSyncsInjectable; diff --git a/src/common/utils/iter.ts b/src/common/utils/iter.ts index 05d097ed78..9752e56dc5 100644 --- a/src/common/utils/iter.ts +++ b/src/common/utils/iter.ts @@ -11,6 +11,7 @@ interface Iterator { find(fn: (val: T) => unknown): T | undefined; collect(fn: (values: Iterable) => U): U; map(fn: (val: T) => U): Iterator; + flatMap(fn: (val: T) => U[]): Iterator; join(sep?: string): string; } @@ -19,6 +20,7 @@ export function pipeline(src: IterableIterator): Iterator { filter: (fn) => pipeline(filter(src, fn)), filterMap: (fn) => pipeline(filterMap(src, fn)), map: (fn) => pipeline(map(src, fn)), + flatMap: (fn) => pipeline(flatMap(src, fn)), find: (fn) => find(src, fn), join: (sep) => join(src, sep), collect: (fn) => fn(src), diff --git a/src/features/quitting-and-restarting-the-app/quitting-the-app-using-application-menu.test.ts b/src/features/quitting-and-restarting-the-app/quitting-the-app-using-application-menu.test.ts index fe903f93f3..5e0989aa91 100644 --- a/src/features/quitting-and-restarting-the-app/quitting-the-app-using-application-menu.test.ts +++ b/src/features/quitting-and-restarting-the-app/quitting-the-app-using-application-menu.test.ts @@ -5,9 +5,9 @@ import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; -import type { ClusterManager } from "../../main/cluster-manager"; +import type { ClusterManager } from "../../main/cluster/manager"; import exitAppInjectable from "../../main/electron-app/features/exit-app.injectable"; -import clusterManagerInjectable from "../../main/cluster-manager.injectable"; +import clusterManagerInjectable from "../../main/cluster/manager.injectable"; import stopServicesAndExitAppInjectable from "../../main/stop-services-and-exit-app.injectable"; import { advanceFakeTime, useFakeTime } from "../../common/test-utils/use-fake-time"; diff --git a/src/main/app-paths/setup-app-paths.injectable.ts b/src/main/app-paths/setup-app-paths.injectable.ts index 3626bbd9c0..842eed89c7 100644 --- a/src/main/app-paths/setup-app-paths.injectable.ts +++ b/src/main/app-paths/setup-app-paths.injectable.ts @@ -27,6 +27,7 @@ const setupAppPathsInjectable = getInjectable({ const joinPaths = di.inject(joinPathsInjectable); return { + id: "setup-app-paths", run: () => { if (directoryForIntegrationTesting) { setElectronAppPath("appData", directoryForIntegrationTesting); diff --git a/src/main/application-update/emit-current-version-to-analytics.injectable.ts b/src/main/application-update/emit-current-version-to-analytics.injectable.ts index 61dd38ea87..4da1893cea 100644 --- a/src/main/application-update/emit-current-version-to-analytics.injectable.ts +++ b/src/main/application-update/emit-current-version-to-analytics.injectable.ts @@ -16,6 +16,7 @@ const emitCurrentVersionToAnalyticsInjectable = getInjectable({ const buildVersion = di.inject(buildVersionInjectable); return { + id: "emit-current-version-to-analytics", run: () => { emitEvent({ name: "app", diff --git a/src/main/application-update/periodical-check-for-updates/start-checking-for-updates.injectable.ts b/src/main/application-update/periodical-check-for-updates/start-checking-for-updates.injectable.ts index 347015b584..15088b3173 100644 --- a/src/main/application-update/periodical-check-for-updates/start-checking-for-updates.injectable.ts +++ b/src/main/application-update/periodical-check-for-updates/start-checking-for-updates.injectable.ts @@ -15,6 +15,7 @@ const startCheckingForUpdatesInjectable = getInjectable({ const updatingIsEnabled = di.inject(updatingIsEnabledInjectable); return { + id: "start-checking-for-updates", run: async () => { if (updatingIsEnabled && !periodicalCheckForUpdates.started) { await periodicalCheckForUpdates.start(); diff --git a/src/main/application-update/periodical-check-for-updates/stop-checking-for-updates.injectable.ts b/src/main/application-update/periodical-check-for-updates/stop-checking-for-updates.injectable.ts index 944642b674..15e71cc817 100644 --- a/src/main/application-update/periodical-check-for-updates/stop-checking-for-updates.injectable.ts +++ b/src/main/application-update/periodical-check-for-updates/stop-checking-for-updates.injectable.ts @@ -13,6 +13,7 @@ const stopCheckingForUpdatesInjectable = getInjectable({ const periodicalCheckForUpdates = di.inject(periodicalCheckForUpdatesInjectable); return { + id: "stop-checking-for-updates", run: async () => { if (periodicalCheckForUpdates.started) { await periodicalCheckForUpdates.stop(); diff --git a/src/main/application-update/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts b/src/main/application-update/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts index ef31cf5db5..3206b29a69 100644 --- a/src/main/application-update/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts +++ b/src/main/application-update/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts @@ -13,6 +13,7 @@ const startWatchingIfUpdateShouldHappenOnQuitInjectable = getInjectable({ const watchIfUpdateShouldHappenOnQuit = di.inject(watchIfUpdateShouldHappenOnQuitInjectable); return { + id: "start-watching-if-update-should-happen-on-quit", run: () => { watchIfUpdateShouldHappenOnQuit.start(); }, diff --git a/src/main/application-update/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts b/src/main/application-update/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts index b66cf927f2..b782f76966 100644 --- a/src/main/application-update/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts +++ b/src/main/application-update/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts @@ -13,6 +13,7 @@ const stopWatchingIfUpdateShouldHappenOnQuitInjectable = getInjectable({ const watchIfUpdateShouldHappenOnQuit = di.inject(watchIfUpdateShouldHappenOnQuitInjectable); return { + id: "stop-watching-if-update-should-happen-on-quit", run: () => { watchIfUpdateShouldHappenOnQuit.stop(); }, diff --git a/src/main/catalog-sources/__test__/kubeconfig-sync.test.ts b/src/main/catalog-sources/__test__/kubeconfig-sync.test.ts index 08ff464bf2..2998022e67 100644 --- a/src/main/catalog-sources/__test__/kubeconfig-sync.test.ts +++ b/src/main/catalog-sources/__test__/kubeconfig-sync.test.ts @@ -3,71 +3,56 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { ObservableMap } from "mobx"; +import { observable, ObservableMap } from "mobx"; import type { CatalogEntity } from "../../../common/catalog"; import { loadFromOptions } from "../../../common/kube-helpers"; import type { Cluster } from "../../../common/cluster/cluster"; -import { computeDiff as computeDiffFor, configToModels } from "../kubeconfig-sync/manager"; -import mockFs from "mock-fs"; -import fs from "fs"; -import clusterStoreInjectable from "../../../common/cluster-store/cluster-store.injectable"; import { getDiForUnitTesting } from "../../getDiForUnitTesting"; -import { createClusterInjectionToken } from "../../../common/cluster/create-cluster-injection-token"; -import directoryForKubeConfigsInjectable from "../../../common/app-paths/directory-for-kube-configs/directory-for-kube-configs.injectable"; -import getConfigurationFileModelInjectable from "../../../common/get-configuration-file-model/get-configuration-file-model.injectable"; -import clusterManagerInjectable from "../../cluster-manager.injectable"; import directoryForUserDataInjectable from "../../../common/app-paths/directory-for-user-data/directory-for-user-data.injectable"; import directoryForTempInjectable from "../../../common/app-paths/directory-for-temp/directory-for-temp.injectable"; -import kubectlBinaryNameInjectable from "../../kubectl/binary-name.injectable"; -import kubectlDownloadingNormalizedArchInjectable from "../../kubectl/normalized-arch.injectable"; -import normalizedPlatformInjectable from "../../../common/vars/normalized-platform.injectable"; -import { iter } from "../../../common/utils"; -import fsInjectable from "../../../common/fs/fs.injectable"; - -jest.mock("electron", () => ({ - app: { - getVersion: () => "99.99.99", - getName: () => "lens", - setName: jest.fn(), - setPath: jest.fn(), - getPath: () => "tmp", - getLocale: () => "en", - setLoginItemSettings: jest.fn(), - }, - ipcMain: { - on: jest.fn(), - handle: jest.fn(), - }, -})); +import { iter, strictGet } from "../../../common/utils"; +import type { ComputeKubeconfigDiff } from "../kubeconfig-sync/compute-diff.injectable"; +import computeKubeconfigDiffInjectable from "../kubeconfig-sync/compute-diff.injectable"; +import type { ConfigToModels } from "../kubeconfig-sync/config-to-models.injectable"; +import configToModelsInjectable from "../kubeconfig-sync/config-to-models.injectable"; +import kubeconfigSyncManagerInjectable from "../kubeconfig-sync/manager.injectable"; +import type { KubeconfigSyncManager } from "../kubeconfig-sync/manager"; +import type { KubeconfigSyncValue } from "../../../common/user-store"; +import kubeconfigSyncsInjectable from "../../../common/user-store/kubeconfig-syncs.injectable"; +import getClusterByIdInjectable from "../../../common/cluster-store/get-by-id.injectable"; +import type { DiContainer } from "@ogre-tools/injectable"; +import type { AsyncFnMock } from "@async-fn/jest"; +import type { Stat } from "../../../common/fs/stat/stat.injectable"; +import asyncFn from "@async-fn/jest"; +import statInjectable from "../../../common/fs/stat/stat.injectable"; +import type { Watcher } from "../../../common/fs/watch/watch.injectable"; +import watchInjectable from "../../../common/fs/watch/watch.injectable"; +import EventEmitter from "events"; +import type { ReadStream, Stats } from "fs"; +import createReadFileStreamInjectable from "../../../common/fs/create-read-file-stream.injectable"; describe("kubeconfig-sync.source tests", () => { - let computeDiff: ReturnType; + let computeKubeconfigDiff: ComputeKubeconfigDiff; + let configToModels: ConfigToModels; + let kubeconfigSyncs: ObservableMap; + let clusters: Map; + let di: DiContainer; beforeEach(async () => { - const di = getDiForUnitTesting({ doGeneralOverrides: true }); + di = getDiForUnitTesting({ doGeneralOverrides: true }); - mockFs(); + di.override(directoryForUserDataInjectable, () => "/some-directory-for-user-data"); + di.override(directoryForTempInjectable, () => "/some-directory-for-temp"); - di.override(directoryForUserDataInjectable, () => "some-directory-for-user-data"); - di.override(directoryForTempInjectable, () => "some-directory-for-temp"); - di.override(kubectlBinaryNameInjectable, () => "kubectl"); - di.override(kubectlDownloadingNormalizedArchInjectable, () => "amd64"); - di.override(normalizedPlatformInjectable, () => "darwin"); + clusters = new Map(); + di.override(getClusterByIdInjectable, () => id => clusters.get(id)); - di.permitSideEffects(fsInjectable); - di.unoverride(clusterStoreInjectable); - di.permitSideEffects(clusterStoreInjectable); - di.permitSideEffects(getConfigurationFileModelInjectable); + kubeconfigSyncs = observable.map(); - computeDiff = computeDiffFor({ - directoryForKubeConfigs: di.inject(directoryForKubeConfigsInjectable), - createCluster: di.inject(createClusterInjectionToken), - clusterManager: di.inject(clusterManagerInjectable), - }); - }); + di.override(kubeconfigSyncsInjectable, () => kubeconfigSyncs); - afterEach(() => { - mockFs.restore(); + computeKubeconfigDiff = di.inject(computeKubeconfigDiffInjectable); + configToModels = di.inject(configToModelsInjectable); }); describe("configsToModels", () => { @@ -108,13 +93,13 @@ describe("kubeconfig-sync.source tests", () => { }); }); - describe("computeDiff", () => { + describe("computeKubeconfigDiff", () => { it("should leave an empty source empty if there are no entries", () => { const contents = ""; const rootSource = new ObservableMap(); const filePath = "/bar"; - computeDiff(contents, rootSource, filePath); + computeKubeconfigDiff(contents, rootSource, filePath); expect(rootSource.size).toBe(0); }); @@ -149,9 +134,7 @@ describe("kubeconfig-sync.source tests", () => { const rootSource = new ObservableMap(); const filePath = "/bar"; - fs.writeFileSync(filePath, contents); - - computeDiff(contents, rootSource, filePath); + computeKubeconfigDiff(contents, rootSource, filePath); expect(rootSource.size).toBe(1); @@ -193,9 +176,7 @@ describe("kubeconfig-sync.source tests", () => { const rootSource = new ObservableMap(); const filePath = "/bar"; - fs.writeFileSync(filePath, contents); - - computeDiff(contents, rootSource, filePath); + computeKubeconfigDiff(contents, rootSource, filePath); expect(rootSource.size).toBe(1); @@ -204,7 +185,7 @@ describe("kubeconfig-sync.source tests", () => { expect(c.kubeConfigPath).toBe("/bar"); expect(c.contextName).toBe("context-name"); - computeDiff("{}", rootSource, filePath); + computeKubeconfigDiff("{}", rootSource, filePath); expect(rootSource.size).toBe(0); }); @@ -247,9 +228,7 @@ describe("kubeconfig-sync.source tests", () => { const rootSource = new ObservableMap(); const filePath = "/bar"; - fs.writeFileSync(filePath, contents); - - computeDiff(contents, rootSource, filePath); + computeKubeconfigDiff(contents, rootSource, filePath); expect(rootSource.size).toBe(2); @@ -289,7 +268,7 @@ describe("kubeconfig-sync.source tests", () => { currentContext: "foobar", }); - computeDiff(newContents, rootSource, filePath); + computeKubeconfigDiff(newContents, rootSource, filePath); expect(rootSource.size).toBe(1); @@ -301,4 +280,181 @@ describe("kubeconfig-sync.source tests", () => { } }); }); + + describe("given a config file at /foobar/config", () => { + let manager: KubeconfigSyncManager; + let watchInstances: Map>; + let firstReadFoobarConfigSteam: ReadStream; + let secondReadFoobarConfigSteam: ReadStream; + let statMock: AsyncFnMock; + + beforeEach(() => { + statMock = asyncFn(); + di.override(statInjectable, () => statMock); + + watchInstances = new Map(); + di.override(watchInjectable, () => (path) => { + const fakeWatchInstance = getFakeWatchInstance(); + + watchInstances.set(path, fakeWatchInstance); + + return fakeWatchInstance; + }); + + di.override(createReadFileStreamInjectable, () => (filePath) => { + if (filePath !== "/foobar/config") { + throw new Error(`unexpected file path "${filePath}"`); + } + + if (!firstReadFoobarConfigSteam) { + return firstReadFoobarConfigSteam = getFakeReadStream(filePath); + } + + if (!secondReadFoobarConfigSteam) { + return secondReadFoobarConfigSteam = getFakeReadStream(filePath); + } + + return getFakeReadStream(filePath); + }); + + manager = di.inject(kubeconfigSyncManagerInjectable); + }); + + afterEach(() => { + (firstReadFoobarConfigSteam as any) = undefined; + (secondReadFoobarConfigSteam as any) = undefined; + }); + + it("should not find any entities", () => { + expect(manager.source.get()).toEqual([]); + }); + + describe("when sync has started", () => { + beforeEach(() => { + manager.startSync(); + }); + + it("should not find any entities", () => { + expect(manager.source.get()).toEqual([]); + }); + + describe("when a file sync target for /foobar/config is added", () => { + beforeEach(() => { + kubeconfigSyncs.set("/foobar/config", {}); + }); + + describe("when stat resolves as not a directory", () => { + beforeEach(async () => { + await statMock.resolveSpecific(["/foobar/config"], { + isDirectory: () => false, + } as Stats); + }); + + describe("when the watch emits that the file is added", () => { + beforeEach(() => { + strictGet(watchInstances, "/foobar/config").emit("add", "/foobar/config", { + size: foobarConfig.length, + } as Stats); + }); + + it("starts to read the file", () => { + expect(firstReadFoobarConfigSteam).toBeDefined(); + }); + + describe("when the data is read in", () => { + beforeEach(() => { + firstReadFoobarConfigSteam.emit("data", Buffer.from(foobarConfig)); + firstReadFoobarConfigSteam.emit("end"); + firstReadFoobarConfigSteam.emit("close"); + }); + + it("should find a single entity", () => { + expect(manager.source.get().length).toBe(1); + }); + + describe("when a folder sync target for /foobar is added", () => { + beforeEach(() => { + kubeconfigSyncs.set("/foobar", {}); + }); + + describe("when stat resolves as not a directory", () => { + beforeEach(async () => { + await statMock.resolveSpecific(["/foobar"], { + isDirectory: () => true, + } as Stats); + }); + + describe("when the watch emits that the file is added", () => { + beforeEach(() => { + strictGet(watchInstances, "/foobar").emit("add", "/foobar/config", { + size: foobarConfig.length, + } as Stats); + }); + + it("starts to read the file", () => { + expect(secondReadFoobarConfigSteam).toBeDefined(); + }); + + describe("when the data is read in", () => { + beforeEach(() => { + secondReadFoobarConfigSteam.emit("data", Buffer.from(foobarConfig)); + secondReadFoobarConfigSteam.emit("end"); + secondReadFoobarConfigSteam.emit("close"); + }); + + it("should still only find a single entity", () => { + expect(manager.source.get().length).toBe(1); + }); + }); + }); + }); + }); + }); + }); + }); + }); + }); + }); +}); + +const getFakeWatchInstance = (): Watcher => { + return Object.assign(new EventEmitter(), { + close: jest.fn().mockImplementation(async () => {}), + }); +}; + +const getFakeReadStream = (path: string): ReadStream => { + return Object.assign(new EventEmitter(), { + path, + close: () => {}, + push: () => true, + read: () => {}, + }) as unknown as ReadStream; +}; + +const foobarConfig = JSON.stringify({ + clusters: [{ + name: "cluster-name", + cluster: { + server: "1.2.3.4", + }, + skipTLSVerify: false, + }], + users: [{ + name: "user-name", + }], + contexts: [{ + name: "context-name", + context: { + cluster: "cluster-name", + user: "user-name", + }, + }, { + name: "context-the-second", + context: { + cluster: "missing-cluster", + user: "user-name", + }, + }], + currentContext: "foobar", }); diff --git a/src/main/catalog-sources/kubeconfig-sync/compute-diff.injectable.ts b/src/main/catalog-sources/kubeconfig-sync/compute-diff.injectable.ts new file mode 100644 index 0000000000..cb1e62e6e8 --- /dev/null +++ b/src/main/catalog-sources/kubeconfig-sync/compute-diff.injectable.ts @@ -0,0 +1,102 @@ +/** + * 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 { createHash } from "crypto"; +import type { ObservableMap } from "mobx"; +import { action } from "mobx"; +import { homedir } from "os"; +import directoryForKubeConfigsInjectable from "../../../common/app-paths/directory-for-kube-configs/directory-for-kube-configs.injectable"; +import type { CatalogEntity } from "../../../common/catalog"; +import getClusterByIdInjectable from "../../../common/cluster-store/get-by-id.injectable"; +import type { Cluster } from "../../../common/cluster/cluster"; +import { loadConfigFromString } from "../../../common/kube-helpers"; +import clustersThatAreBeingDeletedInjectable from "../../cluster/are-being-deleted.injectable"; +import { catalogEntityFromCluster } from "../../cluster/manager"; +import createClusterInjectable from "../../create-cluster/create-cluster.injectable"; +import configToModelsInjectable from "./config-to-models.injectable"; +import kubeconfigSyncLoggerInjectable from "./logger.injectable"; + +export type ComputeKubeconfigDiff = (contents: string, source: ObservableMap, filePath: string) => void; + +const computeKubeconfigDiffInjectable = getInjectable({ + id: "compute-kubeconfig-diff", + instantiate: (di): ComputeKubeconfigDiff => { + const directoryForKubeConfigs = di.inject(directoryForKubeConfigsInjectable); + const createCluster = di.inject(createClusterInjectable); + const clustersThatAreBeingDeleted = di.inject(clustersThatAreBeingDeletedInjectable); + const configToModels = di.inject(configToModelsInjectable); + const logger = di.inject(kubeconfigSyncLoggerInjectable); + const getClusterById = di.inject(getClusterByIdInjectable); + + return action((contents, source, filePath) => { + try { + const { config, error } = loadConfigFromString(contents); + + if (error) { + logger.warn(`encountered errors while loading config: ${error.message}`, { filePath, details: error.details }); + } + + const rawModels = configToModels(config, filePath); + const models = new Map(rawModels.map(([model, configData]) => [model.contextName, [model, configData] as const])); + + logger.debug(`File now has ${models.size} entries`, { filePath }); + + for (const [contextName, value] of source) { + const data = models.get(contextName); + + // remove and disconnect clusters that were removed from the config + if (!data) { + // remove from the deleting set, so that if a new context of the same name is added, it isn't marked as deleting + clustersThatAreBeingDeleted.delete(value[0].id); + + value[0].disconnect(); + source.delete(contextName); + logger.debug(`Removed old cluster from sync`, { filePath, contextName }); + continue; + } + + // TODO: For the update check we need to make sure that the config itself hasn't changed. + // Probably should make it so that cluster keeps a copy of the config in its memory and + // diff against that + + // or update the model and mark it as not needed to be added + value[0].updateModel(data[0]); + models.delete(contextName); + logger.debug(`Updated old cluster from sync`, { filePath, contextName }); + } + + for (const [contextName, [model, configData]] of models) { + // add new clusters to the source + try { + const clusterId = createHash("md5").update(`${filePath}:${contextName}`).digest("hex"); + const cluster = getClusterById(clusterId) ?? createCluster({ ...model, id: clusterId }, configData); + + if (!cluster.apiUrl) { + throw new Error("Cluster constructor failed, see above error"); + } + + const entity = catalogEntityFromCluster(cluster); + + if (!filePath.startsWith(directoryForKubeConfigs)) { + entity.metadata.labels.file = filePath.replace(homedir(), "~"); + } + source.set(contextName, [cluster, entity]); + + logger.debug(`Added new cluster from sync`, { filePath, contextName }); + } catch (error) { + logger.warn(`Failed to create cluster from model: ${error}`, { filePath, contextName }); + } + } + } catch (error) { + logger.warn(`Failed to compute diff: ${error}`, { filePath }); + source.clear(); // clear source if we have failed so as to not show outdated information + } + + logger.debug("Finished computing diff", { filePath }); + }); + }, +}); + +export default computeKubeconfigDiffInjectable; diff --git a/src/main/catalog-sources/kubeconfig-sync/config-to-models.injectable.ts b/src/main/catalog-sources/kubeconfig-sync/config-to-models.injectable.ts new file mode 100644 index 0000000000..8240d4e914 --- /dev/null +++ b/src/main/catalog-sources/kubeconfig-sync/config-to-models.injectable.ts @@ -0,0 +1,42 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ +import type { KubeConfig } from "@kubernetes/client-node"; +import { getInjectable } from "@ogre-tools/injectable"; +import type { ClusterConfigData, UpdateClusterModel } from "../../../common/cluster-types"; +import { splitConfig } from "../../../common/kube-helpers"; +import kubeconfigSyncLoggerInjectable from "./logger.injectable"; + +export type ConfigToModels = (rootConfig: KubeConfig, filePath: string) => [UpdateClusterModel, ClusterConfigData][]; + +const configToModelsInjectable = getInjectable({ + id: "config-to-models", + instantiate: (di): ConfigToModels => { + const logger = di.inject(kubeconfigSyncLoggerInjectable); + + return (rootConfig, filePath) => { + const validConfigs: ReturnType = []; + + for (const { config, validationResult } of splitConfig(rootConfig)) { + if (validationResult.error) { + logger.debug(`context failed validation: ${validationResult.error}`, { context: config.currentContext, filePath }); + } else { + validConfigs.push([ + { + kubeConfigPath: filePath, + contextName: config.currentContext, + }, + { + clusterServerUrl: validationResult.cluster.server, + }, + ]); + } + } + + return validConfigs; + }; + }, +}); + +export default configToModelsInjectable; diff --git a/src/main/catalog-sources/kubeconfig-sync/diff-changed-kubeconfig.injectable.ts b/src/main/catalog-sources/kubeconfig-sync/diff-changed-kubeconfig.injectable.ts new file mode 100644 index 0000000000..f17293fc2d --- /dev/null +++ b/src/main/catalog-sources/kubeconfig-sync/diff-changed-kubeconfig.injectable.ts @@ -0,0 +1,90 @@ +/** + * 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 type { Stats } from "fs"; +import { constants } from "fs"; +import type { ObservableMap } from "mobx"; +import type { Readable } from "stream"; +import type { CatalogEntity } from "../../../common/catalog"; +import type { Cluster } from "../../../common/cluster/cluster"; +import createReadFileStreamInjectable from "../../../common/fs/create-read-file-stream.injectable"; +import type { Disposer } from "../../../common/utils"; +import { bytesToUnits, noop } from "../../../common/utils"; +import computeKubeconfigDiffInjectable from "./compute-diff.injectable"; +import kubeconfigSyncLoggerInjectable from "./logger.injectable"; + +export interface DiffChangedKubeconfigArgs { + filePath: string; + source: ObservableMap; + stats: Stats; + maxAllowedFileReadSize: number; +} +export type DiffChangedKubeconfig = (args: DiffChangedKubeconfigArgs) => Disposer; + +const diffChangedKubeconfigInjectable = getInjectable({ + id: "diff-changed-kubeconfig", + instantiate: (di): DiffChangedKubeconfig => { + const computeKubeconfigDiff = di.inject(computeKubeconfigDiffInjectable); + const logger = di.inject(kubeconfigSyncLoggerInjectable); + const createReadFileStream = di.inject(createReadFileStreamInjectable); + + return ({ filePath, maxAllowedFileReadSize, source, stats }) => { + logger.debug(`file changed`, { filePath }); + + if (stats.size >= maxAllowedFileReadSize) { + logger.warn(`skipping ${filePath}: size=${bytesToUnits(stats.size)} is larger than maxSize=${bytesToUnits(maxAllowedFileReadSize)}`); + source.clear(); + + return noop; + } + + const fileReader = createReadFileStream(filePath, { + mode: constants.O_RDONLY, + }); + const readStream = fileReader as Readable; + const decoder = new TextDecoder("utf-8", { fatal: true }); + let fileString = ""; + let closed = false; + + const cleanup = () => { + closed = true; + fileReader.close(); // This may not close the stream. + // Artificially marking end-of-stream, as if the underlying resource had + // indicated end-of-file by itself, allows the stream to close. + // This does not cancel pending read operations, and if there is such an + // operation, the process may still not be able to exit successfully + // until it finishes. + fileReader.push(null); + fileReader.read(0); + readStream.removeAllListeners(); + }; + + readStream + .on("data", (chunk: Buffer) => { + try { + fileString += decoder.decode(chunk, { stream: true }); + } catch (error) { + logger.warn(`skipping ${filePath}: ${error}`); + source.clear(); + cleanup(); + } + }) + .on("close", () => cleanup()) + .on("error", error => { + cleanup(); + logger.warn(`failed to read file: ${error}`, { filePath }); + }) + .on("end", () => { + if (!closed) { + computeKubeconfigDiff(fileString, source, filePath); + } + }); + + return cleanup; + }; + }, +}); + +export default diffChangedKubeconfigInjectable; diff --git a/src/main/catalog-sources/kubeconfig-sync/logger.injectable.ts b/src/main/catalog-sources/kubeconfig-sync/logger.injectable.ts new file mode 100644 index 0000000000..4705da78d2 --- /dev/null +++ b/src/main/catalog-sources/kubeconfig-sync/logger.injectable.ts @@ -0,0 +1,13 @@ +/** + * 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 prefixedLoggerInjectable from "../../../common/logger/prefixed-logger.injectable"; + +const kubeconfigSyncLoggerInjectable = getInjectable({ + id: "kubeconfig-sync-logger", + instantiate: (di) => di.inject(prefixedLoggerInjectable, "KUBECONFIG-SYNC"), +}); + +export default kubeconfigSyncLoggerInjectable; diff --git a/src/main/catalog-sources/kubeconfig-sync/manager.injectable.ts b/src/main/catalog-sources/kubeconfig-sync/manager.injectable.ts index f95fa0fb17..06265764c8 100644 --- a/src/main/catalog-sources/kubeconfig-sync/manager.injectable.ts +++ b/src/main/catalog-sources/kubeconfig-sync/manager.injectable.ts @@ -5,18 +5,18 @@ import { getInjectable } from "@ogre-tools/injectable"; import directoryForKubeConfigsInjectable from "../../../common/app-paths/directory-for-kube-configs/directory-for-kube-configs.injectable"; import { KubeconfigSyncManager } from "./manager"; -import { createClusterInjectionToken } from "../../../common/cluster/create-cluster-injection-token"; -import clusterManagerInjectable from "../../cluster-manager.injectable"; -import catalogEntityRegistryInjectable from "../../catalog/entity-registry.injectable"; +import kubeconfigSyncLoggerInjectable from "./logger.injectable"; +import watchKubeconfigFileChangesInjectable from "./watch-file-changes.injectable"; +import kubeconfigSyncsInjectable from "../../../common/user-store/kubeconfig-syncs.injectable"; const kubeconfigSyncManagerInjectable = getInjectable({ id: "kubeconfig-sync-manager", instantiate: (di) => new KubeconfigSyncManager({ directoryForKubeConfigs: di.inject(directoryForKubeConfigsInjectable), - createCluster: di.inject(createClusterInjectionToken), - clusterManager: di.inject(clusterManagerInjectable), - entityRegistry: di.inject(catalogEntityRegistryInjectable), + logger: di.inject(kubeconfigSyncLoggerInjectable), + watchKubeconfigFileChanges: di.inject(watchKubeconfigFileChangesInjectable), + kubeconfigSyncs: di.inject(kubeconfigSyncsInjectable), }), }); diff --git a/src/main/catalog-sources/kubeconfig-sync/manager.ts b/src/main/catalog-sources/kubeconfig-sync/manager.ts index 1d281bc936..305f25a909 100644 --- a/src/main/catalog-sources/kubeconfig-sync/manager.ts +++ b/src/main/catalog-sources/kubeconfig-sync/manager.ts @@ -4,97 +4,61 @@ */ import type { IComputedValue, ObservableMap } from "mobx"; -import { action, observable, computed, runInAction, makeObservable, observe } from "mobx"; +import { action, observable, computed, makeObservable, observe } from "mobx"; import type { CatalogEntity } from "../../../common/catalog"; -import type { FSWatcher } from "chokidar"; -import { watch } from "chokidar"; -import type { Stats } from "fs"; -import fs from "fs"; -import path from "path"; import type { Disposer } from "../../../common/utils"; -import { disposer, bytesToUnits, getOrInsertWith, iter, noop } from "../../../common/utils"; -import logger from "../../logger"; -import type { KubeConfig } from "@kubernetes/client-node"; -import { loadConfigFromString, splitConfig } from "../../../common/kube-helpers"; -import type { ClusterManager } from "../../cluster-manager"; -import { catalogEntityFromCluster } from "../../cluster-manager"; -import { UserStore } from "../../../common/user-store"; -import { ClusterStore } from "../../../common/cluster-store/cluster-store"; -import { createHash } from "crypto"; -import { homedir } from "os"; -import globToRegExp from "glob-to-regexp"; -import { inspect } from "util"; -import type { ClusterConfigData, UpdateClusterModel } from "../../../common/cluster-types"; -import type { Cluster } from "../../../common/cluster/cluster"; -import type { CatalogEntityRegistry } from "../../catalog/entity-registry"; -import type { CreateCluster } from "../../../common/cluster/create-cluster-injection-token"; - -const logPrefix = "[KUBECONFIG-SYNC]:"; - -/** - * This is the list of globs of which files are ignored when under a folder sync - */ -const ignoreGlobs = [ - "*.lock", // kubectl lock files - "*.swp", // vim swap files - ".DS_Store", // macOS specific -].map(rawGlob => ({ - rawGlob, - matcher: globToRegExp(rawGlob), -})); - -/** - * This should be much larger than any kubeconfig text file - * - * Even if you have a cert-file, key-file, and client-cert files that is only - * 12kb of extra data (at 4096 bytes each) which allows for around 150 entries. - */ -const folderSyncMaxAllowedFileReadSize = 2 * 1024 * 1024; // 2 MiB -const fileSyncMaxAllowedFileReadSize = 16 * folderSyncMaxAllowedFileReadSize; // 32 MiB +import { iter } from "../../../common/utils"; +import type { KubeconfigSyncValue } from "../../../common/user-store"; +import type { Logger } from "../../../common/logger"; +import type { WatchKubeconfigFileChanges } from "./watch-file-changes.injectable"; interface KubeconfigSyncManagerDependencies { readonly directoryForKubeConfigs: string; - readonly entityRegistry: CatalogEntityRegistry; - readonly clusterManager: ClusterManager; - createCluster: CreateCluster; + readonly logger: Logger; + readonly kubeconfigSyncs: ObservableMap; + watchKubeconfigFileChanges: WatchKubeconfigFileChanges; } -const kubeConfigSyncName = "lens:kube-sync"; - export class KubeconfigSyncManager { protected readonly sources = observable.map, Disposer]>(); - protected syncing = false; protected syncListDisposer?: Disposer; constructor(protected readonly dependencies: KubeconfigSyncManagerDependencies) { makeObservable(this); } + public readonly source = computed(() => { + /** + * This prevents multiple overlapping syncs from leading to multiple entities with the same IDs + */ + const seenIds = new Set(); + + return ( + iter.pipeline(this.sources.values()) + .flatMap(([entities]) => entities.get()) + .filter(entity => { + const alreadySeen = seenIds.has(entity.getId()); + + seenIds.add(entity.getId()); + + return !alreadySeen; + }) + .collect(items => [...items]) + ); + }); + @action startSync(): void { - if (this.syncing) { - return; - } - - this.syncing = true; - - logger.info(`${logPrefix} starting requested syncs`); - - this.dependencies.entityRegistry.addComputedSource(kubeConfigSyncName, computed(() => ( - Array.from(iter.flatMap( - this.sources.values(), - ([entities]) => entities.get(), - )) - ))); + this.dependencies.logger.info(`starting requested syncs`); // This must be done so that c&p-ed clusters are visible this.startNewSync(this.dependencies.directoryForKubeConfigs); - for (const filePath of UserStore.getInstance().syncKubeconfigEntries.keys()) { + for (const filePath of this.dependencies.kubeconfigSyncs.keys()) { this.startNewSync(filePath); } - this.syncListDisposer = observe(UserStore.getInstance().syncKubeconfigEntries, change => { + this.syncListDisposer = observe(this.dependencies.kubeconfigSyncs, change => { switch (change.type) { case "add": this.startNewSync(change.name); @@ -108,275 +72,38 @@ export class KubeconfigSyncManager { @action stopSync() { + this.dependencies.logger.info(`stopping requested syncs`); this.syncListDisposer?.(); for (const filePath of this.sources.keys()) { this.stopOldSync(filePath); } - - this.dependencies.entityRegistry.removeSource(kubeConfigSyncName); - this.syncing = false; } @action protected startNewSync(filePath: string): void { if (this.sources.has(filePath)) { // don't start a new sync if we already have one - return void logger.debug(`${logPrefix} already syncing file/folder`, { filePath }); + return this.dependencies.logger.debug(`already syncing file/folder`, { filePath }); } this.sources.set( filePath, - watchFileChanges(filePath, this.dependencies), + this.dependencies.watchKubeconfigFileChanges(filePath), ); - logger.info(`${logPrefix} starting sync of file/folder`, { filePath }); - logger.debug(`${logPrefix} ${this.sources.size} files/folders watched`, { files: Array.from(this.sources.keys()) }); + this.dependencies.logger.info(`starting sync of file/folder`, { filePath }); + this.dependencies.logger.debug(`${this.sources.size} files/folders watched`, { files: Array.from(this.sources.keys()) }); } @action protected stopOldSync(filePath: string): void { if (!this.sources.delete(filePath)) { // already stopped - return void logger.debug(`${logPrefix} no syncing file/folder to stop`, { filePath }); + return this.dependencies.logger.debug(`no syncing file/folder to stop`, { filePath }); } - logger.info(`${logPrefix} stopping sync of file/folder`, { filePath }); - logger.debug(`${logPrefix} ${this.sources.size} files/folders watched`, { files: Array.from(this.sources.keys()) }); + this.dependencies.logger.info(`stopping sync of file/folder`, { filePath }); + this.dependencies.logger.debug(`${this.sources.size} files/folders watched`, { files: Array.from(this.sources.keys()) }); } } - -// exported for testing -export function configToModels(rootConfig: KubeConfig, filePath: string): [UpdateClusterModel, ClusterConfigData][] { - const validConfigs: ReturnType = []; - - for (const { config, validationResult } of splitConfig(rootConfig)) { - if (validationResult.error) { - logger.debug(`${logPrefix} context failed validation: ${validationResult.error}`, { context: config.currentContext, filePath }); - } else { - validConfigs.push([ - { - kubeConfigPath: filePath, - contextName: config.currentContext, - }, - { - clusterServerUrl: validationResult.cluster.server, - }, - ]); - } - } - - return validConfigs; -} - -type RootSourceValue = [Cluster, CatalogEntity]; -type RootSource = ObservableMap; - -interface ComputeDiffDependencies { - directoryForKubeConfigs: string; - createCluster: CreateCluster; - clusterManager: ClusterManager; -} - -// exported for testing -export const computeDiff = ({ directoryForKubeConfigs, createCluster, clusterManager }: ComputeDiffDependencies) => (contents: string, source: RootSource, filePath: string): void => { - runInAction(() => { - try { - const { config, error } = loadConfigFromString(contents); - - if (error) { - logger.warn(`${logPrefix} encountered errors while loading config: ${error.message}`, { filePath, details: error.details }); - } - - const rawModels = configToModels(config, filePath); - const models = new Map(rawModels.map(([model, configData]) => [model.contextName, [model, configData] as const])); - - logger.debug(`${logPrefix} File now has ${models.size} entries`, { filePath }); - - for (const [contextName, value] of source) { - const data = models.get(contextName); - - // remove and disconnect clusters that were removed from the config - if (!data) { - // remove from the deleting set, so that if a new context of the same name is added, it isn't marked as deleting - clusterManager.deleting.delete(value[0].id); - - value[0].disconnect(); - source.delete(contextName); - logger.debug(`${logPrefix} Removed old cluster from sync`, { filePath, contextName }); - continue; - } - - // TODO: For the update check we need to make sure that the config itself hasn't changed. - // Probably should make it so that cluster keeps a copy of the config in its memory and - // diff against that - - // or update the model and mark it as not needed to be added - value[0].updateModel(data[0]); - models.delete(contextName); - logger.debug(`${logPrefix} Updated old cluster from sync`, { filePath, contextName }); - } - - for (const [contextName, [model, configData]] of models) { - // add new clusters to the source - try { - const clusterId = createHash("md5").update(`${filePath}:${contextName}`).digest("hex"); - - const cluster = ClusterStore.getInstance().getById(clusterId) || createCluster({ ...model, id: clusterId }, configData); - - if (!cluster.apiUrl) { - throw new Error("Cluster constructor failed, see above error"); - } - - const entity = catalogEntityFromCluster(cluster); - - if (!filePath.startsWith(directoryForKubeConfigs)) { - entity.metadata.labels.file = filePath.replace(homedir(), "~"); - } - source.set(contextName, [cluster, entity]); - - logger.debug(`${logPrefix} Added new cluster from sync`, { filePath, contextName }); - } catch (error) { - logger.warn(`${logPrefix} Failed to create cluster from model: ${error}`, { filePath, contextName }); - } - } - } catch (error) { - logger.warn(`${logPrefix} Failed to compute diff: ${error}`, { filePath }); - source.clear(); // clear source if we have failed so as to not show outdated information - } - }); -}; - -interface DiffChangedConfigArgs { - filePath: string; - source: RootSource; - stats: fs.Stats; - maxAllowedFileReadSize: number; -} - -const diffChangedConfigFor = (dependencies: ComputeDiffDependencies) => ({ filePath, source, stats, maxAllowedFileReadSize }: DiffChangedConfigArgs): Disposer => { - logger.debug(`${logPrefix} file changed`, { filePath }); - - if (stats.size >= maxAllowedFileReadSize) { - logger.warn(`${logPrefix} skipping ${filePath}: size=${bytesToUnits(stats.size)} is larger than maxSize=${bytesToUnits(maxAllowedFileReadSize)}`); - source.clear(); - - return noop; - } - - const controller = new AbortController(); - const fileContentsP = fs.promises.readFile(filePath, { - signal: controller.signal, - }); - const cleanup = disposer( - () => controller.abort(), - ); - - fileContentsP - .then((fileData) => { - const decoder = new TextDecoder("utf-8", { fatal: true }); - - try { - const fileString = decoder.decode(fileData); - - computeDiff(dependencies)(fileString, source, filePath); - } catch (error) { - logger.warn(`${logPrefix} skipping ${filePath}: ${error}`); - source.clear(); - cleanup(); - } - }) - .catch(error => { - if (controller.signal.aborted) { - return; - } - - logger.warn(`${logPrefix} failed to read file: ${error}`, { filePath }); - cleanup(); - }); - - return cleanup; -}; - -const watchFileChanges = (filePath: string, dependencies: ComputeDiffDependencies): [IComputedValue, Disposer] => { - const rootSource = observable.map>(); - const derivedSource = computed(() => Array.from(iter.flatMap(rootSource.values(), from => iter.map(from.values(), child => child[1])))); - - let watcher: FSWatcher; - - (async () => { - try { - const stat = await fs.promises.stat(filePath); - const isFolderSync = stat.isDirectory(); - const cleanupFns = new Map(); - const maxAllowedFileReadSize = isFolderSync - ? folderSyncMaxAllowedFileReadSize - : fileSyncMaxAllowedFileReadSize; - - watcher = watch(filePath, { - followSymlinks: true, - depth: isFolderSync ? 0 : 1, // DIRs works with 0 but files need 1 (bug: https://github.com/paulmillr/chokidar/issues/1095) - disableGlobbing: true, - ignorePermissionErrors: true, - usePolling: false, - awaitWriteFinish: { - pollInterval: 100, - stabilityThreshold: 1000, - }, - atomic: 150, // for "atomic writes" - alwaysStat: true, - }); - - const diffChangedConfig = diffChangedConfigFor(dependencies); - - watcher - .on("change", (childFilePath, stats: Stats): void => { - const cleanup = cleanupFns.get(childFilePath); - - if (!cleanup) { - // file was previously ignored, do nothing - return void logger.debug(`${logPrefix} ${inspect(childFilePath)} that should have been previously ignored has changed. Doing nothing`); - } - - cleanup(); - cleanupFns.set(childFilePath, diffChangedConfig({ - filePath: childFilePath, - source: getOrInsertWith(rootSource, childFilePath, observable.map), - stats, - maxAllowedFileReadSize, - })); - }) - .on("add", (childFilePath, stats: Stats): void => { - if (isFolderSync) { - const fileName = path.basename(childFilePath); - - for (const ignoreGlob of ignoreGlobs) { - if (ignoreGlob.matcher.test(fileName)) { - return void logger.info(`${logPrefix} ignoring ${inspect(childFilePath)} due to ignore glob: ${ignoreGlob.rawGlob}`); - } - } - } - - cleanupFns.set(childFilePath, diffChangedConfig({ - filePath: childFilePath, - source: getOrInsertWith(rootSource, childFilePath, observable.map), - stats, - maxAllowedFileReadSize, - })); - }) - .on("unlink", (childFilePath) => { - cleanupFns.get(childFilePath)?.(); - cleanupFns.delete(childFilePath); - rootSource.delete(childFilePath); - }) - .on("error", error => logger.error(`${logPrefix} watching file/folder failed: ${error}`, { filePath })); - } catch (error) { - console.log((error as { stack: unknown }).stack); - logger.warn(`${logPrefix} failed to start watching changes: ${error}`); - } - })(); - - return [derivedSource, () => { - watcher?.close(); - }]; -}; diff --git a/src/main/catalog-sources/kubeconfig-sync/watch-file-changes.injectable.ts b/src/main/catalog-sources/kubeconfig-sync/watch-file-changes.injectable.ts new file mode 100644 index 0000000000..c843222a5f --- /dev/null +++ b/src/main/catalog-sources/kubeconfig-sync/watch-file-changes.injectable.ts @@ -0,0 +1,134 @@ +/** + * 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 GlobToRegExp from "glob-to-regexp"; +import type { IComputedValue, ObservableMap } from "mobx"; +import { computed, observable } from "mobx"; +import path from "path"; +import { inspect } from "util"; +import type { CatalogEntity } from "../../../common/catalog"; +import type { Cluster } from "../../../common/cluster/cluster"; +import statInjectable from "../../../common/fs/stat/stat.injectable"; +import type { Watcher } from "../../../common/fs/watch/watch.injectable"; +import watchInjectable from "../../../common/fs/watch/watch.injectable"; +import type { Disposer } from "../../../common/utils"; +import { getOrInsertWith, iter } from "../../../common/utils"; +import diffChangedKubeconfigInjectable from "./diff-changed-kubeconfig.injectable"; +import kubeconfigSyncLoggerInjectable from "./logger.injectable"; + +export type WatchKubeconfigFileChanges = (filepath: string) => [IComputedValue, Disposer]; + +/** + * This is the list of globs of which files are ignored when under a folder sync + */ +const ignoreGlobs = [ + "*.lock", // kubectl lock files + "*.swp", // vim swap files + ".DS_Store", // macOS specific +].map(rawGlob => ({ + rawGlob, + matcher: GlobToRegExp(rawGlob), +})); + +/** + * This should be much larger than any kubeconfig text file + * + * Even if you have a cert-file, key-file, and client-cert files that is only + * 12kb of extra data (at 4096 bytes each) which allows for around 150 entries. + */ +const folderSyncMaxAllowedFileReadSize = 2 * 1024 * 1024; // 2 MiB +const fileSyncMaxAllowedFileReadSize = 16 * folderSyncMaxAllowedFileReadSize; // 32 MiB + +const watchKubeconfigFileChangesInjectable = getInjectable({ + id: "watch-kubeconfig-file-changes", + instantiate: (di): WatchKubeconfigFileChanges => { + const diffChangedKubeconfig = di.inject(diffChangedKubeconfigInjectable); + const logger = di.inject(kubeconfigSyncLoggerInjectable); + const stat = di.inject(statInjectable); + const watch = di.inject(watchInjectable); + + return (filePath) => { + const rootSource = observable.map>(); + const derivedSource = computed(() => Array.from(iter.flatMap(rootSource.values(), from => iter.map(from.values(), child => child[1])))); + + let watcher: Watcher; + + (async () => { + try { + const stats = await stat(filePath); + const isFolderSync = stats.isDirectory(); + const cleanupFns = new Map(); + const maxAllowedFileReadSize = isFolderSync + ? folderSyncMaxAllowedFileReadSize + : fileSyncMaxAllowedFileReadSize; + + watcher = watch(filePath, { + followSymlinks: true, + depth: isFolderSync ? 0 : 1, // DIRs works with 0 but files need 1 (bug: https://github.com/paulmillr/chokidar/issues/1095) + disableGlobbing: true, + ignorePermissionErrors: true, + usePolling: false, + awaitWriteFinish: { + pollInterval: 100, + stabilityThreshold: 1000, + }, + atomic: 150, // for "atomic writes" + alwaysStat: true, + }); + + watcher + .on("change", (childFilePath, stats): void => { + const cleanup = cleanupFns.get(childFilePath); + + if (!cleanup) { + // file was previously ignored, do nothing + return void logger.debug(`${inspect(childFilePath)} that should have been previously ignored has changed. Doing nothing`); + } + + cleanup(); + cleanupFns.set(childFilePath, diffChangedKubeconfig({ + filePath: childFilePath, + source: getOrInsertWith(rootSource, childFilePath, observable.map), + stats, + maxAllowedFileReadSize, + })); + }) + .on("add", (childFilePath, stats): void => { + if (isFolderSync) { + const fileName = path.basename(childFilePath); + + for (const ignoreGlob of ignoreGlobs) { + if (ignoreGlob.matcher.test(fileName)) { + return void logger.info(`ignoring ${inspect(childFilePath)} due to ignore glob: ${ignoreGlob.rawGlob}`); + } + } + } + + cleanupFns.set(childFilePath, diffChangedKubeconfig({ + filePath: childFilePath, + source: getOrInsertWith(rootSource, childFilePath, observable.map), + stats, + maxAllowedFileReadSize, + })); + }) + .on("unlink", (childFilePath) => { + cleanupFns.get(childFilePath)?.(); + cleanupFns.delete(childFilePath); + rootSource.delete(childFilePath); + }) + .on("error", error => logger.error(`watching file/folder failed: ${error}`, { filePath })); + } catch (error) { + logger.warn(`failed to start watching changes: ${error}`); + } + })(); + + return [derivedSource, () => { + watcher?.close(); + }]; + }; + }, +}); + +export default watchKubeconfigFileChangesInjectable; diff --git a/src/main/catalog-sync-to-renderer/start-catalog-sync.injectable.ts b/src/main/catalog-sync-to-renderer/start-catalog-sync.injectable.ts index 3dfd9ee2ae..ce06a44281 100644 --- a/src/main/catalog-sync-to-renderer/start-catalog-sync.injectable.ts +++ b/src/main/catalog-sync-to-renderer/start-catalog-sync.injectable.ts @@ -13,6 +13,7 @@ const startCatalogSyncInjectable = getInjectable({ const catalogSyncToRenderer = di.inject(catalogSyncToRendererInjectable); return { + id: "start-catalog-sync", run: async () => { if (!catalogSyncToRenderer.started) { await catalogSyncToRenderer.start(); diff --git a/src/main/catalog-sync-to-renderer/stop-catalog-sync.injectable.ts b/src/main/catalog-sync-to-renderer/stop-catalog-sync.injectable.ts index 71c5be55f1..fcd294fe02 100644 --- a/src/main/catalog-sync-to-renderer/stop-catalog-sync.injectable.ts +++ b/src/main/catalog-sync-to-renderer/stop-catalog-sync.injectable.ts @@ -13,6 +13,7 @@ const stopCatalogSyncInjectable = getInjectable({ const catalogSyncToRenderer = di.inject(catalogSyncToRendererInjectable); return { + id: "stop-catalog-sync", run: async () => { if (catalogSyncToRenderer.started) { await catalogSyncToRenderer.stop(); diff --git a/src/main/cluster-manager.injectable.ts b/src/main/cluster-manager.injectable.ts deleted file mode 100644 index 2b55f0e854..0000000000 --- a/src/main/cluster-manager.injectable.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 { ClusterManager } from "./cluster-manager"; -import clusterStoreInjectable from "../common/cluster-store/cluster-store.injectable"; -import catalogEntityRegistryInjectable from "./catalog/entity-registry.injectable"; - -const clusterManagerInjectable = getInjectable({ - id: "cluster-manager", - - instantiate: (di) => { - const clusterManager = new ClusterManager({ - store: di.inject(clusterStoreInjectable), - catalogEntityRegistry: di.inject(catalogEntityRegistryInjectable), - }); - - clusterManager.init(); - - return clusterManager; - }, -}); - -export default clusterManagerInjectable; diff --git a/src/main/cluster/are-being-deleted.injectable.ts b/src/main/cluster/are-being-deleted.injectable.ts new file mode 100644 index 0000000000..610791aee7 --- /dev/null +++ b/src/main/cluster/are-being-deleted.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 { observable } from "mobx"; +import type { ClusterId } from "../../common/cluster-types"; + +const clustersThatAreBeingDeletedInjectable = getInjectable({ + id: "clusters-that-are-being-deleted", + instantiate: () => observable.set(), +}); + +export default clustersThatAreBeingDeletedInjectable; diff --git a/src/main/cluster/initialize-manager.injectable.ts b/src/main/cluster/initialize-manager.injectable.ts new file mode 100644 index 0000000000..adabcf416c --- /dev/null +++ b/src/main/cluster/initialize-manager.injectable.ts @@ -0,0 +1,25 @@ +/** + * 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 { onLoadOfApplicationInjectionToken } from "../start-main-application/runnable-tokens/on-load-of-application-injection-token"; +import clusterManagerInjectable from "./manager.injectable"; + +const initializeClusterManagerInjectable = getInjectable({ + id: "initialize-cluster-manager", + instantiate: (di) => { + const clusterManager = di.inject(clusterManagerInjectable); + + return { + id: "initialize-cluster-manager", + run: () => { + clusterManager.init(); + }, + }; + }, + injectionToken: onLoadOfApplicationInjectionToken, + causesSideEffects: true, +}); + +export default initializeClusterManagerInjectable; diff --git a/src/main/cluster/manager.injectable.ts b/src/main/cluster/manager.injectable.ts new file mode 100644 index 0000000000..13f04f16ac --- /dev/null +++ b/src/main/cluster/manager.injectable.ts @@ -0,0 +1,21 @@ +/** + * 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 clusterStoreInjectable from "../../common/cluster-store/cluster-store.injectable"; +import catalogEntityRegistryInjectable from "../catalog/entity-registry.injectable"; +import clustersThatAreBeingDeletedInjectable from "./are-being-deleted.injectable"; +import { ClusterManager } from "./manager"; + +const clusterManagerInjectable = getInjectable({ + id: "cluster-manager", + + instantiate: (di) => new ClusterManager({ + store: di.inject(clusterStoreInjectable), + catalogEntityRegistry: di.inject(catalogEntityRegistryInjectable), + clustersThatAreBeingDeleted: di.inject(clustersThatAreBeingDeletedInjectable), + }), +}); + +export default clusterManagerInjectable; diff --git a/src/main/cluster-manager.ts b/src/main/cluster/manager.ts similarity index 89% rename from src/main/cluster-manager.ts rename to src/main/cluster/manager.ts index 787f2a1618..8ae6e5ce99 100644 --- a/src/main/cluster-manager.ts +++ b/src/main/cluster/manager.ts @@ -3,36 +3,36 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ -import "../common/ipc/cluster"; +import "../../common/ipc/cluster"; import type http from "http"; +import type { ObservableSet } from "mobx"; import { action, makeObservable, observable, observe, reaction, toJS } from "mobx"; -import type { Cluster } from "../common/cluster/cluster"; -import logger from "./logger"; -import { apiKubePrefix } from "../common/vars"; -import { getClusterIdFromHost, isErrnoException } from "../common/utils"; -import type { KubernetesClusterPrometheusMetrics } from "../common/catalog-entities/kubernetes-cluster"; -import { isKubernetesCluster, KubernetesCluster, LensKubernetesClusterStatus } from "../common/catalog-entities/kubernetes-cluster"; -import { ipcMainOn } from "../common/ipc"; +import type { Cluster } from "../../common/cluster/cluster"; +import logger from "../logger"; +import { apiKubePrefix } from "../../common/vars"; +import { getClusterIdFromHost, isErrnoException } from "../../common/utils"; +import type { KubernetesClusterPrometheusMetrics } from "../../common/catalog-entities/kubernetes-cluster"; +import { isKubernetesCluster, KubernetesCluster, LensKubernetesClusterStatus } from "../../common/catalog-entities/kubernetes-cluster"; +import { ipcMainOn } from "../../common/ipc"; import { once } from "lodash"; -import type { ClusterStore } from "../common/cluster-store/cluster-store"; -import type { ClusterId } from "../common/cluster-types"; -import type { CatalogEntityRegistry } from "./catalog"; +import type { ClusterStore } from "../../common/cluster-store/cluster-store"; +import type { ClusterId } from "../../common/cluster-types"; +import type { CatalogEntityRegistry } from "../catalog"; const logPrefix = "[CLUSTER-MANAGER]:"; const lensSpecificClusterStatuses: Set = new Set(Object.values(LensKubernetesClusterStatus)); interface Dependencies { - store: ClusterStore; - catalogEntityRegistry: CatalogEntityRegistry; + readonly store: ClusterStore; + readonly catalogEntityRegistry: CatalogEntityRegistry; + readonly clustersThatAreBeingDeleted: ObservableSet; } export class ClusterManager { - deleting = observable.set(); - @observable visibleCluster: ClusterId | undefined = undefined; - constructor(private dependencies: Dependencies) { + constructor(private readonly dependencies: Dependencies) { makeObservable(this); } @@ -69,7 +69,7 @@ export class ClusterManager { } }); - observe(this.deleting, change => { + observe(this.dependencies.clustersThatAreBeingDeleted, change => { if (change.type === "add") { this.updateEntityStatus(this.dependencies.catalogEntityRegistry.findById(change.newValue) as KubernetesCluster); } @@ -141,7 +141,7 @@ export class ClusterManager { @action protected updateEntityStatus(entity: KubernetesCluster, cluster?: Cluster) { - if (this.deleting.has(entity.getId())) { + if (this.dependencies.clustersThatAreBeingDeleted.has(entity.getId())) { entity.status.phase = LensKubernetesClusterStatus.DELETING; entity.status.enabled = false; } else { diff --git a/src/main/electron-app/runnables/clean-up-deep-linking.injectable.ts b/src/main/electron-app/runnables/clean-up-deep-linking.injectable.ts index 5925197db3..9943516f72 100644 --- a/src/main/electron-app/runnables/clean-up-deep-linking.injectable.ts +++ b/src/main/electron-app/runnables/clean-up-deep-linking.injectable.ts @@ -13,6 +13,7 @@ const cleanUpDeepLinkingInjectable = getInjectable({ const lensProtocolRouterMain = di.inject(lensProtocolRouterMainInjectable); return { + id: "clean-up-deep-linking", run: () => { lensProtocolRouterMain.cleanup(); }, diff --git a/src/main/electron-app/runnables/dock-visibility/hide-dock-for-last-closed-window.injectable.ts b/src/main/electron-app/runnables/dock-visibility/hide-dock-for-last-closed-window.injectable.ts index 315b2a5689..d7fd4bdcb2 100644 --- a/src/main/electron-app/runnables/dock-visibility/hide-dock-for-last-closed-window.injectable.ts +++ b/src/main/electron-app/runnables/dock-visibility/hide-dock-for-last-closed-window.injectable.ts @@ -16,6 +16,7 @@ const hideDockForLastClosedWindowInjectable = getInjectable({ const getVisibleWindows = di.inject(getVisibleWindowsInjectable); return { + id: "hide-dock-when-there-are-no-windows", run: () => { const visibleWindows = getVisibleWindows(); diff --git a/src/main/electron-app/runnables/dock-visibility/show-dock-for-first-opened-window.injectable.ts b/src/main/electron-app/runnables/dock-visibility/show-dock-for-first-opened-window.injectable.ts index 1dbafb60f5..b47e511c14 100644 --- a/src/main/electron-app/runnables/dock-visibility/show-dock-for-first-opened-window.injectable.ts +++ b/src/main/electron-app/runnables/dock-visibility/show-dock-for-first-opened-window.injectable.ts @@ -13,6 +13,7 @@ const showDockForFirstOpenedWindowInjectable = getInjectable({ const app = di.inject(electronAppInjectable); return { + id: "show-dock-for-first-opened-window", run: () => { app.dock?.show(); }, diff --git a/src/main/electron-app/runnables/enforce-single-application-instance.injectable.ts b/src/main/electron-app/runnables/enforce-single-application-instance.injectable.ts index 6908b6ac47..de192e3372 100644 --- a/src/main/electron-app/runnables/enforce-single-application-instance.injectable.ts +++ b/src/main/electron-app/runnables/enforce-single-application-instance.injectable.ts @@ -15,6 +15,7 @@ const enforceSingleApplicationInstanceInjectable = getInjectable({ const exitApp = di.inject(exitAppInjectable); return { + id: "enforce-single-application-instance", run: () => { if (!requestSingleInstanceLock()) { exitApp(); diff --git a/src/main/electron-app/runnables/setup-application-name.injectable.ts b/src/main/electron-app/runnables/setup-application-name.injectable.ts index 3a8efdfe05..8bafc3fe8b 100644 --- a/src/main/electron-app/runnables/setup-application-name.injectable.ts +++ b/src/main/electron-app/runnables/setup-application-name.injectable.ts @@ -15,6 +15,7 @@ const setupApplicationNameInjectable = getInjectable({ const appName = di.inject(appNameInjectable); return { + id: "setup-application-name", run: () => { app.setName(appName); }, diff --git a/src/main/electron-app/runnables/setup-deep-linking.injectable.ts b/src/main/electron-app/runnables/setup-deep-linking.injectable.ts index 47087cd1c1..5f82d60f42 100644 --- a/src/main/electron-app/runnables/setup-deep-linking.injectable.ts +++ b/src/main/electron-app/runnables/setup-deep-linking.injectable.ts @@ -26,6 +26,7 @@ const setupDeepLinkingInjectable = getInjectable({ ); return { + id: "setup-deep-linking", run: async () => { logger.info(`📟 Setting protocol client for lens://`); diff --git a/src/main/electron-app/runnables/setup-developer-tools-in-development-environment.injectable.ts b/src/main/electron-app/runnables/setup-developer-tools-in-development-environment.injectable.ts index 3438bc1428..07807a7965 100644 --- a/src/main/electron-app/runnables/setup-developer-tools-in-development-environment.injectable.ts +++ b/src/main/electron-app/runnables/setup-developer-tools-in-development-environment.injectable.ts @@ -13,6 +13,7 @@ const setupDeveloperToolsInDevelopmentEnvironmentInjectable = getInjectable({ const logger = di.inject(loggerInjectable); return { + id: "setup-developer-tools-in-development-environment", run: () => { if (process.env.NODE_ENV !== "development") { return; diff --git a/src/main/electron-app/runnables/setup-device-shutdown.injectable.ts b/src/main/electron-app/runnables/setup-device-shutdown.injectable.ts index b0b1ee8096..8c3c21ae30 100644 --- a/src/main/electron-app/runnables/setup-device-shutdown.injectable.ts +++ b/src/main/electron-app/runnables/setup-device-shutdown.injectable.ts @@ -15,6 +15,7 @@ const setupDeviceShutdownInjectable = getInjectable({ const exitApp = di.inject(exitAppInjectable); return { + id: "setup-device-shutdown", run: () => { powerMonitor.on("shutdown", async () => { exitApp(); diff --git a/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.injectable.ts b/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.injectable.ts index 24f90f01b3..c78514d631 100644 --- a/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.injectable.ts +++ b/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.injectable.ts @@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable"; import directoryForLensLocalStorageInjectable from "../../../../common/directory-for-lens-local-storage/directory-for-lens-local-storage.injectable"; import { setupIpcMainHandlers } from "./setup-ipc-main-handlers"; import loggerInjectable from "../../../../common/logger.injectable"; -import clusterManagerInjectable from "../../../cluster-manager.injectable"; +import clusterManagerInjectable from "../../../cluster/manager.injectable"; import applicationMenuItemsInjectable from "../../../menu/application-menu-items.injectable"; import getAbsolutePathInjectable from "../../../../common/path/get-absolute-path.injectable"; import clusterStoreInjectable from "../../../../common/cluster-store/cluster-store.injectable"; @@ -14,6 +14,7 @@ import { onLoadOfApplicationInjectionToken } from "../../../start-main-applicati import operatingSystemThemeInjectable from "../../../theme/operating-system-theme.injectable"; import catalogEntityRegistryInjectable from "../../../catalog/entity-registry.injectable"; import askUserForFilePathsInjectable from "../../../ipc/ask-user-for-file-paths.injectable"; +import clustersThatAreBeingDeletedInjectable from "../../../cluster/are-being-deleted.injectable"; const setupIpcMainHandlersInjectable = getInjectable({ id: "setup-ipc-main-handlers", @@ -32,8 +33,10 @@ const setupIpcMainHandlersInjectable = getInjectable({ const clusterStore = di.inject(clusterStoreInjectable); const operatingSystemTheme = di.inject(operatingSystemThemeInjectable); const askUserForFilePaths = di.inject(askUserForFilePathsInjectable); + const clustersThatAreBeingDeleted = di.inject(clustersThatAreBeingDeletedInjectable); return { + id: "setup-ipc-main-handlers", run: () => { logger.debug("[APP-MAIN] initializing ipc main handlers"); @@ -46,6 +49,7 @@ const setupIpcMainHandlersInjectable = getInjectable({ clusterStore, operatingSystemTheme, askUserForFilePaths, + clustersThatAreBeingDeleted, }); }, }; diff --git a/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.ts b/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.ts index 9342696c77..6f873cd2c3 100644 --- a/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.ts +++ b/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.ts @@ -12,10 +12,10 @@ import { appEventBus } from "../../../../common/app-event-bus/event-bus"; import { broadcastMainChannel, broadcastMessage, ipcMainHandle, ipcMainOn } from "../../../../common/ipc"; import type { CatalogEntityRegistry } from "../../../catalog"; import { pushCatalogToRenderer } from "../../../catalog-pusher"; -import type { ClusterManager } from "../../../cluster-manager"; +import type { ClusterManager } from "../../../cluster/manager"; import { ResourceApplier } from "../../../resource-applier"; import { remove } from "fs-extra"; -import type { IComputedValue } from "mobx"; +import type { IComputedValue, ObservableSet } from "mobx"; import type { GetAbsolutePath } from "../../../../common/path/get-absolute-path.injectable"; import type { MenuItemOpts } from "../../../menu/application-menu-items.injectable"; import { windowActionHandleChannel, windowLocationChangedChannel, windowOpenAppMenuAsContextMenuChannel } from "../../../../common/ipc/window"; @@ -34,9 +34,20 @@ interface Dependencies { clusterStore: ClusterStore; operatingSystemTheme: IComputedValue; askUserForFilePaths: AskUserForFilePaths; + clustersThatAreBeingDeleted: ObservableSet; } -export const setupIpcMainHandlers = ({ applicationMenuItems, directoryForLensLocalStorage, getAbsolutePath, clusterManager, catalogEntityRegistry, clusterStore, operatingSystemTheme, askUserForFilePaths }: Dependencies) => { +export const setupIpcMainHandlers = ({ + applicationMenuItems, + directoryForLensLocalStorage, + getAbsolutePath, + clusterManager, + catalogEntityRegistry, + clusterStore, + operatingSystemTheme, + askUserForFilePaths, + clustersThatAreBeingDeleted, +}: Dependencies) => { ipcMainHandle(clusterActivateHandler, (event, clusterId: ClusterId, force = false) => { return ClusterStore.getInstance() .getById(clusterId) @@ -101,11 +112,11 @@ export const setupIpcMainHandlers = ({ applicationMenuItems, directoryForLensLoc }); ipcMainHandle(clusterSetDeletingHandler, (event, clusterId: string) => { - clusterManager.deleting.add(clusterId); + clustersThatAreBeingDeleted.add(clusterId); }); ipcMainHandle(clusterClearDeletingHandler, (event, clusterId: string) => { - clusterManager.deleting.delete(clusterId); + clustersThatAreBeingDeleted.delete(clusterId); }); ipcMainHandle(clusterKubectlApplyAllHandler, async (event, clusterId: ClusterId, resources: string[], extraArgs: string[]) => { diff --git a/src/main/electron-app/runnables/setup-main-window-visibility-after-activation.injectable.ts b/src/main/electron-app/runnables/setup-main-window-visibility-after-activation.injectable.ts index 3642fa3c6d..c32cfe0765 100644 --- a/src/main/electron-app/runnables/setup-main-window-visibility-after-activation.injectable.ts +++ b/src/main/electron-app/runnables/setup-main-window-visibility-after-activation.injectable.ts @@ -17,6 +17,7 @@ const setupMainWindowVisibilityAfterActivationInjectable = getInjectable({ const logger = di.inject(loggerInjectable); return { + id: "setup-main-window-visibility-after-activation", run: () => { app.on("activate", async (_, windowIsVisible) => { logger.info("APP:ACTIVATE", { hasVisibleWindows: windowIsVisible }); diff --git a/src/main/electron-app/runnables/setup-runnables-after-window-is-opened.injectable.ts b/src/main/electron-app/runnables/setup-runnables-after-window-is-opened.injectable.ts index 8e724fdf50..13650605fb 100644 --- a/src/main/electron-app/runnables/setup-runnables-after-window-is-opened.injectable.ts +++ b/src/main/electron-app/runnables/setup-runnables-after-window-is-opened.injectable.ts @@ -15,6 +15,7 @@ const setupRunnablesAfterWindowIsOpenedInjectable = getInjectable({ const afterWindowIsOpened = runManyFor(di)(afterWindowIsOpenedInjectionToken); return { + id: "setup-runnables-after-window-is-opened", run: () => { const app = di.inject(electronAppInjectable); diff --git a/src/main/electron-app/runnables/setup-runnables-before-closing-of-application.injectable.ts b/src/main/electron-app/runnables/setup-runnables-before-closing-of-application.injectable.ts index bb2c8f8970..5e8b24c2d8 100644 --- a/src/main/electron-app/runnables/setup-runnables-before-closing-of-application.injectable.ts +++ b/src/main/electron-app/runnables/setup-runnables-before-closing-of-application.injectable.ts @@ -26,6 +26,7 @@ const setupRunnablesBeforeClosingOfApplicationInjectable = getInjectable({ ); return { + id: "setup-closing-of-application", run: () => { const app = di.inject(electronAppInjectable); diff --git a/src/main/getDiForUnitTesting.ts b/src/main/getDiForUnitTesting.ts index 8e08c9b86c..bbda6d5838 100644 --- a/src/main/getDiForUnitTesting.ts +++ b/src/main/getDiForUnitTesting.ts @@ -88,6 +88,9 @@ import { registerMobX } from "@ogre-tools/injectable-extension-for-mobx"; import electronInjectable from "./utils/resolve-system-proxy/electron.injectable"; import type { HotbarStore } from "../common/hotbars/store"; import focusApplicationInjectable from "./electron-app/features/focus-application.injectable"; +import kubectlDownloadingNormalizedArchInjectable from "./kubectl/normalized-arch.injectable"; +import initializeClusterManagerInjectable from "./cluster/initialize-manager.injectable"; +import addKubeconfigSyncAsEntitySourceInjectable from "./start-main-application/runnables/kube-config-sync/add-source.injectable"; import type { GlobalOverride } from "../common/test-utils/get-global-override"; export function getDiForUnitTesting(opts: { doGeneralOverrides?: boolean } = {}) { @@ -125,7 +128,7 @@ export function getDiForUnitTesting(opts: { doGeneralOverrides?: boolean } = {}) di.override(electronInjectable, () => ({})); di.override(waitUntilBundledExtensionsAreLoadedInjectable, () => async () => {}); di.override(getRandomIdInjectable, () => () => "some-irrelevant-random-id"); - + di.override(kubectlDownloadingNormalizedArchInjectable, () => "amd64"); di.override(hotbarStoreInjectable, () => ({ load: () => {}, getActive: () => ({ name: "some-hotbar", items: [] }), @@ -204,6 +207,8 @@ export function getDiForUnitTesting(opts: { doGeneralOverrides?: boolean } = {}) const overrideRunnablesHavingSideEffects = (di: DiContainer) => { [ initializeExtensionsInjectable, + initializeClusterManagerInjectable, + addKubeconfigSyncAsEntitySourceInjectable, setupIpcMainHandlersInjectable, setupLensProxyInjectable, setupShellInjectable, @@ -214,7 +219,10 @@ const overrideRunnablesHavingSideEffects = (di: DiContainer) => { startCatalogSyncInjectable, startKubeConfigSyncInjectable, ].forEach((injectable) => { - di.override(injectable, () => ({ run: () => {} })); + di.override(injectable, () => ({ + id: injectable.id, + run: () => {}, + })); }); }; @@ -226,18 +234,20 @@ const overrideOperatingSystem = (di: DiContainer) => { }; const overrideElectronFeatures = (di: DiContainer) => { - di.override(setupMainWindowVisibilityAfterActivationInjectable, () => ({ - run: () => {}, - })); + [ + setupMainWindowVisibilityAfterActivationInjectable, + setupDeviceShutdownInjectable, + setupDeepLinkingInjectable, + setupApplicationNameInjectable, + setupRunnablesBeforeClosingOfApplicationInjectable, + ].forEach((injectable) => { + di.override(injectable, () => ({ + id: injectable.id, + run: () => {}, + })); + }); - di.override(setupDeviceShutdownInjectable, () => ({ - run: () => {}, - })); - - di.override(setupDeepLinkingInjectable, () => ({ run: () => {} })); di.override(exitAppInjectable, () => () => {}); - di.override(setupApplicationNameInjectable, () => ({ run: () => {} })); - di.override(setupRunnablesBeforeClosingOfApplicationInjectable, () => ({ run: () => {} })); di.override(getCommandLineSwitchInjectable, () => () => "irrelevant"); di.override(requestSingleInstanceLockInjectable, () => () => true); di.override(disableHardwareAccelerationInjectable, () => () => {}); diff --git a/src/main/lens-proxy/lens-proxy.injectable.ts b/src/main/lens-proxy/lens-proxy.injectable.ts index 5138ac191e..45d893514d 100644 --- a/src/main/lens-proxy/lens-proxy.injectable.ts +++ b/src/main/lens-proxy/lens-proxy.injectable.ts @@ -7,7 +7,7 @@ import { LensProxy } from "./lens-proxy"; import { kubeApiUpgradeRequest } from "./proxy-functions"; import routerInjectable from "../router/router.injectable"; import httpProxy from "http-proxy"; -import clusterManagerInjectable from "../cluster-manager.injectable"; +import clusterManagerInjectable from "../cluster/manager.injectable"; import shellApiRequestInjectable from "./proxy-functions/shell-api-request/shell-api-request.injectable"; import lensProxyPortInjectable from "./lens-proxy-port.injectable"; import contentSecurityPolicyInjectable from "../../common/vars/content-security-policy.injectable"; diff --git a/src/main/lens-proxy/proxy-functions/shell-api-request/shell-api-request.injectable.ts b/src/main/lens-proxy/proxy-functions/shell-api-request/shell-api-request.injectable.ts index b491ab5456..a9dc0c6747 100644 --- a/src/main/lens-proxy/proxy-functions/shell-api-request/shell-api-request.injectable.ts +++ b/src/main/lens-proxy/proxy-functions/shell-api-request/shell-api-request.injectable.ts @@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable"; import { shellApiRequest } from "./shell-api-request"; import createShellSessionInjectable from "../../../shell-session/create-shell-session.injectable"; import shellRequestAuthenticatorInjectable from "./shell-request-authenticator/shell-request-authenticator.injectable"; -import clusterManagerInjectable from "../../../cluster-manager.injectable"; +import clusterManagerInjectable from "../../../cluster/manager.injectable"; const shellApiRequestInjectable = getInjectable({ id: "shell-api-request", diff --git a/src/main/lens-proxy/proxy-functions/shell-api-request/shell-api-request.ts b/src/main/lens-proxy/proxy-functions/shell-api-request/shell-api-request.ts index 97b6dedd4c..b01a1db44b 100644 --- a/src/main/lens-proxy/proxy-functions/shell-api-request/shell-api-request.ts +++ b/src/main/lens-proxy/proxy-functions/shell-api-request/shell-api-request.ts @@ -7,7 +7,7 @@ import logger from "../../../logger"; import type WebSocket from "ws"; import { Server as WebSocketServer } from "ws"; import type { ProxyApiRequestArgs } from "../types"; -import type { ClusterManager } from "../../../cluster-manager"; +import type { ClusterManager } from "../../../cluster/manager"; import URLParse from "url-parse"; import type { Cluster } from "../../../../common/cluster/cluster"; import type { ClusterId } from "../../../../common/cluster-types"; diff --git a/src/main/menu/start-application-menu.injectable.ts b/src/main/menu/start-application-menu.injectable.ts index b241137cec..3365223c86 100644 --- a/src/main/menu/start-application-menu.injectable.ts +++ b/src/main/menu/start-application-menu.injectable.ts @@ -15,6 +15,7 @@ const startApplicationMenuInjectable = getInjectable({ ); return { + id: "start-application-menu", run: async () => { await applicationMenu.start(); }, diff --git a/src/main/menu/stop-application-menu.injectable.ts b/src/main/menu/stop-application-menu.injectable.ts index 1492da32de..73ed462242 100644 --- a/src/main/menu/stop-application-menu.injectable.ts +++ b/src/main/menu/stop-application-menu.injectable.ts @@ -15,6 +15,7 @@ const stopApplicationMenuInjectable = getInjectable({ ); return { + id: "stop-application-menu", run: async () => { await applicationMenu.stop(); }, diff --git a/src/main/start-main-application/lens-window/current-cluster-frame/setup-listener-for-current-cluster-frame.injectable.ts b/src/main/start-main-application/lens-window/current-cluster-frame/setup-listener-for-current-cluster-frame.injectable.ts index fa8b36c03a..24554c474f 100644 --- a/src/main/start-main-application/lens-window/current-cluster-frame/setup-listener-for-current-cluster-frame.injectable.ts +++ b/src/main/start-main-application/lens-window/current-cluster-frame/setup-listener-for-current-cluster-frame.injectable.ts @@ -14,6 +14,7 @@ const setupListenerForCurrentClusterFrameInjectable = getInjectable({ id: "setup-listener-for-current-cluster-frame", instantiate: (di) => ({ + id: "setup-listener-for-current-cluster-frame", run: () => { const currentClusterFrameState = di.inject(currentClusterFrameClusterIdStateInjectable); diff --git a/src/main/start-main-application/runnables/clean-up-shell-sessions.injectable.ts b/src/main/start-main-application/runnables/clean-up-shell-sessions.injectable.ts index 07066535a1..40d50530ad 100644 --- a/src/main/start-main-application/runnables/clean-up-shell-sessions.injectable.ts +++ b/src/main/start-main-application/runnables/clean-up-shell-sessions.injectable.ts @@ -10,6 +10,7 @@ const cleanUpShellSessionsInjectable = getInjectable({ id: "clean-up-shell-sessions", instantiate: () => ({ + id: "clean-up-shell-sessions", run: () => { ShellSession.cleanup(); }, diff --git a/src/main/start-main-application/runnables/emit-close-to-event-bus.injectable.ts b/src/main/start-main-application/runnables/emit-close-to-event-bus.injectable.ts index 316114f205..d671d50823 100644 --- a/src/main/start-main-application/runnables/emit-close-to-event-bus.injectable.ts +++ b/src/main/start-main-application/runnables/emit-close-to-event-bus.injectable.ts @@ -13,6 +13,7 @@ const emitCloseToEventBusInjectable = getInjectable({ const appEventBus = di.inject(appEventBusInjectable); return { + id: "emit-close-to-event-bus", run: () => { appEventBus.emit({ name: "app", action: "close" }); }, diff --git a/src/main/start-main-application/runnables/emit-service-start-to-event-bus.injectable.ts b/src/main/start-main-application/runnables/emit-service-start-to-event-bus.injectable.ts index 0d3e4cf043..d535b38ad9 100644 --- a/src/main/start-main-application/runnables/emit-service-start-to-event-bus.injectable.ts +++ b/src/main/start-main-application/runnables/emit-service-start-to-event-bus.injectable.ts @@ -13,6 +13,7 @@ const emitServiceStartToEventBusInjectable = getInjectable({ const appEventBus = di.inject(appEventBusInjectable); return { + id: "emit-service-start-to-event-bus", run: () => { appEventBus.emit({ name: "service", action: "start" }); }, diff --git a/src/main/start-main-application/runnables/flag-renderer/flag-renderer-as-loaded.injectable.ts b/src/main/start-main-application/runnables/flag-renderer/flag-renderer-as-loaded.injectable.ts index 3c61b2a011..2bb05cfb52 100644 --- a/src/main/start-main-application/runnables/flag-renderer/flag-renderer-as-loaded.injectable.ts +++ b/src/main/start-main-application/runnables/flag-renderer/flag-renderer-as-loaded.injectable.ts @@ -14,6 +14,7 @@ const flagRendererAsLoadedInjectable = getInjectable({ const lensProtocolRouterMain = di.inject(lensProtocolRouterMainInjectable); return { + id: "flag-renderer-as-loaded", run: () => { runInAction(() => { // Todo: remove this kludge which enables out-of-place temporal dependency. diff --git a/src/main/start-main-application/runnables/flag-renderer/flag-renderer-as-not-loaded.injectable.ts b/src/main/start-main-application/runnables/flag-renderer/flag-renderer-as-not-loaded.injectable.ts index d81f7287aa..8b0a4b8161 100644 --- a/src/main/start-main-application/runnables/flag-renderer/flag-renderer-as-not-loaded.injectable.ts +++ b/src/main/start-main-application/runnables/flag-renderer/flag-renderer-as-not-loaded.injectable.ts @@ -14,6 +14,7 @@ const flagRendererAsNotLoadedInjectable = getInjectable({ const lensProtocolRouterMain = di.inject(lensProtocolRouterMainInjectable); return { + id: "stop-deep-linking", run: () => { runInAction(() => { // Todo: remove this kludge which enables out-of-place temporal dependency. diff --git a/src/main/start-main-application/runnables/initialize-extensions.injectable.ts b/src/main/start-main-application/runnables/initialize-extensions.injectable.ts index 899d684abf..8765721d90 100644 --- a/src/main/start-main-application/runnables/initialize-extensions.injectable.ts +++ b/src/main/start-main-application/runnables/initialize-extensions.injectable.ts @@ -21,6 +21,7 @@ const initializeExtensionsInjectable = getInjectable({ const showErrorPopup = di.inject(showErrorPopupInjectable); return { + id: "initialize-extensions", run: async () => { logger.info("🧩 Initializing extensions"); diff --git a/src/main/start-main-application/runnables/kube-config-sync/add-source.injectable.ts b/src/main/start-main-application/runnables/kube-config-sync/add-source.injectable.ts new file mode 100644 index 0000000000..f95a39f665 --- /dev/null +++ b/src/main/start-main-application/runnables/kube-config-sync/add-source.injectable.ts @@ -0,0 +1,26 @@ +/** + * 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 kubeconfigSyncManagerInjectable from "../../../catalog-sources/kubeconfig-sync/manager.injectable"; +import catalogEntityRegistryInjectable from "../../../catalog/entity-registry.injectable"; +import { afterApplicationIsLoadedInjectionToken } from "../../runnable-tokens/after-application-is-loaded-injection-token"; + +const addKubeconfigSyncAsEntitySourceInjectable = getInjectable({ + id: "add-kubeconfig-sync-as-entity-source", + instantiate: (di) => { + const kubeConfigSyncManager = di.inject(kubeconfigSyncManagerInjectable); + const entityRegistry = di.inject(catalogEntityRegistryInjectable); + + return { + id: "add-kubeconfig-sync-as-entity-source", + run: () => { + entityRegistry.addComputedSource("kubeconfig-sync", kubeConfigSyncManager.source); + }, + }; + }, + injectionToken: afterApplicationIsLoadedInjectionToken, +}); + +export default addKubeconfigSyncAsEntitySourceInjectable; diff --git a/src/main/start-main-application/runnables/kube-config-sync/start-kube-config-sync.injectable.ts b/src/main/start-main-application/runnables/kube-config-sync/start-kube-config-sync.injectable.ts index 0b585f3d65..ad0e446565 100644 --- a/src/main/start-main-application/runnables/kube-config-sync/start-kube-config-sync.injectable.ts +++ b/src/main/start-main-application/runnables/kube-config-sync/start-kube-config-sync.injectable.ts @@ -7,6 +7,7 @@ import { afterApplicationIsLoadedInjectionToken } from "../../runnable-tokens/af import directoryForKubeConfigsInjectable from "../../../../common/app-paths/directory-for-kube-configs/directory-for-kube-configs.injectable"; import ensureDirInjectable from "../../../../common/fs/ensure-dir.injectable"; import kubeconfigSyncManagerInjectable from "../../../catalog-sources/kubeconfig-sync/manager.injectable"; +import addKubeconfigSyncAsEntitySourceInjectable from "./add-source.injectable"; const startKubeConfigSyncInjectable = getInjectable({ id: "start-kubeconfig-sync", @@ -17,11 +18,13 @@ const startKubeConfigSyncInjectable = getInjectable({ const ensureDir = di.inject(ensureDirInjectable); return { + id: "start-kubeconfig-sync", run: async () => { await ensureDir(directoryForKubeConfigs); kubeConfigSyncManager.startSync(); }, + runAfter: di.inject(addKubeconfigSyncAsEntitySourceInjectable), }; }, diff --git a/src/main/start-main-application/runnables/kube-config-sync/stop-kube-config-sync.injectable.ts b/src/main/start-main-application/runnables/kube-config-sync/stop-kube-config-sync.injectable.ts index 6bdf5a7476..77e987effc 100644 --- a/src/main/start-main-application/runnables/kube-config-sync/stop-kube-config-sync.injectable.ts +++ b/src/main/start-main-application/runnables/kube-config-sync/stop-kube-config-sync.injectable.ts @@ -13,6 +13,7 @@ const stopKubeConfigSyncInjectable = getInjectable({ const kubeConfigSyncManager = di.inject(kubeconfigSyncManagerInjectable); return { + id: "stop-kube-config-sync", run: () => { kubeConfigSyncManager.stopSync(); }, diff --git a/src/main/start-main-application/runnables/sentry/setup.injectable.ts b/src/main/start-main-application/runnables/sentry/setup.injectable.ts index 59eacc4199..9db6991fea 100644 --- a/src/main/start-main-application/runnables/sentry/setup.injectable.ts +++ b/src/main/start-main-application/runnables/sentry/setup.injectable.ts @@ -14,6 +14,7 @@ const setupSentryInjectable = getInjectable({ const initializeSentryOnMain = di.inject(initializeSentryOnMainInjectable); return { + id: "setup-sentry", run: () => initializeSentryReportingWith(initializeSentryOnMain), }; }, diff --git a/src/main/start-main-application/runnables/setup-detector-registry.injectable.ts b/src/main/start-main-application/runnables/setup-detector-registry.injectable.ts index 1c91e797f3..0e8b7ffba2 100644 --- a/src/main/start-main-application/runnables/setup-detector-registry.injectable.ts +++ b/src/main/start-main-application/runnables/setup-detector-registry.injectable.ts @@ -18,6 +18,7 @@ const setupDetectorRegistryInjectable = getInjectable({ const detectorRegistry = di.inject(detectorRegistryInjectable); return { + id: "setup-detector-registry", run: () => { detectorRegistry .add(ClusterIdDetector) diff --git a/src/main/start-main-application/runnables/setup-hardware-acceleration.injectable.ts b/src/main/start-main-application/runnables/setup-hardware-acceleration.injectable.ts index ba1b5f2bb8..cbb9b940cb 100644 --- a/src/main/start-main-application/runnables/setup-hardware-acceleration.injectable.ts +++ b/src/main/start-main-application/runnables/setup-hardware-acceleration.injectable.ts @@ -15,6 +15,7 @@ const setupHardwareAccelerationInjectable = getInjectable({ const disableHardwareAcceleration = di.inject(disableHardwareAccelerationInjectable); return { + id: "setup-hardware-acceleration", run: () => { if (hardwareAccelerationShouldBeDisabled) { disableHardwareAcceleration(); diff --git a/src/main/start-main-application/runnables/setup-hotbar-store.injectable.ts b/src/main/start-main-application/runnables/setup-hotbar-store.injectable.ts index 372c339e5e..4f46e46073 100644 --- a/src/main/start-main-application/runnables/setup-hotbar-store.injectable.ts +++ b/src/main/start-main-application/runnables/setup-hotbar-store.injectable.ts @@ -11,6 +11,7 @@ const setupHotbarStoreInjectable = getInjectable({ id: "setup-hotbar-store", instantiate: (di) => ({ + id: "setup-hotbar-store", run: () => { const hotbarStore = di.inject(hotbarStoreInjectable); diff --git a/src/main/start-main-application/runnables/setup-immer.injectable.ts b/src/main/start-main-application/runnables/setup-immer.injectable.ts index 63cd6e3f2f..1d03bd8e9d 100644 --- a/src/main/start-main-application/runnables/setup-immer.injectable.ts +++ b/src/main/start-main-application/runnables/setup-immer.injectable.ts @@ -10,6 +10,7 @@ const setupImmerInjectable = getInjectable({ id: "setup-immer", instantiate: () => ({ + id: "setup-immer", run: () => { // Docs: https://immerjs.github.io/immer/ // Required in `utils/storage-helper.ts` diff --git a/src/main/start-main-application/runnables/setup-lens-proxy.injectable.ts b/src/main/start-main-application/runnables/setup-lens-proxy.injectable.ts index a75f55ec72..58a4b24409 100644 --- a/src/main/start-main-application/runnables/setup-lens-proxy.injectable.ts +++ b/src/main/start-main-application/runnables/setup-lens-proxy.injectable.ts @@ -26,6 +26,7 @@ const setupLensProxyInjectable = getInjectable({ const buildVersion = di.inject(buildVersionInjectable); return { + id: "setup-lens-proxy", run: async () => { try { logger.info("🔌 Starting LensProxy"); diff --git a/src/main/start-main-application/runnables/setup-mobx.injectable.ts b/src/main/start-main-application/runnables/setup-mobx.injectable.ts index ca5a124b77..350911fecd 100644 --- a/src/main/start-main-application/runnables/setup-mobx.injectable.ts +++ b/src/main/start-main-application/runnables/setup-mobx.injectable.ts @@ -10,6 +10,7 @@ const setupMobxInjectable = getInjectable({ id: "setup-mobx", instantiate: () => ({ + id: "setup-mobx", run: () => { // Docs: https://mobx.js.org/configuration.html Mobx.configure({ diff --git a/src/main/start-main-application/runnables/setup-prometheus-registry.injectable.ts b/src/main/start-main-application/runnables/setup-prometheus-registry.injectable.ts index 28b410889d..ef755ac7a1 100644 --- a/src/main/start-main-application/runnables/setup-prometheus-registry.injectable.ts +++ b/src/main/start-main-application/runnables/setup-prometheus-registry.injectable.ts @@ -18,6 +18,7 @@ const setupPrometheusRegistryInjectable = getInjectable({ const prometheusProviderRegistry = di.inject(prometheusProviderRegistryInjectable); return { + id: "setup-prometheus-registry", run: () => { prometheusProviderRegistry .registerProvider(new PrometheusLens()) diff --git a/src/main/start-main-application/runnables/setup-proxy-env.injectable.ts b/src/main/start-main-application/runnables/setup-proxy-env.injectable.ts index 7c05ad8b49..bc709f1f72 100644 --- a/src/main/start-main-application/runnables/setup-proxy-env.injectable.ts +++ b/src/main/start-main-application/runnables/setup-proxy-env.injectable.ts @@ -13,6 +13,7 @@ const setupProxyEnvInjectable = getInjectable({ const getCommandLineSwitch = di.inject(getCommandLineSwitchInjectable); return { + id: "setup-proxy-env", run: () => { const switchValue = getCommandLineSwitch("proxy-server"); diff --git a/src/main/start-main-application/runnables/setup-reactions-in-user-store.injectable.ts b/src/main/start-main-application/runnables/setup-reactions-in-user-store.injectable.ts index 7ab26a1506..f40c3c8796 100644 --- a/src/main/start-main-application/runnables/setup-reactions-in-user-store.injectable.ts +++ b/src/main/start-main-application/runnables/setup-reactions-in-user-store.injectable.ts @@ -13,6 +13,7 @@ const setupReactionsInUserStoreInjectable = getInjectable({ const userStore = di.inject(userStoreInjectable); return { + id: "setup-reactions-in-user-store", run: () => { userStore.startMainReactions(); }, diff --git a/src/main/start-main-application/runnables/setup-shell.injectable.ts b/src/main/start-main-application/runnables/setup-shell.injectable.ts index 80800e8073..147d2f24ab 100644 --- a/src/main/start-main-application/runnables/setup-shell.injectable.ts +++ b/src/main/start-main-application/runnables/setup-shell.injectable.ts @@ -20,6 +20,7 @@ const setupShellInjectable = getInjectable({ const electronApp = di.inject(electronAppInjectable); return { + id: "setup-shell", run: async () => { logger.info("🐚 Syncing shell environment"); diff --git a/src/main/start-main-application/runnables/setup-syncing-of-general-catalog-entities.injectable.ts b/src/main/start-main-application/runnables/setup-syncing-of-general-catalog-entities.injectable.ts index e44752b324..6dc0b27512 100644 --- a/src/main/start-main-application/runnables/setup-syncing-of-general-catalog-entities.injectable.ts +++ b/src/main/start-main-application/runnables/setup-syncing-of-general-catalog-entities.injectable.ts @@ -15,6 +15,7 @@ const setupSyncingOfGeneralCatalogEntitiesInjectable = getInjectable({ ); return { + id: "setup-syncing-of-general-catalog-entities", run: () => { syncGeneralCatalogEntities(); }, diff --git a/src/main/start-main-application/runnables/setup-syncing-of-weblinks.injectable.ts b/src/main/start-main-application/runnables/setup-syncing-of-weblinks.injectable.ts index 0e5ada1b78..fa4e6b436c 100644 --- a/src/main/start-main-application/runnables/setup-syncing-of-weblinks.injectable.ts +++ b/src/main/start-main-application/runnables/setup-syncing-of-weblinks.injectable.ts @@ -13,6 +13,7 @@ const setupSyncingOfWeblinksInjectable = getInjectable({ const syncWeblinks = di.inject(syncWeblinksInjectable); return { + id: "setup-syncing-of-weblinks", run: () => { syncWeblinks(); }, diff --git a/src/main/start-main-application/runnables/setup-system-ca.injectable.ts b/src/main/start-main-application/runnables/setup-system-ca.injectable.ts index 0a09ebebd4..94589fca7d 100644 --- a/src/main/start-main-application/runnables/setup-system-ca.injectable.ts +++ b/src/main/start-main-application/runnables/setup-system-ca.injectable.ts @@ -10,6 +10,7 @@ const setupSystemCaInjectable = getInjectable({ id: "setup-system-ca", instantiate: () => ({ + id: "setup-system-ca", run: async () => { await injectSystemCAs(); }, diff --git a/src/main/start-main-application/runnables/stop-cluster-manager.injectable.ts b/src/main/start-main-application/runnables/stop-cluster-manager.injectable.ts index d062270dd0..f8d6c0bdc7 100644 --- a/src/main/start-main-application/runnables/stop-cluster-manager.injectable.ts +++ b/src/main/start-main-application/runnables/stop-cluster-manager.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import clusterManagerInjectable from "../../cluster-manager.injectable"; +import clusterManagerInjectable from "../../cluster/manager.injectable"; import { beforeQuitOfFrontEndInjectionToken } from "../runnable-tokens/before-quit-of-front-end-injection-token"; const stopClusterManagerInjectable = getInjectable({ @@ -13,6 +13,7 @@ const stopClusterManagerInjectable = getInjectable({ const clusterManager = di.inject(clusterManagerInjectable); return { + id: "stop-cluster-manager", run: () => { clusterManager.stop(); }, diff --git a/src/main/stop-services-and-exit-app.injectable.ts b/src/main/stop-services-and-exit-app.injectable.ts index 25b4324aec..9ac505fe65 100644 --- a/src/main/stop-services-and-exit-app.injectable.ts +++ b/src/main/stop-services-and-exit-app.injectable.ts @@ -4,7 +4,7 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import exitAppInjectable from "./electron-app/features/exit-app.injectable"; -import clusterManagerInjectable from "./cluster-manager.injectable"; +import clusterManagerInjectable from "./cluster/manager.injectable"; import appEventBusInjectable from "../common/app-event-bus/app-event-bus.injectable"; import loggerInjectable from "../common/logger.injectable"; import closeAllWindowsInjectable from "./start-main-application/lens-window/hide-all-windows/close-all-windows.injectable"; diff --git a/src/main/stores/init-user-store.injectable.ts b/src/main/stores/init-user-store.injectable.ts index 572c0154e4..c8d7ec9fe0 100644 --- a/src/main/stores/init-user-store.injectable.ts +++ b/src/main/stores/init-user-store.injectable.ts @@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable"; import userStoreFileNameMigrationInjectable from "../../common/user-store/file-name-migration.injectable"; import userStoreInjectable from "../../common/user-store/user-store.injectable"; import { beforeApplicationIsLoadingInjectionToken } from "../start-main-application/runnable-tokens/before-application-is-loading-injection-token"; -import initDefaultUpdateChannelInjectableInjectable from "../vars/default-update-channel/init.injectable"; +import initDefaultUpdateChannelInjectable from "../vars/default-update-channel/init.injectable"; const initUserStoreInjectable = getInjectable({ id: "init-user-store", @@ -15,11 +15,12 @@ const initUserStoreInjectable = getInjectable({ const userStoreFileNameMigration = di.inject(userStoreFileNameMigrationInjectable); return { + id: "init-user-store", run: async () => { await userStoreFileNameMigration(); userStore.load(); }, - runAfter: di.inject(initDefaultUpdateChannelInjectableInjectable), + runAfter: di.inject(initDefaultUpdateChannelInjectable), }; }, injectionToken: beforeApplicationIsLoadingInjectionToken, diff --git a/src/main/theme/broadcast-theme-change/start-broadcasting-theme-change.injectable.ts b/src/main/theme/broadcast-theme-change/start-broadcasting-theme-change.injectable.ts index 7794c07bd4..e76f251ec2 100644 --- a/src/main/theme/broadcast-theme-change/start-broadcasting-theme-change.injectable.ts +++ b/src/main/theme/broadcast-theme-change/start-broadcasting-theme-change.injectable.ts @@ -13,6 +13,7 @@ const startBroadcastingThemeChangeInjectable = getInjectable({ const broadcastThemeChange = di.inject(broadcastThemeChangeInjectable); return { + id: "start-broadcasting-theme-change", run: async () => { await broadcastThemeChange.start(); }, diff --git a/src/main/theme/broadcast-theme-change/stop-broadcasting-theme-change.injectable.ts b/src/main/theme/broadcast-theme-change/stop-broadcasting-theme-change.injectable.ts index a5f922af13..81f530ad9b 100644 --- a/src/main/theme/broadcast-theme-change/stop-broadcasting-theme-change.injectable.ts +++ b/src/main/theme/broadcast-theme-change/stop-broadcasting-theme-change.injectable.ts @@ -13,6 +13,7 @@ const stopBroadcastingThemeChangeInjectable = getInjectable({ const broadcastThemeChange = di.inject(broadcastThemeChangeInjectable); return { + id: "stop-broadcasting-theme-change", run: async () => { await broadcastThemeChange.stop(); }, diff --git a/src/main/theme/sync-theme-from-os/start-syncing-theme-from-operating-system.injectable.ts b/src/main/theme/sync-theme-from-os/start-syncing-theme-from-operating-system.injectable.ts index 9bf9c5fe49..adc22c4e1e 100644 --- a/src/main/theme/sync-theme-from-os/start-syncing-theme-from-operating-system.injectable.ts +++ b/src/main/theme/sync-theme-from-os/start-syncing-theme-from-operating-system.injectable.ts @@ -13,6 +13,7 @@ const startSyncingThemeFromOperatingSystemInjectable = getInjectable({ const syncTheme = di.inject(syncThemeFromOperatingSystemInjectable); return { + id: "start-syncing-theme-from-operating-system", run: async () => { await syncTheme.start(); }, diff --git a/src/main/theme/sync-theme-from-os/stop-syncing-theme-from-operating-system.injectable.ts b/src/main/theme/sync-theme-from-os/stop-syncing-theme-from-operating-system.injectable.ts index 08657281c2..8a11042883 100644 --- a/src/main/theme/sync-theme-from-os/stop-syncing-theme-from-operating-system.injectable.ts +++ b/src/main/theme/sync-theme-from-os/stop-syncing-theme-from-operating-system.injectable.ts @@ -13,6 +13,7 @@ const stopSyncingThemeFromOperatingSystemInjectable = getInjectable({ const syncTheme = di.inject(syncThemeFromOperatingSystemInjectable); return { + id: "stop-syncing-theme-from-operating-system", run: async () => { await syncTheme.stop(); }, diff --git a/src/main/tray/electron-tray/start-tray.injectable.ts b/src/main/tray/electron-tray/start-tray.injectable.ts index 1a223ac3a5..2226205244 100644 --- a/src/main/tray/electron-tray/start-tray.injectable.ts +++ b/src/main/tray/electron-tray/start-tray.injectable.ts @@ -13,6 +13,7 @@ const startTrayInjectable = getInjectable({ const electronTray = di.inject(electronTrayInjectable); return { + id: "start-tray", run: () => { electronTray.start(); }, diff --git a/src/main/tray/electron-tray/stop-tray.injectable.ts b/src/main/tray/electron-tray/stop-tray.injectable.ts index f66ffb3a64..babf687772 100644 --- a/src/main/tray/electron-tray/stop-tray.injectable.ts +++ b/src/main/tray/electron-tray/stop-tray.injectable.ts @@ -14,6 +14,7 @@ const stopTrayInjectable = getInjectable({ const electronTray = di.inject(electronTrayInjectable); return { + id: "stop-tray", run: () => { electronTray.stop(); }, diff --git a/src/main/tray/menu-icon/start-reactivity.injectable.ts b/src/main/tray/menu-icon/start-reactivity.injectable.ts index 373c3cf8fb..19bc9aec20 100644 --- a/src/main/tray/menu-icon/start-reactivity.injectable.ts +++ b/src/main/tray/menu-icon/start-reactivity.injectable.ts @@ -14,6 +14,7 @@ const startReactiveTrayMenuIconInjectable = getInjectable({ const reactiveTrayMenuIcon = di.inject(reactiveTrayMenuIconInjectable); return { + id: "start-reactive-tray-menu-icon", run: async () => { await reactiveTrayMenuIcon.start(); }, diff --git a/src/main/tray/menu-icon/stop-reactivity.injectable.ts b/src/main/tray/menu-icon/stop-reactivity.injectable.ts index 4b60aaaa54..b43661807d 100644 --- a/src/main/tray/menu-icon/stop-reactivity.injectable.ts +++ b/src/main/tray/menu-icon/stop-reactivity.injectable.ts @@ -13,6 +13,7 @@ const stopReactiveTrayMenuIconInjectable = getInjectable({ const reactiveTrayMenuIcon = di.inject(reactiveTrayMenuIconInjectable); return { + id: "stop-reactive-tray-menu-icon", run: async () => { await reactiveTrayMenuIcon.stop(); }, diff --git a/src/main/tray/reactive-tray-menu-items/start-reactive-tray-menu-items.injectable.ts b/src/main/tray/reactive-tray-menu-items/start-reactive-tray-menu-items.injectable.ts index 63025e6a9a..7abd07e91b 100644 --- a/src/main/tray/reactive-tray-menu-items/start-reactive-tray-menu-items.injectable.ts +++ b/src/main/tray/reactive-tray-menu-items/start-reactive-tray-menu-items.injectable.ts @@ -14,6 +14,7 @@ const startReactiveTrayMenuItemsInjectable = getInjectable({ const reactiveTrayMenuItems = di.inject(reactiveTrayMenuItemsInjectable); return { + id: "start-reactive-tray-menu-items", run: async () => { await reactiveTrayMenuItems.start(); }, diff --git a/src/main/tray/reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable.ts b/src/main/tray/reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable.ts index 384cdc253a..dbf5753c23 100644 --- a/src/main/tray/reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable.ts +++ b/src/main/tray/reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable.ts @@ -13,6 +13,7 @@ const stopReactiveTrayMenuItemsInjectable = getInjectable({ const reactiveTrayMenuItems = di.inject(reactiveTrayMenuItemsInjectable); return { + id: "stop-reactive-tray-menu-items", run: async () => { await reactiveTrayMenuItems.stop(); }, diff --git a/src/main/utils/channel/channel-listeners/start-listening-of-channels.injectable.ts b/src/main/utils/channel/channel-listeners/start-listening-of-channels.injectable.ts index 96fea0a2f0..78d73044e9 100644 --- a/src/main/utils/channel/channel-listeners/start-listening-of-channels.injectable.ts +++ b/src/main/utils/channel/channel-listeners/start-listening-of-channels.injectable.ts @@ -13,6 +13,7 @@ const startListeningOfChannelsInjectable = getInjectable({ const listeningOfChannels = di.inject(listeningOfChannelsInjectable); return { + id: "start-listening-of-channels-main", run: async () => { await listeningOfChannels.start(); }, diff --git a/src/main/vars/build-version/init.injectable.ts b/src/main/vars/build-version/init.injectable.ts index 0d879715a4..f53e735a47 100644 --- a/src/main/vars/build-version/init.injectable.ts +++ b/src/main/vars/build-version/init.injectable.ts @@ -6,16 +6,17 @@ import { getInjectable } from "@ogre-tools/injectable"; import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/before-application-is-loading-injection-token"; import buildVersionInjectable from "./build-version.injectable"; -const initializeBuildVersionAsyncSyncBoxInjectable = getInjectable({ - id: "initialize-build-version-async-sync-box", +const initializeBuildVersionInjectable = getInjectable({ + id: "initialize-build-version", instantiate: (di) => { const buildVersion = di.inject(buildVersionInjectable); return { + id: "initialize-build-version", run: () => buildVersion.init(), }; }, injectionToken: beforeApplicationIsLoadingInjectionToken, }); -export default initializeBuildVersionAsyncSyncBoxInjectable; +export default initializeBuildVersionInjectable; diff --git a/src/main/vars/default-update-channel/init.injectable.ts b/src/main/vars/default-update-channel/init.injectable.ts index e1680efa39..be588780af 100644 --- a/src/main/vars/default-update-channel/init.injectable.ts +++ b/src/main/vars/default-update-channel/init.injectable.ts @@ -7,12 +7,13 @@ import defaultUpdateChannelInjectable from "../../../common/application-update/s import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/before-application-is-loading-injection-token"; import initReleaseChannelInjectable from "../release-channel/init.injectable"; -const initDefaultUpdateChannelInjectableInjectable = getInjectable({ - id: "init-default-update-channel-injectable", +const initDefaultUpdateChannelInjectable = getInjectable({ + id: "init-default-update-channel", instantiate: (di) => { const defaultUpdateChannel = di.inject(defaultUpdateChannelInjectable); return { + id: "init-default-update-channel", run: () => defaultUpdateChannel.init(), runAfter: di.inject(initReleaseChannelInjectable), }; @@ -20,4 +21,4 @@ const initDefaultUpdateChannelInjectableInjectable = getInjectable({ injectionToken: beforeApplicationIsLoadingInjectionToken, }); -export default initDefaultUpdateChannelInjectableInjectable; +export default initDefaultUpdateChannelInjectable; diff --git a/src/main/vars/release-channel/init.injectable.ts b/src/main/vars/release-channel/init.injectable.ts index ed358af550..59527d2194 100644 --- a/src/main/vars/release-channel/init.injectable.ts +++ b/src/main/vars/release-channel/init.injectable.ts @@ -13,6 +13,7 @@ const initReleaseChannelInjectable = getInjectable({ const releaseChannel = di.inject(releaseChannelInjectable); return { + id: "init-release-channel", run: () => releaseChannel.init(), runAfter: di.inject(initSemanticBuildVersionInjectable), }; diff --git a/src/main/vars/semantic-build-version/init.injectable.ts b/src/main/vars/semantic-build-version/init.injectable.ts index 8b33e27576..ee822a8796 100644 --- a/src/main/vars/semantic-build-version/init.injectable.ts +++ b/src/main/vars/semantic-build-version/init.injectable.ts @@ -13,6 +13,7 @@ const initSemanticBuildVersionInjectable = getInjectable({ const buildSemanticVersion = di.inject(buildSemanticVersionInjectable); return { + id: "init-semantic-build-version", run: () => buildSemanticVersion.init(), runAfter: di.inject(initializeBuildVersionInjectable), }; diff --git a/src/renderer/api/setup-on-api-errors.injectable.ts b/src/renderer/api/setup-on-api-errors.injectable.ts index 859b333586..a352293b5e 100644 --- a/src/renderer/api/setup-on-api-errors.injectable.ts +++ b/src/renderer/api/setup-on-api-errors.injectable.ts @@ -11,6 +11,7 @@ const setupOnApiErrorListenersInjectable = getInjectable({ id: "setup-on-api-error-listeners", instantiate: () => ({ + id: "setup-on-api-error-listeners", run: () => { apiBase?.onError.addListener(onApiError); }, diff --git a/src/renderer/app-paths/setup-app-paths.injectable.ts b/src/renderer/app-paths/setup-app-paths.injectable.ts index 14242347f4..3660ad9db8 100644 --- a/src/renderer/app-paths/setup-app-paths.injectable.ts +++ b/src/renderer/app-paths/setup-app-paths.injectable.ts @@ -17,6 +17,7 @@ const setupAppPathsInjectable = getInjectable({ const appPathsState = di.inject(appPathsStateInjectable); return { + id: "setup-app-paths", run: async () => { const appPaths = await requestFromChannel( appPathsChannel, diff --git a/src/renderer/components/hotbar/hotbar-entity-icon.tsx b/src/renderer/components/hotbar/hotbar-entity-icon.tsx index e07f320fad..b3f635acb5 100644 --- a/src/renderer/components/hotbar/hotbar-entity-icon.tsx +++ b/src/renderer/components/hotbar/hotbar-entity-icon.tsx @@ -17,11 +17,12 @@ import { Icon } from "../icon"; import { HotbarIcon } from "./hotbar-icon"; import { LensKubernetesClusterStatus } from "../../../common/catalog-entities/kubernetes-cluster"; import type { VisitEntityContextMenu } from "../../../common/catalog/visit-entity-context-menu.injectable"; -import { navigate } from "../../navigation"; import { withInjectables } from "@ogre-tools/injectable-react"; import catalogCategoryRegistryInjectable from "../../../common/catalog/category-registry.injectable"; import visitEntityContextMenuInjectable from "../../../common/catalog/visit-entity-context-menu.injectable"; import activeEntityInjectable from "../../api/catalog/entity/active.injectable"; +import type { Navigate } from "../../navigation/navigate.injectable"; +import navigateInjectable from "../../navigation/navigate.injectable"; export interface HotbarEntityIconProps { entity: CatalogEntity; @@ -38,13 +39,14 @@ interface Dependencies { visitEntityContextMenu: VisitEntityContextMenu; catalogCategoryRegistry: CatalogCategoryRegistry; activeEntity: IComputedValue; + navigate: Navigate; } @observer class NonInjectedHotbarEntityIcon extends React.Component { private readonly menuItems = observable.array(); - get kindIcon() { + private renderKindIcon() { const className = styles.badge; const category = this.props.catalogCategoryRegistry.getCategoryForEntity(this.props.entity); @@ -59,7 +61,7 @@ class NonInjectedHotbarEntityIcon extends React.Component; } - get ledIcon() { + private renderLedIcon() { if (this.props.entity.kind !== "KubernetesCluster") { return null; } @@ -86,7 +88,7 @@ class NonInjectedHotbarEntityIcon extends React.Component - { this.ledIcon } - { this.kindIcon } + {this.renderLedIcon()} + {this.renderKindIcon()} ); } @@ -126,5 +128,6 @@ export const HotbarEntityIcon = withInjectables { ipcRenderer.on("history:can-go-back", action((event, canGoBack: boolean) => { state.prevEnabled = canGoBack; diff --git a/src/renderer/components/test-utils/get-application-builder.tsx b/src/renderer/components/test-utils/get-application-builder.tsx index 9f9ab7d903..f7e28c7b81 100644 --- a/src/renderer/components/test-utils/get-application-builder.tsx +++ b/src/renderer/components/test-utils/get-application-builder.tsx @@ -54,7 +54,7 @@ import { RootFrame } from "../../frames/root-frame/root-frame"; import { ClusterFrame } from "../../frames/cluster-frame/cluster-frame"; import hostedClusterIdInjectable from "../../cluster-frame-context/hosted-cluster-id.injectable"; import activeKubernetesClusterInjectable from "../../cluster-frame-context/active-kubernetes-cluster.injectable"; -import { catalogEntityFromCluster } from "../../../main/cluster-manager"; +import { catalogEntityFromCluster } from "../../../main/cluster/manager"; import namespaceStoreInjectable from "../+namespaces/store.injectable"; import { isAllowedResource } from "../../../common/cluster/is-allowed-resource"; import createApplicationWindowInjectable from "../../../main/start-main-application/lens-window/application-window/create-application-window.injectable"; diff --git a/src/renderer/frames/root-frame/setup-system-ca.injectable.ts b/src/renderer/frames/root-frame/setup-system-ca.injectable.ts index ca913a4371..3ee10748f9 100644 --- a/src/renderer/frames/root-frame/setup-system-ca.injectable.ts +++ b/src/renderer/frames/root-frame/setup-system-ca.injectable.ts @@ -10,6 +10,7 @@ const setupSystemCaInjectable = getInjectable({ id: "setup-system-ca", instantiate: () => ({ + id: "setup-system-ca", run: async () => { await injectSystemCAs(); }, diff --git a/src/renderer/getDiForUnitTesting.tsx b/src/renderer/getDiForUnitTesting.tsx index 58b17b7eaf..aa146ad385 100644 --- a/src/renderer/getDiForUnitTesting.tsx +++ b/src/renderer/getDiForUnitTesting.tsx @@ -104,9 +104,17 @@ export const getDiForUnitTesting = ( di.override(getRandomIdInjectable, () => () => "some-irrelevant-random-id"); di.override(platformInjectable, () => "darwin"); - di.override(startTopbarStateSyncInjectable, () => ({ - run: () => {}, - })); + + [ + startTopbarStateSyncInjectable, + setupSystemCaInjectable, + setupOnApiErrorListenersInjectable, + ].forEach((injectable) => { + di.override(injectable, () => ({ + id: injectable.id, + run: () => {}, + })); + }); di.override(terminalSpawningPoolInjectable, () => document.createElement("div")); di.override(hostedClusterIdInjectable, () => undefined); @@ -180,9 +188,6 @@ export const getDiForUnitTesting = ( di.override(fileSystemProvisionerStoreInjectable, () => ({}) as FileSystemProvisionerStore); - di.override(setupSystemCaInjectable, () => ({ run: () => {} })); - di.override(setupOnApiErrorListenersInjectable, () => ({ run: () => {} })); - di.override(defaultShellInjectable, () => "some-default-shell"); di.override(userStoreInjectable, () => ({ diff --git a/src/renderer/stores/init-user-store.injectable.ts b/src/renderer/stores/init-user-store.injectable.ts index 36f2caf015..2c5b15dd1b 100644 --- a/src/renderer/stores/init-user-store.injectable.ts +++ b/src/renderer/stores/init-user-store.injectable.ts @@ -5,7 +5,7 @@ import { getInjectable } from "@ogre-tools/injectable"; import userStoreInjectable from "../../common/user-store/user-store.injectable"; import { beforeFrameStartsInjectionToken } from "../before-frame-starts/before-frame-starts-injection-token"; -import initDefaultUpdateChannelInjectableInjectable from "../vars/default-update-channel/init.injectable"; +import initDefaultUpdateChannelInjectable from "../vars/default-update-channel/init.injectable"; const initUserStoreInjectable = getInjectable({ id: "init-user-store", @@ -13,8 +13,9 @@ const initUserStoreInjectable = getInjectable({ const userStore = di.inject(userStoreInjectable); return { + id: "init-user-store", run: () => userStore.load(), - runAfter: di.inject(initDefaultUpdateChannelInjectableInjectable), + runAfter: di.inject(initDefaultUpdateChannelInjectable), }; }, injectionToken: beforeFrameStartsInjectionToken, diff --git a/src/renderer/utils/channel/channel-listeners/start-listening-of-channels.injectable.ts b/src/renderer/utils/channel/channel-listeners/start-listening-of-channels.injectable.ts index c37c9b1864..e423299915 100644 --- a/src/renderer/utils/channel/channel-listeners/start-listening-of-channels.injectable.ts +++ b/src/renderer/utils/channel/channel-listeners/start-listening-of-channels.injectable.ts @@ -13,6 +13,7 @@ const startListeningOfChannelsInjectable = getInjectable({ const listeningOfChannels = di.inject(listeningOfChannelsInjectable); return { + id: "start-listening-of-channels-renderer", run: async () => { await listeningOfChannels.start(); }, diff --git a/src/renderer/utils/sync-box/provide-initial-values-for-sync-boxes.injectable.ts b/src/renderer/utils/sync-box/provide-initial-values-for-sync-boxes.injectable.ts index 472aee497a..f7d692cdef 100644 --- a/src/renderer/utils/sync-box/provide-initial-values-for-sync-boxes.injectable.ts +++ b/src/renderer/utils/sync-box/provide-initial-values-for-sync-boxes.injectable.ts @@ -25,6 +25,7 @@ const provideInitialValuesForSyncBoxesInjectable = getInjectable({ di.inject(createSyncBoxStateInjectable, syncBox.id).set(state); return { + id: "provide-initial-values-for-sync-boxes", run: async () => { const initialValues = await requestFromChannel(syncBoxInitialValueChannel); diff --git a/src/renderer/vars/build-version/init.injectable.ts b/src/renderer/vars/build-version/init.injectable.ts index 0dc867f0ca..25aeb8d2bc 100644 --- a/src/renderer/vars/build-version/init.injectable.ts +++ b/src/renderer/vars/build-version/init.injectable.ts @@ -12,6 +12,7 @@ const initializeBuildVersionInjectable = getInjectable({ const buildVersion = di.inject(buildVersionInjectable); return { + id: "initialize-build-version", run: () => buildVersion.init(), }; }, diff --git a/src/renderer/vars/default-update-channel/init.injectable.ts b/src/renderer/vars/default-update-channel/init.injectable.ts index e486be0aaf..36bbec8157 100644 --- a/src/renderer/vars/default-update-channel/init.injectable.ts +++ b/src/renderer/vars/default-update-channel/init.injectable.ts @@ -7,12 +7,13 @@ import defaultUpdateChannelInjectable from "../../../common/application-update/s import { beforeFrameStartsInjectionToken } from "../../before-frame-starts/before-frame-starts-injection-token"; import initReleaseChannelInjectable from "../release-channel/init.injectable"; -const initDefaultUpdateChannelInjectableInjectable = getInjectable({ - id: "init-default-update-channel-injectable", +const initDefaultUpdateChannelInjectable = getInjectable({ + id: "init-default-update-channel", instantiate: (di) => { const defaultUpdateChannel = di.inject(defaultUpdateChannelInjectable); return { + id: "init-default-update-channel", run: () => defaultUpdateChannel.init(), runAfter: di.inject(initReleaseChannelInjectable), }; @@ -20,4 +21,4 @@ const initDefaultUpdateChannelInjectableInjectable = getInjectable({ injectionToken: beforeFrameStartsInjectionToken, }); -export default initDefaultUpdateChannelInjectableInjectable; +export default initDefaultUpdateChannelInjectable; diff --git a/src/renderer/vars/release-channel/init.injectable.ts b/src/renderer/vars/release-channel/init.injectable.ts index f384fd2716..14e92fccda 100644 --- a/src/renderer/vars/release-channel/init.injectable.ts +++ b/src/renderer/vars/release-channel/init.injectable.ts @@ -13,6 +13,7 @@ const initReleaseChannelInjectable = getInjectable({ const releaseChannel = di.inject(releaseChannelInjectable); return { + id: "init-release-channel", run: () => releaseChannel.init(), runAfter: di.inject(initSemanticBuildVersionInjectable), }; diff --git a/src/renderer/vars/semantic-build-version/init.injectable.ts b/src/renderer/vars/semantic-build-version/init.injectable.ts index 572ccc63ac..393143219f 100644 --- a/src/renderer/vars/semantic-build-version/init.injectable.ts +++ b/src/renderer/vars/semantic-build-version/init.injectable.ts @@ -13,6 +13,7 @@ const initSemanticBuildVersionInjectable = getInjectable({ const buildSemanticVersion = di.inject(buildSemanticVersionInjectable); return { + id: "init-semantic-build-version", run: () => buildSemanticVersion.init(), runAfter: di.inject(initializeBuildVersionInjectable), }; From f54438661906923606404bfda921a5f93ed1197f Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 3 Oct 2022 11:41:59 -0300 Subject: [PATCH 051/280] Remove mac-ca usage since it was only in tests (#6043) * Make injecting CAs injectable, remove mac-ca as dependency Signed-off-by: Sebastian Malton * Fix win-ca failing on electron renderer on windows Signed-off-by: Sebastian Malton * Fix the matcher under features/ for main Signed-off-by: Sebastian Malton * Fix lint Signed-off-by: Sebastian Malton Signed-off-by: Sebastian Malton --- .../__tests__/app-preferences.tests.ts | 7 +- integration/__tests__/cluster-pages.tests.ts | 3 +- integration/helpers/utils.ts | 8 -- package.json | 1 - src/common/__tests__/system-ca.test.ts | 99 ----------------- .../inject-system-cas.injectable.ts | 39 +++++++ .../request-system-cas-token.ts | 10 ++ .../request-system-cas.injectable.darwin.ts | 44 ++++++++ .../request-system-cas.injectable.linux.ts | 14 +++ ...quest-system-cas.injectable.testing-env.ts | 14 +++ .../request-system-cas.injectable.win32.ts | 45 ++++++++ src/common/fs/exec-file.injectable.ts | 24 ++++- src/common/system-ca.ts | 102 ------------------ src/common/utils/__tests__/paths.test.ts | 7 +- src/jest.setup.ts | 4 +- src/main/getDi.ts | 8 +- .../runnables/setup-system-ca.injectable.ts | 12 +-- .../root-frame/setup-system-ca.injectable.ts | 12 +-- src/renderer/getDi.tsx | 8 +- src/test-utils/skippers.ts | 18 ++++ types/from-webpack.d.ts | 8 ++ types/mocks.d.ts | 1 - webpack/main.ts | 6 ++ webpack/renderer.ts | 6 ++ yarn.lock | 12 --- 25 files changed, 250 insertions(+), 262 deletions(-) delete mode 100644 src/common/__tests__/system-ca.test.ts create mode 100644 src/common/certificate-authorities/inject-system-cas.injectable.ts create mode 100644 src/common/certificate-authorities/request-system-cas-token.ts create mode 100644 src/common/certificate-authorities/request-system-cas.injectable.darwin.ts create mode 100644 src/common/certificate-authorities/request-system-cas.injectable.linux.ts create mode 100644 src/common/certificate-authorities/request-system-cas.injectable.testing-env.ts create mode 100644 src/common/certificate-authorities/request-system-cas.injectable.win32.ts delete mode 100644 src/common/system-ca.ts create mode 100644 src/test-utils/skippers.ts create mode 100644 types/from-webpack.d.ts diff --git a/integration/__tests__/app-preferences.tests.ts b/integration/__tests__/app-preferences.tests.ts index 2054a5342d..8a74a8160c 100644 --- a/integration/__tests__/app-preferences.tests.ts +++ b/integration/__tests__/app-preferences.tests.ts @@ -23,9 +23,10 @@ describe("preferences page tests", () => { await app.evaluate(async ({ app }) => { await app.applicationMenu - .getMenuItemById(process.platform === "darwin" ? "root" : "file") - .submenu.getMenuItemById("preferences") - .click(); + ?.getMenuItemById(process.platform === "darwin" ? "root" : "file") + ?.submenu + ?.getMenuItemById("preferences") + ?.click(); }); }, 10*60*1000); diff --git a/integration/__tests__/cluster-pages.tests.ts b/integration/__tests__/cluster-pages.tests.ts index 15e72f0d80..897694caba 100644 --- a/integration/__tests__/cluster-pages.tests.ts +++ b/integration/__tests__/cluster-pages.tests.ts @@ -14,10 +14,11 @@ import { minikubeReady } from "../helpers/minikube"; import type { Frame, Page } from "playwright"; import { groupBy, toPairs } from "lodash/fp"; import { pipeline } from "@ogre-tools/fp"; +import { describeIf } from "../../src/test-utils/skippers"; const TEST_NAMESPACE = "integration-tests"; -utils.describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => { +describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => { let window: Page, cleanup: () => Promise, frame: Frame; beforeEach(async () => { diff --git a/integration/helpers/utils.ts b/integration/helpers/utils.ts index f8eca46c26..49cadb4a38 100644 --- a/integration/helpers/utils.ts +++ b/integration/helpers/utils.ts @@ -17,14 +17,6 @@ export const appPaths: Partial> = { "darwin": "./dist/mac/OpenLens.app/Contents/MacOS/OpenLens", }; -export function itIf(condition: boolean) { - return condition ? it : it.skip; -} - -export function describeIf(condition: boolean) { - return condition ? describe : describe.skip; -} - async function getMainWindow(app: ElectronApplication, timeout = 50_000): Promise { const deadline = Date.now() + timeout; diff --git a/package.json b/package.json index 7d26f9b4a1..2b548b0280 100644 --- a/package.json +++ b/package.json @@ -250,7 +250,6 @@ "js-yaml": "^4.1.0", "jsdom": "^16.7.0", "lodash": "^4.17.15", - "mac-ca": "^1.0.6", "marked": "^4.1.1", "md5-file": "^5.0.0", "mobx": "^6.6.2", diff --git a/src/common/__tests__/system-ca.test.ts b/src/common/__tests__/system-ca.test.ts deleted file mode 100644 index 473fe6ed57..0000000000 --- a/src/common/__tests__/system-ca.test.ts +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Copyright (c) OpenLens Authors. All rights reserved. - * Licensed under MIT License. See LICENSE in root directory for more information. - */ -import https from "https"; -import os from "os"; -import { getMacRootCA, getWinRootCA, injectCAs, DSTRootCAX3 } from "../system-ca"; -import { dependencies, devDependencies } from "../../../package.json"; -import assert from "assert"; - -const deps = { ...dependencies, ...devDependencies }; - -// Skip the test if mac-ca is not installed, or os is not darwin -(deps["mac-ca"] && os.platform().includes("darwin") ? describe: describe.skip)("inject CA for Mac", () => { - // for reset https.globalAgent.options.ca after testing - let _ca: string | Buffer | (string | Buffer)[] | undefined; - - beforeEach(() => { - _ca = https.globalAgent.options.ca; - }); - - afterEach(() => { - https.globalAgent.options.ca = _ca; - }); - - /** - * The test to ensure using getMacRootCA + injectCAs injects CAs in the same way as using - * the auto injection (require('mac-ca')) - */ - it("should inject the same ca as mac-ca", async () => { - const osxCAs = await getMacRootCA(); - - injectCAs(osxCAs); - const injected = https.globalAgent.options.ca as (string | Buffer)[]; - - await import("mac-ca"); - const injectedByMacCA = https.globalAgent.options.ca as (string | Buffer)[]; - - expect(new Set(injected)).toEqual(new Set(injectedByMacCA)); - }); - - it("shouldn't included the expired DST Root CA X3 on Mac", async () => { - const osxCAs = await getMacRootCA(); - - injectCAs(osxCAs); - const injected = https.globalAgent.options.ca; - - assert(injected); - expect(injected.includes(DSTRootCAX3)).toBeFalsy(); - }); -}); - -// Skip the test if win-ca is not installed, or os is not win32 -(deps["win-ca"] && os.platform().includes("win32") ? describe: describe.skip)("inject CA for Windows", () => { - // for reset https.globalAgent.options.ca after testing - let _ca: string | Buffer | (string | Buffer)[] | undefined; - - beforeEach(() => { - _ca = https.globalAgent.options.ca; - }); - - afterEach(() => { - https.globalAgent.options.ca = _ca; - }); - - /** - * The test to ensure using win-ca/api injects CAs in the same way as using - * the auto injection (require('win-ca').inject('+')) - */ - it("should inject the same ca as winca.inject('+')", async () => { - const winCAs = await getWinRootCA(); - - const wincaAPI = await import("win-ca/api"); - - wincaAPI.inject("+", winCAs); - const injected = https.globalAgent.options.ca as (string | Buffer)[]; - - const winca = await import("win-ca"); - - winca.inject("+"); // see: https://github.com/ukoloff/win-ca#caveats - const injectedByWinCA = https.globalAgent.options.ca as (string | Buffer)[]; - - expect(new Set(injected)).toEqual(new Set(injectedByWinCA)); - }); - - it("shouldn't included the expired DST Root CA X3 on Windows", async () => { - const winCAs = await getWinRootCA(); - - const wincaAPI = await import("win-ca/api"); - - wincaAPI.inject("true", winCAs); - const injected = https.globalAgent.options.ca as (string | Buffer)[]; - - expect(injected.includes(DSTRootCAX3)).toBeFalsy(); - }); -}); - - - diff --git a/src/common/certificate-authorities/inject-system-cas.injectable.ts b/src/common/certificate-authorities/inject-system-cas.injectable.ts new file mode 100644 index 0000000000..b6223fa38e --- /dev/null +++ b/src/common/certificate-authorities/inject-system-cas.injectable.ts @@ -0,0 +1,39 @@ +/** + * 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 { globalAgent } from "https"; +import { requestSystemCAsInjectionToken } from "./request-system-cas-token"; + +// DST Root CA X3, which was expired on 9.30.2021 +const DSTRootCAX3 = "-----BEGIN CERTIFICATE-----\nMIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/\nMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\nDkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow\nPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD\nEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\nAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O\nrz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq\nOLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b\nxiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw\n7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD\naeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV\nHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG\nSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69\nikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr\nAvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz\nR8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5\nJDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo\nOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ\n-----END CERTIFICATE-----\n"; + +function isCertActive(cert: string) { + const isExpired = typeof cert !== "string" || cert.includes(DSTRootCAX3); + + return !isExpired; +} + +const injectSystemCAsInjectable = getInjectable({ + id: "inject-system-cas", + instantiate: (di) => { + const requestSystemCAs = di.inject(requestSystemCAsInjectionToken); + + return async () => { + for (const cert of await requestSystemCAs()) { + if (isCertActive(cert)) { + if (Array.isArray(globalAgent.options.ca) && !globalAgent.options.ca.includes(cert)) { + globalAgent.options.ca.push(cert); + } else { + globalAgent.options.ca = [cert]; + } + } + } + }; + }, +}); + +export default injectSystemCAsInjectable; + diff --git a/src/common/certificate-authorities/request-system-cas-token.ts b/src/common/certificate-authorities/request-system-cas-token.ts new file mode 100644 index 0000000000..c69b0bd8b0 --- /dev/null +++ b/src/common/certificate-authorities/request-system-cas-token.ts @@ -0,0 +1,10 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +import { getInjectionToken } from "@ogre-tools/injectable"; + +export const requestSystemCAsInjectionToken = getInjectionToken<() => Promise>({ + id: "request-system-cas-token", +}); diff --git a/src/common/certificate-authorities/request-system-cas.injectable.darwin.ts b/src/common/certificate-authorities/request-system-cas.injectable.darwin.ts new file mode 100644 index 0000000000..7b0425bbe1 --- /dev/null +++ b/src/common/certificate-authorities/request-system-cas.injectable.darwin.ts @@ -0,0 +1,44 @@ +/** + * 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 execFileInjectable from "../fs/exec-file.injectable"; +import loggerInjectable from "../logger.injectable"; +import { requestSystemCAsInjectionToken } from "./request-system-cas-token"; + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Cheatsheet#other_assertions +const certSplitPattern = /(?=-----BEGIN\sCERTIFICATE-----)/g; + +const requestSystemCAsInjectable = getInjectable({ + id: "request-system-cas", + instantiate: (di) => { + const execFile = di.inject(execFileInjectable); + const logger = di.inject(loggerInjectable); + + const execSecurity = async (...args: string[]) => { + const output = await execFile("/usr/bin/security", args); + + return output.split(certSplitPattern); + }; + + return async () => { + try { + const [trusted, rootCA] = await Promise.all([ + execSecurity("find-certificate", "-a", "-p"), + execSecurity("find-certificate", "-a", "-p", "/System/Library/Keychains/SystemRootCertificates.keychain"), + ]); + + return [...new Set([...trusted, ...rootCA])]; + } catch (error) { + logger.warn(`[INJECT-CAS]: Error injecting root CAs from MacOSX: ${error}`); + } + + return []; + }; + }, + causesSideEffects: true, + injectionToken: requestSystemCAsInjectionToken, +}); + +export default requestSystemCAsInjectable; diff --git a/src/common/certificate-authorities/request-system-cas.injectable.linux.ts b/src/common/certificate-authorities/request-system-cas.injectable.linux.ts new file mode 100644 index 0000000000..1d7bf10350 --- /dev/null +++ b/src/common/certificate-authorities/request-system-cas.injectable.linux.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 { requestSystemCAsInjectionToken } from "./request-system-cas-token"; + +const requestSystemCAsInjectable = getInjectable({ + id: "request-system-cas", + instantiate: () => async () => [], + injectionToken: requestSystemCAsInjectionToken, +}); + +export default requestSystemCAsInjectable; diff --git a/src/common/certificate-authorities/request-system-cas.injectable.testing-env.ts b/src/common/certificate-authorities/request-system-cas.injectable.testing-env.ts new file mode 100644 index 0000000000..1d7bf10350 --- /dev/null +++ b/src/common/certificate-authorities/request-system-cas.injectable.testing-env.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 { requestSystemCAsInjectionToken } from "./request-system-cas-token"; + +const requestSystemCAsInjectable = getInjectable({ + id: "request-system-cas", + instantiate: () => async () => [], + injectionToken: requestSystemCAsInjectionToken, +}); + +export default requestSystemCAsInjectable; diff --git a/src/common/certificate-authorities/request-system-cas.injectable.win32.ts b/src/common/certificate-authorities/request-system-cas.injectable.win32.ts new file mode 100644 index 0000000000..af9366970d --- /dev/null +++ b/src/common/certificate-authorities/request-system-cas.injectable.win32.ts @@ -0,0 +1,45 @@ +/** + * 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 execFileInjectable from "../fs/exec-file.injectable"; +import { requestSystemCAsInjectionToken } from "./request-system-cas-token"; + +const pemEncoding = (hexEncodedCert: String) => { + const certData = Buffer.from(hexEncodedCert, "hex").toString("base64"); + const lines = ["-----BEGIN CERTIFICATE-----"]; + + for (let i = 0; i < certData.length; i += 64) { + lines.push(certData.substring(i, i + 64)); + } + + lines.push("-----END CERTIFICATE-----", ""); + + return lines.join("\r\n"); +}; + +const requestSystemCAsInjectable = getInjectable({ + id: "request-system-cas", + instantiate: (di) => { + const wincaRootsExePath: string = __non_webpack_require__.resolve("win-ca/lib/roots.exe"); + const execFile = di.inject(execFileInjectable); + + return async () => { + /** + * This needs to be done manually because for some reason calling the api from "win-ca" + * directly fails to load "child_process" correctly on renderer + */ + const output = await execFile(wincaRootsExePath); + + return output + .split("\r\n") + .filter(Boolean) + .map(pemEncoding); + }; + }, + causesSideEffects: true, + injectionToken: requestSystemCAsInjectionToken, +}); + +export default requestSystemCAsInjectable; diff --git a/src/common/fs/exec-file.injectable.ts b/src/common/fs/exec-file.injectable.ts index 15d0ad48dc..244f05d0a1 100644 --- a/src/common/fs/exec-file.injectable.ts +++ b/src/common/fs/exec-file.injectable.ts @@ -7,7 +7,11 @@ import type { ExecFileOptions } from "child_process"; import { execFile } from "child_process"; import { promisify } from "util"; -export type ExecFile = (filePath: string, args: string[], options: ExecFileOptions) => Promise; +export interface ExecFile { + (filePath: string): Promise; + (filePath: string, argsOrOptions: string[] | ExecFileOptions): Promise; + (filePath: string, args: string[], options: ExecFileOptions): Promise; +} const execFileInjectable = getInjectable({ id: "exec-file", @@ -15,8 +19,22 @@ const execFileInjectable = getInjectable({ instantiate: (): ExecFile => { const asyncExecFile = promisify(execFile); - return async (filePath, args, options) => { - const result = await asyncExecFile(filePath, args, options); + return async (filePath: string, argsOrOptions?: string[] | ExecFileOptions, maybeOptions?: ExecFileOptions) => { + let args: string[]; + let options: ExecFileOptions; + + if (Array.isArray(argsOrOptions)) { + args = argsOrOptions; + options = maybeOptions ?? {}; + } else { + args = []; + options = maybeOptions ?? argsOrOptions ?? {}; + } + + const result = await asyncExecFile(filePath, args, { + encoding: "utf-8", + ...options, + }); return result.stdout; }; diff --git a/src/common/system-ca.ts b/src/common/system-ca.ts deleted file mode 100644 index 4e57ca2d7b..0000000000 --- a/src/common/system-ca.ts +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (c) OpenLens Authors. All rights reserved. - * Licensed under MIT License. See LICENSE in root directory for more information. - */ - -import { isMac, isWindows } from "./vars"; -import wincaAPI from "win-ca/api"; -import https from "https"; -import { promiseExecFile } from "./utils/promise-exec"; - -// DST Root CA X3, which was expired on 9.30.2021 -export const DSTRootCAX3 = "-----BEGIN CERTIFICATE-----\nMIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/\nMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\nDkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow\nPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD\nEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\nAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O\nrz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq\nOLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b\nxiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw\n7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD\naeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV\nHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG\nSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69\nikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr\nAvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz\nR8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5\nJDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo\nOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ\n-----END CERTIFICATE-----\n"; - -export function isCertActive(cert: string) { - const isExpired = typeof cert !== "string" || cert.includes(DSTRootCAX3); - - return !isExpired; -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Cheatsheet#other_assertions -const certSplitPattern = /(?=-----BEGIN\sCERTIFICATE-----)/g; - -async function execSecurity(...args: string[]): Promise { - const { stdout } = await promiseExecFile("/usr/bin/security", args); - - return stdout.split(certSplitPattern); -} - -/** - * Get root CA certificate from MacOSX system keychain - * Only return non-expred certificates. - */ -export async function getMacRootCA() { - // inspired mac-ca https://github.com/jfromaniello/mac-ca - const [trusted, rootCA] = await Promise.all([ - execSecurity("find-certificate", "-a", "-p"), - execSecurity("find-certificate", "-a", "-p", "/System/Library/Keychains/SystemRootCertificates.keychain"), - ]); - - return [...new Set([...trusted, ...rootCA])].filter(isCertActive); -} - -/** - * Get root CA certificate from Windows system certificate store. - * Only return non-expred certificates. - */ -export function getWinRootCA(): Promise { - return new Promise((resolve) => { - const CAs: string[] = []; - - wincaAPI({ - format: wincaAPI.der2.pem, - inject: false, - ondata: (ca: string) => { - CAs.push(ca); - }, - onend: () => { - resolve(CAs.filter(isCertActive)); - }, - }); - }); -} - - -/** - * Add (or merge) CAs to https.globalAgent.options.ca - */ -export function injectCAs(CAs: string[]) { - for (const cert of CAs) { - if (Array.isArray(https.globalAgent.options.ca) && !https.globalAgent.options.ca.includes(cert)) { - https.globalAgent.options.ca.push(cert); - } else { - https.globalAgent.options.ca = [cert]; - } - } -} - -/** - * Inject CAs found in OS's (Windoes/MacOSX only) root certificate store to https.globalAgent.options.ca - */ -export async function injectSystemCAs() { - if (isMac) { - try { - const osxRootCAs = await getMacRootCA(); - - injectCAs(osxRootCAs); - } catch (error) { - console.warn(`[MAC-CA]: Error injecting root CAs from MacOSX. ${error}`); - } - } - - if (isWindows) { - try { - const winRootCAs = await getWinRootCA(); - - wincaAPI.inject("+", winRootCAs); - - } catch (error) { - console.warn(`[WIN-CA]: Error injecting root CAs from Windows. ${error}`); - } - } -} diff --git a/src/common/utils/__tests__/paths.test.ts b/src/common/utils/__tests__/paths.test.ts index f5e8a7ccf5..dc9425eb99 100644 --- a/src/common/utils/__tests__/paths.test.ts +++ b/src/common/utils/__tests__/paths.test.ts @@ -3,12 +3,11 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { describeIf } from "../../../../integration/helpers/utils"; -import { isWindows } from "../../vars"; +import { describeIf } from "../../../test-utils/skippers"; import { isLogicalChildPath } from "../paths"; describe("isLogicalChildPath", () => { - describeIf(isWindows)("windows tests", () => { + describeIf(process.platform === "win32")("windows tests", () => { it.each([ { parentPath: "C:\\Foo", @@ -40,7 +39,7 @@ describe("isLogicalChildPath", () => { }); }); - describeIf(!isWindows)("posix tests", () => { + describeIf(process.platform !== "win32")("posix tests", () => { it.each([ { parentPath: "/foo", diff --git a/src/jest.setup.ts b/src/jest.setup.ts index eb1e801f72..c45303e19c 100644 --- a/src/jest.setup.ts +++ b/src/jest.setup.ts @@ -58,7 +58,7 @@ const getInjectables = (environment: "renderer" | "main", filePathGlob: string) }), ].map(x => path.resolve(__dirname, x)); -(global as any).rendererInjectablePaths = getInjectables("renderer", "*.injectable.{ts,tsx}"); +(global as any).rendererInjectablePaths = getInjectables("renderer", "*.{injectable,injectable.testing-env}.{ts,tsx}"); (global as any).rendererGlobalOverridePaths = getInjectables("renderer", "*.global-override-for-injectable.{ts,tsx}"); -(global as any).mainInjectablePaths = getInjectables("main", "*.injectable.{ts,tsx}"); +(global as any).mainInjectablePaths = getInjectables("main", "*.{injectable,injectable.testing-env}.{ts,tsx}"); (global as any).mainGlobalOverridePaths = getInjectables("main", "*.global-override-for-injectable.{ts,tsx}"); diff --git a/src/main/getDi.ts b/src/main/getDi.ts index 17d9cc36b7..8b71cca39b 100644 --- a/src/main/getDi.ts +++ b/src/main/getDi.ts @@ -19,10 +19,10 @@ export const getDi = () => { autoRegister({ di, requireContexts: [ - require.context("./", true, /\.injectable\.(ts|tsx)$/), - require.context("../extensions", true, /\.injectable\.(ts|tsx)$/), - require.context("../common", true, /\.injectable\.(ts|tsx)$/), - require.context("../features", true, /.*\/(main|common)\/.*\.injectable\.(ts|tsx)$/), + require.context("./", true, CONTEXT_MATCHER_FOR_NON_FEATURES), + require.context("../extensions", true, CONTEXT_MATCHER_FOR_NON_FEATURES), + require.context("../common", true, CONTEXT_MATCHER_FOR_NON_FEATURES), + require.context("../features", true, CONTEXT_MATCHER_FOR_FEATURES), ], }); }); diff --git a/src/main/start-main-application/runnables/setup-system-ca.injectable.ts b/src/main/start-main-application/runnables/setup-system-ca.injectable.ts index 94589fca7d..b5219dbf4f 100644 --- a/src/main/start-main-application/runnables/setup-system-ca.injectable.ts +++ b/src/main/start-main-application/runnables/setup-system-ca.injectable.ts @@ -2,22 +2,16 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { injectSystemCAs } from "../../../common/system-ca"; import { getInjectable } from "@ogre-tools/injectable"; import { beforeApplicationIsLoadingInjectionToken } from "../runnable-tokens/before-application-is-loading-injection-token"; +import injectSystemCAsInjectable from "../../../common/certificate-authorities/inject-system-cas.injectable"; const setupSystemCaInjectable = getInjectable({ id: "setup-system-ca", - - instantiate: () => ({ + instantiate: (di) => ({ id: "setup-system-ca", - run: async () => { - await injectSystemCAs(); - }, + run: di.inject(injectSystemCAsInjectable), }), - - causesSideEffects: true, - injectionToken: beforeApplicationIsLoadingInjectionToken, }); diff --git a/src/renderer/frames/root-frame/setup-system-ca.injectable.ts b/src/renderer/frames/root-frame/setup-system-ca.injectable.ts index 3ee10748f9..cc8a0bafcc 100644 --- a/src/renderer/frames/root-frame/setup-system-ca.injectable.ts +++ b/src/renderer/frames/root-frame/setup-system-ca.injectable.ts @@ -2,22 +2,16 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { injectSystemCAs } from "../../../common/system-ca"; import { getInjectable } from "@ogre-tools/injectable"; import { beforeFrameStartsInjectionToken } from "../../before-frame-starts/before-frame-starts-injection-token"; +import injectSystemCAsInjectable from "../../../common/certificate-authorities/inject-system-cas.injectable"; const setupSystemCaInjectable = getInjectable({ id: "setup-system-ca", - - instantiate: () => ({ + instantiate: (di) => ({ id: "setup-system-ca", - run: async () => { - await injectSystemCAs(); - }, + run: di.inject(injectSystemCAsInjectable), }), - - causesSideEffects: true, - injectionToken: beforeFrameStartsInjectionToken, }); diff --git a/src/renderer/getDi.tsx b/src/renderer/getDi.tsx index 348c5e369b..28e111bc97 100644 --- a/src/renderer/getDi.tsx +++ b/src/renderer/getDi.tsx @@ -20,10 +20,10 @@ export const getDi = () => { autoRegister({ di, requireContexts: [ - require.context("./", true, /\.injectable\.(ts|tsx)$/), - require.context("../common", true, /\.injectable\.(ts|tsx)$/), - require.context("../extensions", true, /\.injectable\.(ts|tsx)$/), - require.context("../features", true, /.*\/(renderer|common)\/.*\.injectable\.(ts|tsx)$/), + require.context("./", true, CONTEXT_MATCHER_FOR_NON_FEATURES), + require.context("../common", true, CONTEXT_MATCHER_FOR_NON_FEATURES), + require.context("../extensions", true, CONTEXT_MATCHER_FOR_NON_FEATURES), + require.context("../features", true, CONTEXT_MATCHER_FOR_FEATURES), ], }); }); diff --git a/src/test-utils/skippers.ts b/src/test-utils/skippers.ts new file mode 100644 index 0000000000..bd8e094308 --- /dev/null +++ b/src/test-utils/skippers.ts @@ -0,0 +1,18 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +/** + * Conditionally run a test + */ +export function itIf(condition: boolean) { + return condition ? it : it.skip; +} + +/** + * Conditionally run a block of tests + */ +export function describeIf(condition: boolean) { + return condition ? describe : describe.skip; +} diff --git a/types/from-webpack.d.ts b/types/from-webpack.d.ts new file mode 100644 index 0000000000..c0b5439355 --- /dev/null +++ b/types/from-webpack.d.ts @@ -0,0 +1,8 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +// These variables will be replaced by webpack at compile time +declare const CONTEXT_MATCHER_FOR_NON_FEATURES: RegExp; +declare const CONTEXT_MATCHER_FOR_FEATURES: RegExp; diff --git a/types/mocks.d.ts b/types/mocks.d.ts index fd01e929d6..3826aac829 100644 --- a/types/mocks.d.ts +++ b/types/mocks.d.ts @@ -2,7 +2,6 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -declare module "mac-ca" declare module "win-ca" declare module "win-ca/api" diff --git a/webpack/main.ts b/webpack/main.ts index 397ffb2968..84efd63f22 100755 --- a/webpack/main.ts +++ b/webpack/main.ts @@ -11,7 +11,9 @@ import getTypeScriptLoader from "./get-typescript-loader"; import CircularDependencyPlugin from "circular-dependency-plugin"; import { iconsAndImagesWebpackRules } from "./renderer"; import type { WebpackPluginInstance } from "webpack"; +import { DefinePlugin } from "webpack"; import { buildDir, isDevelopment, mainDir } from "./vars"; +import { platform } from "process"; const configs: { (): webpack.Configuration }[] = []; @@ -53,6 +55,10 @@ configs.push((): webpack.Configuration => { ], }, plugins: [ + new DefinePlugin({ + CONTEXT_MATCHER_FOR_NON_FEATURES: `/\\.injectable(\\.${platform})?\\.tsx?$/`, + CONTEXT_MATCHER_FOR_FEATURES: `/\\/(main|common)\\/.+\\.injectable(\\.${platform})?\\.tsx?$/`, + }), new ForkTsCheckerPlugin(), new CircularDependencyPlugin({ cwd: __dirname, diff --git a/webpack/renderer.ts b/webpack/renderer.ts index c8c87e856f..6bad203ca7 100755 --- a/webpack/renderer.ts +++ b/webpack/renderer.ts @@ -12,8 +12,10 @@ import MonacoWebpackPlugin from "monaco-editor-webpack-plugin"; import CircularDependencyPlugin from "circular-dependency-plugin"; import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin"; import type { WebpackPluginInstance } from "webpack"; +import { DefinePlugin } from "webpack"; import getTypescriptLoader from "./get-typescript-loader"; import { assetsFolderName, isDevelopment, rendererDir, buildDir, appName, htmlTemplate, publicPath, sassCommonVars } from "./vars"; +import { platform } from "process"; export function webpackLensRenderer({ showVars = true } = {}): webpack.Configuration { if (showVars) { @@ -85,6 +87,10 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura }, plugins: [ + new DefinePlugin({ + CONTEXT_MATCHER_FOR_NON_FEATURES: `/\\.injectable(\\.${platform})?\\.tsx?$/`, + CONTEXT_MATCHER_FOR_FEATURES: `/\\/(renderer|common)\\/.+\\.injectable(\\.${platform})?\\.tsx?$/`, + }), new ForkTsCheckerPlugin(), // see also: https://github.com/Microsoft/monaco-editor-webpack-plugin#options diff --git a/yarn.lock b/yarn.lock index ba4964ea7f..e45f8f7312 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8765,13 +8765,6 @@ lz-string@^1.4.4: resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY= -mac-ca@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/mac-ca/-/mac-ca-1.0.6.tgz#89860edfeebcc4593567044281ab3500961ec15f" - integrity sha512-uuCaT+41YtIQlDDvbigP1evK1iUk97zRirP9+8rZJz8x0eIQZG8Z7YQegMTsCiMesLPb6LBgCS95uyAvVA1tmg== - dependencies: - node-forge "^0.10.0" - make-dir@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" @@ -9348,11 +9341,6 @@ node-fetch@2.6.7, node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" -node-forge@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3" - integrity sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA== - node-forge@^1, node-forge@^1.2.1: version "1.3.1" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" From 5263d9b5ec36bf03c3576775eff2e141bc18765b Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 3 Oct 2022 13:00:08 -0300 Subject: [PATCH 052/280] Bump typedoc-plugin-markdown to 3.13.6 to fix documentation creation (#6308) Signed-off-by: Sebastian Malton Signed-off-by: Sebastian Malton --- package.json | 2 +- yarn.lock | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 2b548b0280..e0c0d61863 100644 --- a/package.json +++ b/package.json @@ -427,7 +427,7 @@ "type-fest": "^2.14.0", "typed-emitter": "^1.4.0", "typedoc": "0.23.15", - "typedoc-plugin-markdown": "^3.13.1", + "typedoc-plugin-markdown": "^3.13.6", "typescript": "^4.8.3", "typescript-plugin-css-modules": "^3.4.0", "webpack": "^5.74.0", diff --git a/yarn.lock b/yarn.lock index e45f8f7312..e496ec0e2f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9599,7 +9599,6 @@ npm@^8.19.2: "@npmcli/fs" "^2.1.0" "@npmcli/map-workspaces" "^2.0.3" "@npmcli/package-json" "^2.0.0" - "@npmcli/promise-spawn" "^3.0.0" "@npmcli/run-script" "^4.2.1" abbrev "~1.1.1" archy "~1.0.0" @@ -9610,7 +9609,6 @@ npm@^8.19.2: cli-table3 "^0.6.2" columnify "^1.6.0" fastest-levenshtein "^1.0.12" - fs-minipass "^2.1.0" glob "^8.0.1" graceful-fs "^4.2.10" hosted-git-info "^5.1.0" @@ -9630,7 +9628,6 @@ npm@^8.19.2: libnpmteam "^4.0.4" libnpmversion "^3.0.7" make-fetch-happen "^10.2.0" - minimatch "^5.1.0" minipass "^3.1.6" minipass-pipeline "^1.2.4" mkdirp "^1.0.4" @@ -12568,10 +12565,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typedoc-plugin-markdown@^3.13.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.13.1.tgz#f4bca4bf8c5a48d8c7f1b44071e64028d223a1e0" - integrity sha512-Gx7pmvFNXAxbE9N2MuQNi5RwMVSH9lPxDBAaBNftaZ+ZzMO8YkDwir6aoXcWNq50qgG/eTs5CiKvLe33OVm2iQ== +typedoc-plugin-markdown@^3.13.6: + version "3.13.6" + resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.13.6.tgz#a419794e3bdbe459fb22772d8e6e02bac05211c1" + integrity sha512-ISSc9v3BK7HkokxSBuJPttXox4tJ6hP0N9wfSIk0fmLN67+eqtAxbk97gs2nDiuha+RTO5eW9gdeAb+RPP0mgg== dependencies: handlebars "^4.7.7" From 032e6d968c17abf37e5e8a44db296c6a83d41387 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 3 Oct 2022 13:36:28 -0300 Subject: [PATCH 053/280] Validate ClusterModel before trying to update or create a Cluster (#4515) * Validate ClusterModel before trying to update or create a Cluster Signed-off-by: Sebastian Malton * Fix tests Signed-off-by: Sebastian Malton Signed-off-by: Sebastian Malton --- src/common/cluster-types.ts | 33 +++++++++++++++++++++++++++++++++ src/common/cluster/cluster.ts | 19 ++++++++++++++++--- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/common/cluster-types.ts b/src/common/cluster-types.ts index f0862e07b8..faf6debbab 100644 --- a/src/common/cluster-types.ts +++ b/src/common/cluster-types.ts @@ -3,6 +3,8 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ +import Joi from "joi"; + /** * JSON serializable metadata type */ @@ -27,6 +29,37 @@ export type ClusterId = string; */ export type UpdateClusterModel = Omit; +/** + * A type validator for `UpdateClusterModel` so that only expected types are present + */ +export const updateClusterModelChecker = Joi.object({ + kubeConfigPath: Joi.string() + .required() + .min(1), + contextName: Joi.string() + .required() + .min(1), + workspace: Joi.string() + .optional(), + workspaces: Joi.array() + .items(Joi.string()), + preferences: Joi.object(), + metadata: Joi.object(), + accessibleNamespaces: Joi.array() + .items(Joi.string()), + labels: Joi.object().pattern(Joi.string(), Joi.string()), +}); + +/** + * A type validator for just the `id` fields of `ClusterModel`. The rest is + * covered by `updateClusterModelChecker` + */ +export const clusterModelIdChecker = Joi.object>({ + id: Joi.string() + .required() + .min(1), +}); + /** * The model for passing cluster data around, including to disk */ diff --git a/src/common/cluster/cluster.ts b/src/common/cluster/cluster.ts index f1a943732c..9b0eed76aa 100644 --- a/src/common/cluster/cluster.ts +++ b/src/common/cluster/cluster.ts @@ -16,7 +16,7 @@ import type { VersionDetector } from "../../main/cluster-detectors/version-detec import type { DetectorRegistry } from "../../main/cluster-detectors/detector-registry"; import plimit from "p-limit"; import type { ClusterState, ClusterRefreshOptions, ClusterMetricsResourceType, ClusterId, ClusterMetadata, ClusterModel, ClusterPreferences, ClusterPrometheusPreferences, UpdateClusterModel, KubeAuthUpdate, ClusterConfigData } from "../cluster-types"; -import { ClusterMetadataKey, initialNodeShellImage, ClusterStatus } from "../cluster-types"; +import { ClusterMetadataKey, initialNodeShellImage, ClusterStatus, clusterModelIdChecker, updateClusterModelChecker } from "../cluster-types"; import { disposer, isDefined, isRequestError, toJS } from "../utils"; import type { Response } from "request"; import { clusterListNamespaceForbiddenChannel } from "../ipc/cluster"; @@ -237,9 +237,16 @@ export class Cluster implements ClusterModel, ClusterState { return this.preferences.defaultNamespace; } - constructor(private readonly dependencies: ClusterDependencies, model: ClusterModel, configData: ClusterConfigData) { + constructor(private readonly dependencies: ClusterDependencies, { id, ...model }: ClusterModel, configData: ClusterConfigData) { makeObservable(this); - this.id = model.id; + + const { error } = clusterModelIdChecker.validate({ id }); + + if (error) { + throw error; + } + + this.id = id; this.updateModel(model); this.apiUrl = configData.clusterServerUrl; @@ -261,6 +268,12 @@ export class Cluster implements ClusterModel, ClusterState { @action updateModel(model: UpdateClusterModel) { // Note: do not assign ID as that should never be updated + const { error } = updateClusterModelChecker.validate(model, { allowUnknown: true }); + + if (error) { + throw error; + } + this.kubeConfigPath = model.kubeConfigPath; this.contextName = model.contextName; From 0fe3242030f90c3bb8566e22bb3751dcf77fbcb1 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Tue, 4 Oct 2022 14:17:21 +0300 Subject: [PATCH 054/280] Refactoring dock tab download logs tests (#6149) * Separate 'download visible' and 'download all' tests Signed-off-by: Alex Andreev * Add disabled prop to DownloadLogsDropdown Signed-off-by: Alex Andreev * Test for dropdown if no logs available in the tab Signed-off-by: Alex Andreev * Fix linter Signed-off-by: Alex Andreev * Remove unused code statement Signed-off-by: Alex Andreev * Update snapshots Signed-off-by: Alex Andreev Signed-off-by: Alex Andreev --- .../__snapshots__/download-logs.test.tsx.snap | 892 +++++++++++++++++- src/features/pod-logs/download-logs.test.tsx | 284 +++--- .../components/dock/logs/controls.tsx | 1 + .../dock/logs/download-all-logs.injectable.ts | 6 +- .../dock/logs/download-logs-dropdown.tsx | 5 +- 5 files changed, 1016 insertions(+), 172 deletions(-) diff --git a/src/features/pod-logs/__snapshots__/download-logs.test.tsx.snap b/src/features/pod-logs/__snapshots__/download-logs.test.tsx.snap index 7fda6db615..91c58b443b 100644 --- a/src/features/pod-logs/__snapshots__/download-logs.test.tsx.snap +++ b/src/features/pod-logs/__snapshots__/download-logs.test.tsx.snap @@ -1,6 +1,856 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`download logs options in pod logs dock tab when opening pod logs renders 1`] = ` +exports[`download logs options in logs dock tab opening pod logs when logs available renders 1`] = ` + +

+
+
+