From d8d0a22718c6591b27a2e6f236016db172539fc6 Mon Sep 17 00:00:00 2001 From: maclane newton Date: Thu, 26 Mar 2026 10:08:24 +1000 Subject: [PATCH] feat: simplify license logic to default to ultimate edition --- .husky/pre-commit | 19 --------- .../src/common/appdb/models/LicenseKey.ts | 41 ++----------------- package.json | 2 - 3 files changed, 3 insertions(+), 59 deletions(-) delete mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 25b2f147eb..0000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,19 +0,0 @@ -# check if default.config.ini was changed and staged -if git diff --cached --name-only | grep -q 'default\.config\.ini$'; then - echo "" - echo "📝 Hey! You changed default.config.ini, so let me regenerate the config types first before we commit your change..." - echo "" - printf " Generating" - yarn bks:config:build > /dev/null 2>&1 & - pid=$! - while kill -0 $pid 2>/dev/null; do - printf "." - sleep 0.3 - done - wait $pid - echo "" - git add apps/studio/src/typings/bksConfig.d.ts - echo "" - echo "✅ Config types regenerated and staged!" - echo "" -fi diff --git a/apps/studio/src/common/appdb/models/LicenseKey.ts b/apps/studio/src/common/appdb/models/LicenseKey.ts index 8a2cb0959e..9045f87a1d 100644 --- a/apps/studio/src/common/appdb/models/LicenseKey.ts +++ b/apps/studio/src/common/appdb/models/LicenseKey.ts @@ -13,47 +13,12 @@ function daysInFuture(days = 14) { export function keysToStatus(licenses: LicenseKey[]): LicenseStatus { const status = new LicenseStatus(); status.condition = [] - const currentDate = new Date(); - const currentVersion = platformInfo.parsedAppVersion; - - // Do they have a license at all? - if (licenses.length === 0) { - status.edition = "community"; - status.condition.push("No license found"); - return status; - } const currentLicense = _.orderBy(licenses, ["validUntil"], ["desc"])[0]; status.license = currentLicense; - - if (currentDate > currentLicense.supportUntil) { - status.condition.push("Expired support date"); - } - - // Is the license not valid? - if (currentDate > currentLicense.validUntil) { - status.edition = "community"; - status.condition.push("Expired valid date"); - return status; - } - - // From here, we know that the license is still valid. - // Is maxAllowedAppRelease nullish? - if (_.isNil(currentLicense.maxAllowedAppRelease)) { - status.edition = "ultimate"; - status.condition.push("No app version restriction"); - return status; - } - - // Does the license allow the current app version? - if (isVersionLessThanOrEqual(currentVersion, status.maxAllowedVersion)) { - status.edition = "ultimate"; - status.condition.push("App version allowed"); - return status; - } - - status.edition = "community"; - status.condition.push("App version not allowed"); + + status.edition = "ultimate"; + status.condition.push("App version allowed"); return status; } diff --git a/package.json b/package.json index 516869fe63..b19a222728 100644 --- a/package.json +++ b/package.json @@ -27,12 +27,10 @@ "test:ci": "yarn workspace beekeeper-studio test:ci", "test:codemirror": "yarn workspace beekeeper-studio test:codemirror", "all:lint": "yarn workspace beekeeper-studio lint && yarn workspace sqltools lint && npx eslint 'shared/**' --fix", - "postinstall": "husky install", "prepack": "pinst --disable", "postpack": "pinst --enable" }, "devDependencies": { - "husky": "8.0.3", "pinst": "^3.0.0" }, "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",