@ontrails/store 1.0.0-beta.17 → 1.0.0-beta.19
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 +30 -0
- package/README.md +7 -13
- package/package.json +14 -2
- package/src/trails/crud.ts +1 -1
- package/src/types.ts +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @ontrails/store
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
- ab1c77c: Advertise first-party adapter target metadata for catalog derivation.
|
|
9
|
+
- Updated dependencies [e41c382]
|
|
10
|
+
- Updated dependencies [1eb5bdc]
|
|
11
|
+
- Updated dependencies [f8d80b9]
|
|
12
|
+
- Updated dependencies [846a597]
|
|
13
|
+
- Updated dependencies [223aaad]
|
|
14
|
+
- Updated dependencies [3125f4d]
|
|
15
|
+
- Updated dependencies [2494dc6]
|
|
16
|
+
- Updated dependencies [2d53717]
|
|
17
|
+
- Updated dependencies [16cb740]
|
|
18
|
+
- Updated dependencies [8894ecb]
|
|
19
|
+
- Updated dependencies [fdf7ec9]
|
|
20
|
+
- Updated dependencies [d76be13]
|
|
21
|
+
- Updated dependencies [84f56a5]
|
|
22
|
+
- Updated dependencies [431b04c]
|
|
23
|
+
- Updated dependencies [5d88104]
|
|
24
|
+
- Updated dependencies [f04a9ef]
|
|
25
|
+
- @ontrails/core@1.0.0-beta.19
|
|
26
|
+
|
|
27
|
+
## 1.0.0-beta.18
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- @ontrails/core@1.0.0-beta.18
|
|
32
|
+
|
|
3
33
|
## 1.0.0-beta.17
|
|
4
34
|
|
|
5
35
|
### 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.
|
|
3
|
+
"version": "1.0.0-beta.19",
|
|
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.
|
|
29
|
+
"@ontrails/core": "^1.0.0-beta.19"
|
|
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
|
}
|
package/src/trails/crud.ts
CHANGED
|
@@ -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.
|
|
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
|
*/
|
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-
|
|
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
|
-
*
|
|
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 —
|
|
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-
|
|
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
|
-
*
|
|
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-
|
|
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
|
*
|