@heroiclands/package-build 22.14.0 → 22.14.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @heroiclands/package-build
2
2
 
3
+ ## 22.14.2
4
+
5
+ ### Patch Changes
6
+
7
+ Lore notes can carry structured event metadata for chronologies.
8
+
9
+ ## 22.14.1
10
+
11
+ ### Patch Changes
12
+
13
+ Item-field reference pages generated inside content packages pass note validation and formatting checks.
14
+
3
15
  ## 22.14.0
4
16
 
5
17
  ### Minor Changes
@@ -3453,6 +3453,13 @@ In-world information about people, places, or concepts.
3453
3453
  | `weekdays` | `{ name, abbreviation? }[]` | The days of the week it names, in order; a calendar with no week writes none |
3454
3454
  | `seasons` | `{ name, abbreviation?, monthStart?, monthEnd?, dayStart?, dayEnd? }[]` | The seasons it marks, bounded by month or by day of year |
3455
3455
  | `eras` | `{ shortcode, name, abbreviation?, proclaimedBy?, start, end? }[]` | The year-counts kept in it, each addressed `<calendar shortcode>.<era shortcode>` |
3456
+ | `event` | `Map<field, value>` | A dated occurrence, with its sources, locations, reach, and relationships |
3457
+
3458
+ `data.event` is available on every `lore` subType. It holds structured
3459
+ chronology metadata, including the event's kind, date, sources, and the places
3460
+ it affects. The shared format checks that it is a map; a content package may
3461
+ check the details and relationships within that map. It is metadata for
3462
+ chronology tools and does not appear as an infobox row.
3456
3463
 
3457
3464
  #### What a calendar note declares
3458
3465
 
@@ -36,6 +36,7 @@
36
36
 
37
37
  import path from "node:path";
38
38
  import matter from "gray-matter";
39
+ import { formatNoteFrontmatter } from "./note-format.mjs";
39
40
 
40
41
  import { authoredFields, runtimeOnlyFields } from "./field-spec.mjs";
41
42
  import { loadPackConfig } from "./pack-config.mjs";
@@ -389,7 +390,7 @@ export function shortcodeFromBasename(destination) {
389
390
  * The universal keys every note in the format carries: `type: doc`,
390
391
  * `subType: reference` — this page is out-of-world lookup material, the same
391
392
  * genre as every other generated reference — a `shortcode`, `name.full` from
392
- * the page's title, and `pack: none`, since the page publishes to the website
393
+ * the page's title, and `data.pack: none`, since the page publishes to the website
393
394
  * and compiles into no compendium document. A consumer's own
394
395
  * `docs.itemFields.frontmatter` is deep-merged over it, so it may add keys or
395
396
  * override any of the derived ones, `shortcode` included.
@@ -409,7 +410,7 @@ export function itemFieldsEnvelope({ title, shortcode, frontmatter }) {
409
410
  subType: "reference",
410
411
  shortcode,
411
412
  name: { full: title },
412
- pack: "none",
413
+ data: { pack: "none" },
413
414
  },
414
415
  frontmatter,
415
416
  );
@@ -448,5 +449,5 @@ export function renderItemFieldsPage(body, { title, destination, contentRoot, fr
448
449
  // between them, so a page written without one fails a consumer's
449
450
  // `lint:format` the moment it is committed. Insert it here rather than
450
451
  // let the generator and the formatter rewrite the file back and forth.
451
- return page.replace(/^(---\n[\s\S]*?\n---\n)/, "$1\n");
452
+ return formatNoteFrontmatter(page.replace(/^(---\n[\s\S]*?\n---\n)/, "$1\n"));
452
453
  }
@@ -274,6 +274,7 @@ export const NOTE_FIELD_PRESENTATION = Object.freeze({
274
274
  bgImage: Object.freeze({ withheld: "an image, which the box never carries" }),
275
275
  banner: Object.freeze({ withheld: "an image, which the box never carries" }),
276
276
  overlay: Object.freeze({ withheld: "an image, which the box never carries" }),
277
+ "lore.event": Object.freeze({ withheld: "chronology machinery, not a summary row" }),
277
278
 
278
279
  assocSkill: Object.freeze({ label: "Skill" }),
279
280
  assocAffiliation: Object.freeze({ label: "Affiliation" }),
@@ -1189,7 +1189,15 @@ export const NOTE_VOCABULARY = Object.freeze({
1189
1189
  // because `DataFieldSpec` declares the keys a type accepts and not the
1190
1190
  // subType that may write them.
1191
1191
  check: checkCalendarNote,
1192
- data: CALENDAR_FIELDS,
1192
+ data: Object.freeze([
1193
+ ...CALENDAR_FIELDS,
1194
+ {
1195
+ name: "event",
1196
+ kind: "map",
1197
+ shape: "event metadata map",
1198
+ describe: "A dated occurrence and its relationships to other events and places.",
1199
+ },
1200
+ ]),
1193
1201
  }),
1194
1202
 
1195
1203
  place: Object.freeze({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heroiclands/package-build",
3
- "version": "22.14.0",
3
+ "version": "22.14.2",
4
4
  "description": "Shared toolchain for building and shipping a HeroicLands Foundry VTT package — content compilation, manifest, localization, staging, bundle, release and deployment.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "type": "module",
@@ -52,7 +52,7 @@ export function shortcodeFromBasename(destination: string): string;
52
52
  * The universal keys every note in the format carries: `type: doc`,
53
53
  * `subType: reference` — this page is out-of-world lookup material, the same
54
54
  * genre as every other generated reference — a `shortcode`, `name.full` from
55
- * the page's title, and `pack: none`, since the page publishes to the website
55
+ * the page's title, and `data.pack: none`, since the page publishes to the website
56
56
  * and compiles into no compendium document. A consumer's own
57
57
  * `docs.itemFields.frontmatter` is deep-merged over it, so it may add keys or
58
58
  * override any of the derived ones, `shortcode` included.