diff --git a/CHANGELOG.md b/CHANGELOG.md index d687843..247d026 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Patch + +- Fix Convex server functions being imported in browser by moving ArtifactType enum to client-safe location + ## [0.3.0] - 2025-12-10 ### Minor diff --git a/components/BuildDownloadButton.tsx b/components/BuildDownloadButton.tsx index 42ca066..efc76d8 100644 --- a/components/BuildDownloadButton.tsx +++ b/components/BuildDownloadButton.tsx @@ -2,7 +2,7 @@ import { SourceAvailable } from "@/components/SourceAvailable" import { Button } from "@/components/ui/button" import { api } from "@/convex/_generated/api" import type { Doc } from "@/convex/_generated/dataModel" -import { ArtifactType } from "@/convex/builds" +import { ArtifactType } from "@/convex/lib/filename" import { useMutation } from "convex/react" import { useState } from "react" import { toast } from "sonner" diff --git a/components/BuildProgress.tsx b/components/BuildProgress.tsx index 7b60da4..f586670 100644 --- a/components/BuildProgress.tsx +++ b/components/BuildProgress.tsx @@ -2,8 +2,7 @@ import { BuildDownloadButton } from "@/components/BuildDownloadButton" import { Button } from "@/components/ui/button" import { TARGETS } from "@/constants/targets" import type { Doc } from "@/convex/_generated/dataModel" -import { ArtifactType } from "@/convex/builds" -import { getArtifactFilenameBase } from "@/convex/lib/filename" +import { ArtifactType, getArtifactFilenameBase } from "@/convex/lib/filename" import modulesData from "@/convex/modules.json" import { getImplicitDependencies, humanizeStatus } from "@/lib/utils" import registryData from "@/public/registry.json" diff --git a/convex/builds.ts b/convex/builds.ts index 4fa84eb..725224f 100644 --- a/convex/builds.ts +++ b/convex/builds.ts @@ -3,15 +3,10 @@ import { v } from "convex/values" import { api, internal } from "./_generated/api" import type { Doc, Id } from "./_generated/dataModel" import { internalMutation, mutation, query } from "./_generated/server" -import { getArtifactFilenameBase } from "./lib/filename" +import { ArtifactType, getArtifactFilenameBase } from "./lib/filename" import { generateSignedDownloadUrl } from "./lib/r2" import { buildFields } from "./schema" -export enum ArtifactType { - Firmware = "firmware", - Source = "source", -} - type BuildUpdateData = { status: string completedAt?: number diff --git a/convex/lib/filename.ts b/convex/lib/filename.ts index 9c40b7d..4ea7cc2 100644 --- a/convex/lib/filename.ts +++ b/convex/lib/filename.ts @@ -1,3 +1,12 @@ +/** + * Artifact type enumeration. + * Safe to import in client-side code. + */ +export enum ArtifactType { + Firmware = "firmware", + Source = "source", +} + /** * Generates the artifact filename base (without extension) matching the download filename format. * Format: meshtastic-{version}-{target}-{last4hash}-{jobId}-{artifactType}