fix(stats): inline worker runtime import
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
|||||||
type ModelCatalogCost,
|
type ModelCatalogCost,
|
||||||
type ModelCatalogEntry,
|
type ModelCatalogEntry,
|
||||||
} from "../model-catalog"
|
} from "../model-catalog"
|
||||||
|
import { statsRuntime } from "../../stats-runtime"
|
||||||
import {
|
import {
|
||||||
applyThemePreference,
|
applyThemePreference,
|
||||||
Footer,
|
Footer,
|
||||||
@@ -95,7 +96,6 @@ const worldBorderPath = worldPath(mesh(worldTopology, worldCountryGeometries, (a
|
|||||||
|
|
||||||
const getModelData = query(async (lab: string, model: string) => {
|
const getModelData = query(async (lab: string, model: string) => {
|
||||||
"use server"
|
"use server"
|
||||||
const { statsRuntime } = await import("../../stats-runtime")
|
|
||||||
return statsRuntime.runPromise(getStatsModelData(model, lab))
|
return statsRuntime.runPromise(getStatsModelData(model, lab))
|
||||||
}, "getStatsModelData")
|
}, "getStatsModelData")
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
type ModelCatalogEntry,
|
type ModelCatalogEntry,
|
||||||
type ModelCatalogLab,
|
type ModelCatalogLab,
|
||||||
} from "../model-catalog"
|
} from "../model-catalog"
|
||||||
|
import { statsRuntime } from "../../stats-runtime"
|
||||||
import {
|
import {
|
||||||
applyThemePreference,
|
applyThemePreference,
|
||||||
Footer,
|
Footer,
|
||||||
@@ -45,7 +46,6 @@ const labFooterLinks: readonly HeaderLink[] = [
|
|||||||
|
|
||||||
const getLabData = query(async (lab: string) => {
|
const getLabData = query(async (lab: string) => {
|
||||||
"use server"
|
"use server"
|
||||||
const { statsRuntime } = await import("../../stats-runtime")
|
|
||||||
return statsRuntime.runPromise(getStatsLabData(lab))
|
return statsRuntime.runPromise(getStatsLabData(lab))
|
||||||
}, "getStatsLabData")
|
}, "getStatsLabData")
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { AppConfig } from "@opencode-ai/stats-core/config"
|
import { AppConfig } from "@opencode-ai/stats-core/config"
|
||||||
import { Effect } from "effect"
|
import { Effect } from "effect"
|
||||||
|
import { statsRuntime } from "../../stats-runtime"
|
||||||
|
|
||||||
export async function GET() {
|
export async function GET() {
|
||||||
const { statsRuntime } = await import("../../stats-runtime")
|
|
||||||
return Response.json(
|
return Response.json(
|
||||||
await statsRuntime.runPromise(
|
await statsRuntime.runPromise(
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { createEffect, createMemo, createSignal, For, onCleanup, onMount, Show,
|
|||||||
import { getRequestEvent } from "solid-js/web"
|
import { getRequestEvent } from "solid-js/web"
|
||||||
import type { FeatureCollection, GeometryObject, GeoJsonProperties } from "geojson"
|
import type { FeatureCollection, GeometryObject, GeoJsonProperties } from "geojson"
|
||||||
import type { GeometryCollection, Topology } from "topojson-specification"
|
import type { GeometryCollection, Topology } from "topojson-specification"
|
||||||
|
import { statsRuntime } from "../stats-runtime"
|
||||||
import { findModelCatalogEntry, getModelCatalog, type ModelCatalog } from "./model-catalog"
|
import { findModelCatalogEntry, getModelCatalog, type ModelCatalog } from "./model-catalog"
|
||||||
import {
|
import {
|
||||||
applyThemePreference,
|
applyThemePreference,
|
||||||
@@ -108,7 +109,6 @@ const worldBorderPath = worldPath(mesh(worldTopology, worldCountryGeometries, (a
|
|||||||
|
|
||||||
const getData = query(async () => {
|
const getData = query(async () => {
|
||||||
"use server"
|
"use server"
|
||||||
const { statsRuntime } = await import("../stats-runtime")
|
|
||||||
return statsRuntime.runPromise(getStatsHomeData())
|
return statsRuntime.runPromise(getStatsHomeData())
|
||||||
}, "getStatsHomeData")
|
}, "getStatsHomeData")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user