@heroiclands/package-build 25.1.3 → 25.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 (83) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/assets/styles/content-base.css +0 -9
  3. package/bin/content-commands.mjs +22 -16
  4. package/bin/package-build.mjs +24 -25
  5. package/content-config.mjs +7 -34
  6. package/docs/api.md +38 -21
  7. package/docs/authoring/first-note.md +3 -3
  8. package/docs/authoring/frontmatter.md +30 -2
  9. package/docs/authoring/links-and-markup.md +92 -31
  10. package/docs/commands.md +103 -59
  11. package/docs/configuration.md +10 -45
  12. package/docs/content-format.md +7 -5
  13. package/docs/diagnostics.md +75 -0
  14. package/docs/guides/book.md +3 -3
  15. package/docs/guides/module-project.md +1 -1
  16. package/docs/guides/reference-pages.md +7 -3
  17. package/docs/project-setup.md +3 -0
  18. package/docs/reference/format-details.md +299 -185
  19. package/docs/reference/note-types.md +16 -17
  20. package/engine/changelog-group.mjs +84 -173
  21. package/engine/changelog-labels.mjs +73 -0
  22. package/engine/changelog-lint.mjs +168 -44
  23. package/engine/content-expand.mjs +58 -38
  24. package/engine/content-format.yaml +0 -2
  25. package/engine/content-index.mjs +49 -23
  26. package/engine/content-links.mjs +4 -0
  27. package/engine/content-lint.mjs +2 -3
  28. package/engine/content-render.mjs +6 -2
  29. package/engine/culture-parents.mjs +1 -1
  30. package/engine/culture-reach.mjs +10 -1
  31. package/engine/diagnostics.mjs +3 -2
  32. package/engine/dictionary-rows.mjs +3 -1
  33. package/engine/first-use.mjs +301 -87
  34. package/engine/frontmatter-lint.mjs +40 -14
  35. package/engine/glossary-entries.mjs +5 -5
  36. package/engine/glossary-language.mjs +21 -44
  37. package/engine/homepage.mjs +0 -4
  38. package/engine/index-records.mjs +3 -1
  39. package/engine/infobox.mjs +6 -3
  40. package/engine/language-names.mjs +3 -2
  41. package/engine/language-rows.mjs +6 -7
  42. package/engine/lexical-sections.mjs +3 -1
  43. package/engine/literature-notes.mjs +4 -76
  44. package/engine/metadata-index.mjs +15 -8
  45. package/engine/name-forms.mjs +99 -0
  46. package/engine/name-refs.mjs +143 -0
  47. package/engine/name-rows.mjs +11 -1
  48. package/engine/names.mjs +27 -22
  49. package/engine/note-addresses.mjs +0 -3
  50. package/engine/note-frontmatter.mjs +3 -5
  51. package/engine/note-language.mjs +348 -0
  52. package/engine/note-vocabulary.mjs +13 -11
  53. package/engine/pdf-index.mjs +3 -2
  54. package/engine/pdf-render.mjs +2 -4
  55. package/engine/settlement-tables.mjs +4 -3
  56. package/engine/site-build.mjs +2 -7
  57. package/engine/site-search.mjs +3 -5
  58. package/engine/site-theme.mjs +1 -1
  59. package/engine/sql-tables.mjs +29 -14
  60. package/engine/wikilink-syntax.mjs +2 -0
  61. package/engine/word-citations.mjs +3 -3
  62. package/engine/word-rows.mjs +3 -1
  63. package/engine/word-terms.mjs +2 -2
  64. package/package.json +1 -1
  65. package/site-theme/static/css/style.css +0 -4
  66. package/types/engine/changelog-group.d.mts +6 -10
  67. package/types/engine/changelog-labels.d.mts +10 -0
  68. package/types/engine/changelog-lint.d.mts +11 -6
  69. package/types/engine/content-index.d.mts +16 -16
  70. package/types/engine/diagnostics.d.mts +1 -1
  71. package/types/engine/first-use.d.mts +97 -1
  72. package/types/engine/frontmatter-lint.d.mts +9 -2
  73. package/types/engine/glossary-language.d.mts +13 -6
  74. package/types/engine/homepage.d.mts +0 -3
  75. package/types/engine/literature-notes.d.mts +2 -27
  76. package/types/engine/name-forms.d.mts +61 -0
  77. package/types/engine/name-refs.d.mts +51 -0
  78. package/types/engine/name-rows.d.mts +4 -0
  79. package/types/engine/names.d.mts +12 -92
  80. package/types/engine/note-frontmatter.d.mts +1 -4
  81. package/types/engine/note-language.d.mts +47 -0
  82. package/types/engine/settlement-tables.d.mts +1 -1
  83. package/types/engine/site-build.d.mts +2 -6
@@ -254,6 +254,49 @@ problems, listing every conflict at once. Stating `data.culture` on the note
254
254
  resolves it. The rules are under
255
255
  [Culture in the index](reference/format-details.md#culture-in-the-index).
256
256
 
257
+ ## A worked case: names and a note's language
258
+
259
+ A note's `name` lists its other names under language codes. A key that is
260
+ neither `full`, `sort`, a character's `given` or `clan`, nor a code
261
+ `languages:` declares or `en` is an error at the key, `aliases` among them:
262
+
263
+ ```text
264
+ assets/content/Beings/Ada.md:3:21: error: `name.aliases` is not valid for this note: a name lists its forms under a language code `languages:` declares, or `en`
265
+ ```
266
+
267
+ A list that is not a list of nonempty strings is an error at its key, and a form
268
+ under `en` that repeats `full`, ignoring case, is an error at the form:
269
+
270
+ ```text
271
+ assets/content/Beings/Ada.md:3:30: error: `name.en` repeats `name.full` (ada vale); `full` is already an English form, so leave it out
272
+ ```
273
+
274
+ The other three come from deriving each note's language into the content index,
275
+ and each is located at the value that causes it. A `data.lang` naming no
276
+ declared code:
277
+
278
+ ```text
279
+ assets/content/Lore/Tale.md:4:14: error: data.lang vyal names no language: state a code `languages:` declares, or en (en, kiic, tenl, vyl)
280
+ ```
281
+
282
+ A `data.culture` whose culture states no `data.lang` and inherits none from its
283
+ parent cultures:
284
+
285
+ ```text
286
+ assets/content/Beings/Ada.md:5:17: error: data.culture lore-folk resolves to no language: state data.lang on the culture or on a parent culture
287
+ ```
288
+
289
+ Every `data.parents` entry on a cycle, one finding for each note of the cycle,
290
+ at the entry naming the next; a note naming itself is a cycle of one:
291
+
292
+ ```text
293
+ assets/content/Places/West.md:4:19: error: data.parents.0 names place-east, which closes a parents cycle; a note is never its own ancestor
294
+ ```
295
+
296
+ Like a culture conflict, each fails the index and every command that reads it
297
+ without collecting problems. The rules are under
298
+ [a note's language](reference/format-details.md#a-notes-language).
299
+
257
300
  ## A worked case: a verse in columns
258
301
 
259
302
  A [verse in columns](authoring/links-and-markup.md#verse-in-columns) has a
@@ -313,6 +356,38 @@ a span in non-English language `vyl` holds no `.strong` emphasis
313
356
  a span takes `.emph` or `.strong`, not both
314
357
  ```
315
358
 
359
+ ## A name's ref
360
+
361
+ A `ref` on a `.name` span names the note the span stands for. Each finding is an
362
+ `error` located at the attribute part it concerns:
363
+
364
+ ```text
365
+ ref "being-tomr" names no note in this package or its declared dependencies
366
+ data-type is for a name with no note; the ref states the type
367
+ ref= belongs on a .name span; a wikilink never takes ref
368
+ ```
369
+
370
+ The first points at the `ref` value, the second at `data-type`, the third at
371
+ `ref`. A value beginning `#` is a page-local key and resolves to no note; it is
372
+ a finding only when it is malformed, and then at its value:
373
+
374
+ ```text
375
+ ref "#" must be a note address or a page-local key such as #jane
376
+ ```
377
+
378
+ A wikilink written with `{ref=…}` is an error at the wikilink, stating that its
379
+ address is its ref.
380
+
381
+ ## A name's first use
382
+
383
+ A name-marking finding is a `warning`: it reports and never fails lint. A
384
+ `.name` span with no `ref` whose label is an indexed note's full name or listed
385
+ form is reported at the span, naming the note to link or tie it to:
386
+
387
+ ```text
388
+ assets/content/Lore/Ferry.md:12:1: warning: first-use/unlinked-name: “Arden” names “Arden Vale”; use a link to “test-note-place-arden”, or tie it with ref=
389
+ ```
390
+
316
391
  ## Native presentation is explicit
317
392
 
318
393
  `enc=` resolves an encoding document and infers its language and font.
@@ -410,7 +410,7 @@ notes the book prints.
410
410
  | ------------------------ | ----------------------------- | ---------------------------------------------------------------------------------- |
411
411
  | A note's name | `name.sort`, else `name.full` | the page of the note's entry in **bold**, then the pages of every authored mention |
412
412
  | A name without its head | `name.full` | the same pages as the note's entry, filed as `Targud, Kingdom of` |
413
- | An alias | `name.aliases` | _see_ the note's name |
413
+ | A listed name form | `name.<code>` | _see_ the note's name |
414
414
  | An event's in-world name | `data.events[].names` | _see_ the name of the note that holds the event |
415
415
 
416
416
  A name that opens with a generic word a reader would not look under, such as
@@ -538,8 +538,8 @@ keeping the source available for inspection.
538
538
  A reference to a GM-only note or secret heading prints normally. GM-only notes
539
539
  remain omitted, and references to them print as text without a link. `.show`
540
540
  does not add an omitted destination to the book. Inline `[text]{.secret}` spans
541
- print as ordinary text, preserving emphasis, links, anchors and `.name` bold
542
- styling; the book ignores their `.secret` class.
541
+ print as ordinary text, preserving emphasis, links, anchors and a name's
542
+ first-use bold; the book ignores their `.secret` class.
543
543
 
544
544
  Secret sections and `:::secret` fences keep their visible contents in pale
545
545
  lavender boxes (`#f2eefb`) with a purple left border and title (`#5c4b8a`). The
@@ -800,7 +800,7 @@ each other. One JSON object per note, carrying the note's canonical address, its
800
800
  name, its description and the Foundry UUID it compiles to:
801
801
 
802
802
  ```text
803
- {"address":{"canonical":"bestiary-none-lore-marshdrake","slug":"lore-marshdrake"},"aliasesAscii":[],"anchors":[],"description":"A wingless drake of the reed flats, hunted for its hide and feared for its patience.","documentation":null,"file":{"folder":"Bestiary","name":"Marsh_Drake","path":"Bestiary/Marsh_Drake.md"},"foundry":{"none":{"uuid":"Compendium.acme-bestiary.journals.JournalEntry.72d497c6a8e57f57"}},"id":"72d497c6a8e57f57","name":{"full":"Marsh Drake"},"nameAscii":"Marsh Drake","package":"bestiary","shortcode":"marshdrake","subType":"bestiary","type":"lore"}
803
+ {"address":{"canonical":"bestiary-none-lore-marshdrake","slug":"lore-marshdrake"},"anchors":[],"description":"A wingless drake of the reed flats, hunted for its hide and feared for its patience.","documentation":null,"file":{"folder":"Bestiary","name":"Marsh_Drake","path":"Bestiary/Marsh_Drake.md"},"formsAscii":{},"foundry":{"none":{"uuid":"Compendium.acme-bestiary.journals.JournalEntry.72d497c6a8e57f57"}},"id":"72d497c6a8e57f57","lang":"en","name":{"full":"Marsh Drake"},"nameAscii":"Marsh Drake","package":"bestiary","shortcode":"marshdrake","subType":"bestiary","type":"lore"}
804
804
  ```
805
805
 
806
806
  A downstream package that declares a dependency on this one fetches this file
@@ -128,9 +128,13 @@ jq -r 'select(.type == "affiliation") | .name.full' \
128
128
  ```
129
129
 
130
130
  Each note record carries its authored frontmatter together with derived
131
- `package`, `file`, `address`, `anchors`, and document destinations. It also has
132
- ASCII-folded `nameAscii` and `aliasesAscii` for searching names typed without
133
- diacritics. Asset files under `assets/icons`, `assets/images`, and
131
+ `package`, `file`, `address`, `anchors`, and document destinations. Its `name`
132
+ is the map the note authors, the full name with every other form listed under
133
+ its language's code. It also has ASCII-folded `nameAscii` and `formsAscii`, the
134
+ listed forms by language, for searching names typed without diacritics, and
135
+ `lang`, the language the note is in, derived as
136
+ [a note's language](../reference/format-details.md#a-notes-language) describes.
137
+ A language note that `languages:` names carries its code as `languageCode`. Asset files under `assets/icons`, `assets/images`, and
134
138
  `assets/audio` have records in the same index, identified by an `asset` block.
135
139
  The index is disposable build output; regenerate it from the authored tree
136
140
  when the content changes.
@@ -473,6 +473,9 @@ need setting, and each is a decision rather than a preference.
473
473
  - **`changelog: "@changesets/changelog-git"`** attributes each entry to its
474
474
  commit. The GitHub changelog generator wants a token and produces entries
475
475
  naming pull requests, which is history the changelog does not need.
476
+ - **`changelog: ["@heroiclands/package-build/changelog", {labels: [...]}]`** is the form
477
+ that also declares the labels changesets group under; see
478
+ [`changelog check`](commands.md#package-build-changelog-check).
476
479
  - **`privatePackages: {version: true, tag: false}`** is what makes changesets
477
480
  work at all here. Every package in the constellation is `private`, because it
478
481
  ships as a Foundry release rather than to npm; without `version: true`