Skip to content

Commit 4406c90

Browse files
committed
some fixes
1 parent cd1d0bf commit 4406c90

87 files changed

Lines changed: 3619 additions & 4743 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/browser-bundle-jj/dist/sds-browser-bundle-jj.js

Lines changed: 1263 additions & 1262 deletions
Large diffs are not rendered by default.

packages/browser-bundle-loro/dist/sds-browser-bundle-loro.js

Lines changed: 151 additions & 150 deletions
Large diffs are not rendered by default.

packages/browser-bundle-yjs/dist/sds-browser-bundle-yjs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11390,7 +11390,8 @@ class yg {
1139011390
// tracks entryId → blob hash for all entries whose value is in a *-reference kind;
1139111391
// used to call releaseValue() when the entry's value changes or the entry is purged
1139211392
_(this, it, /* @__PURE__ */ new Map());
11393-
I(this, he, e), I(this, G, t.PersistenceProvider ?? void 0), I(this, B, t.NetworkProvider ?? void 0), I(this, cn, t.PresenceProvider ?? t.NetworkProvider ?? void 0), I(this, Wn, t.PresenceTimeoutMs ?? 12e4), (t.BroadcastChannel ?? !0) && typeof BroadcastChannel < "u" && l(this, B) != null && I(this, qe, new BroadcastChannel(`sds:${l(this, B).StoreId}`));
11393+
var r;
11394+
I(this, he, e), I(this, G, t.PersistenceProvider ?? void 0), I(this, B, t.NetworkProvider ?? void 0), I(this, cn, t.PresenceProvider ?? (typeof ((r = t.NetworkProvider) == null ? void 0 : r.onRemoteState) == "function" ? t.NetworkProvider : void 0)), I(this, Wn, t.PresenceTimeoutMs ?? 12e4), (t.BroadcastChannel ?? !0) && typeof BroadcastChannel < "u" && l(this, B) != null && I(this, qe, new BroadcastChannel(`sds:${l(this, B).StoreId}`));
1139411395
}
1139511396
//----------------------------------------------------------------------------//
1139611397
// Lifecycle //

packages/core-loro/TestCases.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ instead of physically removing the map key. The observable result is
2323
identical to the contract specification: `EntryWithId(id)` returns `undefined`
2424
and the entry no longer appears in any `innerEntryList`.
2525

26+
## SDS_CoreLoro.test.ts — Export Smoke Tests
27+
28+
| # | Test case | Expected result |
29+
|---|---|---|
30+
| LORO-01 | `SDS_Error` imported from `@rozek/sds-core-loro` is constructible | `err instanceof SDS_Error`, `err.code === 'test'`, `err.message === 'test message'` |
31+
| LORO-02 | `SDS_DataStore` factory methods are exported | `fromScratch`, `fromBinary`, `fromJSON` are functions |
32+
| LORO-03 | `SDS_Entry`, `SDS_Item`, `SDS_Link` are exported | all three are defined |
33+
| LORO-04 | `fromScratch()` produces a working store | `instanceof SDS_DataStore`; well-known IDs correct |
34+
| LORO-05 | Instances have correct prototypes | `instanceof SDS_Item`, `instanceof SDS_Link` |
35+
| LORO-06 | Patch exchange between two independent stores | Label set on StoreA visible on StoreB after `applyRemotePatch` |
36+
37+
---
38+
2639
## SDS_DataStore.construction.test.ts — Backend-specific (Loro)
2740

2841
| # | Test case | Expected result |

packages/core-yjs/TestCases.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ well-known entry IDs. Y.js state-vector-based delta encoding correctly handles
1515
the case where both docs started from divergent initial states — Y.js simply
1616
merges both sets of updates. No canonical pre-generated snapshot is required.
1717

18+
## SDS_CoreYjs.test.ts — Export Smoke Tests
19+
20+
| # | Test case | Expected result |
21+
|---|---|---|
22+
| YJS-01 | `SDS_Error` imported from `@rozek/sds-core-yjs` is constructible | `err instanceof SDS_Error`, `err.code === 'test'`, `err.message === 'test message'` |
23+
| YJS-02 | `SDS_DataStore` factory methods are exported | `fromScratch`, `fromBinary`, `fromJSON` are functions |
24+
| YJS-03 | `SDS_Entry`, `SDS_Item`, `SDS_Link` are exported | all three are defined |
25+
| YJS-04 | `fromScratch()` produces a working store | `instanceof SDS_DataStore`; well-known IDs correct |
26+
| YJS-05 | Instances have correct prototypes | `instanceof SDS_Item`, `instanceof SDS_Link` |
27+
| YJS-06 | Patch exchange between two independent stores | Label set on StoreA visible on StoreB after `applyRemotePatch` |
28+
29+
---
30+
1831
## SDS_DataStore.construction.test.ts — Backend-specific (Y.js)
1932

2033
| # | Test case | Expected result |

packages/sds-command-jj/TestCases.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ All tests spawn the built `dist/sds-command-jj.js` binary. Exit codes and stdout
5555
|---|---|---|
5656
| SY-06 | `store sync --timeout 0` | exits with `UsageError` (code 2); error mentions `--timeout` |
5757
| SY-07 | `store sync --timeout -1` | exits with `UsageError` (code 2); error mentions `--timeout` |
58+
| SY-08 | `--server http://bad` (invalid scheme) | exits with `UsageError` (code 2); error mentions `--server` |
5859

5960
## EC — Entry Create
6061

@@ -179,13 +180,13 @@ All tests spawn the built `dist/sds-command-jj.js` binary. Exit codes and stdout
179180
| # | Description | Expected |
180181
|---|---|---|
181182
| TW-01 | text format | output starts with `root/` header |
182-
| TW-02 | JSON format (empty store) | `{ root: [] }` |
183+
| TW-02 | JSON format | output parses as JSON with a `root` array at the top level |
183184
| TW-03 | store with one item (JSON) | item appears in root array |
184185
| TW-04 | `--depth 1` | only direct inner entries of root; no deeper nodes |
185186
| TW-05 | `--depth` with non-integer | exits with `UsageError` (code 2) |
186187
| TW-06 | `tree show` on non-existent store | exits with `NotFound` (code 3) |
187188
| TW-07 | `--depth 0` with items present | exits with code 0; JSON root array is empty |
188-
| TW-08 | system containers excluded | TrashId and LostAndFoundId absent from JSON tree |
189+
| TW-08 | system containers included | TrashId and LostAndFoundId present in JSON tree at root level |
189190

190191
## RP — REPL
191192

packages/sds-command-jj/TestPlan.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ This package contains the **full integration test suite** for the `sds` CLI tool
1515
**In scope:**
1616
- Binary launch: `--help`, `--version`, unknown options, usage-error output ordering
1717
- All `store` sub-commands: `info`, `destroy`, `export`, `import` (including JSON and binary round-trips)
18-
- `store sync --timeout` validation
18+
- `store sync --timeout` validation and `--server` URL scheme validation
1919
- All `entry` sub-commands: `create`, `get`, `list`, `update`, `move`, `delete`, `restore`, `purge`
2020
- All `trash` sub-commands: `list`, `purge-all`, `purge-expired`
21-
- `tree show` — depth limit, system-container exclusion
21+
- `tree show` — depth limit, system-container inclusion
2222
- REPL (`sds shell`) — blank lines, comments, `exit`/`quit`, error recovery, `help`
2323
- Script runner (`sds --script`) — `--on-error` modes (`stop`, `continue`, `ask`)
2424
- Duplicate-option last-wins behaviour
@@ -117,6 +117,7 @@ This package contains the **full integration test suite** for the `sds` CLI tool
117117

118118
- **SY-06**`store sync --timeout 0` exits with `UsageError` (code 2); error mentions `--timeout`
119119
- **SY-07**`store sync --timeout -1` exits with `UsageError` (code 2); error mentions `--timeout`
120+
- **SY-08**`--server` with an invalid scheme (e.g. `http://bad`) exits with `UsageError` (code 2); error mentions `--server`
120121

121122
---
122123

@@ -243,7 +244,7 @@ This package contains the **full integration test suite** for the `sds` CLI tool
243244
- **TW-05**`--depth` with non-integer → `UsageError` (code 2)
244245
- **TW-06**`tree show` on non-existent store → `NotFound` (code 3)
245246
- **TW-07**`--depth 0` → empty root array in JSON
246-
- **TW-08** — System containers (Trash, LostAndFound) never appear in output
247+
- **TW-08** — System containers (Trash, LostAndFound) appear at root level in output
247248

248249
---
249250

packages/sds-command-jj/src/tests/store.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,12 @@ describe('store sync CLI options (SY)', () => {
234234
expect(Result.ExitCode).toBe(2)
235235
expect(Result.Stderr).toMatch(/--timeout/i)
236236
})
237+
238+
it('SY-08: --server with an invalid scheme exits with UsageError (code 2) and mentions --server', async () => {
239+
const Result = await runCLI([
240+
'--store', 'test', '--server', 'http://bad', 'store', 'info',
241+
])
242+
expect(Result.ExitCode).toBe(2)
243+
expect(Result.Stderr).toMatch(/--server/i)
244+
})
237245
})

packages/sds-command-jj/src/tests/tree.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ describe('tree show (TW)', () => {
141141
}
142142
})
143143

144-
it('TW-08: tree show does not include system containers (trash, lost-and-found)', async () => {
144+
it('TW-08: tree show includes system containers (trash, lost-and-found) at root level', async () => {
145145
const PersistenceDir8 = await fs.mkdtemp(path.join(os.tmpdir(), 'sds-tw8-'))
146146
try {
147147
// create one user item so the store file exists
@@ -154,9 +154,9 @@ describe('tree show (TW)', () => {
154154
expect(Result.ExitCode).toBe(0)
155155
const Json = JSON.parse(Result.Stdout)
156156
const AllIds = JSON.stringify(Json)
157-
// well-known system IDs must never appear in tree output
158-
expect(AllIds).not.toContain('00000000-0000-4000-8000-000000000001') // TrashId
159-
expect(AllIds).not.toContain('00000000-0000-4000-8000-000000000002') // LostAndFoundId
157+
// well-known system IDs must appear in tree output
158+
expect(AllIds).toContain('00000000-0000-4000-8000-000000000001') // TrashId
159+
expect(AllIds).toContain('00000000-0000-4000-8000-000000000002') // LostAndFoundId
160160
} finally {
161161
await fs.rm(PersistenceDir8, { recursive:true, force:true })
162162
}

0 commit comments

Comments
 (0)