From d116f911286cd50d79ed7b35ce19079ce16a5fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grabarz?= Date: Wed, 30 Oct 2024 12:28:16 +0100 Subject: [PATCH 1/3] Add IDE version to window title. --- app/common/src/appConfig.js | 2 +- app/gui/index.html | 2 +- app/gui/vite.config.ts | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/common/src/appConfig.js b/app/common/src/appConfig.js index 8ad2ea51f0e3..eb0e51c4e4c0 100644 --- a/app/common/src/appConfig.js +++ b/app/common/src/appConfig.js @@ -44,7 +44,7 @@ export async function readEnvironmentFromFile() { if (!isProduction || entries.length > 0) { Object.assign(process.env, variables) } - process.env.ENSO_CLOUD_DASHBOARD_VERSION ??= buildInfo.version + process.env.ENSO_CLOUD_DASHBOARD_VERSION ??= buildInfo.version ?? '0.0.1-dev' process.env.ENSO_CLOUD_DASHBOARD_COMMIT_HASH ??= buildInfo.commit } catch (error) { process.env.ENSO_CLOUD_DASHBOARD_VERSION ??= buildInfo.version diff --git a/app/gui/index.html b/app/gui/index.html index 055ad35bde19..7c05be49a9e5 100644 --- a/app/gui/index.html +++ b/app/gui/index.html @@ -37,7 +37,7 @@ maximum-scale = 1.0, user-scalable = no" /> - Enso Analytics + Enso %ENSO_IDE_VERSION%
diff --git a/app/gui/vite.config.ts b/app/gui/vite.config.ts index d28babae7067..e85808cce522 100644 --- a/app/gui/vite.config.ts +++ b/app/gui/vite.config.ts @@ -26,6 +26,10 @@ await readEnvironmentFromFile() const entrypoint = process.env.E2E === 'true' ? './src/project-view/e2e-entrypoint.ts' : './src/entrypoint.ts' +// NOTE(Frizi): This rename is for the sake of forward compatibility with not yet merged config refactor on bazel branch, +// and because Vite's HTML env replacements only work with import.meta.env variables, not defines. +process.env.ENSO_IDE_VERSION = process.env.ENSO_CLOUD_DASHBOARD_VERSION + // https://vitejs.dev/config/ export default defineConfig({ root: fileURLToPath(new URL('.', import.meta.url)), @@ -65,6 +69,7 @@ export default defineConfig({ '#': fileURLToPath(new URL('./src/dashboard', import.meta.url)), }, }, + envPrefix: 'ENSO_IDE_', define: { ...getDefines(), IS_CLOUD_BUILD: JSON.stringify(IS_CLOUD_BUILD), From 6054933874e5752da01006da813fcb1a2012d510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grabarz?= Date: Wed, 30 Oct 2024 12:36:43 +0100 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97754e3e8796..fe1c3cd6d028 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - [New dropdown-based component menu][11398]. - [Size of Table Input Widget is preserved and restored after project re-opening][11435] +- [Added application version to the title bar.][11446] [11151]: https://github.com/enso-org/enso/pull/11151 [11271]: https://github.com/enso-org/enso/pull/11271 @@ -23,6 +24,7 @@ [11388]: https://github.com/enso-org/enso/pull/11388 [11398]: https://github.com/enso-org/enso/pull/11398 [11435]: https://github.com/enso-org/enso/pull/11435 +[11446]: https://github.com/enso-org/enso/pull/11446 #### Enso Standard Library From df4f6cf4f0caa0dd26c51730d0402bb0c3acb55a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grabarz?= Date: Wed, 30 Oct 2024 13:36:50 +0100 Subject: [PATCH 3/3] fix version fallback --- app/common/src/appConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/src/appConfig.js b/app/common/src/appConfig.js index eb0e51c4e4c0..5dc227bad45b 100644 --- a/app/common/src/appConfig.js +++ b/app/common/src/appConfig.js @@ -44,7 +44,7 @@ export async function readEnvironmentFromFile() { if (!isProduction || entries.length > 0) { Object.assign(process.env, variables) } - process.env.ENSO_CLOUD_DASHBOARD_VERSION ??= buildInfo.version ?? '0.0.1-dev' + process.env.ENSO_CLOUD_DASHBOARD_VERSION ??= buildInfo.version ?? '0.0.0-dev' process.env.ENSO_CLOUD_DASHBOARD_COMMIT_HASH ??= buildInfo.commit } catch (error) { process.env.ENSO_CLOUD_DASHBOARD_VERSION ??= buildInfo.version