@molecule/api-resource-comment 1.1.3 → 1.1.4

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/README.md CHANGED
@@ -3,15 +3,11 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-10-16T15:23:41.357Z
6
+ Generated: 2026-10-17T20:52:27.537Z
7
7
  -->
8
8
 
9
9
  # @molecule/api-resource-comment
10
10
 
11
- > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
12
- > It is written to be read by coding agents as much as by people, and is generated from this
13
- > package's source — edit `src/index.ts` JSDoc, not this file.
14
-
15
11
  Threaded comments resource for molecule.dev.
16
12
 
17
13
  Polymorphic comments that attach to any resource type. Supports threaded
@@ -22,6 +18,10 @@ replies, pagination, and ownership-based authorization.
22
18
  by, and the join between the two is `comment_numbers.commentId` = `comments.id` (declared FK,
23
19
  `ON DELETE CASCADE`) — one row per numbered comment, never a mapping table of your own.
24
20
 
21
+ > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
22
+ > It is written to be read by coding agents as much as by people, and is generated from this
23
+ > package's source — edit `src/index.ts` JSDoc, not this file.
24
+
25
25
  ## Quick Start
26
26
 
27
27
  ```typescript
@@ -498,9 +498,12 @@ Peer dependencies:
498
498
  from `@molecule/app-http` normalizes this envelope (pass it the whole HttpResponse), so
499
499
  the rows come back; reading the response as a bare array — or `res.data` alone (which is
500
500
  the envelope) — yields an EMPTY list.
501
- - **Migration required.** `src/__setup__/comments.sql` ships with this package
502
- and must exist in the target database before use (scaffolded apps apply it
503
- automatically; existing apps must apply it first).
501
+ - **A scaffold that lists this package already has these tables** — its `__setup__` SQL is
502
+ copied into the app at create time and replayed on every boot, so do not copy it into
503
+ `api/migrations/` yourself; only a package added after the scaffold needs that.
504
+ `src/__setup__/comments.sql` ships with this package and must exist in the target
505
+ database before use (scaffolded apps apply it automatically; existing apps must apply it
506
+ first).
504
507
  - **Integer comment ids (RealWorld's `comment.id`, most public API specs):** keep the
505
508
  UUID and give each comment a sequential number — `createNumberedComment()` creates both
506
509
  in one transaction, `getCommentByNumber(n)` finds it, `commentNumbers(ids)` maps a list.
package/dist/index.d.ts CHANGED
@@ -30,9 +30,12 @@
30
30
  * from `@molecule/app-http` normalizes this envelope (pass it the whole HttpResponse), so
31
31
  * the rows come back; reading the response as a bare array — or `res.data` alone (which is
32
32
  * the envelope) — yields an EMPTY list.
33
- * - **Migration required.** `src/__setup__/comments.sql` ships with this package
34
- * and must exist in the target database before use (scaffolded apps apply it
35
- * automatically; existing apps must apply it first).
33
+ * - **A scaffold that lists this package already has these tables** — its `__setup__` SQL is
34
+ * copied into the app at create time and replayed on every boot, so do not copy it into
35
+ * `api/migrations/` yourself; only a package added after the scaffold needs that.
36
+ * `src/__setup__/comments.sql` ships with this package and must exist in the target
37
+ * database before use (scaffolded apps apply it automatically; existing apps must apply it
38
+ * first).
36
39
  * - **Integer comment ids (RealWorld's `comment.id`, most public API specs):** keep the
37
40
  * UUID and give each comment a sequential number — `createNumberedComment()` creates both
38
41
  * in one transaction, `getCommentByNumber(n)` finds it, `commentNumbers(ids)` maps a list.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AAEH,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA"}
package/dist/index.js CHANGED
@@ -30,9 +30,12 @@
30
30
  * from `@molecule/app-http` normalizes this envelope (pass it the whole HttpResponse), so
31
31
  * the rows come back; reading the response as a bare array — or `res.data` alone (which is
32
32
  * the envelope) — yields an EMPTY list.
33
- * - **Migration required.** `src/__setup__/comments.sql` ships with this package
34
- * and must exist in the target database before use (scaffolded apps apply it
35
- * automatically; existing apps must apply it first).
33
+ * - **A scaffold that lists this package already has these tables** — its `__setup__` SQL is
34
+ * copied into the app at create time and replayed on every boot, so do not copy it into
35
+ * `api/migrations/` yourself; only a package added after the scaffold needs that.
36
+ * `src/__setup__/comments.sql` ships with this package and must exist in the target
37
+ * database before use (scaffolded apps apply it automatically; existing apps must apply it
38
+ * first).
36
39
  * - **Integer comment ids (RealWorld's `comment.id`, most public API specs):** keep the
37
40
  * UUID and give each comment a sequential number — `createNumberedComment()` creates both
38
41
  * in one transaction, `getCommentByNumber(n)` finds it, `commentNumbers(ids)` maps a list.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/api-resource-comment",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Threaded comments on any resource with polymorphic attachment and pagination",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -30,7 +30,7 @@
30
30
  "license": "Apache-2.0",
31
31
  "devDependencies": {
32
32
  "@molecule/api-database": "1.1.3",
33
- "@molecule/api-database-sqlite": "1.2.4",
33
+ "@molecule/api-database-sqlite": "1.2.6",
34
34
  "@types/node": "26.1.2",
35
35
  "typescript": "6.0.3",
36
36
  "vitest": "4.1.11",