fix: relocate ArtifactType enum to client-safe location to resolve import issues in browser

This commit is contained in:
Ben Allfree
2025-12-10 13:49:05 -08:00
parent f1e5390afc
commit de43b1b024
5 changed files with 16 additions and 9 deletions

View File

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

View File

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

View File

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

View File

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

View File

@@ -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}