@heroiclands/package-build 20.3.1 → 20.5.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 (195) hide show
  1. package/CHANGELOG.md +351 -0
  2. package/CONTENT.md +322 -110
  3. package/README.md +21 -10
  4. package/bin/content-build.mjs +204 -92
  5. package/bin/package-build.mjs +48 -15
  6. package/config.mjs +6 -8
  7. package/content-config.mjs +518 -151
  8. package/docs/api.md +1352 -0
  9. package/docs/commands.md +1609 -0
  10. package/docs/configuration.md +1432 -0
  11. package/docs/content-format.md +73 -74
  12. package/docs/diagnostics.md +356 -0
  13. package/docs/getting-started.md +813 -0
  14. package/docs/project-setup.md +469 -0
  15. package/e2e.mjs +4 -4
  16. package/engine/actor-compiler.mjs +64 -61
  17. package/engine/address-charset.mjs +6 -6
  18. package/engine/address-diff.mjs +57 -52
  19. package/engine/anchored-sections.mjs +1 -1
  20. package/engine/anchors.mjs +1 -1
  21. package/engine/base-compiler.mjs +42 -38
  22. package/engine/bundle-notes.mjs +4 -4
  23. package/engine/bundles.mjs +17 -8
  24. package/engine/code-fences.mjs +3 -3
  25. package/engine/compendiums.mjs +8 -8
  26. package/engine/compile-corpus.mjs +4 -5
  27. package/engine/content-address.mjs +24 -24
  28. package/engine/content-charset.mjs +1 -1
  29. package/engine/content-format-check.mjs +24 -25
  30. package/engine/content-format.mjs +8 -8
  31. package/engine/content-html.mjs +202 -0
  32. package/engine/content-icons.mjs +196 -165
  33. package/engine/content-index.mjs +61 -40
  34. package/engine/content-links.mjs +74 -41
  35. package/engine/content-lint.mjs +64 -34
  36. package/engine/content-package.mjs +7 -9
  37. package/engine/content-slug.mjs +2 -2
  38. package/engine/content-tables.mjs +38 -34
  39. package/engine/content-tree.mjs +1 -1
  40. package/engine/derived-fields.mjs +174 -0
  41. package/engine/diagnostics.mjs +3 -4
  42. package/engine/document-subtypes.mjs +6 -7
  43. package/engine/field-reference.mjs +8 -8
  44. package/engine/field-spec.mjs +29 -30
  45. package/engine/folder-notes.mjs +18 -16
  46. package/engine/foreign-catalog.mjs +8 -9
  47. package/engine/foundry-entries.mjs +19 -20
  48. package/engine/frontmatter-lint.mjs +95 -103
  49. package/engine/frontmatter.mjs +11 -11
  50. package/engine/generate.mjs +44 -39
  51. package/engine/helpers.mjs +147 -84
  52. package/engine/homepage.mjs +20 -22
  53. package/engine/ids.mjs +15 -15
  54. package/engine/index-records.mjs +4 -4
  55. package/engine/index.mjs +26 -10
  56. package/engine/item-compiler.mjs +54 -29
  57. package/engine/item-docs.mjs +11 -13
  58. package/engine/item-registry.mjs +13 -13
  59. package/engine/journals.mjs +24 -15
  60. package/engine/macros.mjs +3 -3
  61. package/engine/map-notes.mjs +6 -6
  62. package/engine/metadata-index.mjs +5 -5
  63. package/engine/note-claims.mjs +51 -41
  64. package/engine/note-ids.mjs +5 -5
  65. package/engine/note-package.mjs +4 -4
  66. package/engine/note-renames.mjs +3 -3
  67. package/engine/note-schemas.mjs +3 -8
  68. package/engine/note-vocabulary.mjs +56 -54
  69. package/engine/pack-config.mjs +39 -25
  70. package/engine/pack-router.mjs +0 -0
  71. package/engine/pdf-build.mjs +464 -0
  72. package/engine/pdf-fonts.mjs +420 -0
  73. package/engine/pdf-render.mjs +798 -0
  74. package/engine/pdf-toc.mjs +525 -0
  75. package/engine/prose-config.mjs +9 -9
  76. package/engine/prose-lint.mjs +12 -13
  77. package/engine/region-events.mjs +2 -2
  78. package/engine/retired-fields.mjs +24 -22
  79. package/engine/runtime-only-fields.mjs +1 -1
  80. package/engine/scene-levels.mjs +1 -1
  81. package/engine/scenes.mjs +33 -25
  82. package/engine/schema-check.mjs +21 -21
  83. package/engine/schema-extract.mjs +1 -1
  84. package/engine/site-build.mjs +66 -50
  85. package/engine/site-index.mjs +17 -18
  86. package/engine/sql-tables.mjs +21 -13
  87. package/engine/subtype-registry.mjs +5 -4
  88. package/engine/system-block.mjs +18 -19
  89. package/engine/systems.mjs +2 -2
  90. package/engine/web-wikilinks.mjs +41 -38
  91. package/engine/wikilink-syntax.mjs +16 -16
  92. package/engine/wikilinks.mjs +40 -42
  93. package/hm3/actors.mjs +30 -22
  94. package/hm3/document-subtypes.mjs +5 -5
  95. package/hm3/index.mjs +2 -2
  96. package/hm3/item-builders.mjs +1 -1
  97. package/hm3/item-fields.mjs +3 -3
  98. package/hm3/items.mjs +28 -8
  99. package/hm3/template-priority.mjs +2 -2
  100. package/lang.mjs +3 -3
  101. package/manifest.mjs +17 -20
  102. package/package.json +1 -2
  103. package/release.mjs +66 -6
  104. package/sohl/actors.mjs +36 -28
  105. package/sohl/affiliation-standings.mjs +2 -2
  106. package/sohl/being-info.mjs +5 -5
  107. package/sohl/default-item-art.mjs +5 -5
  108. package/sohl/document-subtypes.mjs +5 -5
  109. package/sohl/index.mjs +3 -3
  110. package/sohl/item-builders.mjs +7 -7
  111. package/sohl/item-fields.mjs +8 -9
  112. package/sohl/items.mjs +28 -6
  113. package/sohl/kb-passes.mjs +5 -5
  114. package/sohl/note-schemas.mjs +12 -12
  115. package/sohl/skill-base.mjs +1 -1
  116. package/types/content-config.d.mts +91 -39
  117. package/types/e2e.d.mts +3 -3
  118. package/types/engine/actor-compiler.d.mts +45 -40
  119. package/types/engine/address-charset.d.mts +6 -6
  120. package/types/engine/address-diff.d.mts +60 -6
  121. package/types/engine/base-compiler.d.mts +27 -21
  122. package/types/engine/bundle-notes.d.mts +3 -3
  123. package/types/engine/bundles.d.mts +10 -1
  124. package/types/engine/code-fences.d.mts +3 -3
  125. package/types/engine/compendiums.d.mts +3 -3
  126. package/types/engine/compile-corpus.d.mts +1 -1
  127. package/types/engine/content-address.d.mts +20 -20
  128. package/types/engine/content-format-check.d.mts +6 -6
  129. package/types/engine/content-format.d.mts +2 -2
  130. package/types/engine/content-html.d.mts +78 -0
  131. package/types/engine/content-icons.d.mts +139 -92
  132. package/types/engine/content-index.d.mts +59 -15
  133. package/types/engine/content-links.d.mts +8 -8
  134. package/types/engine/content-lint.d.mts +8 -6
  135. package/types/engine/content-package.d.mts +6 -8
  136. package/types/engine/content-tables.d.mts +49 -18
  137. package/types/engine/derived-fields.d.mts +101 -0
  138. package/types/engine/diagnostics.d.mts +2 -2
  139. package/types/engine/document-subtypes.d.mts +3 -3
  140. package/types/engine/field-spec.d.mts +37 -39
  141. package/types/engine/folder-notes.d.mts +4 -5
  142. package/types/engine/foreign-catalog.d.mts +3 -3
  143. package/types/engine/foundry-entries.d.mts +6 -7
  144. package/types/engine/frontmatter-lint.d.mts +10 -9
  145. package/types/engine/frontmatter.d.mts +7 -7
  146. package/types/engine/generate.d.mts +7 -7
  147. package/types/engine/helpers.d.mts +128 -56
  148. package/types/engine/homepage.d.mts +16 -18
  149. package/types/engine/ids.d.mts +13 -13
  150. package/types/engine/index-records.d.mts +3 -3
  151. package/types/engine/index.d.mts +6 -0
  152. package/types/engine/item-compiler.d.mts +21 -5
  153. package/types/engine/item-docs.d.mts +2 -2
  154. package/types/engine/item-registry.d.mts +6 -6
  155. package/types/engine/journals.d.mts +12 -3
  156. package/types/engine/map-notes.d.mts +2 -2
  157. package/types/engine/metadata-index.d.mts +4 -4
  158. package/types/engine/note-claims.d.mts +30 -22
  159. package/types/engine/note-ids.d.mts +4 -4
  160. package/types/engine/note-package.d.mts +1 -1
  161. package/types/engine/note-renames.d.mts +3 -3
  162. package/types/engine/note-vocabulary.d.mts +31 -203
  163. package/types/engine/pack-config.d.mts +7 -7
  164. package/types/engine/pack-router.d.mts +1 -1
  165. package/types/engine/pdf-build.d.mts +42 -0
  166. package/types/engine/pdf-fonts.d.mts +30 -0
  167. package/types/engine/pdf-render.d.mts +144 -0
  168. package/types/engine/pdf-toc.d.mts +114 -0
  169. package/types/engine/prose-config.d.mts +9 -9
  170. package/types/engine/prose-lint.d.mts +3 -4
  171. package/types/engine/region-events.d.mts +2 -2
  172. package/types/engine/retired-fields.d.mts +10 -9
  173. package/types/engine/scenes.d.mts +10 -1
  174. package/types/engine/schema-check.d.mts +13 -13
  175. package/types/engine/site-build.d.mts +52 -25
  176. package/types/engine/site-index.d.mts +3 -4
  177. package/types/engine/sql-tables.d.mts +11 -5
  178. package/types/engine/subtype-registry.d.mts +3 -3
  179. package/types/engine/system-block.d.mts +3 -3
  180. package/types/engine/web-wikilinks.d.mts +7 -7
  181. package/types/engine/wikilink-syntax.d.mts +17 -17
  182. package/types/engine/wikilinks.d.mts +14 -14
  183. package/types/hm3/actors.d.mts +9 -1
  184. package/types/hm3/document-subtypes.d.mts +1 -1
  185. package/types/hm3/items.d.mts +9 -2
  186. package/types/hm3/template-priority.d.mts +1 -1
  187. package/types/manifest.d.mts +8 -8
  188. package/types/release.d.mts +15 -4
  189. package/types/sohl/actors.d.mts +12 -4
  190. package/types/sohl/affiliation-standings.d.mts +2 -2
  191. package/types/sohl/being-info.d.mts +2 -2
  192. package/types/sohl/document-subtypes.d.mts +1 -1
  193. package/types/sohl/items.d.mts +9 -2
  194. package/types/sohl/note-schemas.d.mts +1 -1
  195. package/MIGRATING.md +0 -608
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The description an item carries: a pointer to its **item doc**, the
3
- * JournalEntry the journals pass compiles this same body into (#1348).
3
+ * JournalEntry the journals pass compiles this same body into.
4
4
  *
5
5
  * The prose is not rendered into the item at all. Carrying it would duplicate
6
6
  * it onto every actor holding the item — 7.59 MB of copies across the actors
@@ -40,6 +40,22 @@ export class SystemItemCompiler extends BasePackCompiler {
40
40
  * @type {import("./document-subtypes.mjs").DocumentSubtypeMap|undefined}
41
41
  */
42
42
  static documentSubtypes: import("./document-subtypes.mjs").DocumentSubtypeMap | undefined;
43
+ /**
44
+ * The `system` keys this pass writes for itself, and where each is read
45
+ * from.
46
+ *
47
+ * A note authoring one is refused, because the compiler writes the key
48
+ * unconditionally: the authored value is overwritten, or survives as the
49
+ * wrong type in a shipped document. Declared here rather than named in the
50
+ * refusal so that a second system states its own — see
51
+ * {@link module:engine/derived-fields}.
52
+ *
53
+ * @type {readonly {key: string, from: string}[]}
54
+ */
55
+ static derivedSystemKeys: readonly {
56
+ key: string;
57
+ from: string;
58
+ }[];
43
59
  /**
44
60
  * The frontmatter block this pass reads, and the registry it addresses.
45
61
  *
@@ -60,7 +76,7 @@ export class SystemItemCompiler extends BasePackCompiler {
60
76
  * **Looked up, not inferred.** For every type this system declares, the
61
77
  * emitted subtype is the map's, so the note vocabulary and the document
62
78
  * vocabulary are two separately-stated things rather than one string
63
- * written twice (#79).
79
+ * written twice.
64
80
  *
65
81
  * **A type the map does not name belongs to the consumer**, and its
66
82
  * registry entry is the declaration: a repository shipping an item type of
@@ -69,7 +85,7 @@ export class SystemItemCompiler extends BasePackCompiler {
69
85
  * subtype of. That is an authored statement in the consumer's own
70
86
  * configuration, not a coincidence inside this package's source — and
71
87
  * refusing it here would silently drop every document of a type this system
72
- * has no opinion about (#7/#1563).
88
+ * has no opinion about.
73
89
  *
74
90
  * @param {object} fm - The note's frontmatter.
75
91
  * @returns {string} The document's `type`.
@@ -84,7 +100,7 @@ export class SystemItemCompiler extends BasePackCompiler {
84
100
  * Nothing by default, which is the honest position for a system that has
85
101
  * not said otherwise: a key written here lands on every document of every
86
102
  * type, so inventing one that the receiving DataModel does not declare
87
- * would be a finding on the whole pack (#155).
103
+ * would be a finding on the whole pack.
88
104
  *
89
105
  * @param {object} fm - The note's frontmatter.
90
106
  * @param {object} at - What the pass already knows about this note.
@@ -111,7 +127,7 @@ export class SystemItemCompiler extends BasePackCompiler {
111
127
  * field for it and an undeclared `system` key is discarded at load without
112
128
  * a word.
113
129
  *
114
- * **This is the one emitted key nothing else can check** (#283). A `system`
130
+ * **This is the one emitted key nothing else can check**. A `system`
115
131
  * key this pass invents is caught by the emitted-`system` check against the
116
132
  * receiving schema, but a flag is declared by no schema — so an omission
117
133
  * here is silent, and was: the Actor pass wrote the priority and this one
@@ -3,7 +3,7 @@
3
3
  * addressed by the virtual `doc<type>` qualifier.
4
4
  *
5
5
  * Every item type, plus `macro` — a macro note's body documents the script the
6
- * note also compiles into a Macro (#1514), which is the same shape as an item
6
+ * note also compiles into a Macro, which is the same shape as an item
7
7
  * and its description: one note, two documents, the prose living in the
8
8
  * journals pack.
9
9
  *
@@ -59,7 +59,7 @@ export function itemDocEntryId(itemId: string): string;
59
59
  * happens to contain a link, which the runtime would then show verbatim.
60
60
  *
61
61
  * @param {string} packageId - The Foundry package shipping the journals pack.
62
- * Supplied rather than assumed (#1498).
62
+ * Supplied rather than assumed.
63
63
  * @param {string} itemId - The item note's `id` frontmatter.
64
64
  * @param {string} name - The item's name, used as the link's label. It shows
65
65
  * only if the target ever fails to resolve, where a broken link naming the
@@ -6,9 +6,9 @@
6
6
  * **Derived, never authored.** These are the keys of the consuming
7
7
  * repository's `itemBuilders` registry, so the whitelist and the builder table
8
8
  * are the same list and cannot drift apart. They already had: `trait` was
9
- * whitelisted long after the item type was retired (#651), with no builder
9
+ * whitelisted long after the item type was retired, with no builder
10
10
  * behind it, so every `type: trait` note passed the gate and then failed to
11
- * compile (#1504).
11
+ * compile.
12
12
  *
13
13
  * An accessor rather than a hoisted constant, so that importing this module
14
14
  * needs no configuration (#2).
@@ -21,7 +21,7 @@ export function itemTypes(): ReadonlySet<string>;
21
21
  *
22
22
  * Unreachable through the compiler — its whitelist *is* this registry's keys —
23
23
  * so a throw here means a caller invented a type. It names the type rather than
24
- * failing as an anonymous `is not a function` (#1504).
24
+ * failing as an anonymous `is not a function`.
25
25
  *
26
26
  * @param {string} type - The note's `type` frontmatter.
27
27
  * @param {string} [system] - The system compiling it, where a build declares
@@ -35,9 +35,9 @@ export function itemBuilder(type: string, system?: string): (fm: object) => obje
35
35
  * The frontmatter fields a type's registry entry declares, if any.
36
36
  *
37
37
  * Sparse by design: a type whose entry declares none compiles normally and is
38
- * simply undocumented (#22). What reads it is the `system`-block passthrough,
38
+ * simply undocumented. What reads it is the `system`-block passthrough,
39
39
  * which has to know which paths a declared field already writes before it
40
- * writes the rest (#58).
40
+ * writes the rest.
41
41
  *
42
42
  * @param {string} type - The item type.
43
43
  * @param {string} [system] - The system compiling it, where a build declares
@@ -51,7 +51,7 @@ export function itemFields(type: string, system?: string): readonly object[] | u
51
51
  *
52
52
  * Read from the consuming repository's `itemBuilders` registry, the same place
53
53
  * the type itself is declared, so a consumer's own type can bring art a
54
- * SoHL-owned table could never hold. Art used to be looked up in
54
+ * SoHL-owned table could never hold. Art is not looked up in
55
55
  * `sohl/default-item-art.mjs` instead: a type was configurable while its
56
56
  * default art was not, so a second consumer's items compiled only if every one
57
57
  * of its notes set `img:` (#7).
@@ -29,7 +29,7 @@ export function splitPages(body: any, leadName?: string): {
29
29
  * on an identity alone:
30
30
  *
31
31
  * - **An anchor**, declared twice, has always collided.
32
- * - **A name**, repeated among the unanchored pages, collides since #268 took
32
+ * - **A name**, repeated among the unanchored pages, collides once
33
33
  * the index out of the key. `MD024` with `siblings_only` already makes two
34
34
  * sibling headings with the same text a lint error, so this is the same rule
35
35
  * restated where the build can enforce it — a lint is a separate command, and
@@ -69,7 +69,7 @@ export function assertUniqueAnchors(rawPages: Array<{
69
69
  * doc's first page without having compiled it (see
70
70
  * {@link sohl.utils.packs.itemDocPointer}).
71
71
  *
72
- * **It takes no index** (#268). A page used to be keyed by position *and* name,
72
+ * **It takes no index**. Keying a page by position *and* name,
73
73
  * so inserting a heading renumbered every page after it and a re-import created
74
74
  * new pages beside the old ones — while nothing about those pages had changed.
75
75
  * The anchored case above never took one, and is the shape this now shares.
@@ -134,7 +134,7 @@ export function buildPages(rawPages: Array<object>, entryId: string, noteName: s
134
134
  * @param {object} [params.stats] - The `_stats` block to stamp. Passed by the
135
135
  * caller because it is a property of the *pack* being written, not of the
136
136
  * entry: a module may ship the same content for two systems, and each pack's
137
- * documents record the system version they were built against (#48). A
137
+ * documents record the system version they were built against. A
138
138
  * caller with no pack in hand gets the package-wide block.
139
139
  * @returns {object} The JournalEntry document, keyed for the pack.
140
140
  */
@@ -147,6 +147,15 @@ export function buildJournalEntry({ id, name, markdown, leadName, folder, flags,
147
147
  flags?: object | undefined;
148
148
  stats?: object | undefined;
149
149
  }): object;
150
+ /**
151
+ * Journals pack compiler.
152
+ *
153
+ * Walks the content tree and compiles every `type: doc` note, and every note of
154
+ * a doc-carrying type, into one JournalEntry document: the body split into
155
+ * pages on its top-level H1 headings, each rendered to HTML. A doc-carrying
156
+ * note's entry is that document's documentation, filed in the document's own
157
+ * folder.
158
+ */
150
159
  export class Journals extends BasePackCompiler {
151
160
  /**
152
161
  * How many of the compiled entries were documentation for a document
@@ -8,7 +8,7 @@ export function isMapType(type?: string): boolean;
8
8
  /**
9
9
  * The canvas profile for a map subType.
10
10
  *
11
- * Keyed on the subType rather than the type since #174: every map note is
11
+ * Keyed on the subType rather than the type: every map note is
12
12
  * `type: map`, and which canvas it derives is the one thing the three
13
13
  * spellings ever decided.
14
14
  *
@@ -253,7 +253,7 @@ export const MAP_SUBTYPE_PROFILES: Readonly<Record<string, object>>;
253
253
  */
254
254
  export const DEFAULT_LEVEL_ID: "defaultLevel0000";
255
255
  /**
256
- * The behaviour types a map note may carry (issue #1525, v1).
256
+ * The behaviour types a map note may carry (v1).
257
257
  *
258
258
  * @type {ReadonlySet<string>}
259
259
  */
@@ -22,7 +22,7 @@ export function metadataFileName(pkg: string): string;
22
22
  * `itemCatalog: true` says a dependency supplies *items*; citing its
23
23
  * *addresses* is a separate edge, and a package may have either without the
24
24
  * other. `harn-ensemble` cites no foreign address and carries 324,016 embedded
25
- * item references (`HeroicLands/harn-ensemble#42`); a package citing addresses
25
+ * item references; a package citing addresses
26
26
  * and needing no items is the mirror of it. Gating the index on the catalogue
27
27
  * flag would serve neither.
28
28
  *
@@ -84,7 +84,7 @@ export function cachedMetadataFiles(config: object): string[];
84
84
  * The same fetched indexes, each paired with the package that published it.
85
85
  *
86
86
  * The id is what a SQL content table addresses a dependency's notes by
87
- * (`FROM sohl.notes`, #246), so the pairing has to survive the lookup —
87
+ * (`FROM sohl.notes`), so the pairing has to survive the lookup —
88
88
  * {@link cachedMetadataFiles} drops it, and a caller reconstructing the id from
89
89
  * the file name would be parsing a path to recover something the declaration
90
90
  * already stated.
@@ -113,7 +113,7 @@ export function cachedMetadataIndexes(config: object): Array<{
113
113
  * rather than being written once per cache. Two copies would be two chances to
114
114
  * get it wrong, and the wrong answer is invisible: every cached version is a
115
115
  * complete, stamped, perfectly valid artifact, so picking the older one reports
116
- * nothing and simply resolves against stale data (#272).
116
+ * nothing and simply resolves against stale data.
117
117
  *
118
118
  * @param {string[]} dirs - Complete cache directories, named `<id>@<version>`.
119
119
  * @returns {string} The newest one.
@@ -179,7 +179,7 @@ export function cachedIndexPath(config: object, pkg: string): string;
179
179
  * therefore reported against the index, once, instead of once per citing note.
180
180
  *
181
181
  * The realistic cause is a version skew: a dependency released before the
182
- * address grammar gained its `<system>` segment (#59) ships three-segment keys.
182
+ * address grammar gained its `<system>` segment ships three-segment keys.
183
183
  * Re-fetching after that dependency releases is the fix.
184
184
  *
185
185
  * @param {Map<string, object>} foreignIndex - The resolved foreign index.
@@ -7,22 +7,19 @@
7
7
  * pack from appearing to answer for any note.
8
8
  *
9
9
  * @param {string} docType - The Foundry document type a pack holds.
10
- * @param {ClaimSources} [sources] - What to answer from.
11
- * @param {object} [opts] - Options.
12
- * @param {readonly object[]} [opts.records] - The corpus, derived once by the
13
- * compile and handed in — required, for the reason above (#243). Defaults to the
10
+ * @param {ClaimSources} [sources] - What to answer from. Defaults to the
14
11
  * configured registries and the systems this toolchain ships.
15
12
  * @returns {ReadonlySet<string>} The note types such a pass would claim.
16
13
  */
17
14
  export function noteTypesClaimedBy(docType: string, sources?: ClaimSources): ReadonlySet<string>;
18
15
  /**
19
- * Every document class a note of one type compiles into (#152).
16
+ * Every document class a note of one type compiles into.
20
17
  *
21
18
  * **A note produces more than one document, and that is the ordinary case.** An
22
19
  * item note compiles an Item *and* the JournalEntry its prose becomes; a map
23
- * note a Scene and a JournalEntry; since #337 an actor note an Actor and a
20
+ * note a Scene and a JournalEntry; an actor note an Actor and a
24
21
  * JournalEntry too. {@link claimedNoteTypes} unions over the configured packs
25
- * and so answers "is this note compiled *at all*", which is #146's question and
22
+ * and so answers "is this note compiled *at all*", and
26
23
  * cannot see a note that compiles one of its two documents and loses the other.
27
24
  *
28
25
  * Asked of the **claim table** rather than of a list of its own, so the set of
@@ -33,7 +30,7 @@ export function noteTypesClaimedBy(docType: string, sources?: ClaimSources): Rea
33
30
  * **Union across systems, never per system.** A type one system maps and
34
31
  * another does not appears once, because the `Item` and `Actor` rows already
35
32
  * fold the maps together — so this cannot report a document class a system
36
- * deliberately declines to produce, which is the silence #79 requires.
33
+ * deliberately declines to produce, which is the silence the rule requires.
37
34
  *
38
35
  * ## The JournalEntry row is the one that is per *note*
39
36
  *
@@ -73,13 +70,14 @@ export function documentClassesFor(type: string, sources?: ClaimSources, { hasPr
73
70
  *
74
71
  * The union across the configured pack list, so a type claimed by any one pack
75
72
  * is claimed — which is what keeps a type deliberately unmapped for one system,
76
- * and claimed for another, silent (#79).
73
+ * and claimed for another, silent.
77
74
  *
78
75
  * **A prebuilt pack claims nothing.** Its per-document JSON is checked in
79
76
  * rather than compiled, so it has no pass and no note is routed into one —
80
77
  * which `content-config.mjs` already states by refusing `default: true`
81
78
  * alongside `prebuilt`. Counting it would tell an author their note is claimed
82
- * by a pack that will never look at it. Before #259 the point could not arise:
79
+ * by a pack that will never look at it. With no unimplemented type declared,
80
+ * the point cannot arise:
83
81
  * the only prebuilt pack in the wild is `harn-adventures`'s Adventure pack, and
84
82
  * no compiler was registered for that document type, so the row answered for
85
83
  * nothing whatever it was asked. Now one is.
@@ -87,9 +85,6 @@ export function documentClassesFor(type: string, sources?: ClaimSources, { hasPr
87
85
  * @param {object} [config] - The resolved build configuration. Defaults to this
88
86
  * repository's.
89
87
  * @param {ClaimSources} [sources] - What to answer from.
90
- * @param {object} [opts] - Options.
91
- * @param {readonly object[]} [opts.records] - The corpus, derived once by the
92
- * compile and handed in — required, for the reason above (#243).
93
88
  * @returns {ReadonlySet<string>} The claimed note types.
94
89
  */
95
90
  export function claimedNoteTypes(config?: object, sources?: ClaimSources): ReadonlySet<string>;
@@ -103,9 +98,6 @@ export function claimedNoteTypes(config?: object, sources?: ClaimSources): Reado
103
98
  * declare on top.
104
99
  *
105
100
  * @param {ClaimSources} [sources] - What to answer from.
106
- * @param {object} [opts] - Options.
107
- * @param {readonly object[]} [opts.records] - The corpus, derived once by the
108
- * compile and handed in — required, for the reason above (#243).
109
101
  * @returns {ReadonlySet<string>} The vocabulary.
110
102
  */
111
103
  export function noteTypeVocabulary(sources?: ClaimSources): ReadonlySet<string>;
@@ -124,7 +116,7 @@ export function noteTypeVocabulary(sources?: ClaimSources): ReadonlySet<string>;
124
116
  * @param {ClaimSources} [sources] - What to answer from.
125
117
  * @param {object} [opts] - Options.
126
118
  * @param {readonly object[]} [opts.records] - The corpus, derived once by the
127
- * compile and handed in — required, for the reason above (#243).
119
+ * compile and handed in — required, for the reason above.
128
120
  * @returns {Array<{file: string, line?: number, column?: number,
129
121
  * severity: "error", message: string, type: string}>} One finding per note.
130
122
  */
@@ -149,6 +141,22 @@ export function unclaimedNoteFindings(config?: object, sources?: ClaimSources, {
149
141
  * @type {ReadonlySet<string>}
150
142
  */
151
143
  export const NEVER_PACKED_TYPES: ReadonlySet<string>;
144
+ /**
145
+ * The whole note vocabulary of a package that compiles no Foundry documents.
146
+ *
147
+ * Every other type in the vocabulary exists to *become* a document: a `skill` is
148
+ * an Item, a `being` an Actor, a `place` a JournalEntry, a `folder` the Folder
149
+ * they are filed under. In a `documentation` package none of them has a
150
+ * destination, so a note carrying one would be authored, validated, walked and
151
+ * then published as a page of something that was meant to be a compendium
152
+ * entry — the plausible-looking result that reads as success.
153
+ *
154
+ * `doc` is prose whose single document *is* the prose, and `homepage` is the
155
+ * authored front page every package publishes. Both are already pages first.
156
+ *
157
+ * @type {ReadonlySet<string>}
158
+ */
159
+ export const DOCUMENTATION_NOTE_TYPES: ReadonlySet<string>;
152
160
  /**
153
161
  * Content types the specification states and this toolchain does not yet
154
162
  * compile.
@@ -162,11 +170,11 @@ export const NEVER_PACKED_TYPES: ReadonlySet<string>;
162
170
  * correctly and is worthless, because the configured vocabulary is *derived
163
171
  * from the routing*. Take a type's route away and it leaves the vocabulary too,
164
172
  * so the inference excuses precisely the mistake it was meant to catch. That is
165
- * not hypothetical: it is #241, where `place`, `lore` and `scenario` were
166
- * declared, validated and unrouted, and every gate reported success until a
167
- * downstream repository failed on 450 notes.
173
+ * not hypothetical: `place`, `lore` and `scenario` were declared, validated
174
+ * and unrouted, and every gate reported success until a downstream repository
175
+ * failed on the notes carrying them.
168
176
  *
169
- * A type leaves this set when it is implemented, the way `bundle` did in #259.
177
+ * A type leaves this set when it is implemented.
170
178
  * The membership is asserted, so it cannot be forgotten in either direction.
171
179
  *
172
180
  * @type {ReadonlySet<string>}
@@ -178,7 +186,7 @@ export const UNIMPLEMENTED_TYPES: ReadonlySet<string>;
178
186
  * A folder is the only one, and it is not unclaimed: it compiles to a real
179
187
  * `Folder` document. What it has no answer to is *which* pack claims it, because
180
188
  * that is not a property of the note — a folder materialises in every pack
181
- * holding a document that references it, and its ancestors with it (#257). So
189
+ * holding a document that references it, and its ancestors with it. So
182
190
  * it is exempt from the claim check for the opposite reason a homepage is:
183
191
  * a homepage is in no pack, and a folder may be in several.
184
192
  *
@@ -5,15 +5,15 @@
5
5
  * the rule but an application of it.** A `Folder` is a document of its own
6
6
  * class, and its id is hashed under the `folder` namespace so that a folder and
7
7
  * an item sharing a shortcode cannot derive one id — a collision Foundry would
8
- * not report, since it keys folders and documents in separate collections
9
- * (#258). So the answer for a folder comes from
8
+ * not report, since it keys folders and documents in separate collections.
9
+ * So the answer for a folder comes from
10
10
  * {@link module:engine/folder-notes.folderDocId}, the pass that emits those
11
11
  * documents, rather than from a second derivation here.
12
12
  *
13
13
  * That this function ever answered differently was invisible from inside a
14
14
  * build — no pass reads a folder's id from here — and surfaced only in the
15
15
  * content index, which is read from outside and had no way to be checked
16
- * against what shipped (#310).
16
+ * against what shipped.
17
17
  *
18
18
  * Returns `undefined` for a file with **no address** — no `type`, or no
19
19
  * `shortcode`. Such a file is not an addressable note, so it has no document
@@ -26,7 +26,7 @@
26
26
  * @param {object|null|undefined} fm - Parsed frontmatter.
27
27
  * @param {object} [opts]
28
28
  * @param {string} [opts.pkg] - The owning content package. Defaults to the
29
- * configured one, which is the only package a tree's notes belong to (#56).
29
+ * configured one, which is the only package a tree's notes belong to.
30
30
  * @param {readonly object[]} [opts.maps] - The document-subtype maps, which
31
31
  * decide the address's `<system>` segment.
32
32
  * @returns {string|undefined} The document's `_id`, or `undefined` when the
@@ -6,7 +6,7 @@
6
6
  * field, so a collection note that scopes itself with `WHERE … and package =
7
7
  * "sohl"` would match nothing now that the field is gone, and would render an
8
8
  * **empty table** in silence. Supplying the derived value here is what kept the
9
- * sweep mechanical rather than a trap (#56) — and a query that never mentions
9
+ * sweep mechanical rather than a trap — and a query that never mentions
10
10
  * `package` is unaffected either way.
11
11
  *
12
12
  * The frontmatter is copied rather than written into: it is the note's own
@@ -1,10 +1,10 @@
1
1
  /**
2
- * The shortcodes a note declares it used to be published under (#278).
2
+ * The shortcodes a note declares it used to be published under.
3
3
  *
4
4
  * A package's `(type, shortcode)` addresses are a published interface, and
5
5
  * `addresses diff` reports what a build stopped publishing — telling a
6
6
  * **rename** from a **withdrawal** by matching document ids across two
7
- * releases. #270 removed the property that rested on. An id is now derived from
7
+ * releases. The property that rested on is gone: an id is derived from
8
8
  * the canonical address, which carries the shortcode, so renaming a shortcode
9
9
  * moves the id too: both sides of the join move together, the match finds
10
10
  * nothing, and a rename is reported as a withdrawal with no successor named.
@@ -39,7 +39,7 @@
39
39
  * **It is transient.** Once every baseline a build is compared against post-dates
40
40
  * the rename, the declaration has nothing left to say and may be deleted. That
41
41
  * is the difference from an `id:` pin, which is permanent, opaque, and a second
42
- * identity for a thing that already has one (#270).
42
+ * identity for a thing that already has one.
43
43
  *
44
44
  * **It is one key per note, at the top level, however many systems the note
45
45
  * compiles into.** A shortcode is the note's, not a system block's: a note