From d29e82f59968c8c78f4fab50f730aa854a66756e Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Thu, 21 Aug 2025 01:35:17 +0530 Subject: [PATCH] fix(web): update NPM version fetching logic --- apps/cli/src/utils/config-validation.ts | 2 +- apps/web/src/app/(home)/_components/npm-package.tsx | 4 ++-- apps/web/src/lib/constant.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/cli/src/utils/config-validation.ts b/apps/cli/src/utils/config-validation.ts index cb3f0ea..7440fce 100644 --- a/apps/cli/src/utils/config-validation.ts +++ b/apps/cli/src/utils/config-validation.ts @@ -11,12 +11,12 @@ import { incompatibleFlagsForBackend, isWebFrontend, validateAddonsAgainstFrontends, + validateAlchemyCompatibility, validateApiFrontendCompatibility, validateExamplesCompatibility, validateServerDeployRequiresBackend, validateWebDeployRequiresWebFrontend, validateWorkersCompatibility, - validateAlchemyCompatibility, } from "./compatibility-rules"; import { exitWithError } from "./errors"; diff --git a/apps/web/src/app/(home)/_components/npm-package.tsx b/apps/web/src/app/(home)/_components/npm-package.tsx index 4ac893e..246361e 100644 --- a/apps/web/src/app/(home)/_components/npm-package.tsx +++ b/apps/web/src/app/(home)/_components/npm-package.tsx @@ -13,11 +13,11 @@ const NpmPackage = () => { ); if (!res.ok) throw new Error("Failed to fetch version"); const data = await res.json(); - const latestVersion = data[0].tag_name.split("@")[1]; + const latestVersion = data[0].tag_name.replace(/^v/, ""); setVersion(latestVersion); } catch (error) { console.error("Error fetching NPM version:", error); - setVersion("?.?.?"); + setVersion("latest"); } }; getLatestVersion(); diff --git a/apps/web/src/lib/constant.ts b/apps/web/src/lib/constant.ts index 03fa34f..be787ab 100644 --- a/apps/web/src/lib/constant.ts +++ b/apps/web/src/lib/constant.ts @@ -358,7 +358,7 @@ export const TECH_OPTIONS: Record< description: "Deploy to Cloudflare Workers using Alchemy", icon: `${ICON_BASE_URL}/alchemy.png`, color: "from-purple-400 to-purple-600", - className: "scale-150" + className: "scale-150", }, { id: "none", @@ -383,7 +383,7 @@ export const TECH_OPTIONS: Record< description: "Deploy to Cloudflare Workers using Alchemy", icon: `${ICON_BASE_URL}/alchemy.png`, color: "from-purple-400 to-purple-600", - className: "scale-150" + className: "scale-150", }, { id: "none",