@vllnt/convex-comments 0.1.1-canary.30291b9 → 0.2.0-canary.3d151bb

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,7 +4,10 @@ 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
- ## [0.1.1] - Unreleased
7
+ ## [0.2.0] - Unreleased
8
+
9
+ A minor release, not a patch: it adds the `resourceCounts` component table and `post` now
10
+ rejects empty refs that 0.1.0 accepted, so `^0.1.0` ranges do not pick it up silently.
8
11
 
9
12
  ### Added
10
13
 
@@ -16,22 +19,54 @@ All notable changes to this project are documented here. The format is based on
16
19
  resolve inside the tarball.
17
20
  - `docs/API.md` documents every entry point (`.`, `./convex.config`, `./test`,
18
21
  `./_generated/component`) and the exported types.
22
+ - `pnpm check:docs`, run in CI, fails when a README section is missing or out of order, a code
23
+ block has no language, a relative link does not resolve, an export or error code is not
24
+ documented, a README example does not type-check against `dist`, or the shared Links, footer or
25
+ Ecosystem block differs.
19
26
 
20
27
  ### Changed
21
28
 
29
+ - Docs rewritten for coding agents. The README follows the shared @vllnt section order (For
30
+ coding agents, When to use, Install, Quick start, API, Common tasks, Errors and fixes, Limits
31
+ and gotchas, Compatibility, Testing, Security, Related packages, Contributing, Links, License)
32
+ and every README `ts` example type-checks against the built package. `docs/API.md` holds
33
+ signatures, not examples, and has one heading per export and a single error-codes table;
34
+ `llms.txt` carries the same summary, when-to-use list and links. The `package.json`
35
+ `description` and `keywords` changed to match. The README no longer lists `@vllnt/convex-reactions`,
36
+ `@vllnt/convex-notifications` or `@vllnt/convex-permissions` as related packages: no code,
37
+ test or example here uses them.
22
38
  - A push to `main` publishes a canary automatically (under the `canary` dist-tag only); the
23
39
  repository-variable gate on canary publishing is removed. Docs-only changes to the shipped
24
40
  files also trigger it.
25
41
  - `homepage` now points to `https://oss.vllnt.com/packages/convex-comments`.
42
+ - **Breaking:** `post` rejects an empty `resourceRef` or `authorRef` with
43
+ `ConvexError({ code: "INVALID_REF" })`; 0.1.0 accepted them. Callers that passed `""` must
44
+ pass a non-empty ref. Comments stored by 0.1.0 with an empty `authorRef` still exist, and since
45
+ only `post` checks refs, `edit`, `remove` and `resolve` accept a caller passing `""` as their
46
+ author: hosts should reject an empty `authorRef` before calling those.
26
47
  - `count` reads a maintained `resourceCounts` row (one document) instead of collecting every comment
27
- on the resource, and re-runs only when a comment is posted or removed. The counter is created
28
- by the first `post` on a resource with no comments; resources that already had comments keep the
29
- previous scan, so no write ever scans a whole resource.
48
+ on the resource. The counter is created by the first `post` on a resource with no comments, and
49
+ only `post` and `remove` change it, so for a resource with a counter `count` re-runs only when a
50
+ comment is posted or removed. Resources whose comments predate the counter have no row and keep
51
+ the previous scan (and its reactivity: `count` re-runs on any change to the resource's comments),
52
+ so no write ever scans a whole resource.
53
+ - Upgrading again after a downgrade needs a cleanup: if you run 0.2.0, go back to 0.1.x and later
54
+ upgrade again, the `resourceCounts` rows missed every post and remove made under 0.1.x, so `count`
55
+ returns stale numbers. Before upgrading again, delete every row in the component's
56
+ `resourceCounts` table: `count` then falls back to the scan for each resource that has comments,
57
+ which stays correct, and a resource with no comments gets a fresh counter on its next `post`.
30
58
 
31
59
  ### Fixed
32
60
 
33
- - `post` rejects an empty `resourceRef` or `authorRef` with
34
- `ConvexError({ code: "INVALID_REF" })`.
61
+ - `register(t)` from `@vllnt/convex-comments/test` accepts the `convexTest(schema, modules)`
62
+ instance of any host schema. It was typed against the component's own schema, so a host
63
+ app's test failed to type-check with TS2345. Runtime behavior is unchanged. The repo's
64
+ tests (`example/**`, `src/**/*.test.ts`) are now type-checked by `pnpm typecheck:tests`,
65
+ which `pnpm test` and `pnpm test:coverage` run first.
66
+ - The publish workflow runs `pnpm test:package` in its quality gate, so a canary or stable
67
+ release no longer publishes a tarball that misses a required doc or `exports` target.
68
+ `pnpm check:release` (run by `pnpm lint`) fails if that gate or the existing release
69
+ guards are removed.
35
70
  - `@vllnt/convex-comments/test` now type-checks under `moduleResolution: nodenext`
36
71
  (explicit `.js` relative imports, Vite client types referenced).
37
72
  - The `bodyValidator` JSDoc in `src/client` no longer says a Convex `v.*` validator has a