@heroiclands/package-build 0.6.0 → 3.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 (127) hide show
  1. package/CHANGELOG-content-build.md +965 -0
  2. package/CHANGELOG.md +95 -0
  3. package/CONTENT.md +824 -0
  4. package/MIGRATING.md +127 -0
  5. package/README.md +29 -17
  6. package/bin/content-build.mjs +1082 -0
  7. package/bin/package-build.mjs +2 -2
  8. package/bin/report.mjs +2 -2
  9. package/config.mjs +21 -18
  10. package/content-config.mjs +1424 -0
  11. package/coverage.mjs +1 -1
  12. package/e2e.mjs +1 -1
  13. package/engine/abbreviations.mjs +0 -0
  14. package/engine/base-compiler.mjs +608 -0
  15. package/engine/code-fences.mjs +311 -0
  16. package/engine/compendiums.mjs +353 -0
  17. package/engine/content-address.mjs +141 -0
  18. package/engine/content-links.mjs +438 -0
  19. package/engine/content-lint.mjs +204 -0
  20. package/engine/content-package.mjs +67 -0
  21. package/engine/content-slug.mjs +169 -0
  22. package/engine/content-tables.mjs +1216 -0
  23. package/engine/content-tree.mjs +56 -0
  24. package/engine/diagnostics.mjs +270 -0
  25. package/engine/field-reference.mjs +242 -0
  26. package/engine/field-spec.mjs +218 -0
  27. package/engine/foreign-catalog.mjs +450 -0
  28. package/engine/foreign-manifests.mjs +129 -0
  29. package/engine/frontmatter-lint.mjs +343 -0
  30. package/engine/frontmatter.mjs +258 -0
  31. package/engine/generate.mjs +305 -0
  32. package/engine/helpers.mjs +809 -0
  33. package/engine/ids.mjs +192 -0
  34. package/engine/index.mjs +142 -0
  35. package/engine/item-docs.mjs +153 -0
  36. package/engine/item-registry.mjs +129 -0
  37. package/engine/journals.mjs +374 -0
  38. package/engine/kb-manifest.mjs +473 -0
  39. package/engine/macros.mjs +333 -0
  40. package/engine/manifest-emit.mjs +339 -0
  41. package/engine/map-notes.mjs +1302 -0
  42. package/engine/pack-config.mjs +479 -0
  43. package/engine/pack-router.mjs +254 -0
  44. package/engine/prose-config.mjs +238 -0
  45. package/engine/prose-lint.mjs +294 -0
  46. package/engine/region-events.mjs +79 -0
  47. package/engine/scene-levels.mjs +420 -0
  48. package/engine/scenes.mjs +528 -0
  49. package/engine/site-build.mjs +778 -0
  50. package/engine/site-index.mjs +332 -0
  51. package/engine/web-wikilinks.mjs +330 -0
  52. package/engine/wikilink-syntax.mjs +105 -0
  53. package/engine/wikilinks.mjs +645 -0
  54. package/index.mjs +42 -25
  55. package/lang.mjs +1 -1
  56. package/manifest.mjs +79 -5
  57. package/markdownlint-config.mjs +45 -0
  58. package/package.json +78 -34
  59. package/prettier-config.mjs +34 -0
  60. package/sohl/actors.mjs +581 -0
  61. package/sohl/affiliation-standings.mjs +44 -0
  62. package/sohl/being-info.mjs +173 -0
  63. package/sohl/default-item-art.mjs +82 -0
  64. package/sohl/index.mjs +55 -0
  65. package/sohl/item-builders.mjs +114 -0
  66. package/sohl/item-fields.mjs +867 -0
  67. package/sohl/items.mjs +197 -0
  68. package/sohl/kb-passes.mjs +207 -0
  69. package/sohl/note-schemas.mjs +322 -0
  70. package/templates.mjs +1 -1
  71. package/types/config.d.mts +1 -1
  72. package/types/content-config.d.mts +571 -0
  73. package/types/engine/abbreviations.d.mts +44 -0
  74. package/types/engine/base-compiler.d.mts +320 -0
  75. package/types/engine/code-fences.d.mts +102 -0
  76. package/types/engine/compendiums.d.mts +77 -0
  77. package/types/engine/content-address.d.mts +61 -0
  78. package/types/engine/content-links.d.mts +87 -0
  79. package/types/engine/content-lint.d.mts +47 -0
  80. package/types/engine/content-package.d.mts +36 -0
  81. package/types/engine/content-slug.d.mts +59 -0
  82. package/types/engine/content-tables.d.mts +131 -0
  83. package/types/engine/content-tree.d.mts +12 -0
  84. package/types/engine/diagnostics.d.mts +152 -0
  85. package/types/engine/field-reference.d.mts +20 -0
  86. package/types/engine/field-spec.d.mts +181 -0
  87. package/types/engine/foreign-catalog.d.mts +103 -0
  88. package/types/engine/foreign-manifests.d.mts +43 -0
  89. package/types/engine/frontmatter-lint.d.mts +74 -0
  90. package/types/engine/frontmatter.d.mts +99 -0
  91. package/types/engine/generate.d.mts +56 -0
  92. package/types/engine/helpers.d.mts +348 -0
  93. package/types/engine/ids.d.mts +126 -0
  94. package/types/engine/index.d.mts +33 -0
  95. package/types/engine/item-docs.d.mts +73 -0
  96. package/types/engine/item-registry.d.mts +57 -0
  97. package/types/engine/journals.d.mts +121 -0
  98. package/types/engine/kb-manifest.d.mts +214 -0
  99. package/types/engine/macros.d.mts +201 -0
  100. package/types/engine/manifest-emit.d.mts +137 -0
  101. package/types/engine/map-notes.d.mts +283 -0
  102. package/types/engine/pack-config.d.mts +77 -0
  103. package/types/engine/pack-router.d.mts +53 -0
  104. package/types/engine/prose-config.d.mts +121 -0
  105. package/types/engine/prose-lint.d.mts +59 -0
  106. package/types/engine/region-events.d.mts +43 -0
  107. package/types/engine/scene-levels.d.mts +36 -0
  108. package/types/engine/scenes.d.mts +48 -0
  109. package/types/engine/site-build.d.mts +214 -0
  110. package/types/engine/site-index.d.mts +141 -0
  111. package/types/engine/web-wikilinks.d.mts +67 -0
  112. package/types/engine/wikilink-syntax.d.mts +101 -0
  113. package/types/engine/wikilinks.d.mts +172 -0
  114. package/types/index.d.mts +3 -0
  115. package/types/manifest.d.mts +52 -4
  116. package/types/markdownlint-config.d.mts +8 -0
  117. package/types/prettier-config.d.mts +1 -0
  118. package/types/sohl/actors.d.mts +65 -0
  119. package/types/sohl/affiliation-standings.d.mts +22 -0
  120. package/types/sohl/being-info.d.mts +78 -0
  121. package/types/sohl/default-item-art.d.mts +28 -0
  122. package/types/sohl/index.d.mts +7 -0
  123. package/types/sohl/item-builders.d.mts +11 -0
  124. package/types/sohl/item-fields.d.mts +20 -0
  125. package/types/sohl/items.d.mts +19 -0
  126. package/types/sohl/kb-passes.d.mts +71 -0
  127. package/types/sohl/note-schemas.d.mts +7 -0
@@ -26,7 +26,7 @@
26
26
  *
27
27
  * It is the same shape the configuration had before it became data: not logic,
28
28
  * but the boilerplate a code file needs in order to state a literal. So the
29
- * literals move into `content-build.config.yaml`'s reserved `packageBuild:`
29
+ * literals move into `package-build.config.yaml`'s reserved `packageBuild:`
30
30
  * section, and the boilerplate lives here, once.
31
31
  *
32
32
  * **Every side effect lives in this file.** argv parsing, the environment,
@@ -78,7 +78,7 @@ import yargs from "yargs";
78
78
  import { hideBin } from "yargs/helpers";
79
79
 
80
80
  import { loadPackageBuildConfig } from "../config.mjs";
81
- import { loadPackConfig } from "@heroiclands/content-build/engine/pack-config";
81
+ import { loadPackConfig } from "../engine/pack-config.mjs";
82
82
  import { cleanBuildArtifacts, stageAssets } from "../stage.mjs";
83
83
  import { validateLangSource } from "../lang.mjs";
84
84
  import {
package/bin/report.mjs CHANGED
@@ -28,14 +28,14 @@
28
28
  *
29
29
  * The emitted form is the toolchain's diagnostic contract —
30
30
  * `file:line:column: severity: message`, the path starting the line, a field
31
- * dropped rather than guessed — which `@heroiclands/content-build` already
31
+ * dropped rather than guessed — which `@heroiclands/package-build` already
32
32
  * owns. This module maps findings onto it rather than restating it, so the two
33
33
  * packages cannot drift into two nearly-identical formats.
34
34
  *
35
35
  * @module
36
36
  */
37
37
 
38
- import { emitDiagnostic } from "@heroiclands/content-build/engine/diagnostics";
38
+ import { emitDiagnostic } from "../engine/diagnostics.mjs";
39
39
 
40
40
  /**
41
41
  * A finding as the pure rules report one.
package/config.mjs CHANGED
@@ -15,26 +15,29 @@
15
15
  * The per-repository configuration this package reads.
16
16
  *
17
17
  * **One repository, one configuration file.** A repository already declares
18
- * itself in `content-build.config.yaml`, and two of the values this package
18
+ * itself in `package-build.config.yaml`, and two of the values this package
19
19
  * needs — `packageKind` and `foundryPackage` — are already in it. A second file
20
20
  * would restate them, which is two places for one fact; that is precisely what
21
21
  * every consumer's `push-stage.mjs` did, hard-coding `packageKind: "systems"`
22
22
  * and `packageId: "sohl"` beside a config that already said both.
23
23
  *
24
- * So this package reads the *same* file, through content-build's loader, and
25
- * takes its own settings from the reserved `packageBuild:` section. The two
26
- * packages split by **input** — content-build reads the content tree, this one
27
- * reads `lang/`, `styles/`, `src/`, the assets and the manifest template — and
28
- * neither validates the other's keys. content-build checks that the section is
29
- * a mapping and hands it back frozen; everything inside it is validated here.
30
- *
31
- * **The dependency runs one way.** This package depends on content-build;
32
- * content-build must never depend on this one. It is the same direction the
33
- * loader already implies, and keeping it means content-build stays usable by a
34
- * repository that ships content and no Foundry package at all.
24
+ * So the packaging half reads the *same* file, through the content half's
25
+ * loader (`engine/pack-config.mjs`), and takes its own settings from the
26
+ * `packageBuild:` section. The two halves split by **input** — the content half
27
+ * reads the content tree, this one reads `lang/`, `styles/`, `src/`, the assets
28
+ * and the manifest template — and neither validates the other's keys. The
29
+ * loader checks that the section is a mapping and hands it back frozen;
30
+ * everything inside it is validated here.
31
+ *
32
+ * **That section used to be a reservation.** Until 2.0.0 these were two
33
+ * packages, and `packageBuild:` was a block `@heroiclands/content-build`
34
+ * carried on behalf of a toolchain it knew nothing about. One package now owns
35
+ * the whole file, so it is an ordinary section — but the validation split is
36
+ * kept, because it is what stops a key being checked twice against two
37
+ * disagreeing ideas of what it means.
35
38
  *
36
39
  * ```yaml
37
- * # content-build.config.yaml
40
+ * # package-build.config.yaml
38
41
  * packageKind: systems # read from the top level, not restated below
39
42
  * foundryPackage: sohl
40
43
  *
@@ -56,7 +59,7 @@
56
59
  */
57
60
 
58
61
  import path from "node:path";
59
- import { loadPackConfig } from "@heroiclands/content-build/engine/pack-config";
62
+ import { loadPackConfig } from "./engine/pack-config.mjs";
60
63
 
61
64
  /** Keys the reserved section may declare. */
62
65
  const SECTION_KEYS = [
@@ -92,9 +95,9 @@ export const DERIVED_MANIFEST_KEYS = Object.freeze({
92
95
  bugs: "package.json `repository`",
93
96
  manifest: "package.json `repository` and the release tag",
94
97
  download: "package.json `repository` and the release tag",
95
- compatibility: "the top level of content-build.config.yaml",
96
- relationships: "the top level of content-build.config.yaml",
97
- packs: "the `packs` list at the top level of content-build.config.yaml",
98
+ compatibility: "the top level of package-build.config.yaml",
99
+ relationships: "the top level of package-build.config.yaml",
100
+ packs: "the `packs` list at the top level of package-build.config.yaml",
98
101
  });
99
102
  const ASSET_KEYS = ["from", "to"];
100
103
  const CLEAN_KEYS = ["extra"];
@@ -496,7 +499,7 @@ function normalizeExceptions(value, field, where) {
496
499
  * disk. {@link loadPackageBuildConfig} is the same function with the loading
497
500
  * put back.
498
501
  *
499
- * @param {object} shared - The resolved content-build configuration.
502
+ * @param {object} shared - The resolved content configuration.
500
503
  * @returns {Readonly<PackageBuildConfig>} The frozen configuration.
501
504
  * @throws {TypeError} When the reserved section declares something malformed.
502
505
  */