@molecule/api-resource-article 1.1.0 → 1.1.2

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,7 +3,7 @@ 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-17T00:08:26.585Z
6
+ Generated: 2026-10-17T20:38:27.936Z
7
7
  -->
8
8
 
9
9
  # @molecule/api-resource-article
@@ -20,7 +20,7 @@ favorites and follows the rest of the app sees.
20
20
  **Tables this package owns: `articles` and `article_tags`.** The join between them is
21
21
  `article_tags.articleId` = `articles.id` (a declared FK, `ON DELETE CASCADE`; `("articleId", "tag")` is
22
22
  unique, and `article_tags.position` is the order the tags were given in). It also ships
23
- `reactions.sql` and `follows.sql`, which create the `reactions` and `follows` tables it reads by name.
23
+ `src/__setup__/reactions.sql` and `src/__setup__/follows.sql`, which create the `reactions` and `follows` tables it reads by name.
24
24
 
25
25
  > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
26
26
  > It is written to be read by coding agents as much as by people, and is generated from this
@@ -654,10 +654,12 @@ Peer dependencies:
654
654
  - `@molecule/api-slug`
655
655
  - `zod`
656
656
 
657
- - **Migration required: this package ships every table it reads, four in
658
- all.** `articles.sql` creates the `articles` and `article_tags` tables;
659
- `articles_position.sql` adds the `position` column to a database whose
660
- `article_tags` predates it; `reactions.sql` and `follows.sql` create the
657
+ - **A scaffold that lists this package already has these tables** — its `__setup__` SQL is
658
+ copied into the app at create time and replayed on every boot, so do not copy it into
659
+ `api/migrations/` yourself. This package ships every table it reads, four in
660
+ all. `src/__setup__/articles.sql` creates the `articles` and `article_tags` tables;
661
+ `src/__setup__/articles_position.sql` adds the `position` column to a database whose
662
+ `article_tags` predates it; `src/__setup__/reactions.sql` and `src/__setup__/follows.sql` create the
661
663
  `reactions` and `follows` tables, which this package reads directly by name
662
664
  on every response (favorites) and on its feed (who a reader follows). Those
663
665
  last two are copies of `@molecule/api-resource-reaction`'s and
@@ -666,7 +668,7 @@ Peer dependencies:
666
668
  installs those packages runs both copies harmlessly. A scaffold copies the
667
669
  tables a package's registry entry declares, and this one declares all four,
668
670
  so a project that installs only this package gets every table its endpoints
669
- need. Applying `articles.sql` alone leaves every article response failing
671
+ need. Applying `src/__setup__/articles.sql` alone leaves every article response failing
670
672
  with `no such table: reactions`.
671
673
  - **`article_tags` keeps the order the tags were given in**, in its `position`
672
674
  column (0-based). An app that reads the join table itself must order by
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@
11
11
  * **Tables this package owns: `articles` and `article_tags`.** The join between them is
12
12
  * `article_tags.articleId` = `articles.id` (a declared FK, `ON DELETE CASCADE`; `("articleId", "tag")` is
13
13
  * unique, and `article_tags.position` is the order the tags were given in). It also ships
14
- * `reactions.sql` and `follows.sql`, which create the `reactions` and `follows` tables it reads by name.
14
+ * `src/__setup__/reactions.sql` and `src/__setup__/follows.sql`, which create the `reactions` and `follows` tables it reads by name.
15
15
  *
16
16
  * @module
17
17
  * @example
@@ -57,10 +57,12 @@
57
57
  * ```
58
58
  *
59
59
  * @remarks
60
- * - **Migration required: this package ships every table it reads, four in
61
- * all.** `articles.sql` creates the `articles` and `article_tags` tables;
62
- * `articles_position.sql` adds the `position` column to a database whose
63
- * `article_tags` predates it; `reactions.sql` and `follows.sql` create the
60
+ * - **A scaffold that lists this package already has these tables** — its `__setup__` SQL is
61
+ * copied into the app at create time and replayed on every boot, so do not copy it into
62
+ * `api/migrations/` yourself. This package ships every table it reads, four in
63
+ * all. `src/__setup__/articles.sql` creates the `articles` and `article_tags` tables;
64
+ * `src/__setup__/articles_position.sql` adds the `position` column to a database whose
65
+ * `article_tags` predates it; `src/__setup__/reactions.sql` and `src/__setup__/follows.sql` create the
64
66
  * `reactions` and `follows` tables, which this package reads directly by name
65
67
  * on every response (favorites) and on its feed (who a reader follows). Those
66
68
  * last two are copies of `@molecule/api-resource-reaction`'s and
@@ -69,7 +71,7 @@
69
71
  * installs those packages runs both copies harmlessly. A scaffold copies the
70
72
  * tables a package's registry entry declares, and this one declares all four,
71
73
  * so a project that installs only this package gets every table its endpoints
72
- * need. Applying `articles.sql` alone leaves every article response failing
74
+ * need. Applying `src/__setup__/articles.sql` alone leaves every article response failing
73
75
  * with `no such table: reactions`.
74
76
  * - **`article_tags` keeps the order the tags were given in**, in its `position`
75
77
  * column (0-based). An app that reads the join table itself must order by
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkHG;AAEH,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoHG;AAEH,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA"}
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@
11
11
  * **Tables this package owns: `articles` and `article_tags`.** The join between them is
12
12
  * `article_tags.articleId` = `articles.id` (a declared FK, `ON DELETE CASCADE`; `("articleId", "tag")` is
13
13
  * unique, and `article_tags.position` is the order the tags were given in). It also ships
14
- * `reactions.sql` and `follows.sql`, which create the `reactions` and `follows` tables it reads by name.
14
+ * `src/__setup__/reactions.sql` and `src/__setup__/follows.sql`, which create the `reactions` and `follows` tables it reads by name.
15
15
  *
16
16
  * @module
17
17
  * @example
@@ -57,10 +57,12 @@
57
57
  * ```
58
58
  *
59
59
  * @remarks
60
- * - **Migration required: this package ships every table it reads, four in
61
- * all.** `articles.sql` creates the `articles` and `article_tags` tables;
62
- * `articles_position.sql` adds the `position` column to a database whose
63
- * `article_tags` predates it; `reactions.sql` and `follows.sql` create the
60
+ * - **A scaffold that lists this package already has these tables** — its `__setup__` SQL is
61
+ * copied into the app at create time and replayed on every boot, so do not copy it into
62
+ * `api/migrations/` yourself. This package ships every table it reads, four in
63
+ * all. `src/__setup__/articles.sql` creates the `articles` and `article_tags` tables;
64
+ * `src/__setup__/articles_position.sql` adds the `position` column to a database whose
65
+ * `article_tags` predates it; `src/__setup__/reactions.sql` and `src/__setup__/follows.sql` create the
64
66
  * `reactions` and `follows` tables, which this package reads directly by name
65
67
  * on every response (favorites) and on its feed (who a reader follows). Those
66
68
  * last two are copies of `@molecule/api-resource-reaction`'s and
@@ -69,7 +71,7 @@
69
71
  * installs those packages runs both copies harmlessly. A scaffold copies the
70
72
  * tables a package's registry entry declares, and this one declares all four,
71
73
  * so a project that installs only this package gets every table its endpoints
72
- * need. Applying `articles.sql` alone leaves every article response failing
74
+ * need. Applying `src/__setup__/articles.sql` alone leaves every article response failing
73
75
  * with `no such table: reactions`.
74
76
  * - **`article_tags` keeps the order the tags were given in**, in its `position`
75
77
  * column (0-based). An app that reads the join table itself must order by
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/api-resource-article",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Articles and blog posts: unique slugs, tags, favorites, a followed-authors feed, and filtered, paginated lists",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,9 +34,9 @@
34
34
  "license": "Apache-2.0",
35
35
  "devDependencies": {
36
36
  "@molecule/api-database": "1.1.3",
37
- "@molecule/api-database-sqlite": "1.2.5",
38
- "@molecule/api-resource-follow": "1.0.7",
39
- "@molecule/api-resource-reaction": "1.0.4",
37
+ "@molecule/api-database-sqlite": "1.2.6",
38
+ "@molecule/api-resource-follow": "1.0.8",
39
+ "@molecule/api-resource-reaction": "1.0.5",
40
40
  "@molecule/api-slug": "1.0.1",
41
41
  "@types/node": "26.1.2",
42
42
  "typescript": "6.0.3",