From f3be917da115069c27cad05f2f54b04abfc53a7e Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 25 Apr 2023 12:16:02 +0100 Subject: [PATCH 1/3] Enrich the upgradable version property when fetching the app package --- packages/builder/src/builderStore/store/frontend.js | 1 + .../builder/src/components/deploy/VersionModal.svelte | 9 ++++----- .../builder/portal/overview/[appId]/overview.svelte | 7 +++---- .../pages/builder/portal/overview/[appId]/version.svelte | 5 ++--- packages/server/src/api/controllers/application.ts | 2 +- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 3fc0eb769e..e264dc099b 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -134,6 +134,7 @@ export const getFrontendStore = () => { previousTopNavPath: {}, version: application.version, revertableVersion: application.revertableVersion, + upgradableVersion: application.upgradableVersion, navigation: application.navigation || {}, usedPlugins: application.usedPlugins || [], })) diff --git a/packages/builder/src/components/deploy/VersionModal.svelte b/packages/builder/src/components/deploy/VersionModal.svelte index f357cc7820..75acc974ce 100644 --- a/packages/builder/src/components/deploy/VersionModal.svelte +++ b/packages/builder/src/components/deploy/VersionModal.svelte @@ -9,7 +9,6 @@ } from "@budibase/bbui" import { store } from "builderStore" import { API } from "api" - import clientPackage from "@budibase/client/package.json" export function show() { updateModal.show() @@ -25,9 +24,9 @@ $: appId = $store.appId $: updateAvailable = - clientPackage.version && + $store.upgradableVersion && $store.version && - clientPackage.version !== $store.version + $store.upgradableVersion !== $store.version $: revertAvailable = $store.revertableVersion != null const refreshAppPackage = async () => { @@ -46,7 +45,7 @@ // Don't wait for the async refresh, since this causes modal flashing refreshAppPackage() notifications.success( - `App updated successfully to version ${clientPackage.version}` + `App updated successfully to version ${$store.upgradableVersion}` ) } catch (err) { notifications.error(`Error updating app: ${err}`) @@ -91,7 +90,7 @@ {#if updateAvailable} This app is currently using version {$store.version}, but version - {clientPackage.version} is available. Updates can contain new features, + {$store.upgradableVersion} is available. Updates can contain new features, performance improvements and bug fixes. {:else} diff --git a/packages/builder/src/pages/builder/portal/overview/[appId]/overview.svelte b/packages/builder/src/pages/builder/portal/overview/[appId]/overview.svelte index 2d2b6775fb..c049a610b6 100644 --- a/packages/builder/src/pages/builder/portal/overview/[appId]/overview.svelte +++ b/packages/builder/src/pages/builder/portal/overview/[appId]/overview.svelte @@ -13,7 +13,6 @@ notifications, } from "@budibase/bbui" import { store } from "builderStore" - import clientPackage from "@budibase/client/package.json" import { processStringSync } from "@budibase/string-templates" import { users, auth, apps, groups, overview } from "stores/portal" import { fetchData } from "@budibase/frontend-core" @@ -40,7 +39,7 @@ }, }, }) - $: updateAvailable = clientPackage.version !== $store.version + $: updateAvailable = $store.upgradableVersion !== $store.version $: isPublished = app?.status === AppStatus.DEPLOYED $: appEditorId = !app?.updatedBy ? $auth.user._id : app?.updatedBy $: appEditorText = appEditor?.firstName || appEditor?.email @@ -172,8 +171,8 @@ {$store.version} {#if updateAvailable}
- New version {clientPackage.version} is available - - + New version {$store.upgradableVersion} is + available - { $goto("./version") diff --git a/packages/builder/src/pages/builder/portal/overview/[appId]/version.svelte b/packages/builder/src/pages/builder/portal/overview/[appId]/version.svelte index 676d0b4f59..723e32984d 100644 --- a/packages/builder/src/pages/builder/portal/overview/[appId]/version.svelte +++ b/packages/builder/src/pages/builder/portal/overview/[appId]/version.svelte @@ -1,12 +1,11 @@ @@ -18,7 +17,7 @@ {#if updateAvailable} The app is currently using version {$store.version} - but version {clientPackage.version} is available. + but version {$store.upgradableVersion} is available.
Updates can contain new features, performance improvements and bug fixes. diff --git a/packages/server/src/api/controllers/application.ts b/packages/server/src/api/controllers/application.ts index ec68ca4c72..77a4e7c7f1 100644 --- a/packages/server/src/api/controllers/application.ts +++ b/packages/server/src/api/controllers/application.ts @@ -223,7 +223,7 @@ export async function fetchAppPackage(ctx: UserCtx) { ) ctx.body = { - application, + application : {...application, upgradableVersion : envCore.VERSION}, screens, layouts, clientLibPath, From 72c72fc48ae49a1558b130177fc78541393f94d8 Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 25 Apr 2023 12:31:52 +0100 Subject: [PATCH 2/3] Lint fix --- packages/server/src/api/controllers/application.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/application.ts b/packages/server/src/api/controllers/application.ts index 77a4e7c7f1..ff0dbe015b 100644 --- a/packages/server/src/api/controllers/application.ts +++ b/packages/server/src/api/controllers/application.ts @@ -223,7 +223,7 @@ export async function fetchAppPackage(ctx: UserCtx) { ) ctx.body = { - application : {...application, upgradableVersion : envCore.VERSION}, + application: { ...application, upgradableVersion: envCore.VERSION }, screens, layouts, clientLibPath, From 13134e0bb04a9c67935d5a47b2a77fbf6bf0aceb Mon Sep 17 00:00:00 2001 From: Dean Date: Wed, 26 Apr 2023 14:22:23 +0100 Subject: [PATCH 3/3] Removed client package from builder dependencies --- packages/builder/package.json | 1 - yarn.lock | 58 +++++++++++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 7 deletions(-) diff --git a/packages/builder/package.json b/packages/builder/package.json index 0bf4940d94..736eba5473 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -59,7 +59,6 @@ }, "dependencies": { "@budibase/bbui": "2.5.6-alpha.27", - "@budibase/client": "2.5.6-alpha.27", "@budibase/frontend-core": "2.5.6-alpha.27", "@budibase/shared-core": "2.5.6-alpha.27", "@budibase/string-templates": "2.5.6-alpha.27", diff --git a/yarn.lock b/yarn.lock index 0d89d2cadf..8a77fcafc6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1386,6 +1386,45 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@budibase/backend-core@2.5.6-alpha.26": + version "2.5.6-alpha.26" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.5.6-alpha.26.tgz#72029afe5a85402fa996e92b84ad56cb8c6bde45" + integrity sha512-ktP2SWwLjaDzJYLnadU1BcZlrfQkvhRb3T+v1SEciTBWi0vF7MUa7k5OW0EKwECpGA3VA576sbI7FgGu7m7Sxw== + dependencies: + "@budibase/nano" "10.1.2" + "@budibase/pouchdb-replication-stream" "1.2.10" + "@budibase/types" "2.5.6-alpha.26" + "@shopify/jest-koa-mocks" "5.0.1" + "@techpass/passport-openidconnect" "0.3.2" + aws-cloudfront-sign "2.2.0" + aws-sdk "2.1030.0" + bcrypt "5.0.1" + bcryptjs "2.4.3" + bull "4.10.1" + correlation-id "4.0.0" + dotenv "16.0.1" + emitter-listener "1.1.2" + ioredis "4.28.0" + joi "17.6.0" + jsonwebtoken "9.0.0" + koa-passport "4.1.4" + koa-pino-logger "4.0.0" + lodash "4.17.21" + lodash.isarguments "3.1.0" + node-fetch "2.6.7" + passport-google-oauth "2.0.0" + passport-jwt "4.0.0" + passport-local "1.0.0" + passport-oauth2-refresh "^2.1.0" + posthog-node "1.3.0" + pouchdb "7.3.0" + pouchdb-find "7.2.2" + redlock "4.2.0" + sanitize-s3-objectkey "0.0.1" + semver "7.3.7" + tar-fs "2.1.1" + uuid "8.3.2" + "@budibase/bbui@^0.9.139": version "0.9.190" resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-0.9.190.tgz#e1ec400ac90f556bfbc80fc23a04506f1585ea81" @@ -1486,15 +1525,15 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@2.5.6-alpha.25": - version "2.5.6-alpha.25" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.5.6-alpha.25.tgz#bfe99536060422adb60da2f195acb05b24898c98" - integrity sha512-LEQec9N9gS+j5gt/eKwGzci5oKW1sRTIG8oUvH7faCoJjD7BWIhmNuQNFrNfg70C/zkxYy4CL/2s1P9oVR1B3g== +"@budibase/pro@2.5.6-alpha.26": + version "2.5.6-alpha.26" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.5.6-alpha.26.tgz#979f0de77db78ad4596e6295083047b71f7c7bcc" + integrity sha512-d0ZsggojThcg1m81UEPUHp7fuPaSVwG+HYXh3ElEXmeH7HJNOJrbD2K0U7zkaWzufLK9ay1H6qcaZ9ZHVg/z/Q== dependencies: - "@budibase/backend-core" "2.5.6-alpha.25" + "@budibase/backend-core" "2.5.6-alpha.26" "@budibase/shared-core" "2.4.44-alpha.1" "@budibase/string-templates" "2.4.44-alpha.1" - "@budibase/types" "2.5.6-alpha.25" + "@budibase/types" "2.5.6-alpha.26" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1547,6 +1586,13 @@ resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.44-alpha.1.tgz#1679657aa180d9c59afa1dffa611bff0638bd933" integrity sha512-Sq+8HfM75EBMoOvKYFwELdlxmVN6wNZMofDjT/2G+9aF+Zfe5Tzw69C+unmdBgcGGjGCHEYWSz4mF0v8FPAGbg== +"@budibase/types@2.5.6-alpha.26": + version "2.5.6-alpha.26" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.5.6-alpha.26.tgz#09ac8f1e4f4dfd5e7e109839cd9db36d5c563dc4" + integrity sha512-C1eHWj4tRwsQb2dJbMdukxRFVqiyzRBhwIMuCSIdJg763sbn9TXTqWTBbljyG7ppH+Dwge+py9KtiFP2MpMCfQ== + dependencies: + scim-patch "^0.7.0" + "@bull-board/api@3.7.0": version "3.7.0" resolved "https://registry.yarnpkg.com/@bull-board/api/-/api-3.7.0.tgz#231f687187c0cb34e0b97f463917b6aaeb4ef6af"