mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
fix(web): update NPM version fetching logic
This commit is contained in:
@@ -11,12 +11,12 @@ import {
|
|||||||
incompatibleFlagsForBackend,
|
incompatibleFlagsForBackend,
|
||||||
isWebFrontend,
|
isWebFrontend,
|
||||||
validateAddonsAgainstFrontends,
|
validateAddonsAgainstFrontends,
|
||||||
|
validateAlchemyCompatibility,
|
||||||
validateApiFrontendCompatibility,
|
validateApiFrontendCompatibility,
|
||||||
validateExamplesCompatibility,
|
validateExamplesCompatibility,
|
||||||
validateServerDeployRequiresBackend,
|
validateServerDeployRequiresBackend,
|
||||||
validateWebDeployRequiresWebFrontend,
|
validateWebDeployRequiresWebFrontend,
|
||||||
validateWorkersCompatibility,
|
validateWorkersCompatibility,
|
||||||
validateAlchemyCompatibility,
|
|
||||||
} from "./compatibility-rules";
|
} from "./compatibility-rules";
|
||||||
import { exitWithError } from "./errors";
|
import { exitWithError } from "./errors";
|
||||||
|
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ const NpmPackage = () => {
|
|||||||
);
|
);
|
||||||
if (!res.ok) throw new Error("Failed to fetch version");
|
if (!res.ok) throw new Error("Failed to fetch version");
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
const latestVersion = data[0].tag_name.split("@")[1];
|
const latestVersion = data[0].tag_name.replace(/^v/, "");
|
||||||
setVersion(latestVersion);
|
setVersion(latestVersion);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error fetching NPM version:", error);
|
console.error("Error fetching NPM version:", error);
|
||||||
setVersion("?.?.?");
|
setVersion("latest");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
getLatestVersion();
|
getLatestVersion();
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ export const TECH_OPTIONS: Record<
|
|||||||
description: "Deploy to Cloudflare Workers using Alchemy",
|
description: "Deploy to Cloudflare Workers using Alchemy",
|
||||||
icon: `${ICON_BASE_URL}/alchemy.png`,
|
icon: `${ICON_BASE_URL}/alchemy.png`,
|
||||||
color: "from-purple-400 to-purple-600",
|
color: "from-purple-400 to-purple-600",
|
||||||
className: "scale-150"
|
className: "scale-150",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "none",
|
id: "none",
|
||||||
@@ -383,7 +383,7 @@ export const TECH_OPTIONS: Record<
|
|||||||
description: "Deploy to Cloudflare Workers using Alchemy",
|
description: "Deploy to Cloudflare Workers using Alchemy",
|
||||||
icon: `${ICON_BASE_URL}/alchemy.png`,
|
icon: `${ICON_BASE_URL}/alchemy.png`,
|
||||||
color: "from-purple-400 to-purple-600",
|
color: "from-purple-400 to-purple-600",
|
||||||
className: "scale-150"
|
className: "scale-150",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "none",
|
id: "none",
|
||||||
|
|||||||
Reference in New Issue
Block a user