kitcn 0.25.5 → 0.25.7
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 +3237 -0
- package/dist/aggregate/index.d.ts +1 -1
- package/dist/auth/generated/index.d.ts +1 -1
- package/dist/auth/index.d.ts +15 -15
- package/dist/{builder-DoeyW4Vq.js → builder-CsAw-DK8.js} +123 -7
- package/dist/cli.mjs +1 -1
- package/dist/{generated-contract-disabled-B3ByVG3_.d.ts → generated-contract-disabled-D_-_iJXw.d.ts} +26 -26
- package/dist/{local-env-CiPqNKS_.mjs → local-env-9Qtfn3wR.mjs} +69 -12
- package/dist/{middleware-DIj-bwVi.js → middleware-BvnabcNq.js} +1 -1
- package/dist/orm/index.d.ts +1 -1
- package/dist/orm/migrations/index.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/{procedure-caller-Dxae9DW5.js → procedure-caller-BR-Wb0si.js} +1 -1
- package/dist/ratelimit/index.js +2 -2
- package/dist/server/index.js +2 -2
- package/dist/watcher.mjs +1 -1
- package/dist/{where-clause-compiler-DlRUDuMx.d.ts → where-clause-compiler-CwSrhq51.d.ts} +109 -109
- package/package.json +2 -1
- package/skills/kitcn/SKILL.md +34 -29
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,3237 @@
|
|
|
1
|
+
# kitcn
|
|
2
|
+
|
|
3
|
+
## 0.25.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#379](https://github.com/udecode/kitcn/pull/379) [`53fe88e`](https://github.com/udecode/kitcn/commit/53fe88e6911cdabdfcccba20337bfdadb7b6e5be) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
8
|
+
|
|
9
|
+
- Fix codegen schema loading with constrained required environment values.
|
|
10
|
+
- Fix first-run codegen when schema triggers import newly generated callers.
|
|
11
|
+
|
|
12
|
+
## 0.25.6
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#373](https://github.com/udecode/kitcn/pull/373) [`118093a`](https://github.com/udecode/kitcn/commit/118093aa97c269b4d6d544b31aa939bd62cb8ec4) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
17
|
+
|
|
18
|
+
- Fix `.output()` validation failures reaching the client as an opaque
|
|
19
|
+
`Server Error`. They now throw a `CRPCError` with code
|
|
20
|
+
`INTERNAL_SERVER_ERROR`, message `Output validation failed`, and sanitized
|
|
21
|
+
structural Zod issues in `error.data.ZodError`, so a handler returning the
|
|
22
|
+
wrong shape names itself without exposing rejected server output.
|
|
23
|
+
`.paginated()` is covered too.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
// A handler that returns the wrong shape
|
|
27
|
+
c.query
|
|
28
|
+
.output(z.object({ ok: z.boolean() }))
|
|
29
|
+
.query(async () => ({ ok: "yes" }));
|
|
30
|
+
|
|
31
|
+
// Client
|
|
32
|
+
error.data.ZodError;
|
|
33
|
+
// [{ expected: 'boolean', code: 'invalid_type', path: ['ok'] }]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- Log server faults from HTTP routes. A route that fails its `.output()` schema
|
|
37
|
+
still answers `500` with only a code and message, but the full error now
|
|
38
|
+
reaches the server log instead of being discarded.
|
|
39
|
+
|
|
40
|
+
- Ship `CHANGELOG.md` in the published package.
|
|
41
|
+
|
|
42
|
+
- Document the `.output()` return contract: the handler returns the schema's
|
|
43
|
+
input type, an `undefined` return is parsed as-is rather than substituted with
|
|
44
|
+
`null`, and an absent value is modelled as `.nullable()` rather than a
|
|
45
|
+
top-level `.optional()`, which Convex's returns validator cannot express.
|
|
46
|
+
|
|
47
|
+
## 0.25.5
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- [#372](https://github.com/udecode/kitcn/pull/372) [`f288304`](https://github.com/udecode/kitcn/commit/f2883042f1c8f9467ea8f1bcb57ee88c43cbdfc2) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
52
|
+
|
|
53
|
+
- Fix `kitcn codegen` and `kitcn dev` aborting on a `generated/server.ts` written
|
|
54
|
+
by an older kitcn, or one that no longer matches the schema. That file is now
|
|
55
|
+
rewritten from the schema before codegen reads any app module, so it repairs
|
|
56
|
+
itself instead of failing every module with the error it is supposed to fix.
|
|
57
|
+
- Keep the procedure names recorded by the last full run when running
|
|
58
|
+
`kitcn codegen --scope auth` or `--scope orm`. Scoped runs no longer blank the
|
|
59
|
+
lookup that middleware reads `procedure.name` from.
|
|
60
|
+
- Fail `kitcn codegen` with the underlying error when `schema.ts` cannot be
|
|
61
|
+
loaded, instead of silently regenerating the app as if it had no ORM schema
|
|
62
|
+
and deleting the generated aggregate entry.
|
|
63
|
+
- Point the aggregate and migration capability setup errors at a step that
|
|
64
|
+
works. They previously advised rerunning the command that had just failed.
|
|
65
|
+
|
|
66
|
+
## 0.25.4
|
|
67
|
+
|
|
68
|
+
### Patch Changes
|
|
69
|
+
|
|
70
|
+
- [#371](https://github.com/udecode/kitcn/pull/371) [`80a8441`](https://github.com/udecode/kitcn/commit/80a84414ea684ac8faedc4b16181594528427079) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
71
|
+
|
|
72
|
+
- Fix large `in` and `notIn` filters across ORM reads, updates, and deletes.
|
|
73
|
+
- Fix large `OR` and `AND` filters exceeding Convex's nesting limit.
|
|
74
|
+
- Reject malformed empty logical filters before scheduled mutations run.
|
|
75
|
+
|
|
76
|
+
## 0.25.3
|
|
77
|
+
|
|
78
|
+
### Patch Changes
|
|
79
|
+
|
|
80
|
+
- [#370](https://github.com/udecode/kitcn/pull/370) [`54c88d1`](https://github.com/udecode/kitcn/commit/54c88d18acbcbe60ae17691ac813384b79e41182) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
81
|
+
|
|
82
|
+
- Fix `count()`, `aggregate()`, `groupBy()`, and relation `_count` so `isNull: true` matches rows whose column is absent from the document, not just rows holding an explicit `null` — matching `findMany()` under the same filter.
|
|
83
|
+
- Emit a single group keyed `null` for an `isNull`-constrained `groupBy()` field, combining every metric over both explicitly-`null` and absent rows.
|
|
84
|
+
- Improve `groupBy()` fan-out guards so merged nullish groups count every physical aggregate bucket probe.
|
|
85
|
+
|
|
86
|
+
## 0.25.2
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- [#352](https://github.com/udecode/kitcn/pull/352) [`942fb08`](https://github.com/udecode/kitcn/commit/942fb084db467fa76722941ede4b77781697cffd) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
91
|
+
|
|
92
|
+
- Cut ~256 KB (−22%) from the bundle Convex deploys for apps without Better Auth. `import { z } from 'zod'` binds zod's namespace object, which pins all 50 translation files; scaffolds and internals now use `import * as z from 'zod'`, which tree-shakes them. Apps using Better Auth are unchanged — it pins the barrel itself.
|
|
93
|
+
- Improve `update().returning()`: it reuses the row it just wrote instead of reading it back, so a matched-row update costs one fewer read per row. Tables with lifecycle hooks or a self-referencing cascade still read back, since either can rewrite the row.
|
|
94
|
+
- Improve `update()` foreign-key checks: a single-column reference supplied by `set()` is validated once per statement instead of once per matched row. Unique-index checks still run per row, as they must.
|
|
95
|
+
- Speed up `kitcn analyze` by bundling entry points concurrently: 2.9 s → 2.1 s on a 20-entry app, with byte-identical output.
|
|
96
|
+
- Reduce `kitcn add <plugin>` from three package-manager installs to two. Saves ~2 s on npm; bun is already fast enough that the difference is noise.
|
|
97
|
+
|
|
98
|
+
## 0.25.1
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- [#343](https://github.com/udecode/kitcn/pull/343) [`3f9631c`](https://github.com/udecode/kitcn/commit/3f9631cad7e07fbe034afba702f84a9318067a77) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
103
|
+
|
|
104
|
+
- Support Convex commit timestamp validators in ORM and Zod conversion.
|
|
105
|
+
- Warn when an installed Convex version is outside the supported minor range.
|
|
106
|
+
- Keep emitted declarations compatible with the minimum supported Convex and
|
|
107
|
+
forward commit timestamp variables through database wrappers.
|
|
108
|
+
|
|
109
|
+
## 0.25.0
|
|
110
|
+
|
|
111
|
+
### Minor Changes
|
|
112
|
+
|
|
113
|
+
- [#342](https://github.com/udecode/kitcn/pull/342) [`3aff976`](https://github.com/udecode/kitcn/commit/3aff976a2d955fb9dc916b94bd3cd39e3e2e418d) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - - Rerun `kitcn codegen` to register aggregate, rank, and migration runtimes through the generated ORM setup.
|
|
114
|
+
- Register `aggregateCapability()` from `kitcn/orm/aggregate-index` and `migrationCapability()` from `kitcn/orm/migrations` when constructing a hand-written ORM that uses those subsystems.
|
|
115
|
+
- Import aggregate backfill argument types from `kitcn/orm/aggregate-index` and migration argument types from `kitcn/orm/migrations`.
|
|
116
|
+
- Keep `kitcn/orm` free of optional aggregate, rank, backfill, and migration runtime imports until the corresponding capability is registered.
|
|
117
|
+
- Run `kitcn aggregate prune` after removing the final aggregate or rank index; the generated maintenance entry remains available and drains large rank trees in bounded chunks.
|
|
118
|
+
- Read authenticated query and mutation sessions with `getSession(ctx)`, and keep authenticated action builders in a separate module that owns `getAuth(ctx)`.
|
|
119
|
+
|
|
120
|
+
## 0.24.0
|
|
121
|
+
|
|
122
|
+
### Minor Changes
|
|
123
|
+
|
|
124
|
+
- [#341](https://github.com/udecode/kitcn/pull/341) [`c255ae2`](https://github.com/udecode/kitcn/commit/c255ae2a9305c3ccd2793b109ef6a259202be906) Thanks [@RatelimitUser](https://github.com/RatelimitUser)! - ## Breaking changes
|
|
125
|
+
|
|
126
|
+
- Resolve `getSignals` before `getIdentifier` in `RatelimitPlugin.configure` and
|
|
127
|
+
pass its result in as `signals`. `getSignals` no longer receives `identifier`,
|
|
128
|
+
and `getIdentifier` also receives `tier`.
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
// Before
|
|
132
|
+
getIdentifier: ({ user }: { user: RatelimitUser | null }) =>
|
|
133
|
+
user?.id ?? 'anonymous',
|
|
134
|
+
getSignals: ({ ctx }: { ctx: RatelimitCtx }) => getRequestSignals(ctx),
|
|
135
|
+
|
|
136
|
+
// After
|
|
137
|
+
getSignals: ({ ctx }: { ctx: RatelimitCtx }) => getRequestSignals(ctx),
|
|
138
|
+
getIdentifier: ({
|
|
139
|
+
user,
|
|
140
|
+
signals,
|
|
141
|
+
}: {
|
|
142
|
+
| null;
|
|
143
|
+
signals: LimitRequest | undefined;
|
|
144
|
+
}) => (user ? user.id : signals?.ip ? `ip:${signals.ip}` : 'ip:unknown'),
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
- Key anonymous rate-limit traffic by request IP instead of one shared
|
|
148
|
+
identifier, so a single visitor can no longer spend every other visitor's
|
|
149
|
+
budget or arm a 24 hour deny-list block against all of them. Run
|
|
150
|
+
`kitcn add ratelimit --overwrite` to take the new plugin.
|
|
151
|
+
- Add `cleanupRatelimitState` and scaffold an indexed, batched private mutation
|
|
152
|
+
for manual cleanup of state older than a caller-owned cutoff. Repeat the
|
|
153
|
+
on-demand call while it returns `hasMore: true`.
|
|
154
|
+
- Store no-arg `crpc.http.*` entries under `['httpQuery', route, {}]` on both the
|
|
155
|
+
client and the RSC server, so a server-prefetched route hydrates instead of
|
|
156
|
+
refetching.
|
|
157
|
+
- Return the exact cache key from `crpc.http.*.queryKey()`, `{}` included, so
|
|
158
|
+
`getQueryData` and `setQueryData` hit. Use `queryFilter()` to match every args
|
|
159
|
+
variant of a route.
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
// Before
|
|
163
|
+
queryClient.getQueryData(["httpQuery", "health", undefined]);
|
|
164
|
+
crpc.http.health.queryKey(); // ['httpQuery', 'health']
|
|
165
|
+
|
|
166
|
+
// After
|
|
167
|
+
queryClient.getQueryData(crpc.http.health.queryKey());
|
|
168
|
+
crpc.http.health.queryKey(); // ['httpQuery', 'health', {}]
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
- Narrow `HttpQueryKey` to that exact three-element key. The route-wide prefix
|
|
172
|
+
`queryFilter()` builds is typed as `HttpQueryPrefixKey`.
|
|
173
|
+
|
|
174
|
+
## Features
|
|
175
|
+
|
|
176
|
+
- Add `timeout`, `dynamicLimits`, `denyList`, and `ephemeralCache` to
|
|
177
|
+
`RatelimitPlugin.configure`. They reach the limiter instead of being dropped.
|
|
178
|
+
|
|
179
|
+
## Patches
|
|
180
|
+
|
|
181
|
+
- Fix `crpc.http.*` routes being fetched twice on first paint. `queryOptions`
|
|
182
|
+
carries a 30 second `staleTime` shared with the RSC QueryClient, overridable
|
|
183
|
+
per call, and `refetchOnMount` keeps its default so a route invalidated while
|
|
184
|
+
unmounted still refetches.
|
|
185
|
+
- Fix the deny list blocking shared NAT and mobile-carrier IPs. Count only
|
|
186
|
+
failures inside a rolling 10-minute window and cache values that reach
|
|
187
|
+
`denyListThreshold` as blocked for up to 24 hours.
|
|
188
|
+
- Fix deny-list memory growing without bound when callers forge `User-Agent`
|
|
189
|
+
headers.
|
|
190
|
+
- Fix `ephemeralCache: false` being ignored while a limit is evaluated, which
|
|
191
|
+
kept an in-memory block cache alive after you disabled it.
|
|
192
|
+
|
|
193
|
+
## 0.23.0
|
|
194
|
+
|
|
195
|
+
### Minor Changes
|
|
196
|
+
|
|
197
|
+
- [#340](https://github.com/udecode/kitcn/pull/340) [`13fbae3`](https://github.com/udecode/kitcn/commit/13fbae321d73801c90423c8f9025fef5f958553d) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Breaking changes
|
|
198
|
+
|
|
199
|
+
- `.output()` is now validated once, against the value your handler returned,
|
|
200
|
+
instead of against its wire encoding. Schemas that transform a value into a
|
|
201
|
+
`Date` (or into any type a custom wire codec owns) now encode correctly
|
|
202
|
+
instead of being rejected, and `.output()` schemas using async refinements
|
|
203
|
+
work. Procedure handlers return the schema input type; generated clients
|
|
204
|
+
receive its output type.
|
|
205
|
+
|
|
206
|
+
```ts
|
|
207
|
+
const at = c.query
|
|
208
|
+
.output(z.object({ at: z.string().transform((s) => new Date(s)) }))
|
|
209
|
+
.query(async () => ({ at: "2024-01-01T00:00:00.000Z" }));
|
|
210
|
+
|
|
211
|
+
// Before: the schema ran after encoding, so the Date left the server raw
|
|
212
|
+
// After: { at: { __crpc: 1, t: '$date', v: 1704067200000 } }
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
- `.output()` parses the handler's value as-is and no longer substitutes `null`
|
|
216
|
+
for an `undefined` return. A nullable schema needs an explicit `null`; in
|
|
217
|
+
exchange, `.output(z.string().default(...))` now applies its default to an
|
|
218
|
+
`undefined` return instead of rejecting it. The low-level `returns:` option
|
|
219
|
+
still substitutes. Handlers were already typed to return the schema's input
|
|
220
|
+
type, so TypeScript rejects this ahead of runtime except where a lookup is
|
|
221
|
+
typed as always-present — an index signature or `array[0]` under the default
|
|
222
|
+
`noUncheckedIndexedAccess: false`.
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
const name = c.query
|
|
226
|
+
.input(z.object({ id: z.string() }))
|
|
227
|
+
.output(z.string().nullable())
|
|
228
|
+
// Before: an `undefined` return was parsed as `null`
|
|
229
|
+
// After: coalesce it
|
|
230
|
+
.query(async ({ input }) => names[input.id] ?? null);
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Features
|
|
234
|
+
|
|
235
|
+
- `zCustomQuery`, `zCustomMutation` and `zCustomAction` accept
|
|
236
|
+
`skipZodReturnsValidation`, so `returns` can declare the Convex validator and
|
|
237
|
+
the return type without also parsing the response in JS. The handler is then
|
|
238
|
+
typed as the schema's output, since that value reaches Convex unchanged.
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
zCustomQuery(
|
|
242
|
+
query,
|
|
243
|
+
customCtx(withUser)
|
|
244
|
+
)({
|
|
245
|
+
args: { id: z.string() },
|
|
246
|
+
returns: z.object({ name: z.string() }),
|
|
247
|
+
skipZodReturnsValidation: true,
|
|
248
|
+
handler,
|
|
249
|
+
});
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
- Wire codecs accept `objectsOnly`, declaring that `isType` never claims a
|
|
253
|
+
primitive. `serialize` then skips codec dispatch on primitive values.
|
|
254
|
+
|
|
255
|
+
```ts
|
|
256
|
+
const mapCodec: WireCodec = {
|
|
257
|
+
tag: "$map",
|
|
258
|
+
objectsOnly: true,
|
|
259
|
+
isType: (value) => value instanceof Map,
|
|
260
|
+
encode: (value) => [...value],
|
|
261
|
+
decode: (value) => new Map(value),
|
|
262
|
+
};
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Patches
|
|
266
|
+
|
|
267
|
+
- Cut one full traversal of every response with an `.output()` or
|
|
268
|
+
`.paginated()` declaration.
|
|
269
|
+
- Reuse the argument schema and its parse cache across requests instead of
|
|
270
|
+
rebuilding them on every procedure call.
|
|
271
|
+
- Resolve the multi-`.input()` merge plan when the procedure is defined.
|
|
272
|
+
Declaring a key that `.paginated()` also declares no longer clones a schema
|
|
273
|
+
on every request.
|
|
274
|
+
- Skip codec dispatch on primitive values while encoding the built-in `Date`
|
|
275
|
+
payloads, and stop walking a payload twice per direction when a transformer
|
|
276
|
+
is passed to a server-side caller.
|
|
277
|
+
- Resolve HTTP `searchParams` coercion per route instead of per request, and
|
|
278
|
+
read the query string in a single pass.
|
|
279
|
+
- Convert an `.input()` shape to its Convex validator once per procedure
|
|
280
|
+
instead of three times.
|
|
281
|
+
|
|
282
|
+
## 0.22.1
|
|
283
|
+
|
|
284
|
+
### Patch Changes
|
|
285
|
+
|
|
286
|
+
- [#356](https://github.com/udecode/kitcn/pull/356) [`f5d9edd`](https://github.com/udecode/kitcn/commit/f5d9edd62670ce098bb18d7f4987ec1f3b3365aa) Thanks [@zbeyens](https://github.com/zbeyens)! - Fix prefetched optional React pagination remaining disabled after authentication
|
|
287
|
+
settles.
|
|
288
|
+
|
|
289
|
+
## 0.22.0
|
|
290
|
+
|
|
291
|
+
### Minor Changes
|
|
292
|
+
|
|
293
|
+
- [#339](https://github.com/udecode/kitcn/pull/339) [`ed72944`](https://github.com/udecode/kitcn/commit/ed72944a45e7cae642bd33c7b20dff2968c70508) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Features
|
|
294
|
+
|
|
295
|
+
- Support stable identity values from custom Solid auth providers.
|
|
296
|
+
|
|
297
|
+
## Patches
|
|
298
|
+
|
|
299
|
+
- Fix function-form `enabled` predicates in `kitcn/solid` query options so
|
|
300
|
+
they gate both requests and live subscriptions.
|
|
301
|
+
- Fix unauthenticated `auth: "required"` Solid action queries to reject locally with
|
|
302
|
+
`CRPCClientError`, matching the React bindings.
|
|
303
|
+
- Fix auth-bound cached data crossing identity transitions. Unobserved entries are
|
|
304
|
+
removed; mounted entries are rebuilt without their previous `initialData`,
|
|
305
|
+
return to pending without prior-account placeholder data, and refetch for the
|
|
306
|
+
new account.
|
|
307
|
+
|
|
308
|
+
- Fix `kitcn/solid` paginated lists on an `auth: 'required'` function never
|
|
309
|
+
issuing a query. Auth state is tracked, so a list mounted before sign-in loads
|
|
310
|
+
once auth settles instead of showing a permanent loading state, and logging
|
|
311
|
+
out stops its page subscriptions.
|
|
312
|
+
- Fix `kitcn/solid` tearing down a Convex subscription that another mounted
|
|
313
|
+
component still needs when two components share a query key and one passes
|
|
314
|
+
`enabled: false`. The remaining component keeps receiving real-time updates.
|
|
315
|
+
- Fix `skipUnauth` being ignored by `kitcn/solid`. Queries marked
|
|
316
|
+
`skipUnauth: true` resolve to `null` on an unauthorized result instead of
|
|
317
|
+
sticking in an error state.
|
|
318
|
+
- Fix `kitcn/solid` re-authenticating Convex on every JWT write. Signing in
|
|
319
|
+
authenticates once instead of three times, and a scheduled token refresh no
|
|
320
|
+
longer pauses the socket and re-runs every live subscription.
|
|
321
|
+
- Fix `kitcn/solid` ignoring a `useAuth` that returns a new `fetchAccessToken`.
|
|
322
|
+
Convex is rebound to the current fetcher instead of refreshing through the one
|
|
323
|
+
captured for the previous session.
|
|
324
|
+
- Fix provider-driven identity transitions retaining the previous account's
|
|
325
|
+
auth-bound cache or Convex binding. `ConvexProviderWithAuth` accepts an
|
|
326
|
+
optional stable `identity`; providers that omit it retain the safe legacy
|
|
327
|
+
behavior of rebinding on reactive auth changes. Replacing a Better Auth
|
|
328
|
+
session also invalidates its cached JWT and abandons in-flight token requests
|
|
329
|
+
owned by the previous session before authenticating the new one. SSR tokens
|
|
330
|
+
remain hydration fallbacks only until a client session is confirmed and
|
|
331
|
+
cannot seed that session's cache identity. The first settled client identity
|
|
332
|
+
clears auth-bound hydration state when its ownership cannot be proven.
|
|
333
|
+
- Fix an account transition leaving the previous account's rows in disabled,
|
|
334
|
+
unobserved, or non-subscribed queries.
|
|
335
|
+
- Fix a paginated list restoring the previous account's cursors after signing
|
|
336
|
+
in or out. An auth-bound list starts again from its first page instead of
|
|
337
|
+
paging from cursors that point into another account's results.
|
|
338
|
+
- Fix an auth-bound query refetching everything on every scheduled token
|
|
339
|
+
refresh. A refreshed JWT for the same account leaves the cache alone; only an
|
|
340
|
+
authorization identity change clears it, including tenant or role claims
|
|
341
|
+
changing inside the same Better Auth session.
|
|
342
|
+
- Fix sign-in and sign-up mutations clearing auth-bound queries before Convex
|
|
343
|
+
adopts the new identity. The provider clears previous-account data while the
|
|
344
|
+
binding changes, holds mounted observers idle, then restores and refetches
|
|
345
|
+
only after Convex reports the transition as settled. Sign-out follows the
|
|
346
|
+
same provider-owned transition.
|
|
347
|
+
- Fix custom Solid Convex auth being replaced by the fallback Better Auth
|
|
348
|
+
store. Query subscriptions follow the custom provider, settled identity and
|
|
349
|
+
account epoch instead of remaining blocked or reusing another account's
|
|
350
|
+
pagination state.
|
|
351
|
+
- Fix account transitions retaining obsolete pagination ID entries. Pagination
|
|
352
|
+
state in the QueryClient remains the persistence owner without a second
|
|
353
|
+
process-wide key map.
|
|
354
|
+
- Fix prefetched optional pagination queries fetching while authentication is
|
|
355
|
+
loading. Hydrated data remains readable, but its observer stays disabled
|
|
356
|
+
until the auth binding settles.
|
|
357
|
+
- Fix overlapping auth transitions restoring stale observer options or letting
|
|
358
|
+
an older settlement refetch during a newer identity change. Only the latest
|
|
359
|
+
transition can restore and refetch, and option updates made while observers
|
|
360
|
+
are suspended remain authoritative.
|
|
361
|
+
- Keep auth-bound queries mounted during a Solid identity transition disabled
|
|
362
|
+
until Convex confirms the new identity. Both one-shot requests and live
|
|
363
|
+
subscriptions wait behind the same client-owned settlement barrier.
|
|
364
|
+
- Ignore Convex auth-settlement callbacks from superseded bindings. A late
|
|
365
|
+
callback from an older account cannot republish that identity or reopen the
|
|
366
|
+
query barrier during a newer transition.
|
|
367
|
+
|
|
368
|
+
## 0.21.0
|
|
369
|
+
|
|
370
|
+
### Minor Changes
|
|
371
|
+
|
|
372
|
+
- [#338](https://github.com/udecode/kitcn/pull/338) [`7163710`](https://github.com/udecode/kitcn/commit/7163710aea8ec3758af04128836027aca8bf724b) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Breaking changes
|
|
373
|
+
|
|
374
|
+
- `createClient` now takes a `getBetterAuthSchema` thunk and its `adapter(ctx)`
|
|
375
|
+
takes only the context. The Better Auth table schema is derived once for the
|
|
376
|
+
isolate and shared, instead of every adapter re-deriving it. `dbAdapter` drops
|
|
377
|
+
its options-getter argument for the same reason.
|
|
378
|
+
|
|
379
|
+
```ts
|
|
380
|
+
// Before
|
|
381
|
+
const authClient = createClient({ authFunctions, schema });
|
|
382
|
+
const database = authClient.adapter(ctx, getAuthOptions);
|
|
383
|
+
|
|
384
|
+
// After
|
|
385
|
+
const authClient = createClient({
|
|
386
|
+
authFunctions,
|
|
387
|
+
getBetterAuthSchema,
|
|
388
|
+
schema,
|
|
389
|
+
});
|
|
390
|
+
const database = authClient.adapter(ctx);
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## Patches
|
|
394
|
+
|
|
395
|
+
- Improve authenticated request latency: `getAuth(ctx)` evaluates your
|
|
396
|
+
`defineAuth` callback once per request instead of twice.
|
|
397
|
+
- Improve `admin.listUsers` and other counted reads: totals no longer hold every
|
|
398
|
+
matching row in memory while paginating.
|
|
399
|
+
- Improve Better Auth record updates: an update is one Convex call that reads
|
|
400
|
+
the row once, instead of a separate pre-check call that read it again. The
|
|
401
|
+
"expected exactly 1 match" error now comes from the write itself, so it can no
|
|
402
|
+
longer be invalidated by a concurrent insert or delete.
|
|
403
|
+
- Improve auth request CPU: the Convex auth plugin reuses its OIDC provider, and
|
|
404
|
+
unique-field lookups no longer rescan the auth schema on every read and write.
|
|
405
|
+
- Fix session recovery from a persisted token issuing a fixed 250ms delay plus
|
|
406
|
+
up to ten `/get-session` requests. A live token is recovered with one immediate
|
|
407
|
+
request, a server-confirmed missing session stops after one, and only transport
|
|
408
|
+
failures retry.
|
|
409
|
+
- Fix a dropped `/get-session` request signing the user out. Transport failures
|
|
410
|
+
retry with backoff for the rest of the session-sync grace window, so a session
|
|
411
|
+
is restored in the same mount once connectivity returns.
|
|
412
|
+
- Fix an outage during session recovery leaving the app stuck on `isLoading`.
|
|
413
|
+
When the grace window closes with no answer, auth resolves to unauthenticated
|
|
414
|
+
instead of holding a token no request ever confirmed. The persisted token is
|
|
415
|
+
kept so the next mount can retry it.
|
|
416
|
+
|
|
417
|
+
## 0.20.0
|
|
418
|
+
|
|
419
|
+
### Minor Changes
|
|
420
|
+
|
|
421
|
+
- [#337](https://github.com/udecode/kitcn/pull/337) [`5d3172b`](https://github.com/udecode/kitcn/commit/5d3172b260bba6d44ba06b5639c22711c0d58f79) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Breaking changes
|
|
422
|
+
|
|
423
|
+
- Range-filtered `count()` and `aggregate()` now stop at `aggregateWorkBudget`
|
|
424
|
+
work units and throw `COUNT_FILTER_UNSUPPORTED` /
|
|
425
|
+
`AGGREGATE_FILTER_UNSUPPORTED` naming the index, instead of reading the whole
|
|
426
|
+
equality prefix and failing on Convex's transaction read limit. Bucket scans
|
|
427
|
+
cost one unit; `_min` and `_max` also reserve one extrema read per matching
|
|
428
|
+
bucket. One budget covers every `IN` prefix and extrema metric sharing the
|
|
429
|
+
range plan. Raise it cautiously if a wide range scan is intentional.
|
|
430
|
+
|
|
431
|
+
```ts
|
|
432
|
+
// Before
|
|
433
|
+
export default defineSchema({ runs });
|
|
434
|
+
|
|
435
|
+
// After
|
|
436
|
+
export default defineSchema(
|
|
437
|
+
{ runs },
|
|
438
|
+
// Keep headroom below Convex's 32,000-document transaction ceiling.
|
|
439
|
+
{ defaults: { aggregateWorkBudget: 20_000 } }
|
|
440
|
+
);
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
## Features
|
|
444
|
+
|
|
445
|
+
- `kitcn aggregate rebuild` and index pruning clear stored aggregate state in
|
|
446
|
+
scheduled batches, so rebuilding or dropping an `aggregateIndex` / `rankIndex`
|
|
447
|
+
on a large table no longer has to fit in a single Convex mutation. Indexes
|
|
448
|
+
report a `CLEARING` status while draining, and `kitcn aggregate prune` reports
|
|
449
|
+
how many removed indexes are still being cleared in the background.
|
|
450
|
+
- ORM writes targeting a declared index in `CLEARING` fail before the document
|
|
451
|
+
write. Retry after the index advances to `BUILDING` or `READY`; this prevents
|
|
452
|
+
concurrent writes from being erased by a multi-mutation clear.
|
|
453
|
+
- Automatic pruning follows canonical aggregate lifecycle state instead of
|
|
454
|
+
reverse-scanning every distinct backing-table index. Exact `tableName` and
|
|
455
|
+
`indexName` handler arguments retain bounded recovery for state-less storage.
|
|
456
|
+
|
|
457
|
+
## Patches
|
|
458
|
+
|
|
459
|
+
- Reduce database reads per rank-index write: the btree descent no longer
|
|
460
|
+
re-queries the tree document at every node, re-reads nodes it just wrote, or
|
|
461
|
+
re-reads the child it descends into.
|
|
462
|
+
- Reduce database reads for `rank().min()`, `rank().max()` and `rank().random()`
|
|
463
|
+
by dropping a redundant count scan per call.
|
|
464
|
+
- Reduce document writes during aggregate backfill: a page of rows sharing a key
|
|
465
|
+
tuple now writes its bucket once instead of once per row.
|
|
466
|
+
- Stop writing `aggregate_member` rows when a mutation changes no aggregated
|
|
467
|
+
field.
|
|
468
|
+
- Improve `count()` and `aggregate()` latency for multi-value `IN` filters and
|
|
469
|
+
for `_min` / `_max` by issuing independent bucket reads through a bounded pool.
|
|
470
|
+
- Keep a partially cleared index in `CLEARING` when an error interrupts a
|
|
471
|
+
rebuild, so a retry resumes clearing instead of building over stale buckets.
|
|
472
|
+
|
|
473
|
+
## 0.19.0
|
|
474
|
+
|
|
475
|
+
### Minor Changes
|
|
476
|
+
|
|
477
|
+
- [#336](https://github.com/udecode/kitcn/pull/336) [`aba33f5`](https://github.com/udecode/kitcn/commit/aba33f55f1eacacdf36c8408391068a7e3868132) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Breaking changes
|
|
478
|
+
|
|
479
|
+
- Read `.select().where({ id: { in: [...] } })` in the order the ids are given
|
|
480
|
+
instead of creation order. Each page reads only the listed positions it
|
|
481
|
+
visits rather than the complete ID list; missing or policy-filtered ids still
|
|
482
|
+
count as reads. Add `orderBy` to keep creation order. Cursors issued by the
|
|
483
|
+
previous behavior are not portable.
|
|
484
|
+
|
|
485
|
+
```ts
|
|
486
|
+
// Before — creation order, and every page read the whole id list
|
|
487
|
+
await ctx.orm.query.posts
|
|
488
|
+
.select()
|
|
489
|
+
.where({ id: { in: ids } })
|
|
490
|
+
.map((row) => row)
|
|
491
|
+
.paginate({ cursor, limit: 10 });
|
|
492
|
+
|
|
493
|
+
// After — same call, rows come back in the order `ids` lists them
|
|
494
|
+
await ctx.orm.query.posts
|
|
495
|
+
.select()
|
|
496
|
+
.where({ id: { in: ids } })
|
|
497
|
+
.map((row) => row)
|
|
498
|
+
.paginate({ cursor, limit: 10 });
|
|
499
|
+
|
|
500
|
+
// After — creation order, which still reads every id in the list
|
|
501
|
+
await ctx.orm.query.posts
|
|
502
|
+
.select()
|
|
503
|
+
.where({ id: { in: ids } })
|
|
504
|
+
.orderBy({ createdAt: "asc" })
|
|
505
|
+
.map((row) => row)
|
|
506
|
+
.paginate({ cursor, limit: 10 });
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
## Patches
|
|
510
|
+
|
|
511
|
+
- Fix `.distinct({ fields })` on more than one field growing exponentially more
|
|
512
|
+
expensive with each row returned, which made pages of about twenty rows fail
|
|
513
|
+
to return at all.
|
|
514
|
+
- Fix `.distinct({ fields })` over `.union(...).interleaveBy(...)` slowing down
|
|
515
|
+
sharply as the number of returned rows grows.
|
|
516
|
+
- Support `maxScan` on paginated `where: { id: { in: [...] } }` reads, including
|
|
517
|
+
reads ordered by a single indexed field.
|
|
518
|
+
- Improve paginated reads to register fewer Convex queries per page, and to
|
|
519
|
+
release the ones they opened when a page stops early.
|
|
520
|
+
- Improve the per-row cost of every stream-backed read.
|
|
521
|
+
|
|
522
|
+
## 0.18.0
|
|
523
|
+
|
|
524
|
+
### Minor Changes
|
|
525
|
+
|
|
526
|
+
- [#335](https://github.com/udecode/kitcn/pull/335) [`9b3494d`](https://github.com/udecode/kitcn/commit/9b3494de4a057612b718b8c522d99c012926832f) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Breaking changes
|
|
527
|
+
|
|
528
|
+
- Fix `orderBy` returning the wrong rows when the `where` pins only part of a
|
|
529
|
+
compound index. Ordering by `createdAt` under `where: { type: 'a' }` on an
|
|
530
|
+
index of `(type, numLikes)` used to hand back the rows sorted by `numLikes`.
|
|
531
|
+
It now returns creation order. Queries in that shape return different rows
|
|
532
|
+
than before, and under `cursor` pagination with `strict` they now report that
|
|
533
|
+
the field has no usable index instead of paginating in the wrong order.
|
|
534
|
+
|
|
535
|
+
```ts
|
|
536
|
+
// Schema: index('numLikesAndType').on(t.type, t.numLikes)
|
|
537
|
+
|
|
538
|
+
// Before — returned the two most-liked posts
|
|
539
|
+
// After — returns the two newest posts, as asked
|
|
540
|
+
await ctx.orm.query.posts.findMany({
|
|
541
|
+
where: { type: "a" },
|
|
542
|
+
orderBy: { createdAt: "desc" },
|
|
543
|
+
limit: 2,
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
// Pinning the narrower index leaves creation time as the implicit next key
|
|
547
|
+
index("by_type").on(t.type);
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
- Change which rows a `.through()` relation returns for a given `limit`. Each
|
|
551
|
+
parent now gets its own first `limit` links instead of a window over the
|
|
552
|
+
order in which targets happened to be discovered across the whole page.
|
|
553
|
+
`orderBy` on a through relation is unaffected.
|
|
554
|
+
|
|
555
|
+
## Patches
|
|
556
|
+
|
|
557
|
+
- Push `limit` and `orderBy` on a `many()` relation into the relation index.
|
|
558
|
+
`with: { posts: { limit: 5, orderBy: { createdAt: 'desc' } } }` reads five
|
|
559
|
+
posts per parent instead of every post of every parent.
|
|
560
|
+
- Bound `.through()` relation reads by the requested `limit` instead of reading
|
|
561
|
+
every junction row of every parent. Links whose target is missing or is
|
|
562
|
+
dropped by RLS or the relation `where` do not consume a slot, so the page
|
|
563
|
+
still comes back full.
|
|
564
|
+
- Fill `limit` with rows that survive RLS and relation `where` instead of
|
|
565
|
+
filtering after the read. `findMany({ where: { ownerId }, limit: 3 })` on a
|
|
566
|
+
table with a select policy used to return only whichever of the first three
|
|
567
|
+
stored rows happened to be visible — often none.
|
|
568
|
+
- Push `limit` into `in`, `notIn`, `ne` and `isNotNull` reads, which previously
|
|
569
|
+
read every matching row and sliced afterwards.
|
|
570
|
+
- Use an index for `in` combined with another filter — `where: { status: { in:
|
|
571
|
+
[...] }, name: { contains: 'x' } }` scanned the whole table.
|
|
572
|
+
- Order by a field the `where` does not pin without reading the whole bucket,
|
|
573
|
+
as long as the index sorts by it next.
|
|
574
|
+
- Prefer an index that also supplies the requested order, so a compound
|
|
575
|
+
`(tenantId, createdAt)` is chosen over a narrow `(tenantId)` for a
|
|
576
|
+
tenant-scoped feed.
|
|
577
|
+
- Serve `orderBy` on the leading field of a pinned `.withIndex()` from the
|
|
578
|
+
index instead of scanning the table.
|
|
579
|
+
- Stop loading nested `with:` data, extras and column selection for relation
|
|
580
|
+
rows that the per-parent `limit` or `offset` then discards. Deeply nested
|
|
581
|
+
reads that previously failed the relation fan-out guard now succeed.
|
|
582
|
+
- Read each shared target once when counting a `.through()` relation with a
|
|
583
|
+
`where`, instead of once per parent row.
|
|
584
|
+
- Reuse aggregate bucket reads across rows of a `with._count`.
|
|
585
|
+
- Build the ORM once per request instead of twice; the RLS bypass client is
|
|
586
|
+
now created only when it is used.
|
|
587
|
+
- Reduce per-row work on filtered reads, relation counts, and query planning.
|
|
588
|
+
|
|
589
|
+
## 0.17.5
|
|
590
|
+
|
|
591
|
+
### Patch Changes
|
|
592
|
+
|
|
593
|
+
- [#332](https://github.com/udecode/kitcn/pull/332) [`2609245`](https://github.com/udecode/kitcn/commit/2609245de4e468715e4691f9a159c88a659d4f75) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
594
|
+
|
|
595
|
+
- Fix auth-bound queries being reset every time Convex refreshes the access
|
|
596
|
+
token. Convex rotates the token roughly every 15 minutes and on every socket
|
|
597
|
+
reauth, and each mint carried a new timestamp, so the whole page flashed back
|
|
598
|
+
to its loading state and every query ran twice against the backend. Queries now
|
|
599
|
+
keep their data and their live subscriptions across a refresh, and still reset
|
|
600
|
+
on a real identity change — sign in, sign out, session rotation, or an
|
|
601
|
+
organization/role switch.
|
|
602
|
+
- Fix `fetchNextPage` from `useInfiniteQuery` getting a new identity on every
|
|
603
|
+
render, which re-registered any effect keyed on it — including the
|
|
604
|
+
infinite-scroll observer pattern the docs recommend. It is now stable for the
|
|
605
|
+
life of the hook.
|
|
606
|
+
- Improve `useInfiniteQuery` to reuse its page queries and aggregation across
|
|
607
|
+
unrelated re-renders, instead of re-hashing arguments once per loaded page and
|
|
608
|
+
re-scanning every loaded item.
|
|
609
|
+
- Improve `queryOptions()` to keep its result referentially stable when nothing
|
|
610
|
+
changed, including the two-argument form with inline options.
|
|
611
|
+
- Fix query options losing referential stability entirely on pages that hold more
|
|
612
|
+
than 500 distinct sets of query arguments.
|
|
613
|
+
- Improve `useCRPC()` and `useCRPCClient()` to return the same value across
|
|
614
|
+
renders, so they are safe to place in a dependency array.
|
|
615
|
+
- Improve real-time updates to skip a redundant query-key hash per pushed query.
|
|
616
|
+
|
|
617
|
+
## 0.17.4
|
|
618
|
+
|
|
619
|
+
### Patch Changes
|
|
620
|
+
|
|
621
|
+
- [#331](https://github.com/udecode/kitcn/pull/331) [`23c0c99`](https://github.com/udecode/kitcn/commit/23c0c999adda8aab66d4d4f88806368fbcff8d2f) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
622
|
+
|
|
623
|
+
- Improve mutation latency on tables with triggers, `aggregateIndex()` or
|
|
624
|
+
`rankIndex()`. Writes no longer re-read the document after patching or
|
|
625
|
+
replacing it, and no longer read it at all when no hook consumes it.
|
|
626
|
+
- Improve `update()` and `delete()` cascade latency: `set null`, `set default`
|
|
627
|
+
and cascade-update fan-out now apply their patches concurrently with a
|
|
628
|
+
bounded pool instead of one round trip at a time. Tables with hooks keep
|
|
629
|
+
their strict write order.
|
|
630
|
+
- Improve read throughput on row-level-security tables. Policy `using` /
|
|
631
|
+
`withCheck` callbacks run once per query execution or write-free mutation
|
|
632
|
+
decision batch instead of once per returned row. Multi-row insert and delete
|
|
633
|
+
re-resolve stateful policies after each write.
|
|
634
|
+
- Fix row-level-security visibility when one query object is awaited more than
|
|
635
|
+
once. Every await re-resolves the table's policies, so a policy that reads
|
|
636
|
+
the database sees writes made between the two awaits.
|
|
637
|
+
- Improve CPU cost of every ORM read and every `returning()` row by reshaping
|
|
638
|
+
documents in a single pass.
|
|
639
|
+
- Improve `returning({ _count })` on multi-row mutations: the aggregate-index
|
|
640
|
+
readiness check now runs once per index instead of once per row.
|
|
641
|
+
- Improve cascade delete throughput on schemas with many triggered or
|
|
642
|
+
aggregate-indexed tables by removing per-row table-name probing.
|
|
643
|
+
- Improve mutations that issue concurrent writes to a hooked table: the
|
|
644
|
+
internal write lock now hands off to one waiter instead of waking all of
|
|
645
|
+
them.
|
|
646
|
+
- Fix `kitcn codegen` dropping nested cRPC HTTP routes when parsing projects
|
|
647
|
+
through generated server placeholders.
|
|
648
|
+
|
|
649
|
+
## 0.17.3
|
|
650
|
+
|
|
651
|
+
### Patch Changes
|
|
652
|
+
|
|
653
|
+
- [#330](https://github.com/udecode/kitcn/pull/330) [`b78d94a`](https://github.com/udecode/kitcn/commit/b78d94a53d2f044816944317acea0ee9973739d8) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
654
|
+
|
|
655
|
+
- Start the CLI faster. esbuild, Babel, jiti, dotenv and the interactive prompt
|
|
656
|
+
stack are loaded the first time a command needs them instead of on every
|
|
657
|
+
invocation, so `kitcn --version`, `kitcn --help` and `--json` calls no longer
|
|
658
|
+
pay for tooling they never use.
|
|
659
|
+
- Run `kitcn codegen` with less repeated work: one module loader per run instead
|
|
660
|
+
of two, and the parse shim resolved once instead of once per Convex module.
|
|
661
|
+
- Speed up `kitcn add`, `kitcn view` and `kitcn info` on large schemas by
|
|
662
|
+
parsing each schema revision once instead of once per managed table.
|
|
663
|
+
- Speed up `kitcn init` and `kitcn add` file comparison, which no longer copies
|
|
664
|
+
and serializes both syntax trees before comparing them.
|
|
665
|
+
- Fix `kitcn dev` ignoring edits to shared routers, builders and contracts that
|
|
666
|
+
sit next to the functions directory. Changing one regenerates the api like
|
|
667
|
+
changing a function file does, for any functions path configured in
|
|
668
|
+
`convex.json`.
|
|
669
|
+
- Generate api and procedure metadata in a stable order regardless of the
|
|
670
|
+
filesystem's directory listing order.
|
|
671
|
+
- Shrink the `kitcn dev` file watcher, which no longer loads the rest of the CLI
|
|
672
|
+
into the background process it keeps alive for the session.
|
|
673
|
+
|
|
674
|
+
## 0.17.2
|
|
675
|
+
|
|
676
|
+
### Patch Changes
|
|
677
|
+
|
|
678
|
+
- [#329](https://github.com/udecode/kitcn/pull/329) [`c853115`](https://github.com/udecode/kitcn/commit/c853115311cc6b2645c47736db529731af3fc2c6) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
679
|
+
|
|
680
|
+
- Fix `useInfiniteQuery` from `kitcn/solid` crashing with `state.map is not a function` on every mount.
|
|
681
|
+
- Update Solid infinite query results field by field, so a component reading `status` is not re-run when only `data` changes.
|
|
682
|
+
|
|
683
|
+
## 0.17.1
|
|
684
|
+
|
|
685
|
+
### Patch Changes
|
|
686
|
+
|
|
687
|
+
- [#324](https://github.com/udecode/kitcn/pull/324) [`0536f17`](https://github.com/udecode/kitcn/commit/0536f17bbd22f11d325c26c5e64bed160825a908) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
688
|
+
|
|
689
|
+
- Fix `kitcn codegen` emitting both the `api` and `internal` type imports into
|
|
690
|
+
generated runtime files that only reference one of them. A module whose
|
|
691
|
+
procedures are all internal, or all public, no longer carries an unused import
|
|
692
|
+
that editors grey out and that `tsc` rejects with `TS6196` when
|
|
693
|
+
`noUnusedLocals` is enabled. Each generated runtime now imports only the api
|
|
694
|
+
roots its procedures reference.
|
|
695
|
+
|
|
696
|
+
- [#326](https://github.com/udecode/kitcn/pull/326) [`6196625`](https://github.com/udecode/kitcn/commit/6196625d8ce3e9bd08f25373a7e536a43718b167) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
697
|
+
|
|
698
|
+
- Fix `CRPCError` reaching the client as a bare `Error` with the message
|
|
699
|
+
redacted to `Server Error` and `error.data` undefined. Errors converted by
|
|
700
|
+
cRPC — a procedure calling another procedure through a caller, an ORM
|
|
701
|
+
not-found, a Better Auth `APIError`, or any error wrapped by
|
|
702
|
+
`getCRPCErrorFromUnknown` — now arrive as a `ConvexError` carrying the
|
|
703
|
+
original `code`, `message`, and custom `data`.
|
|
704
|
+
|
|
705
|
+
```ts
|
|
706
|
+
// convex/functions/payment.ts — internal procedure
|
|
707
|
+
throw new CRPCError({
|
|
708
|
+
code: "BAD_REQUEST",
|
|
709
|
+
message: "Declined: INSUFFICIENT_FUNDS",
|
|
710
|
+
data: { processorCode },
|
|
711
|
+
});
|
|
712
|
+
|
|
713
|
+
// Before — the public procedure delegating to it lost the reason
|
|
714
|
+
onError: (error) => {
|
|
715
|
+
error.data; // undefined
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
// After
|
|
719
|
+
onError: (error) => {
|
|
720
|
+
error.data; // { code: 'BAD_REQUEST', message: 'Declined: …', processorCode }
|
|
721
|
+
};
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
- Fix converted errors losing every source-mapped frame in Convex dashboard
|
|
725
|
+
logs. Traces carry frames again; the original throw site stays on
|
|
726
|
+
`error.cause`.
|
|
727
|
+
|
|
728
|
+
## 0.17.0
|
|
729
|
+
|
|
730
|
+
### Minor Changes
|
|
731
|
+
|
|
732
|
+
- [#322](https://github.com/udecode/kitcn/pull/322) [`b80d734`](https://github.com/udecode/kitcn/commit/b80d73402165543c91c7f83bba3eae59a6a82184) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Breaking changes
|
|
733
|
+
|
|
734
|
+
- `kitcn add` no longer replaces scaffold files you have edited. Files that still
|
|
735
|
+
match the scaffold are upgraded as before; edited files are kept, listed under
|
|
736
|
+
`Refused files`, and the command exits `1` because the plugin is only partially
|
|
737
|
+
installed. Pass `--overwrite` for the previous behavior.
|
|
738
|
+
|
|
739
|
+
```bash
|
|
740
|
+
# Before — edits to crpc.ts were replaced, exit 0
|
|
741
|
+
kitcn add auth --yes
|
|
742
|
+
|
|
743
|
+
# After — edits are kept and the run fails until you choose
|
|
744
|
+
kitcn add auth --yes --overwrite
|
|
745
|
+
```
|
|
746
|
+
|
|
747
|
+
- `kitcn add --json` splits the old `skipped` list in two. `skipped` now means
|
|
748
|
+
"already up to date", refused files move to `refused`, and `complete` reports
|
|
749
|
+
whether everything was applied.
|
|
750
|
+
|
|
751
|
+
```jsonc
|
|
752
|
+
// Before
|
|
753
|
+
{ "skipped": ["convex/lib/crpc.ts"] }
|
|
754
|
+
|
|
755
|
+
// After
|
|
756
|
+
{ "skipped": [], "refused": ["convex/lib/crpc.ts"], "complete": false }
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
## Patches
|
|
760
|
+
|
|
761
|
+
- Fix `kitcn codegen` leaving a hidden parse snapshot behind when a Convex module
|
|
762
|
+
fails to load, which kept reporting the old error after the real file was
|
|
763
|
+
fixed. Codegen evaluates modules in memory instead of mirroring them to a
|
|
764
|
+
sibling file, so it no longer writes to — or deletes from — your Convex
|
|
765
|
+
directory, and import-time stack traces now point at the real module rather
|
|
766
|
+
than a temporary path. A file of your own ending in `.kitcn-parse.ts` is left
|
|
767
|
+
untouched.
|
|
768
|
+
- Fix plugin registration landing inside a comment or string that happens to
|
|
769
|
+
mention `defineSchema(`, which recorded the plugin as installed while its
|
|
770
|
+
tables and relations never reached the schema.
|
|
771
|
+
- Fix `kitcn add auth` deleting a table's index callback when it was written as a
|
|
772
|
+
block-bodied arrow or a named function. The callback is now preserved while
|
|
773
|
+
managed fields are merged.
|
|
774
|
+
- Fix schema patching merging value imports into a type-only `kitcn/orm` import,
|
|
775
|
+
which produced duplicate identifiers, and skipping the import entirely when
|
|
776
|
+
only `import * as orm from 'kitcn/orm'` was present.
|
|
777
|
+
|
|
778
|
+
- [#320](https://github.com/udecode/kitcn/pull/320) [`799dc4f`](https://github.com/udecode/kitcn/commit/799dc4f80ab998646fd1960fbf82d6f536e5317a) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Breaking changes
|
|
779
|
+
|
|
780
|
+
- Improve Convex and HTTP middleware to wrap the whole procedure: `next()`
|
|
781
|
+
resolves after the handler runs, so timing, error reporting, and cleanup
|
|
782
|
+
around it observe the handler, and handler errors propagate through every
|
|
783
|
+
wrapping `catch`. A `ctx` changed on the return path no longer reaches the
|
|
784
|
+
handler — pass it to `next()` instead.
|
|
785
|
+
|
|
786
|
+
```ts
|
|
787
|
+
// Before — logged 0ms, never saw handler errors, and this ctx was ignored
|
|
788
|
+
.use(async ({ ctx, next }) => {
|
|
789
|
+
const start = Date.now();
|
|
790
|
+
const result = await next({ ctx });
|
|
791
|
+
console.log(`${Date.now() - start}ms`);
|
|
792
|
+
return { ...result, ctx: { ...ctx, tenant } };
|
|
793
|
+
})
|
|
794
|
+
|
|
795
|
+
// After — times the handler, sees its errors, and passes ctx forward
|
|
796
|
+
.use(async ({ ctx, next }) => {
|
|
797
|
+
const start = Date.now();
|
|
798
|
+
try {
|
|
799
|
+
return await next({ ctx: { ...ctx, tenant } });
|
|
800
|
+
} finally {
|
|
801
|
+
console.log(`${Date.now() - start}ms`);
|
|
802
|
+
}
|
|
803
|
+
})
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
- Improve chained `.input()` to apply each schema on its own instead of
|
|
807
|
+
flattening them into one shape, so object-level rules run. A key declared by
|
|
808
|
+
more than one schema is validated only by the last schema to declare it, even
|
|
809
|
+
when an earlier schema carries object-level rules.
|
|
810
|
+
|
|
811
|
+
```ts
|
|
812
|
+
// Before — the object-level rule was dropped and both fields reached the handler
|
|
813
|
+
.input(z.object({ password: z.string(), confirm: z.string() }))
|
|
814
|
+
|
|
815
|
+
// After — mismatched values are rejected before the handler runs
|
|
816
|
+
.input(
|
|
817
|
+
z
|
|
818
|
+
.object({ password: z.string(), confirm: z.string() })
|
|
819
|
+
.refine((v) => v.password === v.confirm)
|
|
820
|
+
)
|
|
821
|
+
```
|
|
822
|
+
|
|
823
|
+
## Patches
|
|
824
|
+
|
|
825
|
+
- Fix `.input()` schemas running twice per request, which made field transforms
|
|
826
|
+
apply to their own output — `z.string().transform(s => s.length)` threw on
|
|
827
|
+
valid input and `z.number().transform(n => n * 2)` doubled twice. Transforms
|
|
828
|
+
and refinements now run exactly once.
|
|
829
|
+
- Fix `next({ input })` being dropped for every middleware after the first, so
|
|
830
|
+
input enrichment placed after an auth middleware no longer silently no-ops.
|
|
831
|
+
- Fix HTTP routes returning a retryable `500` for errors raised by a procedure
|
|
832
|
+
they called through a caller. `NOT_FOUND`, `FORBIDDEN`, and other codes now
|
|
833
|
+
keep their status and message.
|
|
834
|
+
- Fix HTTP routes returning `500` for the twelve error codes missing from the
|
|
835
|
+
route status map, including `PAYLOAD_TOO_LARGE` (`413`),
|
|
836
|
+
`UNSUPPORTED_MEDIA_TYPE` (`415`), and `PRECONDITION_FAILED` (`412`).
|
|
837
|
+
- Fix a malformed or empty JSON body returning `500` instead of `400`,
|
|
838
|
+
including when HTTP middleware reads it through `getRawInput()`.
|
|
839
|
+
|
|
840
|
+
- [#317](https://github.com/udecode/kitcn/pull/317) [`b765f01`](https://github.com/udecode/kitcn/commit/b765f016cc82aabaad9d5f4d218955163f1a73a5) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Breaking changes
|
|
841
|
+
|
|
842
|
+
- `orderBy` on a field that no index _leads_ now sorts after reading, and under
|
|
843
|
+
cursor pagination it raises instead of returning a page ordered by the wrong
|
|
844
|
+
column. An index merely containing the field no longer counts: Convex walks an
|
|
845
|
+
index in full key order, so `on(type, numLikes)` orders by `type` first. Add an
|
|
846
|
+
index led by the sort field, or read without a cursor.
|
|
847
|
+
|
|
848
|
+
```ts
|
|
849
|
+
// Before: paged, silently ordered by `type`
|
|
850
|
+
index("numLikesAndType").on(t.type, t.numLikes);
|
|
851
|
+
|
|
852
|
+
await db.query.posts.findMany({
|
|
853
|
+
orderBy: { numLikes: "desc" },
|
|
854
|
+
cursor: null,
|
|
855
|
+
limit: 20,
|
|
856
|
+
});
|
|
857
|
+
|
|
858
|
+
// After: add an index the sort field leads
|
|
859
|
+
index("numLikesAndType").on(t.type, t.numLikes);
|
|
860
|
+
index("by_num_likes").on(t.numLikes);
|
|
861
|
+
|
|
862
|
+
await db.query.posts.findMany({
|
|
863
|
+
orderBy: { numLikes: "desc" },
|
|
864
|
+
cursor: null,
|
|
865
|
+
limit: 20,
|
|
866
|
+
});
|
|
867
|
+
```
|
|
868
|
+
|
|
869
|
+
- `.withIndex(name, range)` now wins over the index a `where` object would have
|
|
870
|
+
selected, so a `where` the pinned index cannot serve becomes a scan the caller
|
|
871
|
+
has to bound. Under cursor pagination that combination now asks for `maxScan`
|
|
872
|
+
instead of quietly reading through a different index.
|
|
873
|
+
|
|
874
|
+
```ts
|
|
875
|
+
// Before: scanned `by_status` and returned rows from every city
|
|
876
|
+
await db.query.users
|
|
877
|
+
.withIndex("by_city", (q) => q.eq("cityId", cityId))
|
|
878
|
+
.findMany({ where: { status: "active" }, cursor: null, limit: 20 });
|
|
879
|
+
|
|
880
|
+
// After: bound the scan
|
|
881
|
+
await db.query.users
|
|
882
|
+
.withIndex("by_city", (q) => q.eq("cityId", cityId))
|
|
883
|
+
.findMany({
|
|
884
|
+
where: { status: "active" },
|
|
885
|
+
cursor: null,
|
|
886
|
+
limit: 20,
|
|
887
|
+
maxScan: 500,
|
|
888
|
+
});
|
|
889
|
+
```
|
|
890
|
+
|
|
891
|
+
## Patches
|
|
892
|
+
|
|
893
|
+
- Fix `.withIndex(name, range)` being ignored whenever the `where` object also
|
|
894
|
+
matched another index. The index and its bounds you asked for are now the ones
|
|
895
|
+
scanned — including under cursor pagination — so a range used to scope a query,
|
|
896
|
+
a tenant id for instance, can no longer be dropped and return rows outside it.
|
|
897
|
+
- Fix `where: { field: { in: [...] } }` combined with `orderBy` and `limit`
|
|
898
|
+
returning an arbitrary slice — usually the oldest rows — instead of the
|
|
899
|
+
requested window.
|
|
900
|
+
- Fix `like`, `ilike`, `notLike`, and `notIlike` matching nothing when the
|
|
901
|
+
pattern has a wildcard anywhere but the ends. `%` now matches any run of
|
|
902
|
+
characters and `_` matches exactly one Unicode character, at any position.
|
|
903
|
+
- Fix `eq`, `ne`, `in`, and `notIn` never matching array or object columns.
|
|
904
|
+
Values are compared by content, in queries and in `update`/`delete` filters.
|
|
905
|
+
- Fix `select()` returning raw rows for a `where: { id }` lookup, which silently
|
|
906
|
+
skipped `map`, `filter`, `flatMap`, and `distinct`. `pageByKey` with the same
|
|
907
|
+
`where` also returns its page shape instead of a bare array. A `where` on `id`
|
|
908
|
+
or `id: { in: [...] }` reads those rows by key rather than scanning the table
|
|
909
|
+
for them, so `select()` costs one read per id however large the table is.
|
|
910
|
+
Cursor pagination rejects `id: { in: [...] }` with `maxScan`, because sorting
|
|
911
|
+
arbitrary IDs by creation time requires reading the complete list first.
|
|
912
|
+
- Apply RLS to source rows before any `select()` pipeline callback runs, so a
|
|
913
|
+
mapper or flat-map stage cannot inspect or project a forbidden document.
|
|
914
|
+
- Fix `flatMap`'s `limit` counting rows excluded by its `where`, which returned
|
|
915
|
+
fewer children than asked for and often none. The limit now counts matching
|
|
916
|
+
children, stays stable across pages instead of yielding a fresh batch per page,
|
|
917
|
+
and reads each child once within the `maxScan` budget. It also stops on the
|
|
918
|
+
last child it can return instead of reading one past it, so a small `limit`
|
|
919
|
+
across many parents no longer spends reads no page can show. Exhausted and
|
|
920
|
+
missing optional relations advance cursors without duplicates or loops.
|
|
921
|
+
- Fix a relation `limit` combined with a relation `where` returning too few
|
|
922
|
+
children — none when enough non-matching children sorted first. The limit now
|
|
923
|
+
counts matching children. Without an explicit relation `orderBy`, the scan
|
|
924
|
+
also stops after the requested visible rows, including rows filtered by RLS.
|
|
925
|
+
|
|
926
|
+
- [#316](https://github.com/udecode/kitcn/pull/316) [`59b80d0`](https://github.com/udecode/kitcn/commit/59b80d0f7c8c9aea78a15b427449907ef8976750) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Breaking changes
|
|
927
|
+
|
|
928
|
+
- Require `rls.roleResolver` for policies scoped with `to`. A role-scoped policy
|
|
929
|
+
previously applied to every caller when no resolver was configured; it now
|
|
930
|
+
throws `RLS_ROLE_RESOLVER_REQUIRED`. Queries and mutations check this for
|
|
931
|
+
every table they touch before reading rows, so the error depends only on
|
|
932
|
+
configuration and not on whether the table holds rows. SQL pseudo-roles
|
|
933
|
+
(`public`, `current_user`, `current_role`, `session_user`) apply to everyone
|
|
934
|
+
and still need no resolver.
|
|
935
|
+
|
|
936
|
+
```ts
|
|
937
|
+
// Before
|
|
938
|
+
const ormDb = orm.db(ctx, { rls: { ctx } });
|
|
939
|
+
|
|
940
|
+
// After
|
|
941
|
+
const ormDb = orm.db(ctx, {
|
|
942
|
+
rls: { ctx, roleResolver: (ctx) => ctx.roles ?? [] },
|
|
943
|
+
});
|
|
944
|
+
```
|
|
945
|
+
|
|
946
|
+
- Deny RLS policy comparisons against a missing value, following SQL null
|
|
947
|
+
semantics. A policy written as `eq(column, null)` now denies instead of
|
|
948
|
+
matching explicitly-null columns, and an unauthenticated caller no longer
|
|
949
|
+
matches rows whose owner column was never set. Use `isNull` to match absent
|
|
950
|
+
or null columns.
|
|
951
|
+
|
|
952
|
+
```ts
|
|
953
|
+
// Before
|
|
954
|
+
rlsPolicy("read_unassigned", {
|
|
955
|
+
for: "select",
|
|
956
|
+
using: (ctx, t) => eq(t.ownerId, null),
|
|
957
|
+
});
|
|
958
|
+
|
|
959
|
+
// After
|
|
960
|
+
rlsPolicy("read_unassigned", {
|
|
961
|
+
for: "select",
|
|
962
|
+
using: (ctx, t) => isNull(t.ownerId),
|
|
963
|
+
});
|
|
964
|
+
```
|
|
965
|
+
|
|
966
|
+
## Patches
|
|
967
|
+
|
|
968
|
+
- Fix many-to-many relations ignoring the junction table's RLS policies, which
|
|
969
|
+
revealed which rows other users were linked to. Loading a relation with `with`
|
|
970
|
+
now enforces the junction table's policies alongside the related table's.
|
|
971
|
+
|
|
972
|
+
- [#319](https://github.com/udecode/kitcn/pull/319) [`2aee478`](https://github.com/udecode/kitcn/commit/2aee478fcc750d06bd914bf5cd701045d1c79736) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Breaking changes
|
|
973
|
+
|
|
974
|
+
- Enforce the configured total budget across all `shards`.
|
|
975
|
+
|
|
976
|
+
```ts
|
|
977
|
+
// 20 per minute in total, spread over 4 shards
|
|
978
|
+
Ratelimit.fixedWindow(20, "1 m", { shards: 4 });
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
- Preserve configured `maxReserved` headroom across sharded limiters.
|
|
982
|
+
- Reject limiter budgets that leave any shard with less than one usable token.
|
|
983
|
+
- Reject non-positive, non-finite, or unservable dynamic limit overrides.
|
|
984
|
+
|
|
985
|
+
- Evaluate the requested `count` / `rate` in `check()` against the tokens already
|
|
986
|
+
spent. It previously evaluated nothing and returned `success: true` for every
|
|
987
|
+
caller, so a pre-flight gate now reports `success: false` where it always said
|
|
988
|
+
"allowed".
|
|
989
|
+
|
|
990
|
+
```ts
|
|
991
|
+
// Before: always true, even for an exhausted identifier
|
|
992
|
+
const gate = await limiter.check(userId, { count: 5 });
|
|
993
|
+
|
|
994
|
+
// After: matches what limit() would decide, without consuming tokens
|
|
995
|
+
const gate = await limiter.check(userId, { count: 5 });
|
|
996
|
+
if (!gate.success) return { retryAt: gate.reset };
|
|
997
|
+
```
|
|
998
|
+
|
|
999
|
+
## Features
|
|
1000
|
+
|
|
1001
|
+
- Add `snapshotToState` to convert a `getValue()` snapshot into the state shape
|
|
1002
|
+
`calculateRatelimit()` expects. Snapshots retain the full projected state,
|
|
1003
|
+
including sliding-window current and previous counts, so later projections
|
|
1004
|
+
preserve boundary decay.
|
|
1005
|
+
- Add `remainingRaw` to `calculateRatelimit()` results for the exact token
|
|
1006
|
+
balance, including the negative value when a request overdraws.
|
|
1007
|
+
|
|
1008
|
+
## Patches
|
|
1009
|
+
|
|
1010
|
+
- Fix `getRemaining()` inverting sliding-window quotas. An identifier with no
|
|
1011
|
+
traffic reported `remaining: 0`, and quota banners or `X-RateLimit-Remaining`
|
|
1012
|
+
headers showed the opposite of the truth.
|
|
1013
|
+
- Fix `resetUsedTokens()` leaving an identifier blocked by the ephemeral cache,
|
|
1014
|
+
so an admin quota reset silently failed for the rest of the window.
|
|
1015
|
+
- Key the ephemeral block cache per shard. One exhausted shard used to block the
|
|
1016
|
+
identifier outright, stranding every other shard's tokens until the window
|
|
1017
|
+
reset and enforcing well under the configured limit.
|
|
1018
|
+
- Sum every shard in `getRemaining()` rather than extrapolating the fullest one.
|
|
1019
|
+
A half-drained sharded limiter reported its full budget as still available.
|
|
1020
|
+
- Improve shard selection to compare exact token balances, so sharded limiters
|
|
1021
|
+
spread load onto the emptier shard instead of tying on rounded counts.
|
|
1022
|
+
- Retry the remaining shards when the preferred candidates are exhausted, so
|
|
1023
|
+
routing cannot deny a request while another shard can still serve it.
|
|
1024
|
+
- Preserve whole-request capacity for fractional budgets by dealing the whole
|
|
1025
|
+
portion and keeping the fractional remainder on one shard.
|
|
1026
|
+
- Scale fixed-window snapshots and response balances by `capacity` rather than
|
|
1027
|
+
the refill `limit`, so burst configurations report valid remaining tokens.
|
|
1028
|
+
- Scope ephemeral blocks by shard, requested count, and reservation mode, so a
|
|
1029
|
+
failed large or ordinary request does not hide tokens from a smaller or
|
|
1030
|
+
reserved request, and include cached shards when reporting the earliest
|
|
1031
|
+
global retry time.
|
|
1032
|
+
- Prune expired ephemeral block variants when recording a new block.
|
|
1033
|
+
- Allocate token-bucket refill rates in proportion to shard capacity, preserving
|
|
1034
|
+
the full configured refill when capacity shares are uneven.
|
|
1035
|
+
- Compute reserved-request retry times against `maxReserved` headroom rather
|
|
1036
|
+
than the non-reserved zero-debt threshold.
|
|
1037
|
+
- Evaluate sampled shard states at one common read timestamp, avoid refilling
|
|
1038
|
+
their aggregate again, and sum each shard's independently usable whole tokens
|
|
1039
|
+
in `getRemaining()` without netting debt or fractions across isolated shards.
|
|
1040
|
+
- Preserve sampled per-shard state in snapshots so all-shard projections retain
|
|
1041
|
+
independent capacity saturation and sliding-window decay.
|
|
1042
|
+
- Read each candidate shard set concurrently, including exhaustion fallbacks.
|
|
1043
|
+
- Reject requests that exceed every shard's capacity and reservation headroom
|
|
1044
|
+
with `reason: "requestTooLarge"` and no retry deadline or shard reads.
|
|
1045
|
+
- Exclude permanently undersized shards from retry deadlines and invalidate
|
|
1046
|
+
local snapshot and block-decision caches when dynamic limits change.
|
|
1047
|
+
- Preserve permanent oversized denials through all-shard snapshots and React
|
|
1048
|
+
projections without scheduling an infinite retry timer.
|
|
1049
|
+
- Apply per-shard capacity guards to partial snapshots while retaining uncapped
|
|
1050
|
+
reservation headroom when `maxReserved` is omitted.
|
|
1051
|
+
- Reject negative, non-finite `maxReserved` values before sharding or retry
|
|
1052
|
+
calculation.
|
|
1053
|
+
- Normalize shard-local algorithms, enforce per-shard capacity for fresh
|
|
1054
|
+
projections, and generation-guard cache writes across dynamic updates.
|
|
1055
|
+
- Skip infinite block-cache entries and retain at most 32 finite variants per
|
|
1056
|
+
identifier.
|
|
1057
|
+
|
|
1058
|
+
### Patch Changes
|
|
1059
|
+
|
|
1060
|
+
- [#318](https://github.com/udecode/kitcn/pull/318) [`eddfc08`](https://github.com/udecode/kitcn/commit/eddfc083de4e1656237f1b871919c9c382eeb67e) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
1061
|
+
|
|
1062
|
+
- Fix auth queries that filter by `id` resolving records from the wrong model,
|
|
1063
|
+
which let a lookup, update, or delete for one model read, patch, or destroy a
|
|
1064
|
+
record belonging to another. IDs are now checked against the model being
|
|
1065
|
+
queried, and IDs that belong elsewhere or are malformed resolve to "not
|
|
1066
|
+
found" instead of a foreign record or an error.
|
|
1067
|
+
- Fix `findMany` and `count` returning duplicated records past the first page,
|
|
1068
|
+
which also inflated counts used for membership, role, and API key limits.
|
|
1069
|
+
- Fix mixed `AND`/`OR` filters in `findMany` and `count` returning records the
|
|
1070
|
+
filter excluded, such as rows outside the requested organization. Mixed
|
|
1071
|
+
filters are now rejected, matching `updateMany` and `deleteMany`.
|
|
1072
|
+
- Fix `not_in` filters returning no match when the matching record was not
|
|
1073
|
+
among the first records scanned, which made those updates fail and those
|
|
1074
|
+
deletes silently do nothing.
|
|
1075
|
+
- Fix `auth.jwtCache: false` in the Next.js integration disabling
|
|
1076
|
+
authentication instead of just the JWT cookie cache, which made every server
|
|
1077
|
+
request anonymous.
|
|
1078
|
+
|
|
1079
|
+
- [#321](https://github.com/udecode/kitcn/pull/321) [`9a7feab`](https://github.com/udecode/kitcn/commit/9a7feab2f99ee383a02225c293137416a0438fbd) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
1080
|
+
|
|
1081
|
+
- Fix signed-in users being signed out when their name or email contains
|
|
1082
|
+
non-ASCII characters.
|
|
1083
|
+
- Fix server callers re-running a failed mutation or action after a
|
|
1084
|
+
non-authorization error, which could charge a card or write a row twice.
|
|
1085
|
+
- Fix results of auth-scoped actions surviving sign-out and being served to the
|
|
1086
|
+
next user in the same tab.
|
|
1087
|
+
- Fix `skipUnauth` being ignored on queries and action queries, so backend
|
|
1088
|
+
authorization errors resolve to `null` as documented instead of surfacing as
|
|
1089
|
+
query errors.
|
|
1090
|
+
- Fix `Date` values in query args crashing the render.
|
|
1091
|
+
- Fix a function-form `enabled` being ignored on queries, action queries, and
|
|
1092
|
+
infinite queries, which ran queries the caller had disabled.
|
|
1093
|
+
- Fix mutating a query args object in place returning another component's args
|
|
1094
|
+
for a previously used key, which subscribed to the wrong Convex query.
|
|
1095
|
+
- Fix RSC prefetch of `crpc.http.*` building a different URL than the browser
|
|
1096
|
+
client for `params` and `searchParams`, so prefetched data now hydrates
|
|
1097
|
+
instead of being refetched.
|
|
1098
|
+
|
|
1099
|
+
## 0.16.1
|
|
1100
|
+
|
|
1101
|
+
### Patch Changes
|
|
1102
|
+
|
|
1103
|
+
- [#314](https://github.com/udecode/kitcn/pull/314) [`e01e3f5`](https://github.com/udecode/kitcn/commit/e01e3f58ae33e118f1bf844e7d5a98694ce10ab0) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
1104
|
+
|
|
1105
|
+
- Fix `like`, `ilike`, `contains`, `endsWith`, and the array operators returning
|
|
1106
|
+
too few rows — often none — when combined with `limit`. These operators are
|
|
1107
|
+
matched after the rows are read, so `limit` now counts matches instead of
|
|
1108
|
+
scanned rows. `offset` counts matches too.
|
|
1109
|
+
- Fix those same operators being ignored entirely under cursor pagination, which
|
|
1110
|
+
returned pages containing rows that did not match. Pages now hold only
|
|
1111
|
+
matching rows.
|
|
1112
|
+
- Fix `NOT` around one of those operators matching nothing instead of negating,
|
|
1113
|
+
with or without a cursor.
|
|
1114
|
+
- Fix `isNull` skipping rows whose column was never written once that column is
|
|
1115
|
+
indexed. Absent and explicitly-null columns now both match, with or without an
|
|
1116
|
+
index.
|
|
1117
|
+
- Fix `flatMap` pagination dropping and duplicating children after the first
|
|
1118
|
+
page. Walking every page now returns the same rows as reading them at once.
|
|
1119
|
+
- Fix soft cascade deletes rescheduling themselves forever and never reaching
|
|
1120
|
+
the children past the first batch.
|
|
1121
|
+
|
|
1122
|
+
## 0.16.0
|
|
1123
|
+
|
|
1124
|
+
### Minor Changes
|
|
1125
|
+
|
|
1126
|
+
- [#310](https://github.com/udecode/kitcn/pull/310) [`a229128`](https://github.com/udecode/kitcn/commit/a229128a94605c229d0ba9a5e9e7f2f98ee76e7e) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Breaking changes
|
|
1127
|
+
|
|
1128
|
+
- Require Convex 1.42 or newer.
|
|
1129
|
+
|
|
1130
|
+
```bash
|
|
1131
|
+
# Before
|
|
1132
|
+
bun add convex@1.38.0
|
|
1133
|
+
|
|
1134
|
+
# After
|
|
1135
|
+
bun add convex@1.42.3
|
|
1136
|
+
```
|
|
1137
|
+
|
|
1138
|
+
### Patch Changes
|
|
1139
|
+
|
|
1140
|
+
- [#311](https://github.com/udecode/kitcn/pull/311) [`644ed41`](https://github.com/udecode/kitcn/commit/644ed41f38db3796790a947019ea089c224bf83d) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1141
|
+
|
|
1142
|
+
- Fix unbounded auth queries hanging after 200 rows.
|
|
1143
|
+
- Prevent action contexts from exposing mutation-only transaction options.
|
|
1144
|
+
|
|
1145
|
+
## 0.15.18
|
|
1146
|
+
|
|
1147
|
+
### Patch Changes
|
|
1148
|
+
|
|
1149
|
+
- [#308](https://github.com/udecode/kitcn/pull/308) [`65a331b`](https://github.com/udecode/kitcn/commit/65a331b7b9cb541b46c031e9afabdadd4d9d0c91) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1150
|
+
|
|
1151
|
+
- Fix ORM ID queries and relation loading to treat malformed IDs as missing
|
|
1152
|
+
records.
|
|
1153
|
+
|
|
1154
|
+
## 0.15.17
|
|
1155
|
+
|
|
1156
|
+
### Patch Changes
|
|
1157
|
+
|
|
1158
|
+
- [#305](https://github.com/udecode/kitcn/pull/305) [`b7ccc0b`](https://github.com/udecode/kitcn/commit/b7ccc0b19fb79017a9116bebc548b63b6081b822) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1159
|
+
|
|
1160
|
+
- Fix cRPC infinite queries backed by native Convex pagination loading pages
|
|
1161
|
+
before `fetchNextPage()` is called.
|
|
1162
|
+
|
|
1163
|
+
## 0.15.16
|
|
1164
|
+
|
|
1165
|
+
### Patch Changes
|
|
1166
|
+
|
|
1167
|
+
- [#301](https://github.com/udecode/kitcn/pull/301) [`3248105`](https://github.com/udecode/kitcn/commit/32481058f1043a4f9a0a897ee966d9048dc79739) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Features
|
|
1168
|
+
|
|
1169
|
+
- Add provider-owned Convex authentication recovery after transient token failures.
|
|
1170
|
+
|
|
1171
|
+
## 0.15.15
|
|
1172
|
+
|
|
1173
|
+
### Patch Changes
|
|
1174
|
+
|
|
1175
|
+
- [#297](https://github.com/udecode/kitcn/pull/297) [`4fba1b8`](https://github.com/udecode/kitcn/commit/4fba1b8dcef38e3433984553063306aafd87a453) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
|
|
1176
|
+
|
|
1177
|
+
- Fix `kitcn deploy` and `kitcn aggregate backfill|rebuild|prune` failing with `Too many documents read in a single function execution (limit: 32000)` once a table with an `aggregateIndex()` grows past ~32k rows. Backfill kickoff now discovers removed aggregate indexes with bounded distinct-key index scans instead of reading every aggregate row. Clearing a removed index whose aggregate rows already exceed platform limits still requires a chunked prune.
|
|
1178
|
+
- Fix `backend=concave` failing to locate the Concave CLI with `@concavejs/cli` releases that do not export `./package.json`.
|
|
1179
|
+
- Pin `@concavejs/cli` in concave scaffolds to the supported version instead of `latest`.
|
|
1180
|
+
|
|
1181
|
+
## 0.15.14
|
|
1182
|
+
|
|
1183
|
+
### Patch Changes
|
|
1184
|
+
|
|
1185
|
+
- [#293](https://github.com/udecode/kitcn/pull/293) [`0fcbae0`](https://github.com/udecode/kitcn/commit/0fcbae099b0658c2d921a42a189e713a71ebeb71) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1186
|
+
|
|
1187
|
+
- Fix Better Auth client type compatibility for auth providers and organization-heavy auth clients.
|
|
1188
|
+
- Support Better Auth 1.6.18 across generated auth apps.
|
|
1189
|
+
|
|
1190
|
+
## 0.15.13
|
|
1191
|
+
|
|
1192
|
+
### Patch Changes
|
|
1193
|
+
|
|
1194
|
+
- [#289](https://github.com/udecode/kitcn/pull/289) [`4aae1ee`](https://github.com/udecode/kitcn/commit/4aae1ee1dfac8ae85fe0999fba8a78e523fec975) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1195
|
+
|
|
1196
|
+
- Fix auth adapter updates with no `where` clauses to return `null`.
|
|
1197
|
+
- Fix Next.js and TanStack Start auth proxies to strip hop-by-hop headers.
|
|
1198
|
+
- Update supported Better Auth installs to `1.6.15` with a `>=1.6.11 <1.7.0` peer range.
|
|
1199
|
+
|
|
1200
|
+
## 0.15.12
|
|
1201
|
+
|
|
1202
|
+
### Patch Changes
|
|
1203
|
+
|
|
1204
|
+
- [#285](https://github.com/udecode/kitcn/pull/285) [`0ca9202`](https://github.com/udecode/kitcn/commit/0ca9202b83ccaa692507242aee99e086c1994cb1) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1205
|
+
|
|
1206
|
+
- Fix auth providers to accept plugin-rich Better Auth clients without casts.
|
|
1207
|
+
|
|
1208
|
+
## 0.15.11
|
|
1209
|
+
|
|
1210
|
+
### Patch Changes
|
|
1211
|
+
|
|
1212
|
+
- [#283](https://github.com/udecode/kitcn/pull/283) [`2e09a29`](https://github.com/udecode/kitcn/commit/2e09a297e27ea714fe73d0a388d3ed11359630c3) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1213
|
+
|
|
1214
|
+
- Fix `kitcn init -t start` to preserve the shadcn Start template while safely staging existing empty target directories.
|
|
1215
|
+
- Fix `rankIndex().orderBy()` so documented direction objects typecheck and normalize correctly.
|
|
1216
|
+
|
|
1217
|
+
## 0.15.10
|
|
1218
|
+
|
|
1219
|
+
### Patch Changes
|
|
1220
|
+
|
|
1221
|
+
- [#280](https://github.com/udecode/kitcn/pull/280) [`a684485`](https://github.com/udecode/kitcn/commit/a6844855d69725321ddfbd4b50e8a1f517e70e96) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1222
|
+
|
|
1223
|
+
- Fix `kitcn init -t start` to preserve the shadcn Start template while safely staging existing empty target directories.
|
|
1224
|
+
|
|
1225
|
+
## 0.15.9
|
|
1226
|
+
|
|
1227
|
+
### Patch Changes
|
|
1228
|
+
|
|
1229
|
+
- [`386b54e`](https://github.com/udecode/kitcn/commit/386b54e2d5a9c1b48e9a8db5604d29d8e9013f9f) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1230
|
+
|
|
1231
|
+
- Fix `kitcn init -t start` for TanStack Start scaffolds that use Vite
|
|
1232
|
+
`resolve.tsconfigPaths`.
|
|
1233
|
+
- Improve the packaged kitcn agent skill prompt and reference footprint.
|
|
1234
|
+
|
|
1235
|
+
## 0.15.8
|
|
1236
|
+
|
|
1237
|
+
### Patch Changes
|
|
1238
|
+
|
|
1239
|
+
- [#275](https://github.com/udecode/kitcn/pull/275) [`4dd56d0`](https://github.com/udecode/kitcn/commit/4dd56d062dbd268e7768f0a0e854572a840d7de6) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Features
|
|
1240
|
+
|
|
1241
|
+
- Support Better Auth plugin sign-in methods in `useSignInMutationOptions`.
|
|
1242
|
+
|
|
1243
|
+
## 0.15.7
|
|
1244
|
+
|
|
1245
|
+
### Patch Changes
|
|
1246
|
+
|
|
1247
|
+
- [#272](https://github.com/udecode/kitcn/pull/272) [`d286077`](https://github.com/udecode/kitcn/commit/d286077bf388956d8f423eaaa1afed18b0b4b7b9) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1248
|
+
|
|
1249
|
+
- Fix ORM update and delete filters on primary id arrays so bounded mutations do not require `allowFullScan`.
|
|
1250
|
+
- Bound sync primary-id mutation fanout by `mutationBatchSize` and keep legacy scheduled cursors on the query-pagination path.
|
|
1251
|
+
|
|
1252
|
+
## 0.15.6
|
|
1253
|
+
|
|
1254
|
+
### Patch Changes
|
|
1255
|
+
|
|
1256
|
+
- [#270](https://github.com/udecode/kitcn/pull/270) [`2703bf0`](https://github.com/udecode/kitcn/commit/2703bf056b129c783ec772280b4e1648bffdf171) Thanks [@zbeyens](https://github.com/zbeyens)! - Support `OPTIONS` preflight forwarding in `kitcn/auth/nextjs` route handlers and generated Next auth routes.
|
|
1257
|
+
|
|
1258
|
+
## 0.15.5
|
|
1259
|
+
|
|
1260
|
+
### Patch Changes
|
|
1261
|
+
|
|
1262
|
+
- [#268](https://github.com/udecode/kitcn/pull/268) [`da34316`](https://github.com/udecode/kitcn/commit/da34316d76a64ebd6d0ac683ded2472246bb9439) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Features
|
|
1263
|
+
|
|
1264
|
+
- Support syncing shared Convex query clients directly from `ConvexAuthProvider`.
|
|
1265
|
+
|
|
1266
|
+
## Patches
|
|
1267
|
+
|
|
1268
|
+
- Keep the existing auth store attached when reusing a Convex query client before `ConvexAuthProvider` resyncs it.
|
|
1269
|
+
- Fix `kitcn/auth/start/server` so Nitro production builds can trace and include the TanStack Start server dependency without making `kitcn/auth/start` unsafe for browser loaders.
|
|
1270
|
+
|
|
1271
|
+
## 0.15.4
|
|
1272
|
+
|
|
1273
|
+
### Patch Changes
|
|
1274
|
+
|
|
1275
|
+
- [#266](https://github.com/udecode/kitcn/pull/266) [`5de6e94`](https://github.com/udecode/kitcn/commit/5de6e9466bf066180b76062cbbb5632e27fc6bd1) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Features
|
|
1276
|
+
|
|
1277
|
+
- Support syncing shared Convex query clients directly from `ConvexAuthProvider`.
|
|
1278
|
+
|
|
1279
|
+
## 0.15.3
|
|
1280
|
+
|
|
1281
|
+
### Patch Changes
|
|
1282
|
+
|
|
1283
|
+
- [#264](https://github.com/udecode/kitcn/pull/264) [`21760cb`](https://github.com/udecode/kitcn/commit/21760cb994a8f3e093795c342cdbda11ae8e8819) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1284
|
+
|
|
1285
|
+
- Fix Convex query cache updates when a subscription returns `null`.
|
|
1286
|
+
|
|
1287
|
+
## 0.15.2
|
|
1288
|
+
|
|
1289
|
+
### Patch Changes
|
|
1290
|
+
|
|
1291
|
+
- [#262](https://github.com/udecode/kitcn/pull/262) [`a33d263`](https://github.com/udecode/kitcn/commit/a33d2633e0b2c2e016f4d951b3bea8a2852b7a03) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1292
|
+
|
|
1293
|
+
- Fix Resend scaffolds to resolve optional Resend env values from Convex runtime env proxies.
|
|
1294
|
+
- Fix Resend env helper reruns to update noncanonical `createEnv` formatting instead of silently skipping `readOptionalRuntimeEnv`.
|
|
1295
|
+
- Fix env helper reruns to fail loudly instead of duplicating or rewriting non-literal `readOptionalRuntimeEnv` options.
|
|
1296
|
+
- Fix Resend scaffold table names to match the camelCase schema extension keys.
|
|
1297
|
+
|
|
1298
|
+
## 0.15.1
|
|
1299
|
+
|
|
1300
|
+
### Patch Changes
|
|
1301
|
+
|
|
1302
|
+
- [#260](https://github.com/udecode/kitcn/pull/260) [`b9ae68b`](https://github.com/udecode/kitcn/commit/b9ae68bc6c3c26b783f6ae491555026f05510d80) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Features
|
|
1303
|
+
|
|
1304
|
+
- Add a TanStack Start loader auth helper for priming Convex query clients before protected route loaders run.
|
|
1305
|
+
|
|
1306
|
+
## 0.15.0
|
|
1307
|
+
|
|
1308
|
+
### Minor Changes
|
|
1309
|
+
|
|
1310
|
+
- [#257](https://github.com/udecode/kitcn/pull/257) [`d476288`](https://github.com/udecode/kitcn/commit/d476288e617db8d5d44821a70af3ec787280ea5c) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Breaking changes
|
|
1311
|
+
|
|
1312
|
+
- Require Convex 1.38.0 or newer for generated apps and peer dependency checks.
|
|
1313
|
+
|
|
1314
|
+
```sh
|
|
1315
|
+
# Before
|
|
1316
|
+
bun add convex@1.36.1 kitcn
|
|
1317
|
+
|
|
1318
|
+
# After
|
|
1319
|
+
bun add convex@1.38.0 kitcn
|
|
1320
|
+
```
|
|
1321
|
+
|
|
1322
|
+
## Features
|
|
1323
|
+
|
|
1324
|
+
- Support IP-aware rate-limit scaffolds with Convex request metadata.
|
|
1325
|
+
|
|
1326
|
+
## Patches
|
|
1327
|
+
|
|
1328
|
+
- Support Expo app adoption and avoid Bun-only Expo scaffolding in npm-launched init flows.
|
|
1329
|
+
- Document Convex request metadata for IP-aware rate-limit protection.
|
|
1330
|
+
|
|
1331
|
+
## 0.14.3
|
|
1332
|
+
|
|
1333
|
+
### Patch Changes
|
|
1334
|
+
|
|
1335
|
+
- [#255](https://github.com/udecode/kitcn/pull/255) [`0bf1fc2`](https://github.com/udecode/kitcn/commit/0bf1fc2136bf9a2dd1f2ac218d614dcb58a5888b) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1336
|
+
|
|
1337
|
+
- Fix plugin dependency installs to use the project's package manager.
|
|
1338
|
+
|
|
1339
|
+
## 0.14.2
|
|
1340
|
+
|
|
1341
|
+
### Patch Changes
|
|
1342
|
+
|
|
1343
|
+
- [`21acedd`](https://github.com/udecode/kitcn/commit/21acedd829df53c9207c75cee4fe7f68c6a0bd24) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1344
|
+
|
|
1345
|
+
- Fix raw Convex auth adoption for TanStack Start apps that do not keep a kitcn provider at the default path.
|
|
1346
|
+
- Clarify organization auth guidance for Stripe-style plugin side effects in Convex actions.
|
|
1347
|
+
|
|
1348
|
+
## 0.14.1
|
|
1349
|
+
|
|
1350
|
+
### Patch Changes
|
|
1351
|
+
|
|
1352
|
+
- [#251](https://github.com/udecode/kitcn/pull/251) [`8ac174c`](https://github.com/udecode/kitcn/commit/8ac174cde9642dd61d5e9420b6cbc53ef7a7c124) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1353
|
+
|
|
1354
|
+
- Fix ORM updates so timestamp `$onUpdateFn` hooks can return `Date` values.
|
|
1355
|
+
|
|
1356
|
+
## 0.14.0
|
|
1357
|
+
|
|
1358
|
+
### Minor Changes
|
|
1359
|
+
|
|
1360
|
+
- [#248](https://github.com/udecode/kitcn/pull/248) [`26023d2`](https://github.com/udecode/kitcn/commit/26023d2ae1b359174658aa4e9dabaeb3683d2142) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Breaking changes
|
|
1361
|
+
|
|
1362
|
+
- Require Convex 1.36 or newer.
|
|
1363
|
+
|
|
1364
|
+
```bash
|
|
1365
|
+
# Before
|
|
1366
|
+
bun add convex@1.35.1
|
|
1367
|
+
|
|
1368
|
+
# After
|
|
1369
|
+
bun add convex@1.36.1
|
|
1370
|
+
```
|
|
1371
|
+
|
|
1372
|
+
## Features
|
|
1373
|
+
|
|
1374
|
+
- Add `kitcn env default` passthrough for Convex default environment variables.
|
|
1375
|
+
|
|
1376
|
+
## Patches
|
|
1377
|
+
|
|
1378
|
+
- Align Better Auth scaffolds and auth runtime helpers with Better Auth 1.6.9.
|
|
1379
|
+
- Document Convex inline query, branch deployment, deploy message, and preview deployment passthroughs.
|
|
1380
|
+
|
|
1381
|
+
## 0.13.10
|
|
1382
|
+
|
|
1383
|
+
### Patch Changes
|
|
1384
|
+
|
|
1385
|
+
- [#245](https://github.com/udecode/kitcn/pull/245) [`547ccfd`](https://github.com/udecode/kitcn/commit/547ccfd2673c0099c63b55137b201476da13a56e) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1386
|
+
|
|
1387
|
+
- Fix `createAuthMutations` support for Better Auth clients that use the Convex client plugin.
|
|
1388
|
+
|
|
1389
|
+
## 0.13.9
|
|
1390
|
+
|
|
1391
|
+
### Patch Changes
|
|
1392
|
+
|
|
1393
|
+
- [#240](https://github.com/udecode/kitcn/pull/240) [`042a568`](https://github.com/udecode/kitcn/commit/042a5684066e6a6691f858afc22de68c71b58136) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1394
|
+
|
|
1395
|
+
- Fix raw Convex auth reruns so added Better Auth plugins refresh the generated schema without `--overwrite`.
|
|
1396
|
+
|
|
1397
|
+
## 0.13.8
|
|
1398
|
+
|
|
1399
|
+
### Patch Changes
|
|
1400
|
+
|
|
1401
|
+
- [#238](https://github.com/udecode/kitcn/pull/238) [`f43fc36`](https://github.com/udecode/kitcn/commit/f43fc3623b7f05fb8d55d9be1144d192c3e9235f) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1402
|
+
|
|
1403
|
+
- Fix `kitcn add auth --preset convex` so schema registration reuses existing `authSchema` imports.
|
|
1404
|
+
|
|
1405
|
+
## 0.13.7
|
|
1406
|
+
|
|
1407
|
+
### Patch Changes
|
|
1408
|
+
|
|
1409
|
+
- [#236](https://github.com/udecode/kitcn/pull/236) [`508f6df`](https://github.com/udecode/kitcn/commit/508f6df2cfb0e7177fefcdc48767473560b4b69b) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1410
|
+
|
|
1411
|
+
- Fix auth Stripe subscription writes so `createdAt` and `updatedAt` are only written when the target table defines them.
|
|
1412
|
+
|
|
1413
|
+
## 0.13.6
|
|
1414
|
+
|
|
1415
|
+
### Patch Changes
|
|
1416
|
+
|
|
1417
|
+
- [#234](https://github.com/udecode/kitcn/pull/234) [`f137874`](https://github.com/udecode/kitcn/commit/f13787454ca5cf9a7ea37ca48d021b19de38a2db) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1418
|
+
|
|
1419
|
+
- Fix React query options to stay stable for equal Convex query args.
|
|
1420
|
+
|
|
1421
|
+
## 0.13.5
|
|
1422
|
+
|
|
1423
|
+
### Patch Changes
|
|
1424
|
+
|
|
1425
|
+
- [#232](https://github.com/udecode/kitcn/pull/232) [`24ca124`](https://github.com/udecode/kitcn/commit/24ca124401b22f0ce370709675f796260bebb74e) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1426
|
+
|
|
1427
|
+
- Fix noisy `oidc-provider` deprecation warnings from the internal Convex auth plugin.
|
|
1428
|
+
|
|
1429
|
+
## 0.13.4
|
|
1430
|
+
|
|
1431
|
+
### Patch Changes
|
|
1432
|
+
|
|
1433
|
+
- [#229](https://github.com/udecode/kitcn/pull/229) [`a93f264`](https://github.com/udecode/kitcn/commit/a93f264c522f2818a0166b85770ffe88d1a1eb6d) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1434
|
+
|
|
1435
|
+
- Fix `kitcn migrate` and `kitcn aggregate` so Convex prod-target runs keep
|
|
1436
|
+
ambient deployment auth env in CI.
|
|
1437
|
+
|
|
1438
|
+
## 0.13.3
|
|
1439
|
+
|
|
1440
|
+
### Patch Changes
|
|
1441
|
+
|
|
1442
|
+
- [#227](https://github.com/udecode/kitcn/pull/227) [`2446f3e`](https://github.com/udecode/kitcn/commit/2446f3e53fd74153a1e5ffffc7773553086f899b) Thanks [@zbeyens](https://github.com/zbeyens)! - Add `kitcn init -t expo` for a fresh Expo scaffold built on the official
|
|
1443
|
+
`create-expo-app` shell, including the Convex baseline, starter messages
|
|
1444
|
+
screen, and first-class `kitcn add auth` parity on the Expo scaffold.
|
|
1445
|
+
|
|
1446
|
+
Expo local env now also owns `EXPO_PUBLIC_SITE_URL`, so Concave dev and Expo
|
|
1447
|
+
auth keep one local app-origin contract instead of drifting back to
|
|
1448
|
+
`http://localhost:3000`.
|
|
1449
|
+
|
|
1450
|
+
## 0.13.2
|
|
1451
|
+
|
|
1452
|
+
### Patch Changes
|
|
1453
|
+
|
|
1454
|
+
- [`0f1bed4`](https://github.com/udecode/kitcn/commit/0f1bed493208211e3f452420b2756456ed16f5de) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1455
|
+
|
|
1456
|
+
- Fix `kitcn add auth` in fresh apps so the CLI does not require `better-auth` to be installed before the auth scaffold planner runs.
|
|
1457
|
+
|
|
1458
|
+
## 0.13.1
|
|
1459
|
+
|
|
1460
|
+
### Patch Changes
|
|
1461
|
+
|
|
1462
|
+
- [#219](https://github.com/udecode/kitcn/pull/219) [`3ec2d3b`](https://github.com/udecode/kitcn/commit/3ec2d3b4d4049817124dc4fff12162d1fed2b1a5) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1463
|
+
|
|
1464
|
+
- Fix auth env sync and local auth bootstrap so `kitcn add auth`, `kitcn env push`, and `kitcn dev --bootstrap` use the real Convex CLI entrypoint more reliably across runtimes and platforms.
|
|
1465
|
+
- Fix `kitcn init -t <next|start|vite>` custom shadcn preset exits so they stop with a clear rerun instruction instead of crashing while patching scaffold files.
|
|
1466
|
+
- Improve `kitcn init -t <next|start|vite>` fresh scaffolds by syncing the shadcn wrapper to `shadcn@4.3.0` and regenerating the starter outputs against the latest upstream template contract.
|
|
1467
|
+
|
|
1468
|
+
## 0.13.0
|
|
1469
|
+
|
|
1470
|
+
### Minor Changes
|
|
1471
|
+
|
|
1472
|
+
- [#213](https://github.com/udecode/kitcn/pull/213) [`71dbc28`](https://github.com/udecode/kitcn/commit/71dbc28f9a59716f8ecd41fda8ee61709ad9c9da) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Breaking changes
|
|
1473
|
+
|
|
1474
|
+
- Require explicit `basePath` when `registerRoutes` is used with non-default auth routes.
|
|
1475
|
+
|
|
1476
|
+
```ts
|
|
1477
|
+
// Before
|
|
1478
|
+
import { registerRoutes } from "kitcn/auth/http";
|
|
1479
|
+
|
|
1480
|
+
// auth config uses basePath: "/custom-auth"
|
|
1481
|
+
registerRoutes(http, getAuth, {
|
|
1482
|
+
cors: {
|
|
1483
|
+
allowedOrigins: [process.env.SITE_URL!],
|
|
1484
|
+
},
|
|
1485
|
+
});
|
|
1486
|
+
|
|
1487
|
+
// After
|
|
1488
|
+
import { registerRoutes } from "kitcn/auth/http";
|
|
1489
|
+
|
|
1490
|
+
registerRoutes(http, getAuth, {
|
|
1491
|
+
basePath: "/custom-auth",
|
|
1492
|
+
cors: {
|
|
1493
|
+
allowedOrigins: [process.env.SITE_URL!],
|
|
1494
|
+
},
|
|
1495
|
+
});
|
|
1496
|
+
```
|
|
1497
|
+
|
|
1498
|
+
- Require `better-auth@1.6.5`.
|
|
1499
|
+
|
|
1500
|
+
```bash
|
|
1501
|
+
# Before
|
|
1502
|
+
bun add better-auth@1.5.3
|
|
1503
|
+
|
|
1504
|
+
# After
|
|
1505
|
+
bun add better-auth@1.6.5
|
|
1506
|
+
```
|
|
1507
|
+
|
|
1508
|
+
## Patches
|
|
1509
|
+
|
|
1510
|
+
- Let Convex handle anonymous non-interactive local setup without forcing `CONVEX_AGENT_MODE`.
|
|
1511
|
+
- Warn when an app pins an older Convex dependency family than kitcn expects.
|
|
1512
|
+
- Support Convex `dev --start` as a pre-run conflict flag.
|
|
1513
|
+
- Improve auth route registration so default Convex auth routes avoid eager Better Auth initialization during startup.
|
|
1514
|
+
- Preserve forwarded host and protocol headers through Next.js, TanStack Start, and Convex auth route proxies.
|
|
1515
|
+
- Fix auth helper token refresh, custom auth `basePath` support, and async custom JWT payload resolution.
|
|
1516
|
+
- Fix Better Auth adapter index matching and static filtering for composite and case-insensitive queries.
|
|
1517
|
+
- Support Better Auth `1.6.5` auth clients without user-code casts.
|
|
1518
|
+
|
|
1519
|
+
## 0.12.28
|
|
1520
|
+
|
|
1521
|
+
### Patch Changes
|
|
1522
|
+
|
|
1523
|
+
- [#210](https://github.com/udecode/kitcn/pull/210) [`1b3468a`](https://github.com/udecode/kitcn/commit/1b3468a867d62a9b55679170628d5a78c747f156) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1524
|
+
|
|
1525
|
+
- Fix raw Convex auth adoption so `kitcn add auth --preset convex --yes`
|
|
1526
|
+
installs `kitcn` before codegen and local bootstrap.
|
|
1527
|
+
- Fix `kitcn deploy` so CI deployment env vars reach Convex deploy, migrations,
|
|
1528
|
+
and aggregate backfill.
|
|
1529
|
+
|
|
1530
|
+
## 0.12.27
|
|
1531
|
+
|
|
1532
|
+
### Patch Changes
|
|
1533
|
+
|
|
1534
|
+
- [#206](https://github.com/udecode/kitcn/pull/206) [`7edbb5e`](https://github.com/udecode/kitcn/commit/7edbb5e3e445ed7331a4cc19ec795900ccb9ca52) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1535
|
+
|
|
1536
|
+
- Fix `bunx --bun kitcn init -t start --yes` so Bun-native parse-time imports
|
|
1537
|
+
no longer bypass project aliases and crash first-run codegen on scaffolded
|
|
1538
|
+
Start files.
|
|
1539
|
+
- Fix raw auth reruns so `http.ts` import detection respects both quote styles,
|
|
1540
|
+
`registerRoutes(http, getAuth, ...)` accepts Better Auth route contracts
|
|
1541
|
+
without a type cast, and raw auth clients keep the app `SITE_URL` while
|
|
1542
|
+
preserving user-edited raw `auth-client.ts` files on reruns.
|
|
1543
|
+
|
|
1544
|
+
## 0.12.26
|
|
1545
|
+
|
|
1546
|
+
### Patch Changes
|
|
1547
|
+
|
|
1548
|
+
- [`897a06b`](https://github.com/udecode/kitcn/commit/897a06b9e6ee5289ccf507d6c878d377ecfb1475) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1549
|
+
|
|
1550
|
+
- Fix raw auth reruns so `http.ts` import detection respects both quote styles,
|
|
1551
|
+
and `registerRoutes(http, getAuth, ...)` accepts Better Auth route contracts
|
|
1552
|
+
without a type cast.
|
|
1553
|
+
|
|
1554
|
+
## 0.12.25
|
|
1555
|
+
|
|
1556
|
+
### Patch Changes
|
|
1557
|
+
|
|
1558
|
+
- [`c1bc1a0`](https://github.com/udecode/kitcn/commit/c1bc1a046e71af2b311a3568fa397b57093138b1) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1559
|
+
|
|
1560
|
+
- Fix raw TanStack Start auth adoption reruns so `http.ts` import detection
|
|
1561
|
+
respects both quote styles and `registerRoutes(http, getAuth, ...)`
|
|
1562
|
+
typechecks without casts.
|
|
1563
|
+
|
|
1564
|
+
## 0.12.24
|
|
1565
|
+
|
|
1566
|
+
### Patch Changes
|
|
1567
|
+
|
|
1568
|
+
- [#202](https://github.com/udecode/kitcn/pull/202) [`10c2dc4`](https://github.com/udecode/kitcn/commit/10c2dc4f6de34fd7aaf1ac7bb6c964d7e63fcd3d) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1569
|
+
|
|
1570
|
+
- Support `kitcn add auth --preset convex --yes` on TanStack Start apps
|
|
1571
|
+
without falling through the Vite `main.tsx` patch path.
|
|
1572
|
+
|
|
1573
|
+
## 0.12.23
|
|
1574
|
+
|
|
1575
|
+
### Patch Changes
|
|
1576
|
+
|
|
1577
|
+
- [#200](https://github.com/udecode/kitcn/pull/200) [`7531fc9`](https://github.com/udecode/kitcn/commit/7531fc90d77b12b2e0815b8775ccecab3134784e) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1578
|
+
|
|
1579
|
+
- Fix React auth hooks so `useAuth()` and `useSafeConvexAuth()` stay loading
|
|
1580
|
+
while a cached session token is still syncing to Convex, which prevents a
|
|
1581
|
+
brief signed-out flash before the signed-in state settles.
|
|
1582
|
+
|
|
1583
|
+
## 0.12.22
|
|
1584
|
+
|
|
1585
|
+
### Patch Changes
|
|
1586
|
+
|
|
1587
|
+
- [`998ee69`](https://github.com/udecode/kitcn/commit/998ee69335c3e8f4b86333b15c14d0965a3aaae9) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1588
|
+
|
|
1589
|
+
- Fix `kitcn dev` so local Convex preflight uses `convex init` by default, and only falls back to the upgrade-capable local dev lane when older local backends require it.
|
|
1590
|
+
- Improve auth and backend docs so Convex and Concave env/JWKS flows are split into explicit backend lanes.
|
|
1591
|
+
|
|
1592
|
+
## 0.12.21
|
|
1593
|
+
|
|
1594
|
+
### Patch Changes
|
|
1595
|
+
|
|
1596
|
+
- [`96d5572`](https://github.com/udecode/kitcn/commit/96d55722434c09f7acbfbc8b89efc22f9e24768f) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1597
|
+
|
|
1598
|
+
- Improve TanStack Start auth migration docs and clarify the `kitcn add auth --schema --yes` schema refresh flow.
|
|
1599
|
+
- Fix the Next.js auth proxy so POST auth errors return the upstream response instead of crashing with a 500.
|
|
1600
|
+
- Fix `kitcn dev` local bootstrap so older local Convex backends auto-upgrade without hanging on a non-interactive prompt, and preserve local component targeting during preflight.
|
|
1601
|
+
|
|
1602
|
+
## 0.12.20
|
|
1603
|
+
|
|
1604
|
+
### Patch Changes
|
|
1605
|
+
|
|
1606
|
+
- [#193](https://github.com/udecode/kitcn/pull/193) [`db4b2a9`](https://github.com/udecode/kitcn/commit/db4b2a9c0e7ba4bf2fe52eba2f6d00c6c82bf605) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1607
|
+
|
|
1608
|
+
- Improve mutation-driven action-caller guidance so `requireActionCtx()` points
|
|
1609
|
+
scheduler-capable flows to `requireSchedulerCtx()` and `caller.schedule.*`.
|
|
1610
|
+
- Fix server-side call docs so mutation-or-action callbacks schedule actions
|
|
1611
|
+
instead of showing an invalid direct action call path.
|
|
1612
|
+
- Improve React error-handling docs to recommend `error.data?.message` and a
|
|
1613
|
+
global mutation toast pattern with `meta.errorMessage`.
|
|
1614
|
+
|
|
1615
|
+
## 0.12.19
|
|
1616
|
+
|
|
1617
|
+
### Patch Changes
|
|
1618
|
+
|
|
1619
|
+
- [#187](https://github.com/udecode/kitcn/pull/187) [`269966e`](https://github.com/udecode/kitcn/commit/269966eddf9c2a3407e284c86ef3becca9ff441a) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1620
|
+
|
|
1621
|
+
- Fix `kitcn dev` watcher codegen so Convex parse-time imports read local env
|
|
1622
|
+
values from `.env` and `convex/.env`, matching the initial codegen path.
|
|
1623
|
+
- Ignore watcher-owned `*.kitcn-parse.ts` temp files during `kitcn dev` so
|
|
1624
|
+
parse-time source rewrites do not retrigger codegen in a save loop.
|
|
1625
|
+
- Fix `kitcn codegen` so parse-time imports skip helper `.ts` files that do not
|
|
1626
|
+
define procedures, and support transitive `.tsx` imports like React Email
|
|
1627
|
+
templates.
|
|
1628
|
+
- Add server-only middleware procedure info for logging and tracing. Standard
|
|
1629
|
+
`export const` queries, mutations, and actions infer `module:function`
|
|
1630
|
+
automatically through app `generated/server`; `.name("module:function")`
|
|
1631
|
+
overrides when needed, and HTTP routes expose route method and path
|
|
1632
|
+
automatically.
|
|
1633
|
+
- Add `requireSchedulerCtx()` for mutation-or-action scheduling flows so auth
|
|
1634
|
+
callbacks and other generic ctx paths can enqueue work without lying about
|
|
1635
|
+
action context.
|
|
1636
|
+
|
|
1637
|
+
## 0.12.18
|
|
1638
|
+
|
|
1639
|
+
### Patch Changes
|
|
1640
|
+
|
|
1641
|
+
- [#183](https://github.com/udecode/kitcn/pull/183) [`40db401`](https://github.com/udecode/kitcn/commit/40db401bc93a9eb1ed7f2398445ba0cebc0a5b28) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1642
|
+
|
|
1643
|
+
- Fix `kitcn codegen` parse-time cRPC builder stubs so `.paginated()` chains
|
|
1644
|
+
after `.input()` keep working and preserve pagination metadata.
|
|
1645
|
+
- Fix TanStack Start auth reloads so `createAuthMutations()` persists the
|
|
1646
|
+
returned Better Auth session token/data and `ConvexAuthProvider` restores the
|
|
1647
|
+
signed-in state after a page refresh.
|
|
1648
|
+
|
|
1649
|
+
- [#183](https://github.com/udecode/kitcn/pull/183) [`1218930`](https://github.com/udecode/kitcn/commit/1218930db83b112a43dca074d457ed76c9d4f4c7) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1650
|
+
|
|
1651
|
+
- Support custom structured `data` payloads on `CRPCError` so conflict and
|
|
1652
|
+
validation handlers can return client-readable metadata alongside the built-in
|
|
1653
|
+
error code and message.
|
|
1654
|
+
|
|
1655
|
+
## 0.12.17
|
|
1656
|
+
|
|
1657
|
+
### Patch Changes
|
|
1658
|
+
|
|
1659
|
+
- [#179](https://github.com/udecode/kitcn/pull/179) [`4d2158b`](https://github.com/udecode/kitcn/commit/4d2158b09b4a316df96b4597e9c999517d7a44f8) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1660
|
+
|
|
1661
|
+
- Fix `kitcn codegen` module parsing so project `tsconfig.json` path aliases
|
|
1662
|
+
like `@/lib/crpc` resolve during codegen.
|
|
1663
|
+
- Fix `kitcn dev` and `kitcn codegen` parse-time env loading so Concave apps
|
|
1664
|
+
can read required values from the project root `.env`.
|
|
1665
|
+
|
|
1666
|
+
## 0.12.16
|
|
1667
|
+
|
|
1668
|
+
### Patch Changes
|
|
1669
|
+
|
|
1670
|
+
- [#177](https://github.com/udecode/kitcn/pull/177) [`2c7ff80`](https://github.com/udecode/kitcn/commit/2c7ff80b571147183316115e86df53f2dc1269d6) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1671
|
+
|
|
1672
|
+
- Fix shared `c.middleware()` auth chains so mutation procedures keep mutation
|
|
1673
|
+
writer types like `ctx.db.insert`.
|
|
1674
|
+
- Improve shared middleware docs so mutation-only middleware uses
|
|
1675
|
+
`c.middleware<MutationCtx>(...)` instead of a query-only workaround.
|
|
1676
|
+
|
|
1677
|
+
## 0.12.15
|
|
1678
|
+
|
|
1679
|
+
### Patch Changes
|
|
1680
|
+
|
|
1681
|
+
- [`a0037ff`](https://github.com/udecode/kitcn/commit/a0037ff26d46749f60788548cb73bf81404fbbc8) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1682
|
+
|
|
1683
|
+
- Fix the remaining `bunx --bun kitcn@latest init -t start --yes` bootstrap
|
|
1684
|
+
codegen failure when scaffolded files import `kitcn/server`.
|
|
1685
|
+
|
|
1686
|
+
## 0.12.14
|
|
1687
|
+
|
|
1688
|
+
### Patch Changes
|
|
1689
|
+
|
|
1690
|
+
- [`a5974eb`](https://github.com/udecode/kitcn/commit/a5974ebf70ce984aab6098ffad397c9b116fa7b9) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1691
|
+
|
|
1692
|
+
- Fix the remaining `bunx --bun kitcn@latest init -t start --yes` bootstrap
|
|
1693
|
+
parse failure by inlining a bootstrap-safe generated server stub for the real
|
|
1694
|
+
nested scaffold chain.
|
|
1695
|
+
|
|
1696
|
+
## 0.12.13
|
|
1697
|
+
|
|
1698
|
+
### Patch Changes
|
|
1699
|
+
|
|
1700
|
+
- [#170](https://github.com/udecode/kitcn/pull/170) [`437eff4`](https://github.com/udecode/kitcn/commit/437eff4f19222867dafc278f8f39aef9a81d4647) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1701
|
+
|
|
1702
|
+
- Fix `bunx --bun kitcn init -t start --yes` bootstrap parsing so scaffolded
|
|
1703
|
+
backend files resolve against the project install instead of the Bun cache,
|
|
1704
|
+
and preserve anonymous local Convex mode for follow-up `kitcn dev` runs.
|
|
1705
|
+
|
|
1706
|
+
## 0.12.12
|
|
1707
|
+
|
|
1708
|
+
### Patch Changes
|
|
1709
|
+
|
|
1710
|
+
- [#163](https://github.com/udecode/kitcn/pull/163) [`38ffd3c`](https://github.com/udecode/kitcn/commit/38ffd3c3843cc4549fd6366190b43977e23d34c0) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1711
|
+
|
|
1712
|
+
- Add `kitcn auth jwks` for manual static JWKS export and key rotation when a
|
|
1713
|
+
deployment cannot use the Convex-only `env push` flow.
|
|
1714
|
+
|
|
1715
|
+
## 0.12.11
|
|
1716
|
+
|
|
1717
|
+
### Patch Changes
|
|
1718
|
+
|
|
1719
|
+
- [#166](https://github.com/udecode/kitcn/pull/166) [`3a95ffb`](https://github.com/udecode/kitcn/commit/3a95ffbf86872dbd29dbe806c1a48a10189ce611) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1720
|
+
|
|
1721
|
+
- Fix `kitcn init -t next` monorepo scaffolds so the Next overlay targets the real app root under `apps/*` and uses the workspace package manager instead of assuming a single-app root layout.
|
|
1722
|
+
|
|
1723
|
+
- [#163](https://github.com/udecode/kitcn/pull/163) [`38ffd3c`](https://github.com/udecode/kitcn/commit/38ffd3c3843cc4549fd6366190b43977e23d34c0) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1724
|
+
|
|
1725
|
+
- Fix Concave local `kitcn dev` schema watches so `schema.ts` edits rerun fresh codegen and refresh generated schema outputs without a manual `kitcn codegen`.
|
|
1726
|
+
- Fix `count()` and aggregate range filters on `timestamp({ mode: "string" })`
|
|
1727
|
+
aggregateIndex suffix fields so stored millis buckets match ISO-string
|
|
1728
|
+
filters instead of silently returning zero.
|
|
1729
|
+
|
|
1730
|
+
## 0.12.10
|
|
1731
|
+
|
|
1732
|
+
### Patch Changes
|
|
1733
|
+
|
|
1734
|
+
- [#157](https://github.com/udecode/kitcn/pull/157) [`bb038d8`](https://github.com/udecode/kitcn/commit/bb038d880902ef3c2b7388161945dd067073c08f) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1735
|
+
|
|
1736
|
+
- Fix auth-bound React Query data so guest, sign-in, and account-switch transitions do not keep stale cached user data.
|
|
1737
|
+
|
|
1738
|
+
## 0.12.9
|
|
1739
|
+
|
|
1740
|
+
### Patch Changes
|
|
1741
|
+
|
|
1742
|
+
- [#154](https://github.com/udecode/kitcn/pull/154) [`4681298`](https://github.com/udecode/kitcn/commit/46812983553da242a7ee478fc2ec7d024ca018cc) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1743
|
+
|
|
1744
|
+
- Fix `kitcn dev` so projects with a remote Convex deployment in `.env.local` keep using that remote target instead of falling back to local Convex.
|
|
1745
|
+
|
|
1746
|
+
## 0.12.8
|
|
1747
|
+
|
|
1748
|
+
### Patch Changes
|
|
1749
|
+
|
|
1750
|
+
- [#152](https://github.com/udecode/kitcn/pull/152) [`92dd2bc`](https://github.com/udecode/kitcn/commit/92dd2bcf1ce35c1eb34315b88f025c7ee360a9a1) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1751
|
+
|
|
1752
|
+
- Fix interactive scaffold selection so duplicate file paths are shown once and the active preset stays selected.
|
|
1753
|
+
- Fix generated auth demo pages so sign-in and sign-up stay on the signed-in view instead of bouncing back to the auth route.
|
|
1754
|
+
|
|
1755
|
+
## 0.12.7
|
|
1756
|
+
|
|
1757
|
+
### Patch Changes
|
|
1758
|
+
|
|
1759
|
+
- [#150](https://github.com/udecode/kitcn/pull/150) [`9fb1adf`](https://github.com/udecode/kitcn/commit/9fb1adf3a8f9bb7b54ba4dd42c809c9b54ba7e31) Thanks [@zbeyens](https://github.com/zbeyens)! - - Pin the scaffolded Zod install to the supported Zod 4 line so npm
|
|
1760
|
+
`kitcn init -t start` resolves without the peer conflict hit during release
|
|
1761
|
+
validation.
|
|
1762
|
+
|
|
1763
|
+
## 0.12.6
|
|
1764
|
+
|
|
1765
|
+
### Patch Changes
|
|
1766
|
+
|
|
1767
|
+
- [#148](https://github.com/udecode/kitcn/pull/148) [`8c59d89`](https://github.com/udecode/kitcn/commit/8c59d892f5fdfc12448aee35d86f286378e61aa6) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Features
|
|
1768
|
+
|
|
1769
|
+
- Add `kitcn init -t start` for fresh TanStack Start apps.
|
|
1770
|
+
- Add `kitcn/auth/start` and Start-specific auth scaffolding for `kitcn add auth`.
|
|
1771
|
+
|
|
1772
|
+
## Patches
|
|
1773
|
+
|
|
1774
|
+
- Fix generated file rewrites so unchanged codegen output does not trigger
|
|
1775
|
+
repeated TanStack Start reloads during local development.
|
|
1776
|
+
|
|
1777
|
+
## 0.12.5
|
|
1778
|
+
|
|
1779
|
+
## 0.12.4
|
|
1780
|
+
|
|
1781
|
+
### Patch Changes
|
|
1782
|
+
|
|
1783
|
+
- [`d264542`](https://github.com/udecode/kitcn/commit/d264542e0e6818693cad2ad9520da145c0a72694) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1784
|
+
|
|
1785
|
+
- Fix `kitcn add auth` in fresh apps so auth planning installs its required dependencies before the scaffold loads Better Auth internals.
|
|
1786
|
+
|
|
1787
|
+
## 0.12.3
|
|
1788
|
+
|
|
1789
|
+
### Patch Changes
|
|
1790
|
+
|
|
1791
|
+
- [`ec0aaaa`](https://github.com/udecode/kitcn/commit/ec0aaaa525a95788db5b2ec76626ae445e68eae2) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1792
|
+
|
|
1793
|
+
- Fix scenario packaging for `@kitcn/resend` after the plugin moved `kitcn` to peer dependencies.
|
|
1794
|
+
|
|
1795
|
+
## 0.12.2
|
|
1796
|
+
|
|
1797
|
+
### Patch Changes
|
|
1798
|
+
|
|
1799
|
+
- [`4f9907e`](https://github.com/udecode/kitcn/commit/4f9907e95ceae9f30499b2bad0d1fb20d1fa5fc1) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1800
|
+
|
|
1801
|
+
- Fix fresh `bunx kitcn` installs so the CLI keeps TypeScript off the cold
|
|
1802
|
+
startup path and still boots when Bun omits `typescript` from the transient
|
|
1803
|
+
install tree.
|
|
1804
|
+
|
|
1805
|
+
## 0.12.1
|
|
1806
|
+
|
|
1807
|
+
### Patch Changes
|
|
1808
|
+
|
|
1809
|
+
- [`93726d3`](https://github.com/udecode/kitcn/commit/93726d3d337a7469f98efbf5d932beb370d09d5d) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
1810
|
+
|
|
1811
|
+
- Fix fresh `bunx kitcn init` installs so the published CLI ships its runtime
|
|
1812
|
+
TypeScript dependency instead of failing before scaffold setup starts.
|
|
1813
|
+
- Fix `kitcn init -t next --yes` so non-interactive local bootstrap provisions
|
|
1814
|
+
an anonymous Convex deployment instead of stopping on a login prompt.
|
|
1815
|
+
|
|
1816
|
+
## 0.12.0
|
|
1817
|
+
|
|
1818
|
+
### Minor Changes
|
|
1819
|
+
|
|
1820
|
+
- [#139](https://github.com/udecode/kitcn/pull/139) [`11aa0ee`](https://github.com/udecode/kitcn/commit/11aa0ee2091827e6d52b30c261004f4ed64cac07) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Breaking changes
|
|
1821
|
+
|
|
1822
|
+
- Use `kitcn` and `@kitcn/resend` as the published package names, CLI
|
|
1823
|
+
commands, import paths, generated comments, and scaffold output.
|
|
1824
|
+
|
|
1825
|
+
```ts
|
|
1826
|
+
// Before
|
|
1827
|
+
import { defineSchema } from "<previous package name>/orm";
|
|
1828
|
+
import { sendEmail } from "<previous scoped plugin>/resend";
|
|
1829
|
+
|
|
1830
|
+
// After
|
|
1831
|
+
import { defineSchema } from "kitcn/orm";
|
|
1832
|
+
import { sendEmail } from "@kitcn/resend";
|
|
1833
|
+
```
|
|
1834
|
+
|
|
1835
|
+
- Use `kitcn.json` as the default discovered kitcn config file.
|
|
1836
|
+
|
|
1837
|
+
```ts
|
|
1838
|
+
// Before
|
|
1839
|
+
export default {
|
|
1840
|
+
outputDir: "convex/shared",
|
|
1841
|
+
};
|
|
1842
|
+
|
|
1843
|
+
// After
|
|
1844
|
+
{
|
|
1845
|
+
"paths": {
|
|
1846
|
+
"shared": "convex/shared"
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
```
|
|
1850
|
+
|
|
1851
|
+
- Use app-owned schema composition from the default export. Package schema
|
|
1852
|
+
plugin entrypoints are gone, and relations/triggers chain on
|
|
1853
|
+
`defineSchema(...)`.
|
|
1854
|
+
|
|
1855
|
+
```ts
|
|
1856
|
+
// Before
|
|
1857
|
+
import { defineRelations, defineSchema } from "kitcn/orm";
|
|
1858
|
+
import { ratelimitPlugin } from "kitcn/plugins/ratelimit";
|
|
1859
|
+
|
|
1860
|
+
export const schema = defineSchema(tables, {
|
|
1861
|
+
plugins: [ratelimitPlugin()],
|
|
1862
|
+
});
|
|
1863
|
+
|
|
1864
|
+
export const relations = defineRelations(tables, (r) => ({
|
|
1865
|
+
users: {
|
|
1866
|
+
posts: r.many.posts(),
|
|
1867
|
+
},
|
|
1868
|
+
}));
|
|
1869
|
+
|
|
1870
|
+
// After
|
|
1871
|
+
import { defineSchema } from "kitcn/orm";
|
|
1872
|
+
import { ratelimitExtension } from "../lib/plugins/ratelimit/schema";
|
|
1873
|
+
|
|
1874
|
+
export default defineSchema(tables)
|
|
1875
|
+
.extend(ratelimitExtension())
|
|
1876
|
+
.relations((r) => ({
|
|
1877
|
+
users: {
|
|
1878
|
+
posts: r.many.posts(),
|
|
1879
|
+
},
|
|
1880
|
+
}));
|
|
1881
|
+
```
|
|
1882
|
+
|
|
1883
|
+
- Use `kitcn env push` and `kitcn env pull` for env sync.
|
|
1884
|
+
`env sync` is gone.
|
|
1885
|
+
|
|
1886
|
+
```bash
|
|
1887
|
+
# Before
|
|
1888
|
+
npx kitcn env sync --auth
|
|
1889
|
+
|
|
1890
|
+
# After
|
|
1891
|
+
npx kitcn env push
|
|
1892
|
+
```
|
|
1893
|
+
|
|
1894
|
+
- Use `kitcn/ratelimit` and `kitcn/ratelimit/react`. The old
|
|
1895
|
+
`kitcn/plugins/ratelimit*` surface is gone.
|
|
1896
|
+
|
|
1897
|
+
```ts
|
|
1898
|
+
// Before
|
|
1899
|
+
import { calculateRateLimit } from "kitcn/plugins/ratelimit";
|
|
1900
|
+
import { useRateLimit } from "kitcn/plugins/ratelimit/react";
|
|
1901
|
+
|
|
1902
|
+
// After
|
|
1903
|
+
import { calculateRatelimit } from "kitcn/ratelimit";
|
|
1904
|
+
import { useRatelimit } from "kitcn/ratelimit/react";
|
|
1905
|
+
```
|
|
1906
|
+
|
|
1907
|
+
## Features
|
|
1908
|
+
|
|
1909
|
+
- Add a registry-driven CLI with `init`, `add`, `view`, `info`, and `docs`,
|
|
1910
|
+
plus `--json`, dry-run, and diff output for scaffold changes.
|
|
1911
|
+
- Add backend-aware CLI support for both Convex and Concave, including
|
|
1912
|
+
`kitcn.json`, local bootstrap wrappers, and `kitcn verify`.
|
|
1913
|
+
- Add project-owned ORM migrations with generated `defineMigration(...)`
|
|
1914
|
+
helpers, migration manifests, docs, and `kitcn migrate`.
|
|
1915
|
+
- Add starter scaffolds for Next.js and Vite, plus adoption flows for raw
|
|
1916
|
+
Convex and create-convex-style apps.
|
|
1917
|
+
- Add packaged Convex skills and TanStack Intent metadata so installed apps
|
|
1918
|
+
carry their own agent guidance.
|
|
1919
|
+
- Add auth scaffolding and schema sync that picks up plugin changes from
|
|
1920
|
+
`auth.ts`, keeps `jwks` wired on first install, and supports raw Convex
|
|
1921
|
+
auth adoption.
|
|
1922
|
+
- Add `kitcn/auth/generated` and typed auth runtime helpers for
|
|
1923
|
+
generated auth files.
|
|
1924
|
+
- Add `@kitcn/resend` with scaffolded schema, plugin, webhook, cron,
|
|
1925
|
+
and email helpers.
|
|
1926
|
+
- Add app-owned schema extensions, typed plugin middleware helpers, and
|
|
1927
|
+
project-owned ratelimit scaffolding.
|
|
1928
|
+
- Add `codegen.trimSegments`, `unionOf(...)`, and broader `objectOf(...)`
|
|
1929
|
+
support for generated runtimes and schema builders.
|
|
1930
|
+
|
|
1931
|
+
## Patches
|
|
1932
|
+
|
|
1933
|
+
- Improve local dev and codegen so env bootstrap, JWKS sync, watcher reruns,
|
|
1934
|
+
and supported-Node re-exec behave consistently in real apps.
|
|
1935
|
+
- Improve `dev` and `verify` output so one-shot bootstrap stays readable while
|
|
1936
|
+
long-running dev still preserves raw Convex logs.
|
|
1937
|
+
- Improve codegen failure handling so fatal parse errors keep the last good
|
|
1938
|
+
generated files instead of clobbering them with partial output.
|
|
1939
|
+
- Fix relation pairing for aliased auth organization edges so generated
|
|
1940
|
+
runtimes recover cleanly in apps with multiple relations between the same
|
|
1941
|
+
tables.
|
|
1942
|
+
- Fix TanStack Query/provider drift and generated runtime typing so local apps
|
|
1943
|
+
avoid duplicate React Query context failures and self-import cycles.
|
|
1944
|
+
- Improve auth runtime behavior so local auth metadata routes stay quiet, state
|
|
1945
|
+
updates land immediately, and optional env values do not break auth analysis.
|
|
1946
|
+
- Improve schema-only auth refresh so app-owned `schema.ts` files merge missing
|
|
1947
|
+
compatible auth fields, indexes, and relations, then stop on real conflicts
|
|
1948
|
+
with manual-action guidance.
|
|
1949
|
+
- Keep internal example and scenario typechecks pointed at workspace source so
|
|
1950
|
+
fresh CI runs do not depend on stale built package output after package
|
|
1951
|
+
renames.
|
|
1952
|
+
- Fix ratelimit storage and generated scaffolds so apps use the real
|
|
1953
|
+
ratelimit tables instead of failing with bogus missing-table guidance.
|
|
1954
|
+
- Keep scaffolded apps on the tested Hono and TanStack Query baselines across
|
|
1955
|
+
the example app, generated fixtures, and prepared scenarios.
|
|
1956
|
+
|
|
1957
|
+
## 0.11.0
|
|
1958
|
+
|
|
1959
|
+
### Minor Changes
|
|
1960
|
+
|
|
1961
|
+
- [#135](https://github.com/udecode/kitcn/pull/135) [`2977aa6`](https://github.com/udecode/kitcn/commit/2977aa68204f239bce5214582f111901affdc2ee) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Breaking changes
|
|
1962
|
+
|
|
1963
|
+
- Drop Better Auth `1.4` support and align auth integrations with Better Auth `1.5.3` and `@convex-dev/better-auth@0.11.1`.
|
|
1964
|
+
- Remove bundled passkey schema assumptions and follow the upstream `oauthApplication.redirectUrls` rename during `0.11` migrations.
|
|
1965
|
+
|
|
1966
|
+
```ts
|
|
1967
|
+
// Before
|
|
1968
|
+
"better-auth": "1.4.9";
|
|
1969
|
+
"@convex-dev/better-auth": "0.10.11";
|
|
1970
|
+
|
|
1971
|
+
oauthApplication: {
|
|
1972
|
+
redirectURLs: ["https://example.com/callback"];
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
// After
|
|
1976
|
+
"better-auth": "1.5.3";
|
|
1977
|
+
"@convex-dev/better-auth": "0.11.1";
|
|
1978
|
+
|
|
1979
|
+
oauthApplication: {
|
|
1980
|
+
redirectUrls: ["https://example.com/callback"];
|
|
1981
|
+
}
|
|
1982
|
+
```
|
|
1983
|
+
|
|
1984
|
+
## Patches
|
|
1985
|
+
|
|
1986
|
+
- Improve Next.js server-side token forwarding by forcing `accept-encoding: identity` for internal auth fetches behind proxy compression.
|
|
1987
|
+
- Fix auth adapter selection and OR-query handling so `id` selects preserve `_id`, nullish filters behave correctly, unsupported `experimental.joins` are rejected, and OR updates/deletes/counts dedupe by document id.
|
|
1988
|
+
- Improve auth route origin handling by filtering nullish `trustedOrigins` values before CORS matching.
|
|
1989
|
+
- Reduce generated runtime boilerplate by moving lazy registry/factory caching and caller/handler context typing into shared server helpers without changing generated caller or handler types.
|
|
1990
|
+
|
|
1991
|
+
## 0.10.3
|
|
1992
|
+
|
|
1993
|
+
### Patch Changes
|
|
1994
|
+
|
|
1995
|
+
- [#132](https://github.com/udecode/kitcn/pull/132) [`7182e18`](https://github.com/udecode/kitcn/commit/7182e18a00ee038d64d14c0078a456678fa9e79f) Thanks [@thuillart](https://github.com/thuillart)! - Support loading ORM triggers from `triggers.ts` during codegen, with fallback to `schema.ts` for backward compatibility. This keeps `schema.ts` schema-safe when triggers need generated runtime helpers like `createXCaller(...)`.
|
|
1996
|
+
|
|
1997
|
+
## 0.10.2
|
|
1998
|
+
|
|
1999
|
+
### Patch Changes
|
|
2000
|
+
|
|
2001
|
+
- [#129](https://github.com/udecode/kitcn/pull/129) [`9262e6f`](https://github.com/udecode/kitcn/commit/9262e6fe823bf8ededc84c1ee2ba9087efa96aa9) Thanks [@thuillart](https://github.com/thuillart)! - Fix trigger-generated callers in `schema.ts` so they stay schema-safe during Convex pushes, and preserve mutation scheduling APIs when triggers are parameterized with `MutationCtx`.
|
|
2002
|
+
|
|
2003
|
+
## 0.10.1
|
|
2004
|
+
|
|
2005
|
+
### Patch Changes
|
|
2006
|
+
|
|
2007
|
+
- [#128](https://github.com/udecode/kitcn/pull/128) [`24e1e60`](https://github.com/udecode/kitcn/commit/24e1e60877b1a0c46631abc6d4118058d42acd4e) Thanks [@thuillart](https://github.com/thuillart)! - ## Patches
|
|
2008
|
+
- Fix `kitcn dev` codegen watch mode so added, changed, and removed procedure files regenerate runtime artifacts more reliably during local development.
|
|
2009
|
+
|
|
2010
|
+
## 0.10.0
|
|
2011
|
+
|
|
2012
|
+
### Minor Changes
|
|
2013
|
+
|
|
2014
|
+
- [#121](https://github.com/udecode/kitcn/pull/121) [`7aa4f16`](https://github.com/udecode/kitcn/commit/7aa4f1643b2538627d3c6e51a6e5ab34bec0b500) Thanks [@carere](https://github.com/carere)! - ## Features
|
|
2015
|
+
- Add SolidJS flavor with full feature parity to React integration
|
|
2016
|
+
- Add `ConvexProvider`, `ConvexProviderWithAuth`, `useConvex`, and `useConvexAuth` for SolidJS
|
|
2017
|
+
- Add `createConvexQueryClient` and `useConvexQuery` bridging Convex subscriptions to TanStack Solid Query
|
|
2018
|
+
- Add cRPC layer for SolidJS with typed query/mutation/action proxies
|
|
2019
|
+
- Add `useConvexInfiniteQuery` for paginated queries in SolidJS
|
|
2020
|
+
- Add `createConvexHTTPProxy` for SSR-compatible HTTP client in SolidJS
|
|
2021
|
+
- Add auth mutation helpers (`useSignIn`, `useSignUp`, `useSignOut`) for SolidJS
|
|
2022
|
+
- Add `useRateLimit` hook for SolidJS using `client.onUpdate()` subscriptions
|
|
2023
|
+
- Add `./solid` and `./plugins/ratelimit/solid` package exports
|
|
2024
|
+
|
|
2025
|
+
### Patch Changes
|
|
2026
|
+
|
|
2027
|
+
- [#126](https://github.com/udecode/kitcn/pull/126) [`0c88268`](https://github.com/udecode/kitcn/commit/0c88268d8efe4160a734ff119aba859d8b4b3fb3) Thanks [@thuillart](https://github.com/thuillart)! - Preserve real `createdAt` columns during ORM writes so auth records keep schema-defaulted timestamps when created through the generated auth runtime.
|
|
2028
|
+
|
|
2029
|
+
## 0.9.2
|
|
2030
|
+
|
|
2031
|
+
### Patch Changes
|
|
2032
|
+
|
|
2033
|
+
- [#123](https://github.com/udecode/kitcn/pull/123) [`ba8ce1a`](https://github.com/udecode/kitcn/commit/ba8ce1aaf23c7a152047115763d5e4b7a3e84a64) Thanks [@thuillart](https://github.com/thuillart)! - Pass the Convex deployment URL through the SSR server caller instead of falling back to `NEXT_PUBLIC_CONVEX_URL`.
|
|
2034
|
+
|
|
2035
|
+
`createCallerFactory` now derives the `.convex.cloud` URL from `convexSiteUrl` by default and also accepts an explicit `convexUrl` override for frameworks that do not use Next.js env naming.
|
|
2036
|
+
|
|
2037
|
+
- [#124](https://github.com/udecode/kitcn/pull/124) [`e19de1d`](https://github.com/udecode/kitcn/commit/e19de1d431857851012f9e5e4a1dfa276700c2cd) Thanks [@thuillart](https://github.com/thuillart)! - fix(auth): persist createdAt for auth records
|
|
2038
|
+
|
|
2039
|
+
## 0.9.1
|
|
2040
|
+
|
|
2041
|
+
### Patch Changes
|
|
2042
|
+
|
|
2043
|
+
- [#116](https://github.com/udecode/kitcn/pull/116) [`2c98958`](https://github.com/udecode/kitcn/commit/2c98958f35953dfb4514ee038d2363e3ac92df88) Thanks [@thuillart](https://github.com/thuillart)! - Fix `createEnv` throwing "Invalid environment variables" during `kitcn dev`. The CLI now sets a `globalThis.__KITCN_CODEGEN__` sentinel before importing Convex files via jiti, and `createEnv` reads that sentinel (instead of `process.env`) to activate a safe fallback — using `options[0]` for `z.enum` fields instead of `""` to avoid false validation failures.
|
|
2044
|
+
|
|
2045
|
+
- [#120](https://github.com/udecode/kitcn/pull/120) [`c50c99b`](https://github.com/udecode/kitcn/commit/c50c99b5585721e9e6dccc371c3007def1abd09c) Thanks [@zbeyens](https://github.com/zbeyens)! - Fix SSR auth token refresh when Convex requests `forceRefreshToken` during pending Better Auth session hydration.
|
|
2046
|
+
|
|
2047
|
+
`ConvexAuthProvider` now fetches a fresh JWT instead of reusing the cached SSR token in that forced-refresh path, so Convex can schedule preemptive refresh instead of waiting for an auth failure.
|
|
2048
|
+
|
|
2049
|
+
## 0.9.0
|
|
2050
|
+
|
|
2051
|
+
### Minor Changes
|
|
2052
|
+
|
|
2053
|
+
- [#112](https://github.com/udecode/kitcn/pull/112) [`5bd956c`](https://github.com/udecode/kitcn/commit/5bd956c7d6602d14f3a8f9062638b31879fa1160) Thanks [@zbeyens](https://github.com/zbeyens)! - ORM Discriminator (polymorphic):
|
|
2054
|
+
|
|
2055
|
+
- Drop the experimental query-level `polymorphic` config from `findMany`, `findFirst`, and `findFirstOrThrow`.
|
|
2056
|
+
|
|
2057
|
+
```ts
|
|
2058
|
+
// Before
|
|
2059
|
+
await db.query.auditLogs.findMany({
|
|
2060
|
+
polymorphic: {
|
|
2061
|
+
discriminator: "actionType",
|
|
2062
|
+
schema: targetSchema,
|
|
2063
|
+
cases: { role_change: "roleChange", document_update: "documentUpdate" },
|
|
2064
|
+
},
|
|
2065
|
+
limit: 20,
|
|
2066
|
+
});
|
|
2067
|
+
|
|
2068
|
+
// After
|
|
2069
|
+
const rows = await db.query.auditLogs.findMany({ limit: 20 });
|
|
2070
|
+
// Polymorphic data is synthesized from table schema at row.details
|
|
2071
|
+
```
|
|
2072
|
+
|
|
2073
|
+
- Add schema-first polymorphic discriminator columns via `discriminator({ variants, as? })` directly in `convexTable(...)`.
|
|
2074
|
+
- Add typed nested read unions at `details` by default (or custom alias via `as`).
|
|
2075
|
+
- Add `withVariants: true` as a query shortcut to auto-load one() relations on discriminator tables.
|
|
2076
|
+
- Reject invalid branch writes when required variant fields are missing.
|
|
2077
|
+
- Reject cross-branch write combinations that set fields outside the active discriminator variant.
|
|
2078
|
+
|
|
2079
|
+
### Patch Changes
|
|
2080
|
+
|
|
2081
|
+
- [#115](https://github.com/udecode/kitcn/pull/115) [`dab1447`](https://github.com/udecode/kitcn/commit/dab14473a9d2285459add2781fa5fbf9c8bd8569) Thanks [@zbeyens](https://github.com/zbeyens)! - - Improve `kitcn analyze` to respect `convex.json` `functions` paths so non-default layouts are discovered.
|
|
2082
|
+
|
|
2083
|
+
## 0.8.4
|
|
2084
|
+
|
|
2085
|
+
### Patch Changes
|
|
2086
|
+
|
|
2087
|
+
- [#110](https://github.com/udecode/kitcn/pull/110) [`589e2bc`](https://github.com/udecode/kitcn/commit/589e2bc932b78c552233babe37441deae7ebdcb9) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
2088
|
+
- Fix nested `arrayOf(objectOf(...))` field nullability so `text()` and `text().notNull()` produce distinct schema/data-model types and avoid deploy mismatches.
|
|
2089
|
+
|
|
2090
|
+
## 0.8.3
|
|
2091
|
+
|
|
2092
|
+
### Patch Changes
|
|
2093
|
+
|
|
2094
|
+
- [`7f23a8e`](https://github.com/udecode/kitcn/commit/7f23a8eb512b626b952313b31ed0c2a74b1bee46) Thanks [@zbeyens](https://github.com/zbeyens)! - Fix generated caller support for non-cRPC Convex procedure exports (like `orm.api()` internals such as `migrationStatus`).
|
|
2095
|
+
|
|
2096
|
+
- [`02e40e8`](https://github.com/udecode/kitcn/commit/02e40e8610b6f51962326abce95c51277c3d0177) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Features
|
|
2097
|
+
|
|
2098
|
+
- Add `polymorphic` query config support for `findMany()`, `findFirst()`, and `findFirstOrThrow()` to synthesize discriminated-union targets from `one()` relations.
|
|
2099
|
+
- Support custom target aliases with `polymorphic.as` (default alias is `target`) while preserving discriminated-union narrowing by discriminator value.
|
|
2100
|
+
|
|
2101
|
+
## Patches
|
|
2102
|
+
|
|
2103
|
+
- Validate polymorphic configs at runtime and throw on discriminator/case mismatches or schema parse failures.
|
|
2104
|
+
- Auto-load required polymorphic case relations during synthesis and strip them from results unless explicitly requested via `with`.
|
|
2105
|
+
- Reject `pipeline` + `polymorphic` combinations with explicit query-builder errors.
|
|
2106
|
+
|
|
2107
|
+
## 0.8.2
|
|
2108
|
+
|
|
2109
|
+
### Patch Changes
|
|
2110
|
+
|
|
2111
|
+
- [`fb0064b`](https://github.com/udecode/kitcn/commit/fb0064bba994ba0ea9db7d7862a6632f53c9cede) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Features
|
|
2112
|
+
- Add `getSessionNetworkSignals(ctx, session?)` in `kitcn/auth` to expose session-derived `ip` and `userAgent` for query/mutation middleware and rate-limit guards without per-endpoint HTTP wrappers.
|
|
2113
|
+
|
|
2114
|
+
## 0.8.1
|
|
2115
|
+
|
|
2116
|
+
### Patch Changes
|
|
2117
|
+
|
|
2118
|
+
- [`fc9e17c`](https://github.com/udecode/kitcn/commit/fc9e17c7cf220435451e45eeb2cc08c8d34c7d46) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Fixes
|
|
2119
|
+
- Fix `kitcn/plugins/ratelimit` so `limit()` and `check()` no longer call timer APIs (`setTimeout`/`clearTimeout`) during normal execution.
|
|
2120
|
+
- Remove `blockUntilReady()`
|
|
2121
|
+
|
|
2122
|
+
## 0.8.0
|
|
2123
|
+
|
|
2124
|
+
### Minor Changes
|
|
2125
|
+
|
|
2126
|
+
- [#105](https://github.com/udecode/kitcn/pull/105) [`9ea3902`](https://github.com/udecode/kitcn/commit/9ea3902a9b37bf1206c99c46d3121b95b10af8e7) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Breaking Changes
|
|
2127
|
+
|
|
2128
|
+
- Moved imports from `kitcn/migration` to `kitcn/orm`.
|
|
2129
|
+
|
|
2130
|
+
## Features
|
|
2131
|
+
|
|
2132
|
+
- Add `arrayOf(...)` and `objectOf(...)` ORM helpers to reduce `custom(...)` boilerplate for nested array/object schemas.
|
|
2133
|
+
- Add schema plugin pipeline to `defineSchema(...)` with builtin/default `aggregatePlugin()` and `migrationPlugin()`.
|
|
2134
|
+
- Add optional `plugins` option on `defineSchema` so feature tables can be opt-in.
|
|
2135
|
+
- Expose `aggregatePlugin` and `migrationPlugin` from `kitcn/plugins`.
|
|
2136
|
+
- Add new `kitcn/plugins/ratelimit` module with Upstash-style APIs (`limit`, `check`, `getRemaining`, `blockUntilReady`, `resetUsedTokens`, dynamic limits, timeout/cache/deny reasons) backed by Convex DB tables.
|
|
2137
|
+
- Add `kitcn/plugins/ratelimit/react` with `useRateLimit` hook support for browser-side status checks and retry timing.
|
|
2138
|
+
- Add `ratelimitPlugin()` for explicit ratelimit internal table enablement in ORM `defineSchema`.
|
|
2139
|
+
|
|
2140
|
+
Usage:
|
|
2141
|
+
|
|
2142
|
+
- Replace example app rate limiting from `@convex-dev/rate-limiter` component usage to `kitcn/plugins/ratelimit`.
|
|
2143
|
+
- Add `/ratelimit` coverage demo and guard test suite for ratelimit coverage definitions.
|
|
2144
|
+
- Rewrite rate-limiting docs/template references to the new `kitcn/plugins/ratelimit` package surface.
|
|
2145
|
+
|
|
2146
|
+
## 0.7.3
|
|
2147
|
+
|
|
2148
|
+
### Patch Changes
|
|
2149
|
+
|
|
2150
|
+
- [#103](https://github.com/udecode/kitcn/pull/103) [`590c6e3`](https://github.com/udecode/kitcn/commit/590c6e37d1d61cd4f91b7edba3cd3120206d751a) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Features
|
|
2151
|
+
- Add built-in ORM migrations with `defineMigration`, `defineMigrationSet`, and typed migration plan/status helpers.
|
|
2152
|
+
- Add generated migration procedures (`migrationRun`, `migrationRunChunk`, `migrationStatus`, `migrationCancel`) to generated server/runtime contracts.
|
|
2153
|
+
- Add `kitcn migrate` CLI commands: `create`, `up`, `down`, `status`, and `cancel`.
|
|
2154
|
+
- Add migration orchestration to `kitcn dev` and `kitcn deploy` with configurable strictness, waiting, batching, and drift policy.
|
|
2155
|
+
- Add safe-bypass migration writes by default with per-migration `writeMode: "normal"` override.
|
|
2156
|
+
- Make `kitcn reset` clear migration state/history tables (`migration_state`, `migration_run`) in addition to user and aggregate tables.
|
|
2157
|
+
|
|
2158
|
+
## 0.7.2
|
|
2159
|
+
|
|
2160
|
+
### Patch Changes
|
|
2161
|
+
|
|
2162
|
+
- [`9bccd91`](https://github.com/udecode/kitcn/commit/9bccd91a5ac883fcfe6d1345d1f04ca000dcd62e) Thanks [@zbeyens](https://github.com/zbeyens)! - Fix auth adapter date output regression.
|
|
2163
|
+
|
|
2164
|
+
`getAuth(ctx).api.*` date fields are normalized back to Convex-safe unix millis (`number`) on output, preventing unsupported `Date` values from leaking into raw Convex query/mutation/action returns (for example `auth.api.listOrganizations`).
|
|
2165
|
+
|
|
2166
|
+
## 0.7.1
|
|
2167
|
+
|
|
2168
|
+
### Patch Changes
|
|
2169
|
+
|
|
2170
|
+
- [#99](https://github.com/udecode/kitcn/pull/99) [`ea02427`](https://github.com/udecode/kitcn/commit/ea02427192747fe18859de2e65ede0a96ba7a446) Thanks [@zbeyens](https://github.com/zbeyens)! - ## Patches
|
|
2171
|
+
- Fix server auth queries and mutations to refresh stale JWTs and retry once on unauthorized responses before returning unauthenticated results.
|
|
2172
|
+
- Fix auth header generation to fall back to Better Auth session-token cookies when JWT identity is unavailable, including secure and custom cookie prefixes.
|
|
2173
|
+
- Update `@convex-dev/better-auth` support to `0.10.11` to include upstream cross-domain and Convex plugin auth fixes.
|
|
2174
|
+
- Fix `ConvexAuthProvider` token refresh behavior by deduplicating concurrent token fetches and forcing non-throwing internal token fetch calls.
|
|
2175
|
+
- Improve SSR/OTT auth stability in `ConvexAuthProvider` so session hydration and one-time-token URL handling avoid transient unauthorized states.
|
|
2176
|
+
- Align reactive auth query subscriptions with `skipUnauth` semantics so unauthorized subscription updates resolve to `null` instead of triggering unauthorized callbacks.
|
|
2177
|
+
- Ensure `ConvexAuthProvider` auth state follows confirmed Better Auth session state so stale JWTs do not keep authenticated state after sign-out.
|
|
2178
|
+
- Fix auth adapter date output normalization to return `Date` values for date fields.
|
|
2179
|
+
- Fix Next.js auth token forwarding by removing body-related headers from internal token fetch requests.
|
|
2180
|
+
- Prefer `better-auth/minimal` imports in auth runtime/type paths where available
|
|
2181
|
+
|
|
2182
|
+
## 0.7.0
|
|
2183
|
+
|
|
2184
|
+
### Minor Changes
|
|
2185
|
+
|
|
2186
|
+
- [#97](https://github.com/udecode/kitcn/pull/97) [`4f83203`](https://github.com/udecode/kitcn/commit/4f83203381bbd5030db77b76baed47db29d25057) Thanks [@{](https://github.com/{)! - ## Auth
|
|
2187
|
+
|
|
2188
|
+
### Breaking changes
|
|
2189
|
+
|
|
2190
|
+
- Redesign auth trigger API from flat callbacks to nested `{ create, update, delete, change }` shape matching ORM `defineTriggers` pattern.
|
|
2191
|
+
- Replace split auth exports (`getAuthOptions` + `authTriggers`) with one default `defineAuth((ctx) => ({ ...options, triggers }))` contract.
|
|
2192
|
+
- Drop generated trigger procedures (`beforeCreate`, `onCreate`, `beforeUpdate`, `onUpdate`, `beforeDelete`, `onDelete`); triggers now run inline in the same CRUD transaction.
|
|
2193
|
+
- Add `ctx` as second parameter to all trigger callbacks for access to mutation context.
|
|
2194
|
+
- Add `before` hook return contract: `void` (continue unchanged), `{ data }` (shallow merge into payload), `false` (cancel write).
|
|
2195
|
+
- Add unified `change(change, ctx)` handler with discriminated union `{ operation, id, newDoc, oldDoc }`.
|
|
2196
|
+
- Rename `createApi` option `skipValidation` to `validateInput`; default is now `validateInput: false`.
|
|
2197
|
+
- Rename auth package entrypoints from hyphenated to namespaced paths:
|
|
2198
|
+
- `kitcn/auth-client` -> `kitcn/auth/client`
|
|
2199
|
+
- `kitcn/auth-config` -> `kitcn/auth/config`
|
|
2200
|
+
- `kitcn/auth-nextjs` -> `kitcn/auth/nextjs`
|
|
2201
|
+
- Move HTTP auth helpers to `kitcn/auth/http`:
|
|
2202
|
+
- `authMiddleware` and `registerRoutes` now import from `kitcn/auth/http` (not `kitcn/auth`).
|
|
2203
|
+
- `kitcn/auth/http` auto-installs the Convex-safe `MessageChannel` polyfill. You can remove your own `http-polyfills.ts` file.
|
|
2204
|
+
|
|
2205
|
+
```ts
|
|
2206
|
+
// Before
|
|
2207
|
+
export const getAuthOptions = (ctx) => ({ ...options });
|
|
2208
|
+
export const authTriggers = { user: { onCreate: async (ctx, user) => {} } };
|
|
2209
|
+
|
|
2210
|
+
// After
|
|
2211
|
+
import { defineAuth } from "./generated/auth";
|
|
2212
|
+
|
|
2213
|
+
export default defineAuth((ctx) => ({
|
|
2214
|
+
...options,
|
|
2215
|
+
triggers: {
|
|
2216
|
+
|
|
2217
|
+
create: {
|
|
2218
|
+
before: async (data, ctx) => ({ data: { ...data, role: "user" } }),
|
|
2219
|
+
after: async (doc, ctx) => {},
|
|
2220
|
+
},
|
|
2221
|
+
update: {
|
|
2222
|
+
after: async (newDoc, ctx) => {},
|
|
2223
|
+
},
|
|
2224
|
+
change: async (change, ctx) => {
|
|
2225
|
+
// change.operation: 'insert' | 'update' | 'delete'
|
|
2226
|
+
// change.id, change.newDoc, change.oldDoc
|
|
2227
|
+
},
|
|
2228
|
+
},
|
|
2229
|
+
},
|
|
2230
|
+
}));
|
|
2231
|
+
```
|
|
2232
|
+
|
|
2233
|
+
```ts
|
|
2234
|
+
// Before
|
|
2235
|
+
import { getAuth } from "./auth";
|
|
2236
|
+
createApi(schema, getAuth, { skipValidation: true });
|
|
2237
|
+
|
|
2238
|
+
// After
|
|
2239
|
+
import { getAuth } from "./generated/auth";
|
|
2240
|
+
createApi(schema, getAuth); // validateInput defaults to false
|
|
2241
|
+
createApi(schema, getAuth, { validateInput: true });
|
|
2242
|
+
```
|
|
2243
|
+
|
|
2244
|
+
```ts
|
|
2245
|
+
// Before
|
|
2246
|
+
import { convexClient } from "kitcn/auth-client";
|
|
2247
|
+
import { getAuthConfigProvider } from "kitcn/auth-config";
|
|
2248
|
+
import { convexBetterAuth } from "kitcn/auth-nextjs";
|
|
2249
|
+
|
|
2250
|
+
// After
|
|
2251
|
+
import { convexClient } from "kitcn/auth/client";
|
|
2252
|
+
import { getAuthConfigProvider } from "kitcn/auth/config";
|
|
2253
|
+
import { convexBetterAuth } from "kitcn/auth/nextjs";
|
|
2254
|
+
```
|
|
2255
|
+
|
|
2256
|
+
```ts
|
|
2257
|
+
// Before
|
|
2258
|
+
import "../lib/http-polyfills";
|
|
2259
|
+
import { authMiddleware, registerRoutes } from "kitcn/auth";
|
|
2260
|
+
|
|
2261
|
+
// After
|
|
2262
|
+
import { authMiddleware, registerRoutes } from "kitcn/auth/http";
|
|
2263
|
+
```
|
|
2264
|
+
|
|
2265
|
+
### Features
|
|
2266
|
+
|
|
2267
|
+
- Add `defineAuth` helpers to unify codegen and non-codegen auth setup.
|
|
2268
|
+
- Add always-generated Better Auth runtime contract in `convex/functions/generated/auth.ts`.
|
|
2269
|
+
- Add generated `defineAuth` export in `convex/functions/generated/auth.ts` for inference-first `auth.ts` authoring.
|
|
2270
|
+
- Support ORM-aware auth writes (insert/update/delete go through ORM when available).
|
|
2271
|
+
|
|
2272
|
+
## Codegen
|
|
2273
|
+
|
|
2274
|
+
### Breaking changes
|
|
2275
|
+
|
|
2276
|
+
- Drop generated internal auth calls from `internal.auth.*`; use `internal.generated.*`.
|
|
2277
|
+
- Drop manual `initCRPC.dataModel().context(...)` bootstrap; import generated `initCRPC` from `convex/functions/generated/server`.
|
|
2278
|
+
- Drop manual `ctx.runQuery`/`ctx.runMutation` for inter-procedure calls; use per-module `create<Module>Handler`/`create<Module>Caller` from `convex/functions/generated/<module>.runtime`.
|
|
2279
|
+
- Require `export const httpRouter = router(...)` in `convex/functions/http.ts` so codegen can include typed HTTP routes in generated API output.
|
|
2280
|
+
|
|
2281
|
+
```ts
|
|
2282
|
+
// Before
|
|
2283
|
+
import { initCRPC } from "kitcn/server";
|
|
2284
|
+
import type { DataModel } from "./_generated/dataModel";
|
|
2285
|
+
|
|
2286
|
+
const c = initCRPC
|
|
2287
|
+
.dataModel<DataModel>()
|
|
2288
|
+
.context({
|
|
2289
|
+
query: (ctx) => withOrm(ctx),
|
|
2290
|
+
mutation: (ctx) => withOrm(ctx),
|
|
2291
|
+
})
|
|
2292
|
+
.meta<{
|
|
2293
|
+
auth?: "optional" | "required";
|
|
2294
|
+
role?: "admin";
|
|
2295
|
+
rateLimit?: string;
|
|
2296
|
+
}>()
|
|
2297
|
+
.create();
|
|
2298
|
+
|
|
2299
|
+
// After
|
|
2300
|
+
import { initCRPC } from "./generated/server";
|
|
2301
|
+
|
|
2302
|
+
const c = initCRPC
|
|
2303
|
+
.meta<{
|
|
2304
|
+
auth?: "optional" | "required";
|
|
2305
|
+
role?: "admin";
|
|
2306
|
+
rateLimit?: string;
|
|
2307
|
+
}>()
|
|
2308
|
+
.create();
|
|
2309
|
+
```
|
|
2310
|
+
|
|
2311
|
+
```ts
|
|
2312
|
+
// Before (http.ts)
|
|
2313
|
+
export const appRouter = router({
|
|
2314
|
+
health,
|
|
2315
|
+
todos: todosRouter,
|
|
2316
|
+
});
|
|
2317
|
+
export default createHttpRouter(app, appRouter);
|
|
2318
|
+
|
|
2319
|
+
// After (http.ts)
|
|
2320
|
+
export const httpRouter = router({
|
|
2321
|
+
health,
|
|
2322
|
+
todos: todosRouter,
|
|
2323
|
+
});
|
|
2324
|
+
export default createHttpRouter(app, httpRouter);
|
|
2325
|
+
```
|
|
2326
|
+
|
|
2327
|
+
### Features
|
|
2328
|
+
|
|
2329
|
+
- Add generated `convex/functions/generated/` directory:
|
|
2330
|
+
- `generated/server.ts` — ORM exports (`orm`, `withOrm`, `scheduledMutationBatch`, `scheduledDelete`), wrapped ctx types (`OrmCtx`, `QueryCtx`, `MutationCtx`, `GenericCtx`), prewired `initCRPC`.
|
|
2331
|
+
- `generated/auth.ts` — `defineAuth`, `getAuth`, auth runtime contract.
|
|
2332
|
+
- `generated/<module>.runtime.ts` — per-module scoped caller/handler factories.
|
|
2333
|
+
- Add per-module `create<Module>Handler(ctx)` (DEFAULT) for zero-overhead internal composition in queries/mutations. Bypasses input validation, middleware, and output validation. Same transaction, no serialization.
|
|
2334
|
+
- Add per-module `create<Module>Caller(ctx)` for actions and HTTP routes only. Goes through validation + middleware.
|
|
2335
|
+
- Root calls in `ActionCtx` dispatch via `ctx.runQuery` / `ctx.runMutation`.
|
|
2336
|
+
- Direct action calls are explicit under `caller.actions.*` and dispatch via `ctx.runAction`.
|
|
2337
|
+
- Scheduled calls are available under `caller.schedule.*`:
|
|
2338
|
+
- `caller.schedule.now.<mutation|action>(input)` (alias for `after(0)`)
|
|
2339
|
+
- `caller.schedule.after(ms).<mutation|action>(input)`
|
|
2340
|
+
- `caller.schedule.at(dateOrMs).<mutation|action>(input)`
|
|
2341
|
+
- `caller.schedule.cancel(jobId)`
|
|
2342
|
+
- Auto-generate procedure registry per module from cRPC exports (public + internal).
|
|
2343
|
+
- Enforce call matrix: query ctx → root queries only; mutation ctx → root queries+mutations plus `schedule`; action ctx → root queries+mutations plus `actions` and `schedule`.
|
|
2344
|
+
- Reserve module export names `actions` and `schedule` in runtime callers (codegen throws explicit conflict error).
|
|
2345
|
+
- Never use `ctx.runQuery`/`ctx.runMutation` directly — always use `create<Module>Handler` or `create<Module>Caller`.
|
|
2346
|
+
- Keep manual `initCRPC` setup from `kitcn/server` supported for apps not using codegen.
|
|
2347
|
+
- Add `kitcn.json` support (plus `--config <path>`) for codegen/dev defaults, feature toggles (`api`, `auth`), and passthrough Convex arg presets.
|
|
2348
|
+
|
|
2349
|
+
```ts
|
|
2350
|
+
// Before — manual runQuery/runMutation with function references
|
|
2351
|
+
import { api, internal } from "./_generated/api";
|
|
2352
|
+
|
|
2353
|
+
const result = await ctx.runQuery(api.todos.list, { limit: 10 });
|
|
2354
|
+
await ctx.runMutation(internal.todoInternal.create, { userId, ...input });
|
|
2355
|
+
|
|
2356
|
+
// After (query/mutation) — per-module handler, zero overhead, same transaction
|
|
2357
|
+
import { createSeedHandler } from "./generated/seed.runtime";
|
|
2358
|
+
|
|
2359
|
+
const handler = createSeedHandler(ctx);
|
|
2360
|
+
await handler.cleanupSeedData();
|
|
2361
|
+
await handler.seedUsers();
|
|
2362
|
+
```
|
|
2363
|
+
|
|
2364
|
+
```ts
|
|
2365
|
+
// After (action/HTTP) — per-module caller, validation + middleware
|
|
2366
|
+
import { createSeedCaller } from "./generated/seed.runtime";
|
|
2367
|
+
|
|
2368
|
+
const caller = createSeedCaller(ctx);
|
|
2369
|
+
await caller.generateSamplesBatch({ count: 5, userId, batchIndex: 0 });
|
|
2370
|
+
```
|
|
2371
|
+
|
|
2372
|
+
### Patches
|
|
2373
|
+
|
|
2374
|
+
- Add generated internal API refs for async ORM workers and generated auth handlers under `internal.generated`.
|
|
2375
|
+
|
|
2376
|
+
## API Types
|
|
2377
|
+
|
|
2378
|
+
### Breaking changes
|
|
2379
|
+
|
|
2380
|
+
- Drop separate `meta` arguments in context/proxy/caller/auth setup APIs; pass only `api`.
|
|
2381
|
+
- Drop the `@convex/types` workflow and use generated `@convex/api` types.
|
|
2382
|
+
- Drop manual codegen outputs `convex/shared/meta.ts` and `convex/shared/types.ts` in favor of generated `convex/shared/api.ts`.
|
|
2383
|
+
|
|
2384
|
+
```ts
|
|
2385
|
+
// Before
|
|
2386
|
+
import type { Api, ApiInputs, ApiOutputs } from "@convex/types";
|
|
2387
|
+
createCRPCContext({ api, meta, convexSiteUrl });
|
|
2388
|
+
createServerCRPCProxy({ api, meta });
|
|
2389
|
+
|
|
2390
|
+
// After
|
|
2391
|
+
import type { Api, ApiInputs, ApiOutputs } from "@convex/api";
|
|
2392
|
+
createCRPCContext({ api, convexSiteUrl });
|
|
2393
|
+
createServerCRPCProxy({ api });
|
|
2394
|
+
```
|
|
2395
|
+
|
|
2396
|
+
```ts
|
|
2397
|
+
// Before
|
|
2398
|
+
import type { Select, Insert } from "./shared/types";
|
|
2399
|
+
|
|
2400
|
+
// After
|
|
2401
|
+
import type { Select, Insert } from "@convex/api";
|
|
2402
|
+
```
|
|
2403
|
+
|
|
2404
|
+
### Features
|
|
2405
|
+
|
|
2406
|
+
- Add a single generated `@convex/api` surface that exports `api`, `Api`, `ApiInputs`, and `ApiOutputs` for client typing.
|
|
2407
|
+
- Add optional generated table helpers (`TableName`, `Select`, `Insert`) when schema exports `tables`.
|
|
2408
|
+
|
|
2409
|
+
### Patches
|
|
2410
|
+
|
|
2411
|
+
- Add Date-safe API inference from cRPC exports so `z.date()` fields stay typed as `Date` in generated API input/output types.
|
|
2412
|
+
- Improve generated `Api` typing so HTTP router types are embedded in `typeof api`, reducing manual `<Api>` generics in common setup calls.
|
|
2413
|
+
- Build function metadata from the generated `api` object at runtime, eliminating separate `meta` plumbing in cRPC React/RSC/server helpers.
|
|
2414
|
+
- Filter internal/private namespaces from generated client/caller type surfaces (e.g. `_http`, `_generated`-style keys).
|
|
2415
|
+
- Improve lazy caller invalid-path errors with clearer failure messages.
|
|
2416
|
+
|
|
2417
|
+
```ts
|
|
2418
|
+
// Before
|
|
2419
|
+
import type { Api } from "@convex/api";
|
|
2420
|
+
|
|
2421
|
+
export const { CRPCProvider, useCRPC, useCRPCClient } =
|
|
2422
|
+
createCRPCContext<Api>({
|
|
2423
|
+
api,
|
|
2424
|
+
convexSiteUrl: env.NEXT_PUBLIC_CONVEX_SITE_URL,
|
|
2425
|
+
});
|
|
2426
|
+
|
|
2427
|
+
export const crpc = createServerCRPCProxy<Api>({ api });
|
|
2428
|
+
|
|
2429
|
+
// After
|
|
2430
|
+
export const { CRPCProvider, useCRPC, useCRPCClient } = createCRPCContext({
|
|
2431
|
+
api,
|
|
2432
|
+
convexSiteUrl: env.NEXT_PUBLIC_CONVEX_SITE_URL,
|
|
2433
|
+
});
|
|
2434
|
+
|
|
2435
|
+
export const crpc = createServerCRPCProxy({ api });
|
|
2436
|
+
```
|
|
2437
|
+
|
|
2438
|
+
## Dependency
|
|
2439
|
+
|
|
2440
|
+
### Breaking changes
|
|
2441
|
+
|
|
2442
|
+
- Bump Convex minimum peer dependency to `>=1.32`.
|
|
2443
|
+
|
|
2444
|
+
## ORM
|
|
2445
|
+
|
|
2446
|
+
### Breaking changes
|
|
2447
|
+
|
|
2448
|
+
- Drop manual `convex/lib/orm.ts` server wiring; import `orm`/`withOrm` from `convex/functions/generated/server`.
|
|
2449
|
+
- Drop `OrmQueryCtx`/`OrmMutationCtx`; import wrapped `QueryCtx`/`MutationCtx` from `convex/functions/generated/server`.
|
|
2450
|
+
- Table-level lifecycle registration in `convexTable(..., extraConfig)` is removed.
|
|
2451
|
+
- Lifecycle helpers `onInsert`, `onUpdate`, `onDelete`, and `onChange` are removed from `kitcn/orm`.
|
|
2452
|
+
|
|
2453
|
+
```ts
|
|
2454
|
+
// Before
|
|
2455
|
+
import type { OrmQueryCtx, OrmMutationCtx } from "../lib/orm";
|
|
2456
|
+
import { withOrm } from "../lib/orm";
|
|
2457
|
+
|
|
2458
|
+
// After
|
|
2459
|
+
import type { QueryCtx, MutationCtx } from "./generated/server";
|
|
2460
|
+
import { withOrm } from "./generated/server";
|
|
2461
|
+
```
|
|
2462
|
+
|
|
2463
|
+
### Features
|
|
2464
|
+
|
|
2465
|
+
- ORM triggers are schema-level only and must be exported as `export const triggers = defineTriggers(relations, { ... })`.
|
|
2466
|
+
- Trigger definitions use object hooks per table:
|
|
2467
|
+
- `create.before` / `create.after`
|
|
2468
|
+
- `update.before` / `update.after`
|
|
2469
|
+
- `delete.before` / `delete.after`
|
|
2470
|
+
- `change(change, ctx)`
|
|
2471
|
+
- `before` return contract is:
|
|
2472
|
+
- `void` => continue unchanged
|
|
2473
|
+
- `{ data }` => shallow merge into write payload
|
|
2474
|
+
- `false` => cancel write via `TriggerCancelledError`
|
|
2475
|
+
- Generated server wiring includes `triggers` only when `schema.ts` exports both `relations` and `triggers`.
|
|
2476
|
+
- Add `createOrm({ schema, triggers })` support for generated and manual setups.
|
|
2477
|
+
- Add `ctx.orm.withoutTriggers(callback)` to bypass trigger hooks for bulk operations (e.g. data resets, migrations). The callback receives a trigger-free ORM instance scoped to the same transaction.
|
|
2478
|
+
|
|
2479
|
+
## Aggregates
|
|
2480
|
+
|
|
2481
|
+
### Features
|
|
2482
|
+
|
|
2483
|
+
- Add built-in aggregate-core runtime (B-tree backed).
|
|
2484
|
+
- Add `aggregateIndex` schema builder for declaring ORM count and aggregate index coverage:
|
|
2485
|
+
- `aggregateIndex(name).on(field1, field2)` — filter key fields.
|
|
2486
|
+
- `aggregateIndex(name).all()` — unfiltered (global) metrics.
|
|
2487
|
+
- Chainable metric methods: `.count(field)`, `.sum(field)`, `.avg(field)`, `.min(field)`, `.max(field)`.
|
|
2488
|
+
|
|
2489
|
+
```ts
|
|
2490
|
+
// Schema declaration
|
|
2491
|
+
const orders = convexTable(
|
|
2492
|
+
"orders",
|
|
2493
|
+
{ orgId: text(), amount: integer(), score: integer() },
|
|
2494
|
+
(t) => [
|
|
2495
|
+
aggregateIndex("by_org")
|
|
2496
|
+
.on(t.orgId)
|
|
2497
|
+
.sum(t.amount)
|
|
2498
|
+
.avg(t.amount)
|
|
2499
|
+
.min(t.score)
|
|
2500
|
+
.max(t.score),
|
|
2501
|
+
aggregateIndex("all_metrics").all().sum(t.amount).count(t.orgId),
|
|
2502
|
+
]
|
|
2503
|
+
);
|
|
2504
|
+
```
|
|
2505
|
+
|
|
2506
|
+
- Add `ctx.orm.query.<table>.count()` and `ctx.orm.query.<table>.count({ where, select, orderBy, skip, take, cursor })` for O(1) filtered counts backed by `aggregateIndex`. Windowed count (`skip`/`take`/`cursor`) counts rows within a window defined by ordering and bounds.
|
|
2507
|
+
- Add `ctx.orm.query.<table>.aggregate({ where, _count, _sum, _avg, _min, _max, orderBy, skip, take, cursor })` for Prisma-style aggregate blocks with optional windowed bounds.
|
|
2508
|
+
- Add safe finite `OR` rewrite for aggregate/count `where` — `OR` branches collapse when each is index-plannable (differs on one scalar eq/in/isNull field).
|
|
2509
|
+
- Add `findMany({ distinct })` deterministic `DISTINCT_UNSUPPORTED` error directing to `select().distinct({ fields })` pipeline.
|
|
2510
|
+
- Add relation `_count` loading via `with: { _count: { todos: true } }` with optional filtered variants.
|
|
2511
|
+
- Add through-filtered relation `_count` for `through()` relations using indexed lookups + no-scan-safe filter validation.
|
|
2512
|
+
- Add mutation `returning({ _count })` for insert/update/delete via split selection + relation count loading.
|
|
2513
|
+
- Add Prisma-style `_sum` nullability: returns `null` for empty sets or all-null field values (instead of `0`).
|
|
2514
|
+
- Add `groupBy()` to the ORM query builder with Prisma-style `by`, `_count`, `_sum`, `_avg`, `_min`, `_max` blocks. Requires finite `where` constraints (`eq`/`in`/`isNull`) on every `by` field — no `having`/`orderBy`/`skip`/`take`/`cursor` in v1.
|
|
2515
|
+
|
|
2516
|
+
```ts
|
|
2517
|
+
// Count
|
|
2518
|
+
const total = await ctx.orm.query.todos.count({ where: { projectId } });
|
|
2519
|
+
|
|
2520
|
+
// Aggregate
|
|
2521
|
+
const stats = await ctx.orm.query.orders.aggregate({
|
|
2522
|
+
where: { orgId: "org-1" },
|
|
2523
|
+
_count: { _all: true },
|
|
2524
|
+
_sum: { amount: true },
|
|
2525
|
+
_avg: { amount: true },
|
|
2526
|
+
});
|
|
2527
|
+
|
|
2528
|
+
// Relation _count
|
|
2529
|
+
const users = await ctx.orm.query.user.findMany({
|
|
2530
|
+
with: { _count: { todos: { where: { completed: true } } } },
|
|
2531
|
+
});
|
|
2532
|
+
```
|
|
2533
|
+
|
|
2534
|
+
- Add generated `aggregateBackfill` and `aggregateBackfillStatus` procedures for index building and status polling.
|
|
2535
|
+
- Add ORM internal storage tables (`aggregate_bucket`, `aggregate_member`, `aggregate_extrema`, `aggregate_state`, `aggregate_rank_tree`, `aggregate_rank_node`) auto-injected by `defineSchema`. Convex rejects table names starting with `_`, so internals use the `aggregate_` prefix.
|
|
2536
|
+
- Add `rankIndex` schema builder for declaring ranked/ordered aggregate indexes:
|
|
2537
|
+
- `rankIndex(name).partitionBy(field1, field2).orderBy(t.score).sum(t.amount)` — partitioned rank index with optional weighted sum.
|
|
2538
|
+
- `rankIndex(name).all().orderBy(t.score)` — unpartitioned (global) rank index.
|
|
2539
|
+
- `orderBy()` supports `integer()`/`timestamp()`/`date()` columns only.
|
|
2540
|
+
- Add `db.query.<table>.rank(indexName, { where })` query builder with O(log n) operations:
|
|
2541
|
+
- `.count()`, `.sum()` — aggregate reads.
|
|
2542
|
+
- `.at(offset)` — positional access by rank.
|
|
2543
|
+
- `.indexOf({ id })` — rank lookup by document ID.
|
|
2544
|
+
- `.paginate({ cursor, limit })` — cursor-based ranked pagination.
|
|
2545
|
+
- `.min()`, `.max()`, `.random()` — extrema and random sampling.
|
|
2546
|
+
- Add backfill support for rank indexes alongside metric indexes (shared `aggregateBackfill`/`aggregateBackfillStatus` procedures).
|
|
2547
|
+
|
|
2548
|
+
## CLI
|
|
2549
|
+
|
|
2550
|
+
### Features
|
|
2551
|
+
|
|
2552
|
+
- Add `kitcn analyze` command with two modes:
|
|
2553
|
+
- Default **hotspot** mode: per-entry bundle analysis showing output size, dependency size, and handler counts. Interactive TUI with keyboard navigation, live filtering, sort cycling, detail panes (handlers/packages/inputs), and file watch for auto-refresh.
|
|
2554
|
+
- `--deploy` mode: single-isolate bundle analysis matching Convex deploy bundling. Reports total size, top inputs, and top packages.
|
|
2555
|
+
- `--fail-mb <n>` for CI gating: exit 1 if largest entry or chunk exceeds threshold.
|
|
2556
|
+
- Positional regex argument to filter entry points (e.g. `kitcn analyze "auth.*"`).
|
|
2557
|
+
- Add `kitcn deploy` command that wraps `convex deploy` with automatic post-deploy aggregate backfill.
|
|
2558
|
+
- Add `kitcn aggregate rebuild` command for full aggregate index rebuild.
|
|
2559
|
+
- Add `kitcn aggregate backfill` command for resume-mode backfill (no clear/rebuild).
|
|
2560
|
+
- Add automatic aggregate backfill to `kitcn dev` (auto-resumes on startup, non-blocking).
|
|
2561
|
+
- Add `aggregateBackfill` config section in `kitcn.json` for both `dev` and `deploy`:
|
|
2562
|
+
- `enabled`: `"auto"` (skip if function not found), `"on"`, or `"off"`.
|
|
2563
|
+
- `wait`: poll until all indexes READY or timeout (default `true`).
|
|
2564
|
+
- `batchSize`, `pollIntervalMs`, `timeoutMs`: tuning knobs.
|
|
2565
|
+
- `strict`: exit 1 on failure/timeout (default `true` for deploy, `false` for dev).
|
|
2566
|
+
- Add CLI flags for aggregate backfill overrides: `--backfill`, `--backfill-wait`, `--backfill-strict`, `--backfill-batch-size`, `--backfill-timeout-ms`, `--backfill-poll-ms`.
|
|
2567
|
+
- Add `kitcn reset --yes` command: calls `generated/server:reset`. Supports `--before <fn>` and `--after <fn>` hooks.
|
|
2568
|
+
|
|
2569
|
+
## 0.6.4
|
|
2570
|
+
|
|
2571
|
+
### Patch Changes
|
|
2572
|
+
|
|
2573
|
+
- [#93](https://github.com/udecode/kitcn/pull/93) [`8153811`](https://github.com/udecode/kitcn/commit/81538110000a33855f1b5bb9b66f613604cd8388) Thanks [@zbeyens](https://github.com/zbeyens)! - Fix `findFirst` now returns `null` instead of `undefined` when no result is found. Fix `.returning()` crash on nullable timestamp fields.
|
|
2574
|
+
|
|
2575
|
+
## 0.6.3
|
|
2576
|
+
|
|
2577
|
+
### Patch Changes
|
|
2578
|
+
|
|
2579
|
+
- [#88](https://github.com/udecode/kitcn/pull/88) [`207d62f`](https://github.com/udecode/kitcn/commit/207d62f19912ccf355ff4c5e9ec5fee56ecf58cb) Thanks [@zbeyens](https://github.com/zbeyens)! - ORM/RLS update: async policy callbacks, safe empty `inArray([])` handling in query + mutation paths, and runtime+types support for system fields (`t.id`) in `extraConfig` callbacks.
|
|
2580
|
+
|
|
2581
|
+
## 0.6.2
|
|
2582
|
+
|
|
2583
|
+
### Patch Changes
|
|
2584
|
+
|
|
2585
|
+
- [#86](https://github.com/udecode/kitcn/pull/86) [`49098fa`](https://github.com/udecode/kitcn/commit/49098fa5919b4a9c4a3e73b989ab55d897df02c3) Thanks [@zbeyens](https://github.com/zbeyens)! - Fix Better Auth HTTP adapter error handling to preserve auth error status/code instead of surfacing unexpected 500s.
|
|
2586
|
+
|
|
2587
|
+
## 0.6.1
|
|
2588
|
+
|
|
2589
|
+
### Patch Changes
|
|
2590
|
+
|
|
2591
|
+
- [#82](https://github.com/udecode/kitcn/pull/82) [`aed9972`](https://github.com/udecode/kitcn/commit/aed9972f5869949cfc02ca2eb6bfcb7e57fb754d) Thanks [@zbeyens](https://github.com/zbeyens)! - Migration example: https://github.com/udecode/kitcn/pull/82
|
|
2592
|
+
|
|
2593
|
+
Added `AnyColumn` type export for self-referencing foreign keys (mirrors Drizzle's `AnyPgColumn`).
|
|
2594
|
+
|
|
2595
|
+
```ts
|
|
2596
|
+
import { type AnyColumn, convexTable, text } from "kitcn/orm";
|
|
2597
|
+
|
|
2598
|
+
export const comments = convexTable("comments", {
|
|
2599
|
+
body: text().notNull(),
|
|
2600
|
+
parentId: text().references((): AnyColumn => comments.id, {
|
|
2601
|
+
onDelete: "cascade",
|
|
2602
|
+
}),
|
|
2603
|
+
});
|
|
2604
|
+
```
|
|
2605
|
+
|
|
2606
|
+
## 0.6.0
|
|
2607
|
+
|
|
2608
|
+
### Minor Changes
|
|
2609
|
+
|
|
2610
|
+
- [#75](https://github.com/udecode/kitcn/pull/75) [`54eeb6d`](https://github.com/udecode/kitcn/commit/54eeb6d68909737b21b3dddfa860de0fc84e7924) Thanks [@zbeyens](https://github.com/zbeyens)! - - Added `kitcn/orm` as the recommended DB API surface (Drizzle-style schema/query/mutation API).
|
|
2611
|
+
|
|
2612
|
+
- Docs: [/docs/db/orm](https://www.kitcn.dev/docs/db/orm)
|
|
2613
|
+
- Migration guide: [/docs/migrations/convex](https://www.kitcn.dev/docs/migrations/convex)
|
|
2614
|
+
|
|
2615
|
+
## Breaking changes
|
|
2616
|
+
|
|
2617
|
+
- `createAuth(ctx)` is removed. Use `getAuth(ctx)` for query/mutation/action/http.
|
|
2618
|
+
|
|
2619
|
+
```ts
|
|
2620
|
+
// Before
|
|
2621
|
+
export const createAuth = (ctx: ActionCtx) =>
|
|
2622
|
+
betterAuth(createAuthOptions(ctx));
|
|
2623
|
+
app.use(authMiddleware(createAuth));
|
|
2624
|
+
|
|
2625
|
+
// After
|
|
2626
|
+
export const getAuth = (ctx: GenericCtx) => betterAuth(getAuthOptions(ctx));
|
|
2627
|
+
app.use(authMiddleware(getAuth));
|
|
2628
|
+
```
|
|
2629
|
+
|
|
2630
|
+
- `authClient.httpAdapter` is no longer needed. Use context-aware `adapter(...)`.
|
|
2631
|
+
|
|
2632
|
+
```ts
|
|
2633
|
+
// Before
|
|
2634
|
+
database: authClient.httpAdapter(ctx);
|
|
2635
|
+
|
|
2636
|
+
// After
|
|
2637
|
+
database: authClient.adapter(ctx, getAuthOptions);
|
|
2638
|
+
```
|
|
2639
|
+
|
|
2640
|
+
- cRPC templates now use `ctx.orm` (not `ctx.table`) and string IDs at the API boundary.
|
|
2641
|
+
|
|
2642
|
+
```ts
|
|
2643
|
+
// Before
|
|
2644
|
+
input: z.object({ id: zid("user") });
|
|
2645
|
+
const user = await ctx.table("user").get(input.id);
|
|
2646
|
+
|
|
2647
|
+
// After
|
|
2648
|
+
input: z.object({ id: z.string() });
|
|
2649
|
+
const user = await ctx.orm.query.user.findFirst({ where: { id: input.id } });
|
|
2650
|
+
```
|
|
2651
|
+
|
|
2652
|
+
- cRPC/auth context ID types are now string-based at the procedure boundary (`ctx.userId`, params, input/output IDs).
|
|
2653
|
+
|
|
2654
|
+
```ts
|
|
2655
|
+
// Before
|
|
2656
|
+
const userId: Id<"user"> = ctx.userId;
|
|
2657
|
+
|
|
2658
|
+
// After
|
|
2659
|
+
const userId: string = ctx.userId;
|
|
2660
|
+
```
|
|
2661
|
+
|
|
2662
|
+
- `getAuthConfigProvider` should be imported from `kitcn/auth/config`.
|
|
2663
|
+
(instead of legacy `@convex-dev/better-auth/auth-config`, or old `kitcn/auth` docs)
|
|
2664
|
+
|
|
2665
|
+
```ts
|
|
2666
|
+
// Before
|
|
2667
|
+
import { getAuthConfigProvider } from "@convex-dev/better-auth/auth-config";
|
|
2668
|
+
|
|
2669
|
+
// After
|
|
2670
|
+
import { getAuthConfigProvider } from "kitcn/auth/config";
|
|
2671
|
+
```
|
|
2672
|
+
|
|
2673
|
+
- Remove legacy app deps: `@convex-dev/better-auth`, `convex-ents`, and `convex-helpers`.
|
|
2674
|
+
|
|
2675
|
+
```sh
|
|
2676
|
+
bun remove @convex-dev/better-auth convex-ents convex-helpers
|
|
2677
|
+
```
|
|
2678
|
+
|
|
2679
|
+
- `convex-helpers` primitives are no longer part of the template path.
|
|
2680
|
+
Replace `zid(...)` with `z.string()`, and remove `customMutation`/`Triggers` wrappers in favor of:
|
|
2681
|
+
- `initCRPC.create()` defaults
|
|
2682
|
+
- trigger declarations in schema table config
|
|
2683
|
+
- ORM row shape is `id`/`createdAt` (not `_id`/`_creationTime`) at the app boundary.
|
|
2684
|
+
Update UI/client code and shared types accordingly.
|
|
2685
|
+
|
|
2686
|
+
## Features
|
|
2687
|
+
|
|
2688
|
+
- `initCRPC.create()` supports default Convex builders, so old manual wiring is usually unnecessary.
|
|
2689
|
+
|
|
2690
|
+
```ts
|
|
2691
|
+
// Before (remove this boilerplate)
|
|
2692
|
+
const c = initCRPC.create({
|
|
2693
|
+
query,
|
|
2694
|
+
internalQuery,
|
|
2695
|
+
mutation,
|
|
2696
|
+
internalMutation,
|
|
2697
|
+
action,
|
|
2698
|
+
internalAction,
|
|
2699
|
+
httpAction,
|
|
2700
|
+
});
|
|
2701
|
+
const internalMutationWithTriggers = customMutation(...);
|
|
2702
|
+
|
|
2703
|
+
// After
|
|
2704
|
+
const c = initCRPC.create();
|
|
2705
|
+
// Triggers are declared in schema table config.
|
|
2706
|
+
```
|
|
2707
|
+
|
|
2708
|
+
- cRPC now supports wire transformers end-to-end (Date codec included by default).
|
|
2709
|
+
- Supported in `initCRPC.create({ transformer })`, HTTP proxy, server caller, React client, and RSC query client.
|
|
2710
|
+
|
|
2711
|
+
```ts
|
|
2712
|
+
const c = initCRPC.create({ transformer: superjson });
|
|
2713
|
+
|
|
2714
|
+
const http = createHttpProxy({
|
|
2715
|
+
convexSiteUrl,
|
|
2716
|
+
routes,
|
|
2717
|
+
transformer: superjson,
|
|
2718
|
+
});
|
|
2719
|
+
```
|
|
2720
|
+
|
|
2721
|
+
- Auth setup supports `triggers` + `context` in `createClient`, and `context` in `createApi`.
|
|
2722
|
+
|
|
2723
|
+
```ts
|
|
2724
|
+
const authClient = createClient({
|
|
2725
|
+
authFunctions,
|
|
2726
|
+
schema,
|
|
2727
|
+
triggers,
|
|
2728
|
+
context: getOrmCtx,
|
|
2729
|
+
});
|
|
2730
|
+
|
|
2731
|
+
const authApi = createApi(schema, getAuth, {
|
|
2732
|
+
context: getOrmCtx,
|
|
2733
|
+
});
|
|
2734
|
+
```
|
|
2735
|
+
|
|
2736
|
+
- `createEnv` can replace manual env parsing/throw boilerplate.
|
|
2737
|
+
|
|
2738
|
+
```ts
|
|
2739
|
+
// Before
|
|
2740
|
+
export const getEnv = () => {
|
|
2741
|
+
const parsed = envSchema.safeParse(process.env);
|
|
2742
|
+
if (!parsed.success) throw new Error("Invalid environment variables");
|
|
2743
|
+
return parsed.data;
|
|
2744
|
+
};
|
|
2745
|
+
|
|
2746
|
+
// After
|
|
2747
|
+
export const getEnv = createEnv({ schema: envSchema });
|
|
2748
|
+
```
|
|
2749
|
+
|
|
2750
|
+
- Added new public server helpers: context guards (`isActionCtx`/`requireActionCtx`, etc.).
|
|
2751
|
+
|
|
2752
|
+
## Patched
|
|
2753
|
+
|
|
2754
|
+
- Updated template and docs to use:
|
|
2755
|
+
- `kitcn/auth/client` (`convexClient`)
|
|
2756
|
+
- `kitcn/auth/config` (`getAuthConfigProvider`)
|
|
2757
|
+
- Example app migration now reflects the current user-facing API (`ctx.orm`, `getAuth(ctx)`, simpler `initCRPC.create()`).
|
|
2758
|
+
- cRPC/server error handling now normalizes known causes into deterministic CRPC errors:
|
|
2759
|
+
- `OrmNotFoundError` -> `NOT_FOUND`
|
|
2760
|
+
- `APIError` status/statusCode -> mapped cRPC code
|
|
2761
|
+
- standard `Error.message`/stack preservation on wrapped errors
|
|
2762
|
+
- HTTP route validation errors (params/query/body/form) now return `BAD_REQUEST` consistently.
|
|
2763
|
+
- `createAuthMutations` now throws `AUTH_STATE_TIMEOUT` when auth token never appears after sign-in/up flow.
|
|
2764
|
+
- `getSession` now returns `null` when no session id is present (instead of attempting invalid DB lookups).
|
|
2765
|
+
- CLI reliability improvements (`kitcn dev/codegen/env`): argument parsing and entrypoint resolution are more robust across runtime/symlink setups.
|
|
2766
|
+
|
|
2767
|
+
```ts
|
|
2768
|
+
// Client import migration
|
|
2769
|
+
// Before
|
|
2770
|
+
import { convexClient } from "@convex-dev/better-auth/client/plugins";
|
|
2771
|
+
|
|
2772
|
+
// After
|
|
2773
|
+
import { convexClient } from "kitcn/auth/client";
|
|
2774
|
+
```
|
|
2775
|
+
|
|
2776
|
+
```ts
|
|
2777
|
+
// Retry only non-deterministic errors
|
|
2778
|
+
import { isCRPCError } from "kitcn/crpc";
|
|
2779
|
+
|
|
2780
|
+
retry: (count, error) => !isCRPCError(error) && count < 3;
|
|
2781
|
+
```
|
|
2782
|
+
|
|
2783
|
+
## 0.5.8
|
|
2784
|
+
|
|
2785
|
+
### Patch Changes
|
|
2786
|
+
|
|
2787
|
+
- [#73](https://github.com/udecode/kitcn/pull/73) [`232d126`](https://github.com/udecode/kitcn/commit/232d12697602e5c1cb3965b6e12cfe9b880d3c5c) Thanks [@zbeyens](https://github.com/zbeyens)! - Support multiple WHERE conditions in `update()` for Better Auth organization plugin compatibility.
|
|
2788
|
+
- Multiple AND conditions with equality checks now work
|
|
2789
|
+
- Validates exactly 1 document matches before updating (prevents accidental bulk updates)
|
|
2790
|
+
- OR conditions and non-eq operators still require `updateMany()`
|
|
2791
|
+
|
|
2792
|
+
## 0.5.7
|
|
2793
|
+
|
|
2794
|
+
### Patch Changes
|
|
2795
|
+
|
|
2796
|
+
- [#61](https://github.com/udecode/kitcn/pull/61) [`7e63e54`](https://github.com/udecode/kitcn/commit/7e63e541fc2853d8d1d45e4f1fb7db3f82e0592c) Thanks [@zbeyens](https://github.com/zbeyens)! - Auth mutation hooks now properly trigger `onError` when Better Auth returns errors (401, 422, etc.).
|
|
2797
|
+
|
|
2798
|
+
```tsx
|
|
2799
|
+
// Before: onSuccess always ran, even on errors
|
|
2800
|
+
// After: onError fires on auth failures
|
|
2801
|
+
|
|
2802
|
+
const signUp = useMutation(
|
|
2803
|
+
useSignUpMutationOptions({
|
|
2804
|
+
onSuccess: () => router.push("/"), // Only on success now
|
|
2805
|
+
onError: (error) => toast.error(error.message), // Fires on auth errors
|
|
2806
|
+
})
|
|
2807
|
+
);
|
|
2808
|
+
```
|
|
2809
|
+
|
|
2810
|
+
New exports: `AuthMutationError` class and `isAuthMutationError` type guard for error handling.
|
|
2811
|
+
|
|
2812
|
+
## 0.5.6
|
|
2813
|
+
|
|
2814
|
+
### Patch Changes
|
|
2815
|
+
|
|
2816
|
+
- [`fdeae26`](https://github.com/udecode/kitcn/commit/fdeae26ef81b46dc1334a4940814628d398659d9) Thanks [@zbeyens](https://github.com/zbeyens)! - - Support Convex 1.31.6
|
|
2817
|
+
- Missing `jotai` dependency
|
|
2818
|
+
|
|
2819
|
+
## 0.5.5
|
|
2820
|
+
|
|
2821
|
+
### Patch Changes
|
|
2822
|
+
|
|
2823
|
+
- [#56](https://github.com/udecode/kitcn/pull/56) [`b34a396`](https://github.com/udecode/kitcn/commit/b34a39621af83c6b6f2b2e6e11e35997981c5bb4) Thanks [@zbeyens](https://github.com/zbeyens)! - Add `ConvexProviderWithAuth` for `@convex-dev/auth` users (React Native):
|
|
2824
|
+
|
|
2825
|
+
```tsx
|
|
2826
|
+
import { ConvexProviderWithAuth } from "kitcn/react";
|
|
2827
|
+
|
|
2828
|
+
<ConvexProviderWithAuth client={convex} useAuth={useAuthFromConvexDev}>
|
|
2829
|
+
<App />
|
|
2830
|
+
</ConvexProviderWithAuth>;
|
|
2831
|
+
```
|
|
2832
|
+
|
|
2833
|
+
Enables `skipUnauth` queries, `useAuth`, and conditional rendering components.
|
|
2834
|
+
|
|
2835
|
+
## 0.5.4
|
|
2836
|
+
|
|
2837
|
+
### Patch Changes
|
|
2838
|
+
|
|
2839
|
+
- [#54](https://github.com/udecode/kitcn/pull/54) [`4321118`](https://github.com/udecode/kitcn/commit/43211189285333f998cef34c7726efa1735837aa) Thanks [@zbeyens](https://github.com/zbeyens)! - Support nested file structures in meta generation:
|
|
2840
|
+
|
|
2841
|
+
```
|
|
2842
|
+
convex/functions/
|
|
2843
|
+
todos.ts → crpc.todos.*
|
|
2844
|
+
items/queries.ts → crpc.items.queries.*
|
|
2845
|
+
```
|
|
2846
|
+
|
|
2847
|
+
- Organize functions in subdirectories
|
|
2848
|
+
- `_` prefixed files/directories are excluded
|
|
2849
|
+
|
|
2850
|
+
## 0.5.3
|
|
2851
|
+
|
|
2852
|
+
### Patch Changes
|
|
2853
|
+
|
|
2854
|
+
- [#44](https://github.com/udecode/kitcn/pull/44) [`ea6bfce`](https://github.com/udecode/kitcn/commit/ea6bfce4fb20dda7afdad4a9d0663aa7021e2a88) Thanks [@zbeyens](https://github.com/zbeyens)! - Fix queries throwing without auth provider.
|
|
2855
|
+
|
|
2856
|
+
## 0.5.2
|
|
2857
|
+
|
|
2858
|
+
### Patch Changes
|
|
2859
|
+
|
|
2860
|
+
- [`185f496`](https://github.com/udecode/kitcn/commit/185f496c6b64e70cba96adcfe25e459c8c559a92) Thanks [@zbeyens](https://github.com/zbeyens)! - Add `staticQueryOptions` method to CRPC proxy for non-hook usage in event handlers.
|
|
2861
|
+
|
|
2862
|
+
- [`2288076`](https://github.com/udecode/kitcn/commit/228807652c04df9bdb1e9f054a0664d35a643ff2) Thanks [@zbeyens](https://github.com/zbeyens)! - Fix `MiddlewareBuilder` generic parameter mismatch causing typecheck failures when using reusable middleware with `.use()`. Factory functions now correctly pass through the `TInputOut` parameter added in v0.5.1.
|
|
2863
|
+
|
|
2864
|
+
## 0.5.1
|
|
2865
|
+
|
|
2866
|
+
### Patch Changes
|
|
2867
|
+
|
|
2868
|
+
- [#39](https://github.com/udecode/kitcn/pull/39) [`ede0d47`](https://github.com/udecode/kitcn/commit/ede0d473ed8f7254f44b9edb86172cfd3c900857) Thanks [@zbeyens](https://github.com/zbeyens)! - Middleware now receives `input` and `getRawInput` parameters:
|
|
2869
|
+
|
|
2870
|
+
```ts
|
|
2871
|
+
publicQuery
|
|
2872
|
+
.input(z.object({ projectId: zid("projects") }))
|
|
2873
|
+
.use(async ({ ctx, input, next }) => {
|
|
2874
|
+
// input.projectId is typed!
|
|
2875
|
+
const project = await ctx.db.get(input.projectId);
|
|
2876
|
+
return next({ ctx: { ...ctx, project } });
|
|
2877
|
+
});
|
|
2878
|
+
```
|
|
2879
|
+
|
|
2880
|
+
- Middleware after `.input()` receives typed input
|
|
2881
|
+
- Middleware before `.input()` receives `unknown`
|
|
2882
|
+
- `getRawInput()` returns raw input before validation
|
|
2883
|
+
- `next({ input })` allows modifying input for downstream middleware
|
|
2884
|
+
- Non-breaking: existing middleware works unchanged
|
|
2885
|
+
|
|
2886
|
+
## 0.5.0
|
|
2887
|
+
|
|
2888
|
+
### Minor Changes
|
|
2889
|
+
|
|
2890
|
+
- [#34](https://github.com/udecode/kitcn/pull/34) [`e2a2f62`](https://github.com/udecode/kitcn/commit/e2a2f6258d75007c39b6dc86d6000e0a9460052d) Thanks [@zbeyens](https://github.com/zbeyens)! - URL searchParams now auto-coerce to numbers and booleans based on Zod schema type, eliminating `z.coerce.*` boilerplate:
|
|
2891
|
+
|
|
2892
|
+
```ts
|
|
2893
|
+
// Before: Required z.coerce.* boilerplate
|
|
2894
|
+
.searchParams(z.object({
|
|
2895
|
+
page: z.coerce.number().optional(),
|
|
2896
|
+
active: z.coerce.boolean().optional(),
|
|
2897
|
+
}))
|
|
2898
|
+
|
|
2899
|
+
// After: Standard Zod schemas work directly
|
|
2900
|
+
.searchParams(z.object({
|
|
2901
|
+
page: z.number().optional(),
|
|
2902
|
+
active: z.boolean().optional(),
|
|
2903
|
+
}))
|
|
2904
|
+
```
|
|
2905
|
+
|
|
2906
|
+
Coercion behavior:
|
|
2907
|
+
|
|
2908
|
+
- `z.number()` - parses string to number (`"5"` → `5`)
|
|
2909
|
+
- `z.boolean()` - parses `"true"`/`"1"` → `true`, everything else → `false`
|
|
2910
|
+
- Works with `.optional()`, `.nullable()`, `.default()` wrappers
|
|
2911
|
+
- `z.coerce.*` still works if preferred
|
|
2912
|
+
|
|
2913
|
+
### Vanilla CRPC client
|
|
2914
|
+
|
|
2915
|
+
`useCRPCClient()` now returns a typed proxy for direct procedural calls without React Query:
|
|
2916
|
+
|
|
2917
|
+
```ts
|
|
2918
|
+
const client = useCRPCClient();
|
|
2919
|
+
|
|
2920
|
+
// Convex functions
|
|
2921
|
+
const user = await client.user.get.query({ id });
|
|
2922
|
+
await client.user.update.mutate({ id, name: "test" });
|
|
2923
|
+
|
|
2924
|
+
// HTTP endpoints
|
|
2925
|
+
const todos = await client.http.todos.list.query();
|
|
2926
|
+
await client.http.todos.create.mutate({ title: "New" });
|
|
2927
|
+
```
|
|
2928
|
+
|
|
2929
|
+
Useful for event handlers, effects, or when you don't need caching/deduplication.
|
|
2930
|
+
|
|
2931
|
+
**Breaking:** `useCRPCClient()` return type changed from `ConvexReactClient` to typed proxy. Use `useConvex()` (now exported from `kitcn/react`) for raw client access.
|
|
2932
|
+
|
|
2933
|
+
### Error handling: `isCRPCError` helper
|
|
2934
|
+
|
|
2935
|
+
New unified error check for retry logic - returns true for any deterministic CRPC error (Convex 4xx or HTTP 4xx):
|
|
2936
|
+
|
|
2937
|
+
```ts
|
|
2938
|
+
import { isCRPCError } from "kitcn/crpc";
|
|
2939
|
+
|
|
2940
|
+
// In query client config
|
|
2941
|
+
retry: (failureCount, error) => {
|
|
2942
|
+
if (isCRPCError(error)) return false; // Don't retry client errors
|
|
2943
|
+
return failureCount < 3;
|
|
2944
|
+
};
|
|
2945
|
+
```
|
|
2946
|
+
|
|
2947
|
+
## 0.4.0
|
|
2948
|
+
|
|
2949
|
+
### Minor Changes
|
|
2950
|
+
|
|
2951
|
+
- [#31](https://github.com/udecode/kitcn/pull/31) [`618ec38`](https://github.com/udecode/kitcn/commit/618ec386eaf7e893d87570616871386953789753) Thanks [@zbeyens](https://github.com/zbeyens)! - ### HTTP Client: Hybrid API
|
|
2952
|
+
|
|
2953
|
+
The HTTP client now uses a hybrid API combining tRPC-style JSON body at root level with explicit `params`/`searchParams` for URL data.
|
|
2954
|
+
|
|
2955
|
+
#### Breaking Changes
|
|
2956
|
+
|
|
2957
|
+
- **Query/mutation args restructured**: Path params and search params now use explicit keys instead of flat merging
|
|
2958
|
+
- Before: `queryOptions({ id: '123', limit: 10 })`
|
|
2959
|
+
- After: `queryOptions({ params: { id: '123' }, searchParams: { limit: '10' } })`
|
|
2960
|
+
- **Client options in args**: `fetch`, `init`, `headers` go in args (1st param)
|
|
2961
|
+
- `queryOptions(args?, queryOpts?)` - args = params/searchParams/form/headers/etc
|
|
2962
|
+
- `mutationOptions(mutationOpts?)` - client opts go in `mutate(args)` call
|
|
2963
|
+
- **Server handler `query` renamed to `searchParams`**: Consistent naming between client and server
|
|
2964
|
+
- Before: `.query(async ({ query }) => { query.limit })`
|
|
2965
|
+
- After: `.query(async ({ searchParams }) => { searchParams.limit })`
|
|
2966
|
+
|
|
2967
|
+
#### New Features
|
|
2968
|
+
|
|
2969
|
+
- **Explicit input args**: `params`, `searchParams` keys for clear separation
|
|
2970
|
+
- **JSON body at root**: Non-reserved keys spread at root level (tRPC-style): `mutate({ title: 'New' })`
|
|
2971
|
+
- **Typed form uploads**: `.form()` builder method for typed FormData schemas (client args + server handler)
|
|
2972
|
+
- **Client options in args**: Per-request `fetch`, `init`, `headers` in args (1st param)
|
|
2973
|
+
- **mutationOptions for GET**: Use `useMutation` for one-time fetches (exports/downloads) without caching
|
|
2974
|
+
|
|
2975
|
+
#### Migration
|
|
2976
|
+
|
|
2977
|
+
```tsx
|
|
2978
|
+
// Client: Before
|
|
2979
|
+
crpc.http.todos.list.queryOptions({ limit: 10 });
|
|
2980
|
+
updateTodo.mutate({ id, completed: true });
|
|
2981
|
+
deleteTodo.mutate({ id });
|
|
2982
|
+
|
|
2983
|
+
// Client: After
|
|
2984
|
+
crpc.http.todos.list.queryOptions({ searchParams: { limit: "10" } });
|
|
2985
|
+
updateTodo.mutate({ params: { id }, completed: true });
|
|
2986
|
+
deleteTodo.mutate({ params: { id } });
|
|
2987
|
+
|
|
2988
|
+
// Headers go in args (1st param)
|
|
2989
|
+
// Before: queryOptions({ header: { 'X-Custom': 'value' } })
|
|
2990
|
+
// After:
|
|
2991
|
+
crpc.http.todos.list.queryOptions({ headers: { 'X-Custom': 'value' } });
|
|
2992
|
+
|
|
2993
|
+
// Mutations: client opts in mutate args
|
|
2994
|
+
updateTodo.mutate({ params: { id }, completed: true, headers: { 'X-Custom': 'value' } });
|
|
2995
|
+
|
|
2996
|
+
// Server: Before
|
|
2997
|
+
.query(async ({ query }) => ({ limit: query.limit }))
|
|
2998
|
+
|
|
2999
|
+
// Server: After
|
|
3000
|
+
.query(async ({ searchParams }) => ({ limit: searchParams.limit }))
|
|
3001
|
+
|
|
3002
|
+
// Server: Typed form (new)
|
|
3003
|
+
.form(z.object({ file: z.instanceof(Blob) }))
|
|
3004
|
+
.mutation(async ({ form }) => {
|
|
3005
|
+
// form.file is typed as Blob
|
|
3006
|
+
})
|
|
3007
|
+
```
|
|
3008
|
+
|
|
3009
|
+
## 0.3.1
|
|
3010
|
+
|
|
3011
|
+
### Patch Changes
|
|
3012
|
+
|
|
3013
|
+
- [#29](https://github.com/udecode/kitcn/pull/29) [`2638311`](https://github.com/udecode/kitcn/commit/26383112835605dd806151832edfbcd98e1e75b2) Thanks [@zbeyens](https://github.com/zbeyens)! - - Move hono to peerDependencies (type-only imports in package)
|
|
3014
|
+
- Add stale cursor auto-recovery for `useInfiniteQuery` - automatically recovers from stale pagination cursors after WebSocket reconnection without losing scroll position
|
|
3015
|
+
|
|
3016
|
+
## 0.3.0
|
|
3017
|
+
|
|
3018
|
+
### Minor Changes
|
|
3019
|
+
|
|
3020
|
+
- [#27](https://github.com/udecode/kitcn/pull/27) [`6309e68`](https://github.com/udecode/kitcn/commit/6309e688b3f92b07877966a6f6f7929f2cb7ade0) Thanks [@zbeyens](https://github.com/zbeyens)! - ### HTTP Router: Hono Integration
|
|
3021
|
+
|
|
3022
|
+
The HTTP router now wraps a Hono app, enabling full middleware support.
|
|
3023
|
+
|
|
3024
|
+
#### New Features
|
|
3025
|
+
|
|
3026
|
+
- **Hono-based routing**: `createHttpRouter(app, router)` accepts a Hono app
|
|
3027
|
+
- **Auth middleware**: `authMiddleware(createAuth)` for Better Auth routes
|
|
3028
|
+
- **Hono context in handlers**: Access `c.json()`, `c.text()`, `c.redirect()`, `c.req`
|
|
3029
|
+
- **Non-JSON response support**
|
|
3030
|
+
- **CLI watch improvements**: Watches `routers/**/*.ts` and `http.ts` for changes
|
|
3031
|
+
|
|
3032
|
+
#### Breaking Changes
|
|
3033
|
+
|
|
3034
|
+
- **Removed `response()` mode**: Return `Response` directly from handler
|
|
3035
|
+
- **Removed per-procedure `cors()`**: Use Hono's `cors()` middleware
|
|
3036
|
+
- **CORS via Hono**: `app.use('/api/*', cors())` instead of router options
|
|
3037
|
+
- **Handler signature**: `{ ctx, c, input, params, query }` - `c` is Hono Context
|
|
3038
|
+
|
|
3039
|
+
#### Migration
|
|
3040
|
+
|
|
3041
|
+
Before:
|
|
3042
|
+
|
|
3043
|
+
```ts
|
|
3044
|
+
import { registerRoutes } from "kitcn/auth/http";
|
|
3045
|
+
import { registerCRPCRoutes } from "kitcn/server";
|
|
3046
|
+
import { httpRouter } from "convex/server";
|
|
3047
|
+
|
|
3048
|
+
const http = httpRouter();
|
|
3049
|
+
|
|
3050
|
+
registerRoutes(http, createAuth);
|
|
3051
|
+
|
|
3052
|
+
export const appRouter = router({
|
|
3053
|
+
health,
|
|
3054
|
+
todos: todosRouter,
|
|
3055
|
+
});
|
|
3056
|
+
|
|
3057
|
+
registerCRPCRoutes(http, appRouter, {
|
|
3058
|
+
httpAction,
|
|
3059
|
+
cors: {
|
|
3060
|
+
allowedOrigins: [process.env.SITE_URL!],
|
|
3061
|
+
allowCredentials: true,
|
|
3062
|
+
},
|
|
3063
|
+
});
|
|
3064
|
+
|
|
3065
|
+
export default http;
|
|
3066
|
+
```
|
|
3067
|
+
|
|
3068
|
+
After:
|
|
3069
|
+
|
|
3070
|
+
```ts
|
|
3071
|
+
import { authMiddleware } from "kitcn/auth/http";
|
|
3072
|
+
import { createHttpRouter } from "kitcn/server";
|
|
3073
|
+
import { Hono } from "hono";
|
|
3074
|
+
import { cors } from "hono/cors";
|
|
3075
|
+
|
|
3076
|
+
const app = new Hono();
|
|
3077
|
+
|
|
3078
|
+
app.use(
|
|
3079
|
+
"/api/*",
|
|
3080
|
+
cors({
|
|
3081
|
+
origin: process.env.SITE_URL!,
|
|
3082
|
+
credentials: true,
|
|
3083
|
+
})
|
|
3084
|
+
);
|
|
3085
|
+
|
|
3086
|
+
app.use(authMiddleware(createAuth));
|
|
3087
|
+
|
|
3088
|
+
export const appRouter = router({
|
|
3089
|
+
health,
|
|
3090
|
+
todos: todosRouter,
|
|
3091
|
+
});
|
|
3092
|
+
|
|
3093
|
+
export default createHttpRouter(app, appRouter);
|
|
3094
|
+
```
|
|
3095
|
+
|
|
3096
|
+
#### Handler Examples with `c`
|
|
3097
|
+
|
|
3098
|
+
cRPC handlers now receive `c` (Hono Context) for custom responses:
|
|
3099
|
+
|
|
3100
|
+
```ts
|
|
3101
|
+
// File download with custom headers
|
|
3102
|
+
export const download = authRoute
|
|
3103
|
+
.get("/api/todos/export/:format")
|
|
3104
|
+
.params(z.object({ format: z.enum(["json", "csv"]) }))
|
|
3105
|
+
.query(async ({ ctx, params, c }) => {
|
|
3106
|
+
const todos = await ctx.runQuery(api.todos.list, {});
|
|
3107
|
+
|
|
3108
|
+
c.header(
|
|
3109
|
+
"Content-Disposition",
|
|
3110
|
+
`attachment; filename="todos.${params.format}"`
|
|
3111
|
+
);
|
|
3112
|
+
|
|
3113
|
+
if (params.format === "csv") {
|
|
3114
|
+
return c.text(todos.map((t) => `${t.id},${t.title}`).join("\n"));
|
|
3115
|
+
}
|
|
3116
|
+
return c.json({ todos });
|
|
3117
|
+
});
|
|
3118
|
+
|
|
3119
|
+
// Webhook with signature verification
|
|
3120
|
+
export const webhook = publicRoute
|
|
3121
|
+
.post("/webhooks/stripe")
|
|
3122
|
+
.mutation(async ({ ctx, c }) => {
|
|
3123
|
+
const signature = c.req.header("stripe-signature");
|
|
3124
|
+
if (!signature) throw new CRPCError({ code: "BAD_REQUEST" });
|
|
3125
|
+
|
|
3126
|
+
const body = await c.req.text();
|
|
3127
|
+
await ctx.runMutation(internal.stripe.process, { body, signature });
|
|
3128
|
+
|
|
3129
|
+
return c.text("OK", 200);
|
|
3130
|
+
});
|
|
3131
|
+
|
|
3132
|
+
// Redirect
|
|
3133
|
+
export const redirect = publicRoute
|
|
3134
|
+
.get("/api/old-path")
|
|
3135
|
+
.query(async ({ c }) => c.redirect("/api/new-path", 301));
|
|
3136
|
+
```
|
|
3137
|
+
|
|
3138
|
+
## 0.2.1
|
|
3139
|
+
|
|
3140
|
+
### Patch Changes
|
|
3141
|
+
|
|
3142
|
+
- [#24](https://github.com/udecode/kitcn/pull/24) [`b5555ea`](https://github.com/udecode/kitcn/commit/b5555eac9e67ef06328f5e122ce2d4512f3b3c7f) Thanks [@zbeyens](https://github.com/zbeyens)! - - Fix (`UNAUTHORIZED`) queries failing after switching tabs and returning to the app. The auth token is now preserved during session refetch instead of being cleared.
|
|
3143
|
+
- Fix (`UNAUTHORIZED`) `useSuspenseQuery` failing on initial page load when auth is still loading. WebSocket subscriptions now wait for auth to settle before connecting.
|
|
3144
|
+
- Fix logout setting `isAuthenticated: false` before unsubscribing to prevent query re-subscriptions.
|
|
3145
|
+
- Add missing `dotenv` dependency for CLI.
|
|
3146
|
+
|
|
3147
|
+
## 0.2.0
|
|
3148
|
+
|
|
3149
|
+
### Minor Changes
|
|
3150
|
+
|
|
3151
|
+
- [#22](https://github.com/udecode/kitcn/pull/22) [`27d355e`](https://github.com/udecode/kitcn/commit/27d355e4ac067503e00bf534164c6ce2974a8a46) Thanks [@zbeyens](https://github.com/zbeyens)! - **BREAKING:** Refactored `createCRPCContext` and `createServerCRPCProxy` to use options object:
|
|
3152
|
+
|
|
3153
|
+
Before:
|
|
3154
|
+
|
|
3155
|
+
```ts
|
|
3156
|
+
createCRPCContext(api, meta);
|
|
3157
|
+
createServerCRPCProxy(api, meta);
|
|
3158
|
+
```
|
|
3159
|
+
|
|
3160
|
+
After:
|
|
3161
|
+
|
|
3162
|
+
```ts
|
|
3163
|
+
createCRPCContext<Api>({ api, meta, convexSiteUrl });
|
|
3164
|
+
createServerCRPCProxy<Api>({ api, meta });
|
|
3165
|
+
```
|
|
3166
|
+
|
|
3167
|
+
**BREAKING:** `getServerQueryClientOptions` now requires `convexSiteUrl`:
|
|
3168
|
+
|
|
3169
|
+
```ts
|
|
3170
|
+
getServerQueryClientOptions({
|
|
3171
|
+
getToken: caller.getToken,
|
|
3172
|
+
convexSiteUrl: env.NEXT_PUBLIC_CONVEX_SITE_URL,
|
|
3173
|
+
});
|
|
3174
|
+
```
|
|
3175
|
+
|
|
3176
|
+
**Feature:** Added type-safe HTTP routes with tRPC-style client:
|
|
3177
|
+
|
|
3178
|
+
```ts
|
|
3179
|
+
// 1. Pass httpAction to initCRPC.create()
|
|
3180
|
+
const c = initCRPC.dataModel<DataModel>().create({
|
|
3181
|
+
query, mutation, action, httpAction,
|
|
3182
|
+
});
|
|
3183
|
+
export const publicRoute = c.httpAction;
|
|
3184
|
+
export const authRoute = c.httpAction.use(authMiddleware);
|
|
3185
|
+
export const router = c.router;
|
|
3186
|
+
|
|
3187
|
+
// 2. Define routes with .get()/.post()/.patch()/.delete()
|
|
3188
|
+
export const health = publicRoute
|
|
3189
|
+
.get('/api/health')
|
|
3190
|
+
.output(z.object({ status: z.string() }))
|
|
3191
|
+
.query(async () => ({ status: 'ok' }));
|
|
3192
|
+
|
|
3193
|
+
// 3. Use .params(), .searchParams(), .input() for typed inputs
|
|
3194
|
+
export const todosRouter = router({
|
|
3195
|
+
list: publicRoute.get('/api/todos')
|
|
3196
|
+
.searchParams(z.object({ limit: z.coerce.number().optional() }))
|
|
3197
|
+
.query(...),
|
|
3198
|
+
get: publicRoute.get('/api/todos/:id')
|
|
3199
|
+
.params(z.object({ id: zid('todos') }))
|
|
3200
|
+
.query(...),
|
|
3201
|
+
create: authRoute.post('/api/todos')
|
|
3202
|
+
.input(z.object({ title: z.string() }))
|
|
3203
|
+
.mutation(...),
|
|
3204
|
+
});
|
|
3205
|
+
|
|
3206
|
+
// 4. Register with CORS
|
|
3207
|
+
registerCRPCRoutes(http, appRouter, {
|
|
3208
|
+
httpAction,
|
|
3209
|
+
cors: { allowedOrigins: [process.env.SITE_URL!], allowCredentials: true },
|
|
3210
|
+
});
|
|
3211
|
+
|
|
3212
|
+
// 5. Add to Api type for inference
|
|
3213
|
+
export type Api = WithHttpRouter<typeof api, typeof appRouter>;
|
|
3214
|
+
|
|
3215
|
+
// 6. Client: TanStack Query integration via crpc.http.*
|
|
3216
|
+
const crpc = useCRPC();
|
|
3217
|
+
useSuspenseQuery(crpc.http.todos.list.queryOptions({ limit: 10 }));
|
|
3218
|
+
useMutation(crpc.http.todos.create.mutationOptions());
|
|
3219
|
+
queryClient.invalidateQueries(crpc.http.todos.list.queryFilter());
|
|
3220
|
+
|
|
3221
|
+
// 7. RSC: prefetch helper
|
|
3222
|
+
prefetch(crpc.http.health.queryOptions({}));
|
|
3223
|
+
```
|
|
3224
|
+
|
|
3225
|
+
**Fix:** Improved authentication in `ConvexAuthProvider`:
|
|
3226
|
+
|
|
3227
|
+
- **FetchAccessTokenContext**: New context passes `fetchAccessToken` through React tree - eliminates race conditions where token wasn't available during render
|
|
3228
|
+
- **Token Expiration Tracking**: Added `expiresAt` field with `decodeJwtExp()` - 60s cache leeway prevents unnecessary token refreshes
|
|
3229
|
+
- **SSR Hydration Fix**: Defensive `isLoading` check prevents UNAUTHORIZED errors when Better Auth briefly returns null during hydration
|
|
3230
|
+
- **Removed HMR persistence**: No more globalThis Symbol storage (`getPersistedToken`/`persistToken`)
|
|
3231
|
+
- **Simplified AuthStore**: Removed `guard` method and `AuthEffect` - state synced via `useConvexAuth()` directly
|
|
3232
|
+
|
|
3233
|
+
## 0.1.0
|
|
3234
|
+
|
|
3235
|
+
### Minor Changes
|
|
3236
|
+
|
|
3237
|
+
- [#18](https://github.com/udecode/kitcn/pull/18) [`681e9ba`](https://github.com/udecode/kitcn/commit/681e9bafdeaa62928f15fe9781f944d42ce2d2b4) Thanks [@zbeyens](https://github.com/zbeyens)! - Initial release
|