@heroiclands/package-build 21.1.0 → 22.0.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 (115) hide show
  1. package/CHANGELOG.md +245 -0
  2. package/CONTENT.md +107 -3
  3. package/assets/fonts/libertinus/LibertinusMono-Regular.otf +0 -0
  4. package/assets/fonts/libertinus/LibertinusSans-Bold.otf +0 -0
  5. package/assets/fonts/libertinus/LibertinusSans-Italic.otf +0 -0
  6. package/assets/fonts/libertinus/LibertinusSans-Regular.otf +0 -0
  7. package/assets/fonts/libertinus/OFL.txt +94 -0
  8. package/assets/fonts/libertinus/provenance.yaml +11 -0
  9. package/assets/images/banners/afflictionbnr.webp +0 -0
  10. package/assets/images/banners/armorclothingbnr.webp +0 -0
  11. package/assets/images/banners/attributebnr.webp +0 -0
  12. package/assets/images/banners/containerbnr.webp +0 -0
  13. package/assets/images/banners/devdocsbnr.webp +0 -0
  14. package/assets/images/banners/miscgearbnr.webp +0 -0
  15. package/assets/images/banners/mysticalabilitybnr.webp +0 -0
  16. package/assets/images/banners/projectilebnr.webp +0 -0
  17. package/assets/images/banners/rulesbnr.webp +0 -0
  18. package/assets/images/banners/skillbnr.webp +0 -0
  19. package/assets/images/banners/traumabnr.webp +0 -0
  20. package/assets/images/banners/userguidebnr.webp +0 -0
  21. package/assets/images/banners/weapongearbnr.webp +0 -0
  22. package/assets/images/provenance.yaml +4 -0
  23. package/bin/content-build.mjs +19 -5
  24. package/bin/package-build.mjs +6 -5
  25. package/ci/emit-asset-index.mjs +32 -0
  26. package/content-config.mjs +30 -1
  27. package/docs/api.md +103 -27
  28. package/docs/commands.md +13 -11
  29. package/docs/configuration.md +16 -7
  30. package/docs/content-format.md +523 -111
  31. package/engine/actor-compiler.mjs +58 -9
  32. package/engine/art-fields.mjs +292 -0
  33. package/engine/asset-index.mjs +397 -0
  34. package/engine/asset-types.mjs +192 -0
  35. package/engine/base-compiler.mjs +69 -1
  36. package/engine/bundles.mjs +5 -5
  37. package/engine/compile-corpus.mjs +4 -0
  38. package/engine/content-address.mjs +14 -2
  39. package/engine/content-charset.mjs +5 -1
  40. package/engine/content-embeds.mjs +314 -0
  41. package/engine/content-html.mjs +5 -1
  42. package/engine/content-icons.mjs +5 -1
  43. package/engine/content-images.mjs +26 -5
  44. package/engine/content-index.mjs +68 -33
  45. package/engine/content-links.mjs +164 -24
  46. package/engine/dependency-bump.mjs +14 -16
  47. package/engine/frontmatter-lint.mjs +36 -23
  48. package/engine/helpers.mjs +83 -31
  49. package/engine/index-records.mjs +63 -4
  50. package/engine/index.mjs +15 -0
  51. package/engine/infobox-registry.mjs +50 -3
  52. package/engine/infobox.mjs +12 -8
  53. package/engine/item-compiler.mjs +10 -10
  54. package/engine/journals.mjs +3 -0
  55. package/engine/macros.mjs +16 -13
  56. package/engine/map-notes.mjs +29 -22
  57. package/engine/metadata-index.mjs +44 -36
  58. package/engine/note-vocabulary.mjs +71 -29
  59. package/engine/pack-router.mjs +14 -0
  60. package/engine/packagebuild-index.mjs +124 -0
  61. package/engine/packages.mjs +83 -0
  62. package/engine/pathnames.mjs +74 -0
  63. package/engine/pdf-build.mjs +133 -8
  64. package/engine/pdf-render.mjs +49 -12
  65. package/engine/scenes.mjs +12 -9
  66. package/engine/site-build.mjs +43 -16
  67. package/engine/site-index.mjs +10 -1
  68. package/engine/subtype-registry.mjs +21 -0
  69. package/engine/web-wikilinks.mjs +46 -12
  70. package/engine/wikilink-syntax.mjs +20 -2
  71. package/engine/wikilinks.mjs +15 -2
  72. package/hm3/actors.mjs +11 -38
  73. package/manifest.mjs +67 -13
  74. package/package.json +5 -2
  75. package/packagebuild-metadata.jsonl +13 -0
  76. package/sohl/actors.mjs +12 -86
  77. package/sohl/note-schemas.mjs +4 -16
  78. package/types/content-config.d.mts +8 -0
  79. package/types/engine/actor-compiler.d.mts +29 -0
  80. package/types/engine/art-fields.d.mts +192 -0
  81. package/types/engine/asset-index.d.mts +92 -0
  82. package/types/engine/asset-types.d.mts +110 -0
  83. package/types/engine/base-compiler.d.mts +42 -1
  84. package/types/engine/compile-corpus.d.mts +4 -1
  85. package/types/engine/content-charset.d.mts +4 -0
  86. package/types/engine/content-embeds.d.mts +218 -0
  87. package/types/engine/content-html.d.mts +4 -0
  88. package/types/engine/content-icons.d.mts +4 -0
  89. package/types/engine/content-images.d.mts +15 -2
  90. package/types/engine/content-index.d.mts +27 -15
  91. package/types/engine/dependency-bump.d.mts +2 -2
  92. package/types/engine/frontmatter-lint.d.mts +11 -14
  93. package/types/engine/helpers.d.mts +7 -2
  94. package/types/engine/index-records.d.mts +44 -3
  95. package/types/engine/index.d.mts +5 -0
  96. package/types/engine/infobox-registry.d.mts +36 -1
  97. package/types/engine/infobox.d.mts +6 -4
  98. package/types/engine/macros.d.mts +9 -5
  99. package/types/engine/map-notes.d.mts +10 -6
  100. package/types/engine/metadata-index.d.mts +2 -17
  101. package/types/engine/note-vocabulary.d.mts +30 -0
  102. package/types/engine/packagebuild-index.d.mts +56 -0
  103. package/types/engine/packages.d.mts +62 -0
  104. package/types/engine/pathnames.d.mts +41 -81
  105. package/types/engine/pdf-build.d.mts +58 -1
  106. package/types/engine/pdf-render.d.mts +3 -1
  107. package/types/engine/scenes.d.mts +2 -1
  108. package/types/engine/site-build.d.mts +5 -1
  109. package/types/engine/site-index.d.mts +4 -1
  110. package/types/engine/subtype-registry.d.mts +20 -0
  111. package/types/engine/web-wikilinks.d.mts +14 -4
  112. package/types/engine/wikilink-syntax.d.mts +13 -1
  113. package/types/engine/wikilinks.d.mts +7 -1
  114. package/types/manifest.d.mts +42 -1
  115. package/types/sohl/actors.d.mts +0 -1
@@ -128,6 +128,10 @@ export function anchorPageId(noteId: string, anchorSlug: string): string;
128
128
  * vendored manifests of packages this build links into but does not publish.
129
129
  * @param {string} [contentPackage] - This build's *content* package, which an
130
130
  * authored address may name explicitly. Defaults to `packageId`.
131
+ * @param {object} [opts] - Options.
132
+ * @param {Map<string, object>} [opts.assets] - The files this package ships, by
133
+ * canonical address. They resolve no link — an asset is not a document — and
134
+ * answer only the art fields, which name a file and never a document.
131
135
  * @returns {{byShortcode: Map<string, object>, types: Set<string>}} `types` is
132
136
  * every type the tree actually contains, so a qualifier naming no real type
133
137
  * can be told apart from a missing target.
@@ -140,7 +144,9 @@ export function buildWikilinkIndex(docs: Array<{
140
144
  pack?: string;
141
145
  docPack?: string;
142
146
  draft?: boolean;
143
- }>, packageId: string, foreign?: Map<string, object>, contentPackage?: string): {
147
+ }>, packageId: string, foreign?: Map<string, object>, contentPackage?: string, { assets }?: {
148
+ assets?: Map<string, object> | undefined;
149
+ }): {
144
150
  byShortcode: Map<string, object>;
145
151
  types: Set<string>;
146
152
  };
@@ -17,6 +17,28 @@
17
17
  export function normalizeRepoUrl(repository: string | {
18
18
  url?: string;
19
19
  }): string;
20
+ /**
21
+ * A package's homepage — the page `url` sends a reader to.
22
+ *
23
+ * Derived from the content package rather than declared, because the address is
24
+ * already fixed: every package publishes an authored homepage at
25
+ * `<origin>/<contentPackage>/`, and the shared site-deploy workflow publishes
26
+ * it there. A declared copy would be a second spelling of a settled fact, free
27
+ * to drift — and the one that drifts is this one, because nothing fetches `url`
28
+ * the way Foundry fetches `manifest`, so a wrong value is never reported.
29
+ *
30
+ * The site's own `baseURL` says the same thing, and is deliberately not the
31
+ * source: it sits at `site/hugo.toml` in most repositories and `kb/hugo.toml`
32
+ * in the system, so reading it would mean the packaging half knowing where each
33
+ * repository keeps its site configuration.
34
+ *
35
+ * @param {string} contentPackage - The package's content-package name.
36
+ * @returns {string} The homepage URL, with its trailing slash.
37
+ * @throws {TypeError} When no name is given. Interpolating a missing one yields
38
+ * `<origin>/undefined/`, a URL that resolves and is wrong — and nothing
39
+ * fetches `url`, so it would be advertised for as long as nobody clicked it.
40
+ */
41
+ export function packageHomepage(contentPackage: string): string;
20
42
  /**
21
43
  * The addresses a Foundry manifest advertises.
22
44
  *
@@ -26,14 +48,23 @@ export function normalizeRepoUrl(repository: string | {
26
48
  * install at that release forever. `download` points at this exact version,
27
49
  * because that is the archive this manifest describes.
28
50
  *
51
+ * **`url` is the homepage, not the repository.** It is the Project Homepage
52
+ * link a reader follows from the package listing *before* installing anything,
53
+ * so it answers "what is this?" — which a page written for that question does
54
+ * and a source tree does not. `bugs`, `manifest` and `download` address release
55
+ * artefacts and stay on the repository that holds them.
56
+ *
29
57
  * @param {object} opts
30
58
  * @param {string} opts.repoUrl - Normalised repository URL.
59
+ * @param {string} opts.homeUrl - The package's homepage, from
60
+ * {@link packageHomepage}.
31
61
  * @param {string} opts.version - The version being built.
32
62
  * @param {"system"|"module"} opts.artifact - Which artifact is shipped.
33
63
  * @returns {{url: string, bugs: string, manifest: string, download: string}}
34
64
  */
35
- export function releaseUrls({ repoUrl, version, artifact }: {
65
+ export function releaseUrls({ repoUrl, homeUrl, version, artifact }: {
36
66
  repoUrl: string;
67
+ homeUrl: string;
37
68
  version: string;
38
69
  artifact: "system" | "module";
39
70
  }): {
@@ -223,6 +254,16 @@ export function writeManifest({ config, packageJson, artifact, outDir, flags, co
223
254
  * convention this project is free to choose.
224
255
  */
225
256
  export const ARTIFACTS: readonly string[];
257
+ /**
258
+ * Where every HeroicLands package's homepage is served from.
259
+ *
260
+ * Stated once here and read by {@link packageHomepage}, so the origin a
261
+ * manifest advertises and the origin the configuration documents cannot come
262
+ * to disagree.
263
+ *
264
+ * @type {string}
265
+ */
266
+ export const HOMEPAGE_ORIGIN: string;
226
267
  /**
227
268
  * Relationship keys that direct the **build**, rather than describe the
228
269
  * package.
@@ -56,7 +56,6 @@ export class Actors extends SystemActorCompiler {
56
56
  system: {
57
57
  shortcode: any;
58
58
  templatePriority: number | null;
59
- portrait: any;
60
59
  appearance: string;
61
60
  dossier: string;
62
61
  };