@heroiclands/package-build 23.1.0 → 23.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 (248) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/bin/content-commands.mjs +68 -149
  3. package/bin/package-build.mjs +56 -10
  4. package/ci/check-banners.mjs +42 -6
  5. package/ci/confirm-npm-version.mjs +135 -0
  6. package/ci/content-format-reference.mjs +14 -5
  7. package/config.mjs +1 -0
  8. package/container.mjs +185 -4
  9. package/content-config.mjs +333 -210
  10. package/deploy.mjs +116 -10
  11. package/docs/api.md +238 -246
  12. package/docs/authoring/assets.md +11 -5
  13. package/docs/authoring/frontmatter.md +1 -1
  14. package/docs/authoring/links-and-markup.md +87 -0
  15. package/docs/commands.md +138 -99
  16. package/docs/configuration.md +277 -125
  17. package/docs/content-format.md +2 -0
  18. package/docs/diagnostics.md +48 -13
  19. package/docs/guides/book.md +341 -21
  20. package/docs/guides/e2e.md +13 -2
  21. package/docs/guides/icons.md +14 -4
  22. package/docs/guides/module-project.md +18 -8
  23. package/docs/guides/release-and-deploy.md +54 -6
  24. package/docs/guides/site.md +5 -2
  25. package/docs/project-setup.md +30 -10
  26. package/docs/reference/format-details.md +373 -170
  27. package/docs/reference/note-types.md +128 -109
  28. package/docs/reference/theme-pages.md +31 -6
  29. package/e2e.mjs +140 -28
  30. package/engine/actor-compiler.mjs +22 -31
  31. package/engine/address-charset.mjs +4 -17
  32. package/engine/address-fields.mjs +1 -1
  33. package/engine/address-render.mjs +12 -1
  34. package/engine/address-values.mjs +6 -0
  35. package/engine/address.mjs +46 -33
  36. package/engine/art-fields.mjs +30 -5
  37. package/engine/art-slots.mjs +10 -1
  38. package/engine/asset-bindings.mjs +12 -1
  39. package/engine/base-compiler.mjs +34 -65
  40. package/engine/being-age.mjs +2 -7
  41. package/engine/being-measurements.mjs +12 -1
  42. package/engine/calendar-artifacts.mjs +6 -0
  43. package/engine/calendar-choice.mjs +12 -1
  44. package/engine/calendar-format.mjs +12 -1
  45. package/engine/calendar-human.mjs +12 -1
  46. package/engine/compile-corpus.mjs +3 -1
  47. package/engine/content-address.mjs +9 -12
  48. package/engine/content-alerts.mjs +13 -1
  49. package/engine/content-blocks.mjs +14 -3
  50. package/engine/content-embeds.mjs +11 -3
  51. package/engine/content-figures.mjs +9 -0
  52. package/engine/content-footnotes.mjs +12 -1
  53. package/engine/content-format-check.mjs +11 -262
  54. package/engine/content-format.yaml +5 -2
  55. package/engine/content-images.mjs +3 -0
  56. package/engine/content-index.mjs +443 -20
  57. package/engine/content-links.mjs +29 -35
  58. package/engine/content-lint.mjs +2 -3
  59. package/engine/content-poetry.mjs +12 -1
  60. package/engine/content-slug.mjs +2 -14
  61. package/engine/content-spans.mjs +13 -1
  62. package/engine/content-tables.mjs +12 -1
  63. package/engine/culture-choice.mjs +210 -13
  64. package/engine/data-keys.mjs +19 -16
  65. package/engine/date-conversion.mjs +12 -1
  66. package/engine/declaration-check.mjs +9 -0
  67. package/engine/derived-fields.mjs +6 -7
  68. package/engine/diagnostics.mjs +34 -4
  69. package/engine/docs-checks.mjs +9 -0
  70. package/engine/document-subtypes.mjs +47 -34
  71. package/engine/event-views.mjs +139 -14
  72. package/engine/exported-scene.mjs +92 -28
  73. package/engine/extension-attributes.mjs +12 -1
  74. package/engine/field-spec.mjs +11 -102
  75. package/engine/folder-notes.mjs +0 -64
  76. package/engine/foreign-catalog.mjs +2 -1
  77. package/engine/format-generated.mjs +9 -0
  78. package/engine/foundry-entries.mjs +10 -28
  79. package/engine/frontmatter-lint.mjs +83 -392
  80. package/engine/frontmatter.mjs +20 -70
  81. package/engine/generate.mjs +10 -15
  82. package/engine/heading-attributes.mjs +12 -1
  83. package/engine/helpers.mjs +41 -102
  84. package/engine/holdings.mjs +1 -1
  85. package/engine/homepage.mjs +3 -10
  86. package/engine/ids.mjs +1 -167
  87. package/engine/index-records.mjs +6 -4
  88. package/engine/index.mjs +0 -3
  89. package/engine/infobox-render.mjs +15 -3
  90. package/engine/infobox.mjs +13 -14
  91. package/engine/item-compiler.mjs +4 -10
  92. package/engine/item-docs.mjs +3 -5
  93. package/engine/item-registry.mjs +2 -10
  94. package/engine/journals.mjs +1 -5
  95. package/engine/literature-notes.mjs +4 -12
  96. package/engine/macros.mjs +1 -2
  97. package/engine/map-graphviz.mjs +12 -1
  98. package/engine/markdown-expressions.mjs +12 -1
  99. package/engine/markdownlint-run.mjs +567 -0
  100. package/engine/metadata-index.mjs +42 -12
  101. package/engine/note-addresses.mjs +143 -35
  102. package/engine/note-claims.mjs +14 -28
  103. package/engine/note-dates.mjs +3 -3
  104. package/engine/note-frontmatter.mjs +6 -0
  105. package/engine/note-ids.mjs +8 -14
  106. package/engine/note-package.mjs +8 -25
  107. package/engine/note-state.mjs +1 -3
  108. package/engine/note-vocabulary.mjs +148 -84
  109. package/engine/number-words.mjs +12 -1
  110. package/engine/pack-config.mjs +15 -25
  111. package/engine/pack-router.mjs +10 -16
  112. package/engine/pathnames.mjs +8 -22
  113. package/engine/pdf-build.mjs +773 -121
  114. package/engine/pdf-coverage.mjs +188 -0
  115. package/engine/pdf-index.mjs +54 -7
  116. package/engine/pdf-pages.mjs +247 -0
  117. package/engine/pdf-render.mjs +114 -4
  118. package/engine/pdf-toc.mjs +29 -32
  119. package/engine/project-init.mjs +46 -6
  120. package/engine/prose-config.mjs +1 -1
  121. package/engine/prose-lint.mjs +52 -88
  122. package/engine/readability-lint.mjs +9 -0
  123. package/engine/reckoning-markers.mjs +12 -1
  124. package/engine/reference-targets.mjs +7 -0
  125. package/engine/runtime-only-fields.mjs +5 -8
  126. package/engine/scene-levels.mjs +2 -2
  127. package/engine/scenes.mjs +1 -1
  128. package/engine/shortcode-references.mjs +7 -0
  129. package/engine/site-build.mjs +30 -16
  130. package/engine/site-index.mjs +10 -16
  131. package/engine/site-preview.mjs +6 -0
  132. package/engine/site-root.mjs +8 -1
  133. package/engine/social-tie-terms.mjs +12 -1
  134. package/engine/social-ties.mjs +3 -0
  135. package/engine/sql-tables.mjs +56 -20
  136. package/engine/standing-terms.mjs +11 -1
  137. package/engine/standings.mjs +11 -27
  138. package/engine/system-block.mjs +39 -141
  139. package/engine/system-vocabulary.mjs +6 -0
  140. package/engine/walk-files.mjs +69 -0
  141. package/engine/web-wikilinks.mjs +23 -3
  142. package/engine/wikilink-syntax.mjs +32 -21
  143. package/engine/wikilinks.mjs +27 -16
  144. package/engine/yaml-lint.mjs +7 -4
  145. package/githooks/attribution.mjs +8 -0
  146. package/githooks/commit-message.mjs +9 -0
  147. package/hm3/actors.mjs +9 -48
  148. package/hm3/default-item-art.mjs +9 -9
  149. package/hm3/item-fields.mjs +2 -9
  150. package/hm3/template-priority.mjs +6 -7
  151. package/hugo-theme/data/banner-kinds.yaml +78 -0
  152. package/hugo-theme/data/banners.yaml +2 -3
  153. package/hugo-theme/layouts/404.html +3 -3
  154. package/hugo-theme/layouts/partials/banner-url.html +31 -7
  155. package/hugo-theme/layouts/partials/hero-banner.html +13 -14
  156. package/hugo-theme/layouts/partials/related.html +1 -1
  157. package/hugo-theme/layouts/partials/warn-missing-banner.html +1 -1
  158. package/hugo-theme/static/css/style.css +1 -1
  159. package/manifest.mjs +11 -4
  160. package/markdownlint-config.mjs +1 -1
  161. package/package.json +6 -3
  162. package/release.mjs +83 -18
  163. package/sohl/actors.mjs +16 -27
  164. package/sohl/default-item-art.mjs +3 -3
  165. package/sohl/document-subtypes.mjs +1 -16
  166. package/sohl/infobox.mjs +2 -3
  167. package/sohl/item-builders.mjs +5 -8
  168. package/sohl/item-fields.mjs +5 -35
  169. package/sohl/items.mjs +0 -4
  170. package/sohl/kb-passes.mjs +3 -3
  171. package/types/container.d.mts +116 -5
  172. package/types/content-config.d.mts +83 -35
  173. package/types/deploy.d.mts +42 -6
  174. package/types/e2e.d.mts +35 -3
  175. package/types/engine/address-charset.d.mts +4 -17
  176. package/types/engine/address.d.mts +17 -8
  177. package/types/engine/art-fields.d.mts +7 -4
  178. package/types/engine/art-slots.d.mts +6 -0
  179. package/types/engine/base-compiler.d.mts +15 -17
  180. package/types/engine/content-address.d.mts +9 -12
  181. package/types/engine/content-embeds.d.mts +4 -2
  182. package/types/engine/content-format-check.d.mts +0 -64
  183. package/types/engine/content-index.d.mts +82 -3
  184. package/types/engine/content-links.d.mts +2 -4
  185. package/types/engine/culture-choice.d.mts +51 -8
  186. package/types/engine/data-keys.d.mts +2 -2
  187. package/types/engine/derived-fields.d.mts +1 -2
  188. package/types/engine/diagnostics.d.mts +27 -4
  189. package/types/engine/document-subtypes.d.mts +12 -31
  190. package/types/engine/event-views.d.mts +14 -2
  191. package/types/engine/exported-scene.d.mts +3 -2
  192. package/types/engine/field-spec.d.mts +13 -122
  193. package/types/engine/folder-notes.d.mts +0 -39
  194. package/types/engine/foreign-catalog.d.mts +2 -1
  195. package/types/engine/foundry-entries.d.mts +4 -5
  196. package/types/engine/frontmatter-lint.d.mts +2 -2
  197. package/types/engine/frontmatter.d.mts +19 -45
  198. package/types/engine/generate.d.mts +1 -1
  199. package/types/engine/helpers.d.mts +25 -42
  200. package/types/engine/homepage.d.mts +3 -10
  201. package/types/engine/ids.d.mts +0 -114
  202. package/types/engine/index-records.d.mts +6 -4
  203. package/types/engine/index.d.mts +0 -1
  204. package/types/engine/infobox-render.d.mts +7 -1
  205. package/types/engine/infobox.d.mts +3 -2
  206. package/types/engine/item-docs.d.mts +1 -1
  207. package/types/engine/item-registry.d.mts +2 -4
  208. package/types/engine/literature-notes.d.mts +1 -1
  209. package/types/engine/markdownlint-run.d.mts +40 -0
  210. package/types/engine/metadata-index.d.mts +9 -1
  211. package/types/engine/note-addresses.d.mts +27 -2
  212. package/types/engine/note-claims.d.mts +3 -5
  213. package/types/engine/note-ids.d.mts +2 -4
  214. package/types/engine/note-package.d.mts +1 -1
  215. package/types/engine/note-state.d.mts +1 -3
  216. package/types/engine/note-vocabulary.d.mts +28 -21
  217. package/types/engine/pack-config.d.mts +2 -6
  218. package/types/engine/pack-router.d.mts +4 -4
  219. package/types/engine/pathnames.d.mts +3 -3
  220. package/types/engine/pdf-build.d.mts +98 -12
  221. package/types/engine/pdf-coverage.d.mts +60 -0
  222. package/types/engine/pdf-index.d.mts +34 -5
  223. package/types/engine/pdf-pages.d.mts +143 -0
  224. package/types/engine/pdf-render.d.mts +45 -1
  225. package/types/engine/pdf-toc.d.mts +12 -14
  226. package/types/engine/prose-config.d.mts +1 -1
  227. package/types/engine/prose-lint.d.mts +11 -10
  228. package/types/engine/runtime-only-fields.d.mts +2 -2
  229. package/types/engine/site-build.d.mts +9 -5
  230. package/types/engine/site-index.d.mts +4 -5
  231. package/types/engine/site-root.d.mts +1 -1
  232. package/types/engine/sql-tables.d.mts +31 -2
  233. package/types/engine/standing-terms.d.mts +2 -1
  234. package/types/engine/standings.d.mts +7 -9
  235. package/types/engine/system-block.d.mts +10 -44
  236. package/types/engine/walk-files.d.mts +15 -0
  237. package/types/engine/wikilink-syntax.d.mts +18 -19
  238. package/types/engine/yaml-lint.d.mts +5 -4
  239. package/types/hm3/actors.d.mts +1 -2
  240. package/types/hm3/item-fields.d.mts +2 -4
  241. package/types/hm3/template-priority.d.mts +6 -7
  242. package/types/manifest.d.mts +3 -2
  243. package/types/release.d.mts +12 -7
  244. package/types/sohl/actors.d.mts +2 -1
  245. package/types/sohl/document-subtypes.d.mts +1 -2
  246. package/types/sohl/item-fields.d.mts +3 -7
  247. package/engine/retired-fields.mjs +0 -631
  248. package/types/engine/retired-fields.d.mts +0 -354
@@ -1,354 +0,0 @@
1
- /**
2
- * What a note declaring `draft:` is told, in one place.
3
- *
4
- * Written once and shared by the compile-time refusal and the frontmatter lint,
5
- * because an author meets whichever of the two runs first and they should read
6
- * the same. It says what the field did and what to write instead, rather than
7
- * which value to correct: no value makes declaring it right.
8
- *
9
- * @param {string} [file] - The note's path, named in the message. Omit it where
10
- * the caller emits through a diagnostic, whose locator already starts the
11
- * line — repeating it prints the path twice.
12
- * @returns {string} The message, unpunctuated at the end as a finding is.
13
- */
14
- export function draftRetiredMessage(file?: string): string;
15
- /**
16
- * Refuse a note that declares `draft:` at all.
17
- *
18
- * Presence is the whole test. `draft: false` is as retired as `draft: true` —
19
- * it reads as "publish this note", which is what happens either way, and is
20
- * exactly the belief the message exists to correct.
21
- *
22
- * @param {object|null|undefined} fm - Parsed frontmatter, or nothing when it
23
- * could not be parsed.
24
- * @param {object} [options] - Options.
25
- * @param {string} [options.file] - The note's path, named in the message. Omit
26
- * it where the caller emits through a diagnostic, which puts the locator at
27
- * the start of the line already — repeating it prints the path twice.
28
- * @param {string} [options.absPath] - The note's file on disk, read only on the
29
- * failing path to locate the offending line and column. The position rides on
30
- * the thrown error as `position`, for a caller that emits a diagnostic.
31
- * @returns {void}
32
- * @throws {Error} When the note declares the field.
33
- */
34
- export function assertNoDraftField(fm: object | null | undefined, { file, absPath }?: {
35
- file?: string | undefined;
36
- absPath?: string | undefined;
37
- }): void;
38
- /**
39
- * What a note declaring a top-level `aliases:` is told, in one place.
40
- *
41
- * Shared by the compile-time refusal and the frontmatter lint, because an
42
- * author meets whichever of the two runs first and they should read the same.
43
- * It says what the field fed and what to write instead, rather than which value
44
- * to correct: no value makes declaring it right.
45
- *
46
- * **What it did.** It was the authored half of the alias index — the
47
- * namespace a bare `[[Alias]]` was looked up in. Across the three content trees
48
- * not one bare link resolved through it, while the collision rule that kept it
49
- * unambiguous folded in every note's `name.full` and so dictated what a note
50
- * could be named. The form is retired, so the list has no reader.
51
- *
52
- * **`name.aliases` is a different field.** It lists alternate names in the
53
- * infobox and is deliberately unmentioned by this message. See
54
- * {@link assertNoAliasesField}.
55
- *
56
- * @param {string} [file] - The note's path, named in the message. Omit it where
57
- * the caller emits through a diagnostic, whose locator already starts the
58
- * line — repeating it prints the path twice.
59
- * @returns {string} The message, unpunctuated at the end as a finding is.
60
- */
61
- export function aliasesRetiredMessage(file?: string): string;
62
- /**
63
- * Refuse a note that declares a top-level `aliases:`.
64
- *
65
- * Presence is the whole test. `aliases: []` is as retired as a populated one —
66
- * it reads as "this note claims no other names", a statement about a namespace
67
- * that no longer exists.
68
- *
69
- * **The nested `name.aliases` is deliberately not refused.** It is the note's
70
- * ordered alternate names and appears in the note infobox. It does not create
71
- * addresses or change how authored links resolve.
72
- *
73
- * That distinction is the reason this checks `Object.hasOwn(fm, "aliases")`
74
- * rather than resolving a dotted key: the top-level field is the whole subject,
75
- * and reaching into `name` at all is the thing being avoided.
76
- *
77
- * @param {object|null|undefined} fm - Parsed frontmatter, or nothing when it
78
- * could not be parsed.
79
- * @param {object} [options] - Options.
80
- * @param {string} [options.file] - The note's path, named in the message. Omit
81
- * it where the caller emits through a diagnostic, which puts the locator at
82
- * the start of the line already — repeating it prints the path twice.
83
- * @param {string} [options.absPath] - The note's file on disk, read only on the
84
- * failing path to locate the offending line and column. The position rides on
85
- * the thrown error as `position`, for a caller that emits a diagnostic.
86
- * @returns {void}
87
- * @throws {Error} When the note declares a top-level `aliases`.
88
- */
89
- export function assertNoAliasesField(fm: object | null | undefined, { file, absPath }?: {
90
- file?: string | undefined;
91
- absPath?: string | undefined;
92
- }): void;
93
- /**
94
- * Whether a note declares the retired top-level `aliases:`.
95
- *
96
- * A nested `name.aliases` is **not** this field and never answers true here —
97
- * see {@link assertNoAliasesField} for why the two part company.
98
- *
99
- * @param {object|null|undefined} fm - Parsed frontmatter.
100
- * @returns {boolean} Whether the retired field is declared.
101
- */
102
- export function declaresRetiredAliasesField(fm: object | null | undefined): boolean;
103
- /**
104
- * What a note declaring `section:` is told, in one place.
105
- *
106
- * Shared by the compile-time refusal and the frontmatter lint, because an
107
- * author meets whichever of the two runs first and they should read the same.
108
- * It names what lands a section now rather than a value to correct: no value
109
- * makes declaring the field right.
110
- *
111
- * **What it did.** It named the section a `collection` note headed,
112
- * under the `collection` landing rule — the only reader it ever had, in the
113
- * second branch of `landingOf` (`engine/content-address.mjs`). That rule went
114
- * first, and the whole mechanism went with it: a section is a Hugo
115
- * directory the note format does not carry, so no note lands one and a page
116
- * that introduces a type is an ordinary note addressed `doc-<type>`. Nothing
117
- * else read the field, and no schema or vocabulary declared it, so left in
118
- * place it would be ignored in silence — the note saying one thing and the
119
- * build doing another.
120
- *
121
- * @param {string} [file] - The note's path, named in the message. Omit it where
122
- * the caller emits through a diagnostic, whose locator already starts the
123
- * line — repeating it prints the path twice.
124
- * @returns {string} The message, unpunctuated at the end as a finding is.
125
- */
126
- export function sectionRetiredMessage(file?: string): string;
127
- /**
128
- * Refuse a note that declares `section:` at all.
129
- *
130
- * Presence is the whole test, as it is for `draft:` and `aliases:`: an empty
131
- * value reads as "this note heads a section and names none", a statement about
132
- * a rule that no longer exists.
133
- *
134
- * @param {object|null|undefined} fm - Parsed frontmatter, or nothing when it
135
- * could not be parsed.
136
- * @param {object} [options] - Options.
137
- * @param {string} [options.file] - The note's path, named in the message. Omit
138
- * it where the caller emits through a diagnostic, which puts the locator at
139
- * the start of the line already — repeating it prints the path twice.
140
- * @param {string} [options.absPath] - The note's file on disk, read only on the
141
- * failing path to locate the offending line and column. The position rides on
142
- * the thrown error as `position`, for a caller that emits a diagnostic.
143
- * @returns {void}
144
- * @throws {Error} When the note declares the field.
145
- */
146
- export function assertNoSectionField(fm: object | null | undefined, { file, absPath }?: {
147
- file?: string | undefined;
148
- absPath?: string | undefined;
149
- }): void;
150
- /**
151
- * What a note writing a top-level `traits:` block is told.
152
- *
153
- * The message states the **mapping**, not just the destination, because three
154
- * of the keys reshaped as well as moved: the block nested its measurements
155
- * where the format flattens them. A bare "write `data:` instead" would send an
156
- * author to author `data.height: {m: 1.78}`, which is a declared key holding an
157
- * undeclared shape.
158
- *
159
- * @param {string} [file] - The note's path, named in the message. Omit it where
160
- * the caller emits through a diagnostic, whose locator already starts the
161
- * line — repeating it prints the path twice.
162
- * @returns {string} The message, unpunctuated at the end as a finding is.
163
- */
164
- export function traitsRetiredMessage(file?: string): string;
165
- /**
166
- * Refuse a note that declares a top-level `traits:` block at all.
167
- *
168
- * Presence is the whole test, as it is for `draft:` and `aliases:`: an empty
169
- * `traits:` is still a note claiming a block that no longer exists.
170
- *
171
- * @param {object|null|undefined} fm - Parsed frontmatter, or nothing when it
172
- * could not be parsed.
173
- * @param {object} [options] - Options.
174
- * @param {string} [options.file] - The note's path, named in the message. Omit
175
- * it where the caller emits through a diagnostic, which puts the locator at
176
- * the start of the line already.
177
- * @param {string} [options.absPath] - The note's file on disk, read only on the
178
- * failing path to locate the offending line and column. The position rides on
179
- * the thrown error as `position`, for a caller that emits a diagnostic.
180
- * @returns {void}
181
- * @throws {Error} When the note declares the block.
182
- */
183
- export function assertNoTraitsField(fm: object | null | undefined, { file, absPath }?: {
184
- file?: string | undefined;
185
- absPath?: string | undefined;
186
- }): void;
187
- /**
188
- * A frontmatter key's position in a note's file, or nothing.
189
- *
190
- * {@link positionInFrontmatter} answers the same question from the file's
191
- * *text*; this reads the file to ask it. Kept apart from either caller because
192
- * both refusals need it and a second copy is a second thing to keep correct.
193
- *
194
- * @param {string|undefined} absPath - The note's file.
195
- * @param {string} key - The frontmatter key.
196
- * @param {string} [value] - When given, prefer the occurrence whose line also
197
- * carries this text — so a finding about one entry of a block opens on that
198
- * entry rather than on the key that introduces it.
199
- * @param {object} [options] - Options, forwarded to
200
- * {@link positionInFrontmatter}.
201
- * @param {boolean} [options.topLevel=false] - Require the key at column 1, so
202
- * an identically named nested key cannot answer for it.
203
- * @returns {{line?: number, column?: number}|undefined} Spreadable position
204
- * fields, dropped rather than guessed when the file cannot be read or the key
205
- * cannot be found — as `formatDiagnostic` requires.
206
- */
207
- export function locateFrontmatterKey(absPath: string | undefined, key: string, value?: string, { topLevel }?: {
208
- topLevel?: boolean | undefined;
209
- }): {
210
- line?: number;
211
- column?: number;
212
- } | undefined;
213
- /**
214
- * What a note writing a renamed field is told, in one place.
215
- *
216
- * Shared by the compile-time report and the frontmatter lint, because an author
217
- * meets whichever runs first and they should read the same. It names the key to
218
- * write rather than a value to correct — no value makes the retired spelling
219
- * right — and it says the note compiles either way, so a reader knows this is a
220
- * rename to schedule rather than a build to unbreak.
221
- *
222
- * @param {string} retired - The spelling the note used.
223
- * @param {string} current - What to write instead.
224
- * @param {string} [file] - The note's path, named in the message. Omit it where
225
- * the caller emits through a diagnostic, whose locator already starts the
226
- * line — repeating it prints the path twice.
227
- * @returns {string} The message, unpunctuated at the end as a finding is.
228
- */
229
- export function retiredAliasMessage(retired: string, current: string, file?: string): string;
230
- /**
231
- * What a note writing a field at its **legacy in-block position** is told.
232
- *
233
- * The same three-step retirement `retiredAliasMessage` announces, applied to a
234
- * *position* rather than a spelling. A field whose shared source moved
235
- * under `data:` keeps reading the key its block still carries, that read wins,
236
- * and it is reported here so a sweep has something to count down — without it,
237
- * moving a field into `data:` would be a flag day across every repository that
238
- * authors it.
239
- *
240
- * It names the block, because the key is `hm3.species` and not `species`: an
241
- * author told to move "`species`" has two regions to guess between.
242
- *
243
- * @param {string} block - The system block the key was written in.
244
- * @param {{name?: string, legacyKey?: string}} field - The declaration, which
245
- * names both positions.
246
- * @param {string} [file] - The note's path, named in the message. Omit it where
247
- * the caller emits through a diagnostic, whose locator already starts the
248
- * line — repeating it prints the path twice.
249
- * @returns {string} The message, unpunctuated at the end as a finding is.
250
- */
251
- export function legacyKeyMessage(block: string, field: {
252
- name?: string;
253
- legacyKey?: string;
254
- }, file?: string): string;
255
- /**
256
- * What a note writing a field at the **top-level key `data:` gathered it off**
257
- * is told.
258
- *
259
- * {@link legacyKeyMessage}'s counterpart for the other retiring position.
260
- * `portrait:` beside `img:` is the bare spelling of `data.portrait`, and both
261
- * are read for the same reason both in-block spellings are: a package moves its
262
- * corpus when it is ready, not on a flag day.
263
- *
264
- * It says nothing about which value is emitted, because that is not what an
265
- * author needs from it. The value is the same either way; what the finding
266
- * counts is one more note still on the old position.
267
- *
268
- * @param {{name?: string}} field - The declaration, which names the current
269
- * position; the retiring one is derived from it.
270
- * @param {string} [file] - The note's path, named in the message. Omit it where
271
- * the caller emits through a diagnostic, whose locator already starts the
272
- * line — repeating it prints the path twice.
273
- * @returns {string} The message, unpunctuated at the end as a finding is.
274
- */
275
- export function retiredTopLevelMessage(field: {
276
- name?: string;
277
- }, file?: string): string;
278
- /**
279
- * Whether a note writes the retired spelling of a field, wherever it put it.
280
- *
281
- * Both regions are searched, because {@link sohlField} reads both: a note that
282
- * moved the key to the top level without renaming it has done half the
283
- * migration, and should be told so rather than passing in silence.
284
- *
285
- * @param {object|null|undefined} fm - Parsed frontmatter.
286
- * @param {string} current - The field's current name.
287
- * @param {object} [options] - Options.
288
- * @param {boolean} [options.inData=false] - Search the `data:` container
289
- * instead. A `data:` field has exactly one home, so its retired spelling has
290
- * exactly one too, and searching the block or the top level for it would
291
- * answer about a key the container check has already refused.
292
- * @returns {boolean} Whether the retired spelling is declared.
293
- */
294
- export function declaresRetiredAlias(fm: object | null | undefined, current: string, { inData }?: {
295
- inData?: boolean | undefined;
296
- }): boolean;
297
- /**
298
- * Read a field that has a retired spelling, the current name winning.
299
- *
300
- * This is the whole of the retirement window's behaviour, in one function, so
301
- * the compiler and the linter cannot disagree about which value a note carries.
302
- * Resolution within each spelling is {@link sohlField}'s — the `sohl:` block
303
- * first, then the note's top level — so a renamed field keeps working wherever
304
- * it was already written while the canonical home is the top level.
305
- *
306
- * A blank value counts as absent: `relations:` cleared in an editor means the
307
- * note records no standings there, and falling through to the retired spelling
308
- * is what an author part-way through the rename means by it.
309
- *
310
- * @param {object|null|undefined} fm - Parsed frontmatter.
311
- * @param {string} current - The field's current name.
312
- * @param {object} [options] - Options.
313
- * @param {boolean} [options.inData=false] - Read the `data:` container instead,
314
- * which is where a `data:` field and its retired spelling are both written.
315
- * Dotted names resolve inside it, so `appearance.eye_color` reads the way it
316
- * is authored.
317
- * @returns {any} The value, or `undefined` when neither spelling carries one.
318
- */
319
- export function readAliasedField(fm: object | null | undefined, current: string, { inData }?: {
320
- inData?: boolean | undefined;
321
- }): any;
322
- /**
323
- * The current field name a retired spelling was renamed to.
324
- *
325
- * Keyed by the **current** name, because that is what a type's schema declares
326
- * and what every reader asks for; the value is the spelling still honoured.
327
- * The table is therefore scoped by the schema without saying so twice: an alias
328
- * applies to a note only where that note's type declares the current field, so
329
- * `relation` is retired on an affiliation — which declares `relations` — and
330
- * remains an unknown key anywhere else.
331
- *
332
- * **`templatePriority`.** The number that decides which of several
333
- * competing templates the Create dialog offers was called `archetype`, and
334
- * `archetypes` — one letter apart — is a list of what *sort* a character is.
335
- * A priority and a taxonomy cannot be told apart by a plural `s`, so the
336
- * priority takes the name that says what it is. The specification already
337
- * called it `templatePriority` on two of its three sides.
338
- *
339
- * **`relations`.** The field holds a *map* of standings, one per
340
- * affiliation — its own description says so, and `resolveRelation` has always
341
- * read it that way. `relation` named the many as one, which every author had to
342
- * read past. Only `affiliation` declares the field, so the alias is reported
343
- * there and the old spelling stays an ordinary unknown key everywhere else.
344
- *
345
- * **`born`.** A birthday is a day that recurs; what a note records is the date
346
- * somebody was born, once. The two read alike while every value belonged to a
347
- * living person, and `born` is what the field has to be called beside `died`,
348
- * which a being now also states. It is the first alias whose field lives in
349
- * `data:` rather than in a system block, so the two readers below take
350
- * `inData`.
351
- *
352
- * @type {Readonly<Record<string, string>>}
353
- */
354
- export const RETIRED_FIELD_ALIASES: Readonly<Record<string, string>>;