@ontrails/store 1.0.0-beta.18 → 1.0.0-beta.21

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/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # @ontrails/store
2
2
 
3
+ ## 1.0.0-beta.21
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [99523f2]
8
+ - @ontrails/core@1.0.0-beta.21
9
+
10
+ ## 1.0.0-beta.20
11
+
12
+ ### Patch Changes
13
+
14
+ - 851a2a3: Derive trail caller and blaze input types from the authored input schema while keeping one public input contract.
15
+ - Updated dependencies [851a2a3]
16
+ - @ontrails/core@1.0.0-beta.20
17
+
18
+ ## 1.0.0-beta.19
19
+
20
+ ### Patch Changes
21
+
22
+ - e41c382: Document beta-channel install guidance in package and adapter README install snippets so consumers use explicit `@beta` (or pinned `1.0.0-beta.N`) tags instead of accidental `latest` resolution during the prerelease line. Adds the policy doc at `docs/releases/beta-channel-policy.md`, prints both `latest` and `beta` dist-tags in `bun run publish:registry-check`, and aligns plugin/skill install snippets.
23
+ - ab1c77c: Advertise first-party adapter target metadata for catalog derivation.
24
+ - Updated dependencies [e41c382]
25
+ - Updated dependencies [1eb5bdc]
26
+ - Updated dependencies [f8d80b9]
27
+ - Updated dependencies [846a597]
28
+ - Updated dependencies [223aaad]
29
+ - Updated dependencies [3125f4d]
30
+ - Updated dependencies [2494dc6]
31
+ - Updated dependencies [2d53717]
32
+ - Updated dependencies [16cb740]
33
+ - Updated dependencies [8894ecb]
34
+ - Updated dependencies [fdf7ec9]
35
+ - Updated dependencies [d76be13]
36
+ - Updated dependencies [84f56a5]
37
+ - Updated dependencies [431b04c]
38
+ - Updated dependencies [5d88104]
39
+ - Updated dependencies [f04a9ef]
40
+ - @ontrails/core@1.0.0-beta.19
41
+
3
42
  ## 1.0.0-beta.18
4
43
 
5
44
  ### Patch Changes
package/README.md CHANGED
@@ -146,16 +146,13 @@ created.id;
146
146
 
147
147
  ## Adapter Support Subpath
148
148
 
149
- Adapter authors who bind a `store(...)` definition to a concrete backend should
150
- import signal-binding helpers from `@ontrails/store/adapter-support`:
149
+ Adapter authors who bind a `store(...)` definition to a concrete backend should import signal-binding helpers from `@ontrails/store/adapter-support`:
151
150
 
152
151
  ```typescript
153
152
  import { bindStoreDefinition } from '@ontrails/store/adapter-support';
154
153
  ```
155
154
 
156
- The subpath owns `bindStoreDefinition`, `createStoreTableSignals`,
157
- `composeStoreSignalId`, `isValidResourceId`, and `StoreSignalChange`. The root
158
- package stays focused on backend-agnostic store contracts.
155
+ The subpath owns `bindStoreDefinition`, `createStoreTableSignals`, `composeStoreSignalId`, `isValidResourceId`, and `StoreSignalChange`. The root package stays focused on backend-agnostic store contracts.
159
156
 
160
157
  Writable bindings fire those canonical scoped signals automatically when you access the resource through `db.from(ctx)` inside a trail context.
161
158
 
@@ -227,8 +224,7 @@ This keeps the default happy path derived and typed, while still giving you full
227
224
 
228
225
  ## Adapter binding
229
226
 
230
- `@ontrails/drizzle` keeps the durable `store(...)` declaration in
231
- `@ontrails/store` and binds it to a concrete runtime:
227
+ `@ontrails/drizzle` keeps the durable `store(...)` declaration in `@ontrails/store` and binds it to a concrete runtime:
232
228
 
233
229
  ```typescript
234
230
  import { connectDrizzle, connectReadOnlyDrizzle } from '@ontrails/drizzle';
@@ -249,13 +245,11 @@ export const readonly = connectReadOnlyDrizzle(definition, {
249
245
  });
250
246
  ```
251
247
 
252
- The root package still owns the authored persistence model; adapter packages
253
- project that model into runnable resources.
248
+ The root package still owns the authored persistence model; adapter packages project that model into runnable resources.
254
249
 
255
250
  ## Schema export for external tooling
256
251
 
257
- If you need the raw derived Drizzle tables for tooling such as `drizzle-kit`,
258
- read them from the bound resource's `tables` field:
252
+ If you need the raw derived Drizzle tables for tooling such as `drizzle-kit`, read them from the bound resource's `tables` field:
259
253
 
260
254
  ```typescript
261
255
  import { connectDrizzle } from '@ontrails/drizzle';
@@ -276,13 +270,13 @@ const schema = db.tables;
276
270
  ## Installation
277
271
 
278
272
  ```bash
279
- bun add @ontrails/store zod
273
+ bun add @ontrails/store@beta zod
280
274
  ```
281
275
 
282
276
  Add Drizzle only when you want the external SQLite/ORM adapter:
283
277
 
284
278
  ```bash
285
- bun add @ontrails/drizzle
279
+ bun add @ontrails/drizzle@beta
286
280
  ```
287
281
 
288
282
  ## Migration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ontrails/store",
3
- "version": "1.0.0-beta.18",
3
+ "version": "1.0.0-beta.21",
4
4
  "files": [
5
5
  "src/**/*.ts",
6
6
  "!src/**/__tests__/**",
@@ -26,9 +26,21 @@
26
26
  "clean": "rm -rf dist *.tsbuildinfo"
27
27
  },
28
28
  "dependencies": {
29
- "@ontrails/core": "^1.0.0-beta.17"
29
+ "@ontrails/core": "^1.0.0-beta.21"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "zod": "^4.3.5"
33
+ },
34
+ "trails": {
35
+ "adapterTargets": {
36
+ "store": {
37
+ "placements": [
38
+ "extracted",
39
+ "subpath"
40
+ ],
41
+ "supportImport": "@ontrails/store/adapter-support",
42
+ "testingImport": "@ontrails/store/testing"
43
+ }
44
+ }
33
45
  }
34
46
  }
@@ -39,7 +39,7 @@ type GeneratedFieldsOf<TTable extends AnyStoreTable> =
39
39
 
40
40
  /**
41
41
  * Input type `deriveTrail` projects for a given CRUD operation against a
42
- * store table. Routes through `TableContour<TTable>` so the projected input
42
+ * store table. Uses `TableContour<TTable>` so the projected input
43
43
  * structurally matches the contour-backed derivation path in
44
44
  * `@ontrails/core`'s `deriveTrail`.
45
45
  */
@@ -263,7 +263,7 @@ export const reconcile = <
263
263
  const entityContour = createTableContour(options.table);
264
264
  const strategy = options.strategy ?? 'last-write-wins';
265
265
 
266
- return trail<UpsertOf<TTable>, EntityOf<TTable>>(id, {
266
+ return trail(id, {
267
267
  blaze: createReconcileBlaze(options, id),
268
268
  contours: [entityContour],
269
269
  description:
@@ -178,7 +178,7 @@ export const sync = <
178
178
  const sourceContour = createTableContour(options.from.table);
179
179
  const targetContour = createTableContour(options.to.table);
180
180
 
181
- return trail<IdentityInputOf<TSourceTable>, EntityOf<TTargetTable>>(id, {
181
+ return trail(id, {
182
182
  // oxlint-disable-next-line max-statements -- sync blaze reads more clearly as one try/catch with schema validation, transform, and accessor call inline
183
183
  blaze: async (input, ctx) => {
184
184
  try {
package/src/types.ts CHANGED
@@ -43,7 +43,7 @@ type GeneratedFieldNames<
43
43
  ? TGenerated[number]
44
44
  : never;
45
45
 
46
- // We intentionally use Zod v4's shape-routed object infer helpers here because
46
+ // We intentionally use Zod v4's shape-based object infer helpers here because
47
47
  // the public z.input/z.output path widens away the generic equality we need at
48
48
  // store/core trail boundaries. These $-prefixed helpers are semi-internal Zod
49
49
  // v4 API; that maintenance tradeoff is acceptable here because the public path
@@ -65,7 +65,7 @@ type ObjectOutputOf<TShape extends z.ZodRawShape> = z.core.$InferObjectOutput<
65
65
  * fixtures can omit timestamps and similar server-managed values when the mock
66
66
  * store can synthesize them.
67
67
  *
68
- * Routes input inference through the object's `shape` via a conditional
68
+ * Feeds input inference through the object's `shape` via a conditional
69
69
  * `infer` so fixture inputs stay structurally aligned with the derived
70
70
  * create/upsert inputs they meet at store/core trail boundaries.
71
71
  *
@@ -101,11 +101,11 @@ export type StoreFixtureInput<
101
101
  /**
102
102
  * Normalized fixture row after schema validation and default application.
103
103
  *
104
- * Mirror of {@link StoreFixtureInput} on the output side — routed through
104
+ * Mirror of {@link StoreFixtureInput} on the output side — computed through
105
105
  * `$InferObjectOutput<TShape, Record<never, never>>` so row types stay
106
106
  * structurally aligned with the contour output shapes they compose against.
107
107
  *
108
- * As with {@link StoreFixtureInput}, this is a shape-routed equivalent rather
108
+ * As with {@link StoreFixtureInput}, this is a shape-based equivalent rather
109
109
  * than the identical `z.output<TSchema>` inference path core uses directly.
110
110
  */
111
111
  export type StoreFixtureRow<
@@ -428,11 +428,11 @@ export type GeneratedKeysOf<TTable extends AnyStoreTable> = Extract<
428
428
  /**
429
429
  * Insert shape: entity minus generated fields, with defaulted fields optional.
430
430
  *
431
- * Routes through `$InferObjectInput<TShape, Record<never, never>>` via a
431
+ * Uses `$InferObjectInput<TShape, Record<never, never>>` via a
432
432
  * conditional `infer` on the object's `shape`. At concrete instantiations
433
433
  * this collapses to the same structural shape as
434
434
  * `Omit<z.input<TTable['schema']>, GeneratedKeysOf<TTable>>`, but the
435
- * shape-routed form lets TypeScript prove structural equality with
435
+ * shape-based form lets TypeScript prove structural equality with
436
436
  * `CreateInputOf<Contour, ...>` at trail boundaries without widening
437
437
  * generic call sites to `Record<string, unknown>`.
438
438
  *