opencode/packages/data/server/src/sync.ts
Dax Raad 070b980c0b refactor(data): strict dev/production stages and data naming
- services/data/stage.ts: stage(mode) throws on anything but dev or production, used by all three configs, build.ts and deploy.ts
- packages/stats -> packages/data (@opencode/data-app, -core, -server)
- StatsSyncWorkflow -> DataSyncWorkflow, instance ids data-hourly-/data-history-, Data* resource keys, data sync log lines
- worker, route, workflow and cron names unchanged
2026-11-11 02:35:05 -05:00

10 lines
462 B
TypeScript

import { R2Sql } from "@opencode/data-core/r2-sql"
import { layer } from "@opencode/data-core/runtime"
import { syncData } from "@opencode/data-core/stat-sync"
import { Effect, Layer } from "effect"
// Runs one sync pass in this process, for local use. Deployed stages run the
// same steps in the DataSyncWorkflow.
await Effect.runPromise(
syncData({ history: process.argv.includes("--history") }).pipe(Effect.provide(Layer.mergeAll(layer, R2Sql.layer))),
)