feat(workspace): R2 facade operations for the editor rules, the publish check and the sheet index data
Free ops: sheet.check, report.new, report.add_observation, report.remove_observation, report.move_observation, vertebra.select. Sheet ops: index_data, zone.click, zone.add_sides, zone.remove_at, vertebra.initial, vertebra.sync, finding.toggle. Input contracts exported to TypeScript; a JavaScript index that names no position removes nothing in the filters and is refused by the move (the TypeScript swap would have written a hole). Shipped module 999 KB raw, 319 KB gzip (budget 600 KB).
This commit is contained in:
1 parent
3639c8778e
commit
6c0533c1da
25 files changed
+470
-11
No files matched your search
@@ -87,18 +87,18 @@ describe('core runtime', () => {
|
||||
const runtime = new CoreRuntime(countingSource())
|
||||
await runtime.ready()
|
||||
const sheet = runtime.sheet(BUNDLE)
|
||||
expect(sheet.call('sheet.ref', '')).toMatchObject({
|
||||
expect(sheet.call('index_data', '')).toMatchObject({
|
||||
ok: true,
|
||||
value: { sheetId: 'sheet', versionId: null },
|
||||
value: { ref: { sheetId: 'sheet', versionId: null } },
|
||||
})
|
||||
trap(runtime)
|
||||
expect(sheet.call('sheet.ref', '')).toMatchObject({
|
||||
expect(sheet.call('index_data', '')).toMatchObject({
|
||||
kind: 'core_unavailable',
|
||||
})
|
||||
await runtime.ready()
|
||||
// A call through the stack-trapped instance would fail in its allocator and poison
|
||||
// again: one generation more and a ready runtime prove the handle was rebuilt.
|
||||
expect(sheet.call('sheet.ref', '')).toMatchObject({ ok: true })
|
||||
expect(sheet.call('index_data', '')).toMatchObject({ ok: true })
|
||||
expect(runtime.generation).toBe(2)
|
||||
expect(runtime.status).toBe('ready')
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user