@heroiclands/package-build 22.15.0 → 22.16.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 (223) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/README.md +39 -678
  3. package/bin/{content-build.mjs → content-commands.mjs} +197 -118
  4. package/bin/package-build.mjs +303 -42
  5. package/bin/report.mjs +1 -1
  6. package/ci/ci-docker.mjs +6 -3
  7. package/ci/ci-steps.mjs +6 -4
  8. package/ci/content-format-reference.mjs +106 -0
  9. package/config.mjs +22 -2
  10. package/content-config.mjs +74 -134
  11. package/docs/api.md +294 -234
  12. package/docs/authoring/assets.md +31 -0
  13. package/docs/authoring/dates-and-calendars.md +33 -0
  14. package/docs/authoring/first-note.md +48 -0
  15. package/docs/authoring/frontmatter.md +40 -0
  16. package/docs/authoring/links-and-markup.md +137 -0
  17. package/docs/commands.md +631 -162
  18. package/docs/configuration.md +176 -140
  19. package/docs/content-format.md +50 -4229
  20. package/docs/design.md +32 -0
  21. package/docs/diagnostics.md +29 -22
  22. package/docs/getting-started.md +21 -877
  23. package/docs/guides/book.md +153 -0
  24. package/docs/guides/e2e.md +143 -0
  25. package/docs/guides/icons.md +126 -0
  26. package/docs/guides/localization.md +120 -0
  27. package/docs/guides/module-project.md +915 -0
  28. package/docs/guides/packs.md +167 -0
  29. package/docs/guides/reference-pages.md +148 -0
  30. package/docs/guides/release-and-deploy.md +114 -0
  31. package/docs/guides/site.md +152 -0
  32. package/docs/guides/system-project.md +45 -0
  33. package/docs/index.md +16 -0
  34. package/docs/project-setup.md +54 -35
  35. package/docs/reference/format-details.md +4420 -0
  36. package/docs/reference/note-types.md +531 -0
  37. package/engine/address-render.mjs +26 -0
  38. package/engine/address.mjs +3 -20
  39. package/engine/anchors.mjs +15 -6
  40. package/engine/asset-bindings.mjs +6 -2
  41. package/engine/base-compiler.mjs +47 -11
  42. package/engine/being-measurements.mjs +70 -0
  43. package/engine/calendar-artifacts.mjs +1 -1
  44. package/engine/calendar-choice.mjs +32 -0
  45. package/engine/calendar-human.mjs +71 -0
  46. package/engine/calendar-notes.mjs +41 -3
  47. package/engine/calendars.mjs +8 -1
  48. package/engine/changelog-lint.mjs +2 -2
  49. package/engine/code-fences.mjs +23 -97
  50. package/engine/compile-corpus.mjs +6 -7
  51. package/engine/content-admonitions.mjs +114 -0
  52. package/engine/content-captions.mjs +181 -0
  53. package/engine/content-embeds.mjs +2 -2
  54. package/engine/content-footnotes.mjs +34 -0
  55. package/engine/content-format-check.mjs +2 -2
  56. package/engine/content-format.mjs +127 -73
  57. package/engine/content-format.yaml +745 -0
  58. package/engine/content-html.mjs +1 -1
  59. package/engine/content-icons.mjs +45 -92
  60. package/engine/content-images.mjs +22 -74
  61. package/engine/content-index.mjs +12 -3
  62. package/engine/content-links.mjs +21 -26
  63. package/engine/content-lint.mjs +1 -5
  64. package/engine/content-secrets.mjs +3 -1
  65. package/engine/content-tables.mjs +47 -1257
  66. package/engine/culture-choice.mjs +32 -0
  67. package/engine/date-conversion.mjs +47 -0
  68. package/engine/declaration-check.mjs +87 -0
  69. package/engine/docs-checks.mjs +140 -0
  70. package/engine/documentation-links.mjs +31 -0
  71. package/engine/exported-scene.mjs +1 -1
  72. package/engine/extension-attributes.mjs +74 -0
  73. package/engine/field-reference.mjs +1 -1
  74. package/engine/field-spec.mjs +4 -0
  75. package/engine/foreign-catalog.mjs +5 -5
  76. package/engine/format-generated.mjs +15 -0
  77. package/engine/foundry-entries.mjs +3 -1
  78. package/engine/frontmatter-lint.mjs +5 -1
  79. package/engine/frontmatter.mjs +10 -0
  80. package/engine/generate.mjs +2 -2
  81. package/engine/helpers.mjs +71 -117
  82. package/engine/homepage.mjs +2 -3
  83. package/engine/index-records.mjs +1 -0
  84. package/engine/index.mjs +18 -3
  85. package/engine/infobox-registry.mjs +3 -1
  86. package/engine/infobox.mjs +38 -20
  87. package/engine/item-compiler.mjs +10 -8
  88. package/engine/item-docs.mjs +7 -6
  89. package/engine/itinerary-scenes.mjs +4 -2
  90. package/engine/journals.mjs +51 -10
  91. package/engine/macros.mjs +1 -1
  92. package/engine/map-build.mjs +1 -1
  93. package/engine/map-dot.mjs +1 -1
  94. package/engine/map-raster.mjs +4 -2
  95. package/engine/markdown-expressions.mjs +117 -0
  96. package/engine/metadata-index.mjs +7 -3
  97. package/engine/note-addresses.mjs +1 -0
  98. package/engine/note-dates.mjs +283 -61
  99. package/engine/note-package.mjs +5 -25
  100. package/engine/note-state.mjs +6 -2
  101. package/engine/note-vocabulary.mjs +74 -19
  102. package/engine/number-words.mjs +75 -0
  103. package/engine/office-holders.mjs +188 -0
  104. package/engine/pack-config.mjs +2 -15
  105. package/engine/pack-router.mjs +24 -5
  106. package/engine/packages.mjs +3 -2
  107. package/engine/pathnames.mjs +21 -24
  108. package/engine/pdf-build.mjs +217 -55
  109. package/engine/pdf-fonts.mjs +2 -2
  110. package/engine/pdf-images.mjs +82 -0
  111. package/engine/pdf-render.mjs +174 -22
  112. package/engine/populations.mjs +3 -2
  113. package/engine/project-init.mjs +499 -0
  114. package/engine/prose-config.mjs +1 -1
  115. package/engine/prose-lint.mjs +7 -6
  116. package/engine/readability-lint.mjs +86 -0
  117. package/engine/reckoning-markers.mjs +205 -93
  118. package/engine/scenes.mjs +5 -2
  119. package/engine/schema-check.mjs +3 -3
  120. package/engine/site-build.mjs +87 -37
  121. package/engine/site-config.mjs +8 -8
  122. package/engine/site-index.mjs +4 -0
  123. package/engine/site-maps.mjs +1 -1
  124. package/engine/site-preview.mjs +19 -8
  125. package/engine/social-ties.mjs +5 -1
  126. package/engine/sql-tables.mjs +92 -22
  127. package/engine/web-wikilinks.mjs +15 -31
  128. package/engine/wikilink-syntax.mjs +4 -1
  129. package/engine/wikilinks.mjs +12 -14
  130. package/hm3/item-fields.mjs +1 -1
  131. package/hm3/items.mjs +12 -45
  132. package/index.mjs +2 -14
  133. package/manifest.mjs +31 -4
  134. package/markdownlint-config.mjs +1 -1
  135. package/package.json +32 -11
  136. package/prettier-config.mjs +1 -1
  137. package/sohl/being-info.mjs +3 -145
  138. package/sohl/index.mjs +1 -1
  139. package/sohl/infobox.mjs +2 -1
  140. package/sohl/item-builders.mjs +3 -27
  141. package/sohl/item-fields.mjs +61 -22
  142. package/sohl/kb-passes.mjs +2 -2
  143. package/sohl/note-schemas.mjs +0 -8
  144. package/stage.mjs +19 -0
  145. package/types/config.d.mts +12 -3
  146. package/types/content-config.d.mts +15 -81
  147. package/types/engine/address-render.d.mts +13 -0
  148. package/types/engine/address.d.mts +2 -11
  149. package/types/engine/anchors.d.mts +3 -4
  150. package/types/engine/asset-bindings.d.mts +9 -2
  151. package/types/engine/base-compiler.d.mts +1 -2
  152. package/types/engine/being-measurements.d.mts +16 -0
  153. package/types/engine/calendar-choice.d.mts +14 -0
  154. package/types/engine/calendar-human.d.mts +4 -0
  155. package/types/engine/calendar-notes.d.mts +2 -0
  156. package/types/engine/calendars.d.mts +5 -3
  157. package/types/engine/code-fences.d.mts +6 -72
  158. package/types/engine/compile-corpus.d.mts +1 -3
  159. package/types/engine/content-admonitions.d.mts +24 -0
  160. package/types/engine/content-captions.d.mts +45 -0
  161. package/types/engine/content-footnotes.d.mts +10 -0
  162. package/types/engine/content-format-check.d.mts +17 -4
  163. package/types/engine/content-format.d.mts +24 -11
  164. package/types/engine/content-icons.d.mts +14 -23
  165. package/types/engine/content-images.d.mts +2 -2
  166. package/types/engine/content-index.d.mts +9 -2
  167. package/types/engine/content-links.d.mts +3 -5
  168. package/types/engine/content-tables.d.mts +11 -140
  169. package/types/engine/culture-choice.d.mts +14 -0
  170. package/types/engine/date-conversion.d.mts +4 -0
  171. package/types/engine/declaration-check.d.mts +24 -0
  172. package/types/engine/docs-checks.d.mts +28 -0
  173. package/types/engine/documentation-links.d.mts +7 -0
  174. package/types/engine/exported-scene.d.mts +6 -2
  175. package/types/engine/extension-attributes.d.mts +14 -0
  176. package/types/engine/field-spec.d.mts +9 -0
  177. package/types/engine/format-generated.d.mts +7 -0
  178. package/types/engine/frontmatter.d.mts +14 -4
  179. package/types/engine/generate.d.mts +1 -1
  180. package/types/engine/helpers.d.mts +37 -92
  181. package/types/engine/homepage.d.mts +2 -3
  182. package/types/engine/index.d.mts +5 -0
  183. package/types/engine/infobox-registry.d.mts +3 -1
  184. package/types/engine/infobox.d.mts +17 -6
  185. package/types/engine/item-compiler.d.mts +4 -4
  186. package/types/engine/item-docs.d.mts +4 -3
  187. package/types/engine/journals.d.mts +10 -7
  188. package/types/engine/map-graphviz.d.mts +1 -1
  189. package/types/engine/markdown-expressions.d.mts +17 -0
  190. package/types/engine/note-dates.d.mts +47 -1
  191. package/types/engine/note-package.d.mts +3 -19
  192. package/types/engine/note-state.d.mts +2 -1
  193. package/types/engine/note-vocabulary.d.mts +9 -0
  194. package/types/engine/number-words.d.mts +4 -0
  195. package/types/engine/office-holders.d.mts +14 -0
  196. package/types/engine/pack-config.d.mts +1 -1
  197. package/types/engine/packages.d.mts +3 -2
  198. package/types/engine/pdf-images.d.mts +38 -0
  199. package/types/engine/populations.d.mts +2 -2
  200. package/types/engine/project-init.d.mts +17 -0
  201. package/types/engine/prose-config.d.mts +1 -1
  202. package/types/engine/prose-lint.d.mts +3 -2
  203. package/types/engine/readability-lint.d.mts +22 -0
  204. package/types/engine/reckoning-markers.d.mts +4 -2
  205. package/types/engine/schema-check.d.mts +3 -3
  206. package/types/engine/site-build.d.mts +38 -28
  207. package/types/engine/site-config.d.mts +2 -2
  208. package/types/engine/site-index.d.mts +4 -0
  209. package/types/engine/site-preview.d.mts +1 -1
  210. package/types/engine/social-ties.d.mts +8 -2
  211. package/types/engine/sql-tables.d.mts +13 -2
  212. package/types/engine/web-wikilinks.d.mts +2 -1
  213. package/types/engine/wikilinks.d.mts +7 -1
  214. package/types/hm3/items.d.mts +5 -6
  215. package/types/labels.d.mts +40 -0
  216. package/types/manifest.d.mts +3 -3
  217. package/types/sohl/actors.d.mts +2 -2
  218. package/types/sohl/being-info.d.mts +3 -43
  219. package/types/sohl/index.d.mts +1 -1
  220. package/types/sohl/infobox.d.mts +5 -2
  221. package/types/sohl/item-fields.d.mts +4 -13
  222. package/types/stage.d.mts +9 -0
  223. package/CONTENT.md +0 -3239
@@ -1,3 +1,10 @@
1
+ ---
2
+ shortcode: projectsetup
3
+ name: { full: "Project setup" }
4
+ type: doc
5
+ subType: userguide
6
+ ---
7
+
1
8
  # Project setup
2
9
 
3
10
  [`getting-started.md`](getting-started.md) builds a package. This document
@@ -42,13 +49,13 @@ it is configurable through [`paths`](configuration.md#paths). The defaults:
42
49
 
43
50
  | Path | Written by | Holds |
44
51
  | ----------------------- | ------------------------------ | ------------------------------------------------------------- |
45
- | `build/packs-json/` | `content-build package` | One JSON file per compiled document, before the pack is made. |
46
- | `build/stage/packs/` | `content-build package` | The LevelDB compendium packs. |
52
+ | `build/packs-json/` | `package-build package` | One JSON file per compiled document, before the pack is made. |
53
+ | `build/stage/packs/` | `package-build package` | The LevelDB compendium packs. |
47
54
  | `build/stage/` | `package-build assets` | The staged package — manifest, packs, and the shipped files. |
48
- | `build/content-index/` | `content-build content-index` | This package's published note index. |
49
- | `build/cache/foreign/` | `content-build deps` | A dependency's unpacked item catalogue. |
50
- | `build/cache/metadata/` | `content-build deps` | A dependency's fetched content index. |
51
- | `build/tmp/packs/` | `content-build package unpack` | A compiled pack extracted back to JSON. |
55
+ | `build/content-index/` | `package-build content-index` | This package's published note index. |
56
+ | `build/cache/foreign/` | `package-build deps` | A dependency's unpacked item catalogue. |
57
+ | `build/cache/metadata/` | `package-build deps` | A dependency's fetched content index. |
58
+ | `build/tmp/packs/` | `package-build package unpack` | A compiled pack extracted back to JSON. |
52
59
  | `build/dist/` | `package-build release` | The release archive, and the book when one is built. |
53
60
 
54
61
  The two that matter when something is wrong are `build/packs-json/`, which is
@@ -64,7 +71,7 @@ note compiles.
64
71
 
65
72
  Beyond the identity keys [`getting-started.md`](getting-started.md) covers,
66
73
  `package.json` carries the whole command surface of the repository. Nobody types
67
- `npx content-build package compile`; they type `npm run build`.
74
+ `npx package-build package compile`; they type `npm run build`.
68
75
 
69
76
  The scripts fall into six groups, and the grouping is the point — a contributor
70
77
  who knows the groups can guess a name.
@@ -132,11 +139,12 @@ To commit here anyway just this once, use 'git commit --no-verify'. To opt this
132
139
  repository out permanently, 'git config hooks.allowCommitOnMain true'.
133
140
  ```
134
141
 
135
- `pre-push` reads the step list out of `.github/workflows/build.yml` rather than
136
- holding its own copy, and runs it over a clean export of `HEAD` in a
137
- `linux/amd64` container. That last detail is the one a Mac cannot reproduce any
138
- other way: this filesystem is case-insensitive and the runner's is not, so a
139
- wrong-case import passes locally and fails there.
142
+ `pre-push` reads the pull-request workflows and runs their commands over a
143
+ clean export of `HEAD` in a `linux/amd64` container. Run the same check manually
144
+ with `package-build ci`; use `package-build ci --native` to run against the
145
+ current working tree without Docker. The container catches wrong-case imports
146
+ that pass on a case-insensitive Mac filesystem and fail on the Linux runner.
147
+ Published `uses:` actions are listed but run only on GitHub.
140
148
 
141
149
  ### `clean` — removing what the build wrote
142
150
 
@@ -159,11 +167,11 @@ first failure, and knowing _which_ question failed is most of the diagnosis.
159
167
 
160
168
  ```json
161
169
  "lint": "run-s lint:format lint:markdown lint:addresses lint:content-links lint:lang lint:labels lint:changelog",
162
- "lint:format": "content-build format",
163
- "lint:markdown": "content-build markdown",
164
- "lint:markdown:fix": "content-build markdown --fix",
165
- "lint:addresses": "content-build lint",
166
- "lint:content-links": "content-build links",
170
+ "lint:format": "package-build format",
171
+ "lint:markdown": "package-build markdown",
172
+ "lint:markdown:fix": "package-build markdown --fix",
173
+ "lint:addresses": "package-build lint",
174
+ "lint:content-links": "package-build links",
167
175
  "lint:lang": "package-build lang check",
168
176
  "lint:labels": "package-build labels check",
169
177
  "lint:changelog": "package-build changelog check"
@@ -202,12 +210,13 @@ and stops at the first failure, which is what makes a named chain readable.
202
210
  ```json
203
211
  "build": "npm ci && npm run build:noci",
204
212
  "build:local": "npm i && npm run build:noci",
205
- "build:noci": "run-s lint build:db build:module",
213
+ "build:noci": "run-s lint build:stage-reset build:db build:module",
214
+ "build:stage-reset": "package-build stage reset",
206
215
  "build:db": "run-s build:content-index build:assets build:compiledb",
207
- "build:content-index": "content-build content-index",
216
+ "build:content-index": "package-build content-index",
208
217
  "build:assets": "package-build assets",
209
- "build:compiledb": "content-build package compile",
210
- "build:unpackdb": "content-build package unpack",
218
+ "build:compiledb": "package-build package compile",
219
+ "build:unpackdb": "package-build package unpack",
211
220
  "build:module": "package-build manifest",
212
221
  "build:pack-release": "package-build release"
213
222
  ```
@@ -218,6 +227,11 @@ from the lockfile first**, so what it compiles is what CI compiles;
218
227
  `build:noci` skips the install entirely, which is the one to reach for inside a
219
228
  git worktree where `node_modules` is already correct.
220
229
 
230
+ `build:stage-reset` clears only the assembled Foundry package. Keep it before
231
+ every stage writer, including a repository's own code or stylesheet bundle
232
+ step. This keeps renamed and deleted files out of the next package while
233
+ preserving the content index and other generated outputs.
234
+
221
235
  Within the chain, two orderings are real:
222
236
 
223
237
  - **`build:content-index` before `build:pack-release`.** The manifest advertises
@@ -234,16 +248,21 @@ another's, so their order among themselves is legibility rather than necessity.
234
248
  `build:unpackdb` is the inverse of `build:compiledb`: it extracts a compiled
235
249
  LevelDB pack back to JSON, which is how you read what actually shipped.
236
250
 
237
- A package with a dependency adds `"build:deps": "content-build deps fetch"` at
251
+ A package with a dependency adds `"build:deps": "package-build deps fetch"` at
238
252
  the head of `build:db`. Fetching is its own step and never happens during a
239
253
  compile, so a build never reaches the network silently — a cold cache fails
240
254
  naming `deps fetch`.
241
255
 
256
+ Commands that read dependency addresses check for a complete local index before
257
+ walking content or writing output. This applies to `lint`, `links`, `site`,
258
+ `pdf`, `map`, `reachability`, and `package compile`. The check does not fetch;
259
+ run `package-build deps fetch` as a separate step when the cache is empty.
260
+
242
261
  ### `format` — writing rather than checking
243
262
 
244
263
  ```json
245
- "format": "content-build format --write",
246
- "format:check": "content-build format"
264
+ "format": "package-build format --write",
265
+ "format:check": "package-build format"
247
266
  ```
248
267
 
249
268
  Two names for one command because two audiences want it: a contributor wants
@@ -276,14 +295,14 @@ package carries this group:
276
295
 
277
296
  ```json
278
297
  "build:site": "run-s build:site-content build:site-html build:site-root",
279
- "build:site-content": "content-build site",
298
+ "build:site-content": "package-build site",
280
299
  "build:site-html": "hugo --source build/hugo --minify --gc --cleanDestinationDir",
281
300
  "build:site-root": "package-build site-root",
282
301
  "serve:site": "npm run build:site-content && hugo server --source build/hugo"
283
302
  ```
284
303
 
285
304
  `build:site-content` writes the whole Hugo source tree under `build/hugo/` —
286
- the generated `hugo.toml` and the content mount — with `content-build site`;
305
+ the generated `hugo.toml` and the content mount — with `package-build site`;
287
306
  `build:site-html` runs Hugo over it, rendering into `build/site/<contentPackage>/`;
288
307
  `build:site-root` writes the deployment's `_headers` beside that and indexes
289
308
  the rendered pages for search into `build/site/<contentPackage>/pagefind/`;
@@ -300,7 +319,7 @@ no other dependency still runs `deps fetch` first:
300
319
 
301
320
  ```json
302
321
  "build:site": "run-s build:deps build:site-content build:site-html build:site-root",
303
- "build:deps": "content-build deps fetch"
322
+ "build:deps": "package-build deps fetch"
304
323
  ```
305
324
 
306
325
  ### Deployment scripts
@@ -330,19 +349,19 @@ options the toolchain applies — without it they fall back to Prettier's own
330
349
  defaults, and a print width that differs from the project's turns every
331
350
  save into a diff the lint chain reverts.
332
351
 
333
- `content-build markdown` needs no equivalent file: it hands the shared rule set
352
+ `package-build markdown` needs no equivalent file: it hands the shared rule set
334
353
  to markdownlint directly, and a repository that declares nothing gets it. A
335
354
  `.markdownlint-cli2.jsonc` is for the editor's markdownlint extension, and
336
355
  [`@heroiclands/package-build/markdownlint`](api.md) is the export it re-uses —
337
356
  with one trap worth knowing before writing one. A consumer file overrides the
338
357
  shared configuration **key by key, and each key wholesale**: declaring only
339
358
  `ignores` keeps every rule intact but _replaces_ the shared ignore list rather
340
- than extending it, so such a file must restate every shared entry it still
341
- wants.
359
+ than extending it, so such a file must restate `CHANGELOG.md` if it still wants
360
+ that file excluded. The command always excludes `node_modules`.
342
361
 
343
362
  ## `.prettierignore`
344
363
 
345
- `content-build format` already consults `.gitignore`, so generated trees named
364
+ `package-build format` already consults `.gitignore`, so generated trees named
346
365
  there need no second entry. `.prettierignore` is for the opposite case: files
347
366
  that are **committed** and must not be rewritten.
348
367
 
@@ -399,8 +418,8 @@ developer's absolute path. Unanchored so the same cannot happen one directory
399
418
  down, which is where a nested worktree puts it.
400
419
 
401
420
  Note also that `.gitignore` is what keeps `build/` out of the prose checks:
402
- `content-build format` reads `.gitignore` and `.prettierignore` both, and
403
- `content-build markdown` reads `.gitignore`.
421
+ `package-build format` reads `.gitignore` and `.prettierignore` both, and
422
+ `package-build markdown` reads `.gitignore`.
404
423
 
405
424
  ## `.changeset/`
406
425
 
@@ -515,8 +534,8 @@ A summary, because "where does this come from" is the question that recurs.
515
534
  | `package.json` | The Foundry package id, the version, the release addresses; the site's `baseURL`, description and author. |
516
535
  | `package-build.config.yaml` | Everything else about the build. |
517
536
  | `assets/content/**/*.md` | Every content command. |
518
- | `.gitignore` | `content-build format`, `content-build markdown`. |
519
- | `.prettierignore` | `content-build format`. |
537
+ | `.gitignore` | `package-build format`, `package-build markdown`. |
538
+ | `.prettierignore` | `package-build format`. |
520
539
  | `.github/labels.yml`, `.github/ISSUE_REPORTING.md` | `package-build labels check`. |
521
540
  | `lang/*.json` | `package-build lang`. |
522
541
  | `.env.local` | `package-build deploy`. |