fix(durable): import sync's store API from Chord's root

Chord v2 moved from @earendil-works/chord/next to the package root and
Context and JsonValue left the root with Chord v1; sync and its tests
import them from @earendil-works/chord, chord/context and chord/json.
This commit is contained in:
Cristina Poncela Cubeiro 2026-11-03 14:16:29 +01:00
parent a597c90e11
commit d27dfd12f8
9 changed files with 13 additions and 12 deletions

View file

@ -1,4 +1,4 @@
import type { ArchivePart, OutboxCommit } from "@earendil-works/chord/next";
import type { ArchivePart, OutboxCommit } from "@earendil-works/chord";
import { decodeLogLines, encodeLogLine, LogFormatError } from "./lines.ts";
/**

View file

@ -1,4 +1,3 @@
import type { Context } from "@earendil-works/chord";
import {
applyBatch,
type Backend,
@ -7,7 +6,8 @@ import {
type OutboxCommit,
openStore,
type Store,
} from "@earendil-works/chord/next";
} from "@earendil-works/chord";
import type { Context } from "@earendil-works/chord/context";
import { seqFromNumber } from "../ids.ts";
import type { CommitPublication, Seq } from "../types.ts";
import { decodeBatch, decodeSnapshot, encodeBatch, encodeSnapshot } from "./batch.ts";

View file

@ -1,4 +1,4 @@
import type { Context } from "@earendil-works/chord";
import type { Context } from "@earendil-works/chord/context";
import type { FileError, FileSystem, Result } from "../env/index.ts";
import { seqFromNumber } from "../ids.ts";
import type { JsonObject, Seq } from "../types.ts";

View file

@ -1,4 +1,4 @@
import type { OutboxCommit } from "@earendil-works/chord/next";
import type { OutboxCommit } from "@earendil-works/chord";
/**
* Version of the line envelope. It changes when the envelope changes; the writes inside carry the store outbox's own

View file

@ -1,4 +1,4 @@
import type { Context } from "@earendil-works/chord";
import type { Context } from "@earendil-works/chord/context";
import { seqFromNumber } from "../ids.ts";
import type { JsonObject, Seq } from "../types.ts";

View file

@ -1,4 +1,4 @@
import type { Context } from "@earendil-works/chord";
import type { Context } from "@earendil-works/chord/context";
import type { FileError, FileSystem, Result } from "../env/index.ts";
import type { Seq } from "../types.ts";
import type { SyncState, SyncStateStore } from "./client.ts";

View file

@ -4,7 +4,7 @@
import { mkdtemp, rename, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { openStore, type Store } from "@earendil-works/chord/next";
import { openStore, type Store } from "@earendil-works/chord";
import { fauxAssistantMessage } from "@earendil-works/pi-ai";
import { afterEach, describe, expect, it } from "vitest";
import { NodeExecutionEnv } from "../src/env/node.ts";

View file

@ -3,9 +3,10 @@
import { mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import type { Context, JsonValue } from "@earendil-works/chord";
import { openStore, type Store } from "@earendil-works/chord";
import type { Context } from "@earendil-works/chord/context";
import { BACKGROUND_CONTEXT } from "@earendil-works/chord/context";
import { openStore, type Store } from "@earendil-works/chord/next";
import type { JsonValue } from "@earendil-works/chord/json";
import { afterEach, describe, expect, it } from "vitest";
import { NodeExecutionEnv } from "../src/env/node.ts";
import { idFromNumber, seqFromNumber } from "../src/ids.ts";

View file

@ -1,9 +1,9 @@
// A session's copy for the sync tests: a Chord store over a SQLite database with its outbox on, and Durable's storage
// in it under one owner name. The store is what syncs; the storage is opened on it only while something commits.
import type { Context } from "@earendil-works/chord";
import { type Backend, openStore, type Store, sqliteBackend } from "@earendil-works/chord";
import type { Context } from "@earendil-works/chord/context";
import { BACKGROUND_CONTEXT } from "@earendil-works/chord/context";
import { type Backend, openStore, type Store, sqliteBackend } from "@earendil-works/chord/next";
import { openNodeSqliteDatabase } from "@earendil-works/chord/sqlite/node";
import { StoreStorage } from "../src/storage/store/index.ts";
import { commitWrites } from "../src/testing/commit-writes.ts";