Skip to content

Commit 38778d5

Browse files
vanceingallsclaude
andcommitted
fix(sdk): make engine-layer PR self-contained — trim index.ts, guard indexed access
- index.ts no longer exports document/session/history/persist-queue (those modules land in the next stacked PR); branch now typechecks standalone - setOwnText: optional-chain children[i] access (TS2532 under noUncheckedIndexedAccess) - fallow suppressions for buildPatchEvent + adapters/types.ts — consumers arrive in #1325 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 049cff6 commit 38778d5

4 files changed

Lines changed: 5 additions & 12 deletions

File tree

packages/sdk/src/adapters/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Consumed by session.ts + adapter implementations in the next stacked PR (#1325).
2+
// fallow-ignore-file unused-file
13
import type { PersistErrorEvent } from "../types.js";
24

35
// ─── PersistAdapter ───────────────────────────────────────────────────────────

packages/sdk/src/engine/model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export function setOwnText(el: Element, text: string): void {
116116
// Track original position of the first text node so we restore there, not at firstChild.
117117
let firstTextIdx = -1;
118118
for (let i = 0; i < children.length; i++) {
119-
if (children[i].nodeType === 3) {
119+
if (children[i]?.nodeType === 3) {
120120
firstTextIdx = i;
121121
break;
122122
}

packages/sdk/src/engine/patches.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ export function pathToKey(path: string): string | null {
105105

106106
// ─── Patch event builder ──────────────────────────────────────────────────────
107107

108+
// Consumed by session.ts dispatch/batch in the next stacked PR (#1325).
109+
// fallow-ignore-next-line unused-export
108110
export function buildPatchEvent(
109111
forward: readonly JsonPatchOp[],
110112
inverse: readonly JsonPatchOp[],

packages/sdk/src/index.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,3 @@ export type {
1717
} from "./types.js";
1818

1919
export { ORIGIN_APPLY_PATCHES, ORIGIN_LOCAL } from "./types.js";
20-
21-
export { buildDocument, flatElements } from "./document.js";
22-
23-
export { openComposition } from "./session.js";
24-
export type { OpenCompositionOptions } from "./session.js";
25-
26-
export { createHistory } from "./history.js";
27-
export type { HistoryModule, HistoryOptions, HistoryEntry } from "./history.js";
28-
29-
export { createPersistQueue } from "./persist-queue.js";
30-
export type { PersistQueueModule, PersistQueueOptions } from "./persist-queue.js";

0 commit comments

Comments
 (0)