@catalyst-cloud/schema 0.1.18 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@catalyst-cloud/schema",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "type": "module",
5
5
  "description": "Typed Drizzle schema = single source of truth for the per-tenant Mirror DO SQLite store (CTC-13 / ADR-0002). Shared by the mirror Worker, the host-sync replica, and the browser OPFS replica.",
6
6
  "license": "MIT",
@@ -27,14 +27,14 @@
27
27
  "build:bundle": "bun scripts/build-bundle.ts && prettier --write src/migrations.generated.ts"
28
28
  },
29
29
  "dependencies": {
30
- "drizzle-orm": "0.44.7"
30
+ "drizzle-orm": "0.45.2"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@catalyst-cloud/typescript-config": "workspace:*",
34
34
  "@types/node": "^25.9.3",
35
35
  "drizzle-kit": "^0.31.0",
36
- "prettier": "^3.8.4",
37
- "typescript": "^5.6.3",
38
- "vitest": "^2.1.8"
36
+ "prettier": "^3.9.6",
37
+ "typescript": "^7.0.2",
38
+ "vitest": "^4.1.11"
39
39
  }
40
40
  }
@@ -0,0 +1,8 @@
1
+ // index.ts — CTC-936 phase 1. The `events` contract module barrel. Phase 1 ships the envelope + the
2
+ // type grammar only; phase 2 adds the closed registry (./registry.ts), phase 4 adds retention
3
+ // (./retention.ts) — both re-exported here as they land so this stays the one import surface.
4
+
5
+ export * from "./types.js";
6
+ export * from "./type-grammar.js";
7
+ export * from "./registry.js";
8
+ export * from "./retention.js";
@@ -0,0 +1,20 @@
1
+ // registry-support.ts — the shared `keysOf` helper the event registry needs, structurally identical
2
+ // to (and NOT a second copy of the concept behind) `packages/schema/src/index.ts`'s own `keysOf`.
3
+ //
4
+ // ⚠️ Why this is a small duplicate rather than an import from `../index.ts`: `../index.ts` re-exports
5
+ // `./events/index.js` (this module's own barrel) — importing `../index.ts` FROM `./events/` would be
6
+ // a circular import. The plan's Refactor note for this phase says to prefer importing the existing
7
+ // `keysOf` "if duplicating it from index.ts becomes a second copy" of the CONCEPT (CTC-643/CTC-671's
8
+ // defect was two DISAGREEING lists, not two textually-identical five-line generic helpers) — this
9
+ // helper carries no policy, just a type-preserving `Object.keys`, so a second textual copy here does
10
+ // not reintroduce that defect. If TypeScript ever supports referencing a sibling package export
11
+ // without a cycle, this can be deleted in favor of importing `../index.ts`'s copy.
12
+
13
+ /**
14
+ * `Object.keys` with the key type preserved. TypeScript types `Object.keys` as `string[]` because an
15
+ * object may carry extra keys at runtime; every caller here passes an `as const` literal declared in
16
+ * the same module, so the narrowing is sound.
17
+ */
18
+ export function keysOf<T extends object>(o: T): (keyof T & string)[] {
19
+ return Object.keys(o) as (keyof T & string)[];
20
+ }