@vllnt/convex-memberships 0.2.0-canary.d8e965d → 0.2.0

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +32 -12
  2. package/README.md +394 -167
  3. package/dist/client/index.d.ts +6 -2
  4. package/dist/client/index.d.ts.map +1 -1
  5. package/dist/client/index.js +6 -2
  6. package/dist/client/index.js.map +1 -1
  7. package/dist/client/types.d.ts +2 -2
  8. package/dist/client/types.d.ts.map +1 -1
  9. package/dist/component/convex.config.d.ts +1 -0
  10. package/dist/component/convex.config.d.ts.map +1 -1
  11. package/dist/component/convex.config.js +1 -0
  12. package/dist/component/convex.config.js.map +1 -1
  13. package/dist/component/guards.d.ts +8 -0
  14. package/dist/component/guards.d.ts.map +1 -1
  15. package/dist/component/guards.js +17 -0
  16. package/dist/component/guards.js.map +1 -1
  17. package/dist/component/mutations.d.ts.map +1 -1
  18. package/dist/component/mutations.js +9 -1
  19. package/dist/component/mutations.js.map +1 -1
  20. package/dist/component/validators.d.ts +2 -1
  21. package/dist/component/validators.d.ts.map +1 -1
  22. package/dist/component/validators.js +2 -1
  23. package/dist/component/validators.js.map +1 -1
  24. package/dist/react/index.d.ts +15 -14
  25. package/dist/react/index.d.ts.map +1 -1
  26. package/dist/react/index.js +9 -8
  27. package/dist/react/index.js.map +1 -1
  28. package/docs/API.md +303 -127
  29. package/llms.txt +58 -15
  30. package/package.json +13 -15
  31. package/src/client/index.ts +6 -2
  32. package/src/client/types.ts +2 -2
  33. package/src/component/convex.config.ts +1 -0
  34. package/src/component/guards.ts +19 -0
  35. package/src/component/mutations.ts +9 -1
  36. package/src/component/validators.ts +2 -1
  37. package/src/react/index.tsx +15 -14
package/CHANGELOG.md CHANGED
@@ -4,27 +4,34 @@ All notable changes to this project are documented here. The format is based on
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
5
5
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [Unreleased]
8
-
9
7
  ## [0.2.0] - 2026-11-28
10
8
 
11
- 0.2.0 has two breaking changes for 0.1.0 users. They are why this release is a minor
9
+ 0.2.0 has three breaking changes for 0.1.0 users. They are why this release is a minor
12
10
  bump: a `^0.1.0` range does not pull it in automatically.
13
11
 
14
12
  ### Breaking
15
13
 
14
+ - `add` rejects a `memberRef`, `resourceRef`, `relation`, `memberKind` or `status` longer than 512
15
+ UTF-16 code units (JavaScript `string.length`; an emoji counts 2), and `setRelation` rejects
16
+ such a `toRelation`, with `ConvexError({ code: "INVALID_ARGUMENT" })`. 0.1.0 had no limit. Edges
17
+ stored before 0.2.0 with a longer value stay readable and can be removed or moved with
18
+ `setRelation`; calling `add` again with that value throws `INVALID_ARGUMENT` and leaves the edge
19
+ unchanged.
20
+ **What to do:** trim or hash long refs before calling `add` or `setRelation`.
16
21
  - `add`, `remove` and `setRelation` reject an empty `memberRef`, `resourceRef`, `relation`,
17
22
  `memberKind`, `status`, `fromRelation` or `toRelation` with
18
23
  `ConvexError({ code: "INVALID_ARGUMENT" })`. 0.1.0 accepted these and stored the empty value
19
- as a real edge. Reactive queries still accept empty placeholder values and find nothing.
24
+ as a real edge. Queries still accept empty strings as placeholders; they find nothing unless
25
+ an edge stored by 0.1.0 with that empty value remains.
20
26
  **What to do:** never pass `""` to a write (including a `defaultRelation` or
21
27
  `defaultMemberKind` option). An edge stored with an empty `memberRef`, `resourceRef` or
22
28
  `relation` can no longer be removed or moved through `remove` or `setRelation`, so delete
23
29
  such edges while still on 0.1.0 (find them with `documents`).
24
30
  - The `by_member`, `by_resource` and `by_member_resource` indexes are gone (see Changed), so
25
- pages are ordered differently. `members` and `documents` filtered by `memberRef` are ordered
26
- by resource, then relation, then insertion time. `listMembers` without `relation` and
27
- `documents` filtered by `resourceRef` are ordered by relation, then insertion time.
31
+ pages are ordered differently. `members`, and `documents` filtered by `memberRef` (and no
32
+ `resourceRef`), are ordered by resource, then relation, then insertion time. `listMembers`
33
+ without `relation` and `documents` filtered by `resourceRef` are ordered by relation, then
34
+ insertion time.
28
35
  `isMember` results and the set of rows returned do not change.
29
36
  **What to do:** do not rely on insertion order within those pages, and restart any
30
37
  pagination from `cursor: null` after the upgrade; do not reuse a cursor issued by 0.1.0.
@@ -33,12 +40,14 @@ bump: a `^0.1.0` range does not pull it in automatically.
33
40
 
34
41
  - The npm tarball now ships `docs/*.md`, `CHANGELOG.md` and `llms.txt`, so the docs for the
35
42
  installed version are at `node_modules/@vllnt/convex-memberships/docs/`. `llms.txt` links the
36
- bundled files relatively. `pnpm test:package` (run in CI) fails when a required file is missing
37
- from the tarball, a contributor-only file is included, or the packed `/test` helper does not
38
- compile in a consumer project.
43
+ bundled files relatively.
39
44
  - `docs/API.md` lists the package entry points, the `useIsMember` hook, result ordering, and that
40
45
  `setRelation` rejects an empty `fromRelation` or `toRelation`.
41
46
  - README: "For coding agents" and "Related packages" sections.
47
+ - Docs follow the shared agent-first layout: the README has When to use, API, Common tasks,
48
+ Errors and fixes, Limits and gotchas, Compatibility and Links sections; `docs/API.md` has one
49
+ heading per export; `llms.txt` adds When to use and the Ecosystem block; every public export
50
+ has a TSDoc summary; `package.json` has a new description, keywords and homepage.
42
51
 
43
52
  ### Fixed
44
53
 
@@ -57,10 +66,21 @@ bump: a `^0.1.0` range does not pull it in automatically.
57
66
  queries now use the `by_tuple` and `by_resource_relation` prefixes, so each write updates 2
58
67
  indexes instead of 5. The rows returned are unchanged; page order and old cursors are not (see
59
68
  Breaking).
60
- - Adopt pnpm 10 with a release-age gate; releases are published only from CI with npm trusted
61
- publishing and provenance. Pin the deepmerge-ts override to 8.0.2.
69
+ - `engines.node` is now `>=20` (was `>=18`): convex 1.45, the lowest supported version, needs
70
+ Node.js 20, and Node.js 18 is end-of-life. convex 1.49 and later need Node.js 22.
71
+ **What to do:** use Node.js 20 or later (22 or later with convex 1.49+).
62
72
  - Document the error codes, that role/permission checks and last-owner protection are the host's
63
73
  job, and how to use `/test` in a consuming app.
74
+ - Internal: releases only from CI, a canary on every push to `main`, pnpm 10 with a
75
+ release-age gate, CI checks of the packed tarball and its docs, and more tests; no runtime
76
+ change.
77
+
78
+ ### Security
79
+
80
+ - The `./react` docs now say each hook must be given a host query that authorizes the caller.
81
+ The 0.1.0 docs said to pass the host's re-export of the component query, which lets any client
82
+ read any member's or resource's edges. **What to do:** wrap the component query in a host
83
+ query that checks the caller before calling it.
64
84
 
65
85
  ## [0.1.0] - 2026-09-01
66
86