Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/app/src/entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { authFromToken } from "@/utils/server"
import pkg from "../package.json"
import { ServerConnection } from "./context/server"

const appVersion = import.meta.env.VITE_OPENCODE_VERSION ?? pkg.version

const DEFAULT_SERVER_URL_KEY = "opencode.settings.dat:defaultServerUrl"

const getLocale = () => {
Expand Down Expand Up @@ -121,7 +123,7 @@ const clearAuthToken = () => {

const platform: Platform = {
platform: "web",
version: pkg.version,
version: appVersion,
openLink,
back,
forward,
Expand All @@ -138,7 +140,7 @@ if (import.meta.env.VITE_SENTRY_DSN) {
Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN,
environment: import.meta.env.VITE_SENTRY_ENVIRONMENT ?? import.meta.env.MODE,
release: import.meta.env.VITE_SENTRY_RELEASE ?? `web@${pkg.version}`,
release: import.meta.env.VITE_SENTRY_RELEASE ?? `web@${appVersion}`,
initialScope: {
tags: {
platform: "web",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
interface ImportMetaEnv {
readonly VITE_OPENCODE_SERVER_HOST: string
readonly VITE_OPENCODE_SERVER_PORT: string
readonly VITE_OPENCODE_VERSION?: string
readonly VITE_OPENCODE_CHANNEL?: "dev" | "beta" | "prod"

readonly VITE_SENTRY_DSN?: string
Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/script/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const createEmbeddedWebUIBundle = async () => {
console.log(`Building Web UI to embed in the binary`)
const appDir = path.join(import.meta.dirname, "../../app")
const dist = path.join(appDir, "dist")
await $`OPENCODE_CHANNEL=${Script.channel} bun run --cwd ${appDir} build`
await $`OPENCODE_CHANNEL=${Script.channel} VITE_OPENCODE_VERSION=${Script.version} bun run --cwd ${appDir} build`
const files = (await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: dist })))
.map((file) => file.replaceAll("\\", "/"))
.filter((file) => !file.endsWith(".map"))
Expand Down
Loading