fix(web): update NPM version fetching logic

This commit is contained in:
Aman Varshney
2025-08-21 01:35:17 +05:30
parent 4c7fda3f7c
commit d29e82f599
3 changed files with 5 additions and 5 deletions

View File

@@ -11,12 +11,12 @@ import {
incompatibleFlagsForBackend,
isWebFrontend,
validateAddonsAgainstFrontends,
validateAlchemyCompatibility,
validateApiFrontendCompatibility,
validateExamplesCompatibility,
validateServerDeployRequiresBackend,
validateWebDeployRequiresWebFrontend,
validateWorkersCompatibility,
validateAlchemyCompatibility,
} from "./compatibility-rules";
import { exitWithError } from "./errors";

View File

@@ -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();

View File

@@ -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",