@heroiclands/package-build 22.14.3 → 22.15.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 (62) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/CONTENT.md +25 -1
  3. package/bin/content-build.mjs +3 -7
  4. package/bin/package-build.mjs +25 -0
  5. package/docs/api.md +64 -36
  6. package/docs/commands.md +65 -9
  7. package/docs/configuration.md +6 -3
  8. package/docs/content-format.md +187 -140
  9. package/docs/diagnostics.md +1 -1
  10. package/docs/getting-started.md +27 -3
  11. package/engine/base-compiler.mjs +3 -1
  12. package/engine/being-age.mjs +16 -24
  13. package/engine/calendar-artifacts.mjs +153 -0
  14. package/engine/calendar-notes.mjs +64 -16
  15. package/engine/calendars.mjs +129 -0
  16. package/engine/content-images.mjs +20 -10
  17. package/engine/content-index.mjs +3 -1
  18. package/engine/exported-scene.mjs +230 -0
  19. package/engine/generate.mjs +1 -0
  20. package/engine/ids.mjs +1 -1
  21. package/engine/index.mjs +6 -0
  22. package/engine/infobox.mjs +4 -0
  23. package/engine/itinerary-scenes.mjs +170 -0
  24. package/engine/map-build.mjs +10 -45
  25. package/engine/map-dot.mjs +6 -3
  26. package/engine/map-graphviz.mjs +50 -131
  27. package/engine/map-notes.mjs +26 -3
  28. package/engine/map-places.mjs +12 -6
  29. package/engine/map-raster.mjs +49 -0
  30. package/engine/note-dates.mjs +125 -85
  31. package/engine/note-vocabulary.mjs +22 -6
  32. package/engine/pdf-build.mjs +57 -1
  33. package/engine/pdf-render.mjs +48 -7
  34. package/engine/reckoning-markers.mjs +207 -0
  35. package/engine/scenes.mjs +113 -26
  36. package/engine/site-build.mjs +11 -13
  37. package/engine/site-maps.mjs +5 -35
  38. package/engine/site-preview.mjs +6 -1
  39. package/engine/social-tie-terms.mjs +3 -0
  40. package/engine/social-ties.mjs +30 -19
  41. package/package.json +3 -1
  42. package/types/engine/being-age.d.mts +2 -2
  43. package/types/engine/calendar-artifacts.d.mts +16 -0
  44. package/types/engine/calendar-notes.d.mts +1 -1
  45. package/types/engine/calendars.d.mts +65 -0
  46. package/types/engine/content-images.d.mts +7 -4
  47. package/types/engine/exported-scene.d.mts +12 -0
  48. package/types/engine/index.d.mts +2 -0
  49. package/types/engine/itinerary-scenes.d.mts +29 -0
  50. package/types/engine/map-build.d.mts +4 -13
  51. package/types/engine/map-graphviz.d.mts +17 -59
  52. package/types/engine/map-places.d.mts +5 -1
  53. package/types/engine/map-raster.d.mts +8 -0
  54. package/types/engine/note-dates.d.mts +6 -0
  55. package/types/engine/note-vocabulary.d.mts +3 -3
  56. package/types/engine/pdf-render.d.mts +16 -1
  57. package/types/engine/reckoning-markers.d.mts +27 -0
  58. package/types/engine/scenes.d.mts +9 -2
  59. package/types/engine/site-build.d.mts +1 -5
  60. package/types/engine/site-maps.d.mts +2 -7
  61. package/types/engine/social-tie-terms.d.mts +2 -0
  62. package/types/engine/social-ties.d.mts +2 -1
@@ -18,6 +18,10 @@
18
18
  * the value is written in, as its note declares it. Its ordered month list
19
19
  * bounds a written month and a written day, the day against the length of
20
20
  * the month it names. A calendar that declares no list bounds nothing.
21
+ * @param {Map<string, object>} [options.markers] - Resolved era markers from
22
+ * the corpus, each carrying its calendar and canonical start.
23
+ * @param {number} [options.daysPerYear] - The world's year length, required for
24
+ * canonical days and marked dates.
21
25
  * @param {string} [options.field] - The key that carried it, named in every
22
26
  * message. Omitted, a message names the value alone.
23
27
  * @param {boolean} [options.allowUnknown=true] - Whether `"unknown"` is a
@@ -34,6 +38,8 @@ export function parseNoteDate(value: unknown, options?: {
34
38
  calendar?: {
35
39
  months?: readonly object[] | null;
36
40
  } | undefined;
41
+ markers?: Map<string, object> | undefined;
42
+ daysPerYear?: number | undefined;
37
43
  field?: string | undefined;
38
44
  allowUnknown?: boolean | undefined;
39
45
  file?: string | undefined;
@@ -278,15 +278,15 @@ export type DataFieldSpec = {
278
278
  * value — which is the honest answer wherever the specification's stated
279
279
  * shape and the shape notes are authored in today disagree.
280
280
  */
281
- kind?: "string" | "number" | "boolean" | "map" | "list" | "shortcode" | "scalar-or-map" | "address" | undefined;
281
+ kind?: "string" | "number" | "boolean" | "map" | "address" | "list" | "shortcode" | "scalar-or-map" | undefined;
282
282
  /**
283
283
  * - Type of each list or pack-map value.
284
284
  */
285
- entryKind?: "shortcode" | "address" | undefined;
285
+ entryKind?: "address" | "shortcode" | undefined;
286
286
  /**
287
287
  * - Type of each map key.
288
288
  */
289
- keyKind?: "shortcode" | "address" | undefined;
289
+ keyKind?: "address" | "shortcode" | undefined;
290
290
  /**
291
291
  * - An alternative `subType:<skill-subtype>` key.
292
292
  */
@@ -209,9 +209,11 @@ export function bookTypstPreamble(): string;
209
209
  * declared it → the staged file's path, relative to the `.typ`. A declared
210
210
  * banner this map does not carry has no file the compiler can open, so the
211
211
  * plate draws without a picture.
212
+ * @param {Map<string, {path: string, title: string}>} [opts.maps] - An entry
213
+ * anchor to its SVG path and page heading. Each map takes a page after its entry.
212
214
  * @returns {string} A complete `.typ` document.
213
215
  */
214
- export function renderBook({ plan, bodies, title, subtitle, front, fonts, version, preamble, banners, }?: {
216
+ export function renderBook({ plan, bodies, title, subtitle, front, fonts, version, preamble, banners, maps, }?: {
215
217
  plan: object;
216
218
  bodies: Map<string, string>;
217
219
  title: string;
@@ -221,6 +223,10 @@ export function renderBook({ plan, bodies, title, subtitle, front, fonts, versio
221
223
  version?: string | undefined;
222
224
  preamble?: string | undefined;
223
225
  banners?: Map<string, string> | undefined;
226
+ maps?: Map<string, {
227
+ path: string;
228
+ title: string;
229
+ }> | undefined;
224
230
  }): string;
225
231
  /**
226
232
  * Point every internal link at a label the document actually declares.
@@ -252,3 +258,12 @@ export function resolveDanglingLabels(source: string, findings?: object[]): stri
252
258
  * @returns {string[]} The names, in order of appearance, with repeats.
253
259
  */
254
260
  export function iconNamesIn(markdown: string): string[];
261
+ /** Requested print width for every named image size. */
262
+ export const BOOK_IMAGE_WIDTHS: Readonly<{
263
+ auto: "auto";
264
+ small: "1.6cm";
265
+ medium: "3.2cm";
266
+ large: "5.6cm";
267
+ xlarge: "8cm";
268
+ "full-width": "\"full-width\"";
269
+ }>;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Resolve every declared reckoning marker against its calendar and era start.
3
+ * The marker names one era, while the calendar supplies the month layout.
4
+ *
5
+ * @param {{notes?: readonly object[]}} index - The corpus link index.
6
+ * @param {number} daysPerYear - The world's year length.
7
+ * @returns {{markers: Map<string, object>, findings: object[]}} Resolved markers and errors.
8
+ */
9
+ export function resolveReckoningMarkers(index: {
10
+ notes?: readonly object[];
11
+ }, daysPerYear: number): {
12
+ markers: Map<string, object>;
13
+ findings: object[];
14
+ };
15
+ /**
16
+ * Read the world's year length and its era markers from one corpus index.
17
+ *
18
+ * @param {{notes?: readonly object[]}|undefined} index - The corpus index.
19
+ * @returns {{markers: Map<string, object>, daysPerYear: number|undefined, findings: object[]}}
20
+ */
21
+ export function reckoningContext(index: {
22
+ notes?: readonly object[];
23
+ } | undefined): {
24
+ markers: Map<string, object>;
25
+ daysPerYear: number | undefined;
26
+ findings: object[];
27
+ };
@@ -23,7 +23,7 @@ export function collectKnownActionNames(repoRoot: string): Set<string>;
23
23
  * scene's id-based references resolve on import.
24
24
  */
25
25
  export class Scenes extends BasePackCompiler {
26
- constructor({ contentBase, assetsBase, dest, skipDirectories, companionDests, folderResolver, repoRoot, }: {
26
+ constructor({ contentBase, assetsBase, dest, skipDirectories, companionDests, folderResolver, repoRoot, config, packName, bundleSourceDirs, corpus, }: {
27
27
  contentBase: any;
28
28
  assetsBase: any;
29
29
  dest: any;
@@ -31,6 +31,10 @@ export class Scenes extends BasePackCompiler {
31
31
  companionDests?: {} | undefined;
32
32
  folderResolver?: (() => null) | undefined;
33
33
  repoRoot?: string | undefined;
34
+ config: any;
35
+ packName: any;
36
+ bundleSourceDirs?: {} | undefined;
37
+ corpus: any;
34
38
  });
35
39
  /** @type {string} */
36
40
  adventureDir: string;
@@ -40,6 +44,9 @@ export class Scenes extends BasePackCompiler {
40
44
  * @type {number}
41
45
  */
42
46
  adventureCount: number;
47
+ mapConfig: any;
48
+ packName: any;
49
+ journalSourceDirs: any;
43
50
  index: Map<string, object> | undefined;
44
51
  effectsByAddress: Map<string, object> | undefined;
45
52
  knownActions: Set<string> | undefined;
@@ -51,7 +58,7 @@ export class Scenes extends BasePackCompiler {
51
58
  *
52
59
  * @returns {Promise<void>}
53
60
  */
54
- finish(): Promise<void>;
61
+ finish(stats: any): Promise<void>;
55
62
  /** @inheritdoc */
56
63
  reportCompiled(stats: any): void;
57
64
  #private;
@@ -338,18 +338,14 @@ export function sitePageDecorator(config: any, index: any): (data: any, page: an
338
338
  * {@link module:engine/sql-tables.prepareSqlTables}. A page authoring an
339
339
  * `sql` directive with none prepared is a table error: nothing here runs a
340
340
  * query.
341
- * @param {(engine: string) => string|undefined} [options.locate] - How a
342
- * GraphViz engine's binary is found, for the maps; the real lookup by
343
- * default.
344
341
  * @returns {{gates: object, stats: object|null, tableErrors: object[],
345
342
  * wikiErrors: object[], imageErrors: object[], mapFindings: object[],
346
343
  * manifests: object|null}} `mapFindings` is what drawing the maps found —
347
344
  * warnings, never a reason to fail the build.
348
345
  */
349
- export function buildSite({ config, sqlTables, locate }?: {
346
+ export function buildSite({ config, sqlTables }?: {
350
347
  config?: object | undefined;
351
348
  sqlTables?: Map<string, object[]> | undefined;
352
- locate?: ((engine: string) => string | undefined) | undefined;
353
349
  }): {
354
350
  gates: object;
355
351
  stats: object | null;
@@ -34,21 +34,16 @@ export function inlineSvg(svg: string): string;
34
34
  * @param {object} opts.config - The resolved configuration.
35
35
  * @param {string} opts.base - The site base every page is served under,
36
36
  * ending in a slash: what every name in a drawing links through.
37
- * @param {(engine: string) => string|undefined} [opts.locate] - How the
38
- * engine's binary is found; the real lookup by default.
39
37
  * @returns {{maps: Map<string, SiteMap>, findings: Array<{file: string,
40
38
  * line?: number, column?: number, severity: "error"|"warning",
41
39
  * message: string}>}} The drawings, keyed by the URL of the page each
42
- * belongs to, and what the drawing found — one warning naming what to
43
- * install when GraphViz is absent, and a warning for each relation that
44
- * names no place.
40
+ * belongs to, and warnings for relations that name no place.
45
41
  */
46
- export function drawSiteMaps({ records, foreignIndex, config, base, locate }: {
42
+ export function drawSiteMaps({ records, foreignIndex, config, base }: {
47
43
  records: Array<Record<string, any>>;
48
44
  foreignIndex: Map<string, object>;
49
45
  config: object;
50
46
  base: string;
51
- locate?: ((engine: string) => string | undefined) | undefined;
52
47
  }): {
53
48
  maps: Map<string, SiteMap>;
54
49
  findings: Array<{
@@ -3,3 +3,5 @@ export const SOCIAL_TIES: readonly {
3
3
  term: string;
4
4
  meaning: string;
5
5
  }[];
6
+ /** The note types a being can name as a social tie. */
7
+ export const SOCIAL_TIE_TARGET_TYPES: readonly string[];
@@ -6,5 +6,6 @@ export function checkSocialTies(note: any, { index }?: {}): {
6
6
  column?: number;
7
7
  file: any;
8
8
  }[];
9
- export { SOCIAL_TIES };
10
9
  import { SOCIAL_TIES } from "./social-tie-terms.mjs";
10
+ import { SOCIAL_TIE_TARGET_TYPES } from "./social-tie-terms.mjs";
11
+ export { SOCIAL_TIES, SOCIAL_TIE_TARGET_TYPES };