@heroiclands/package-build 22.15.1 → 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.
- package/CHANGELOG.md +95 -0
- package/README.md +39 -678
- package/bin/{content-build.mjs → content-commands.mjs} +197 -118
- package/bin/package-build.mjs +303 -42
- package/bin/report.mjs +1 -1
- package/ci/ci-docker.mjs +6 -3
- package/ci/ci-steps.mjs +6 -4
- package/ci/content-format-reference.mjs +106 -0
- package/config.mjs +22 -2
- package/content-config.mjs +74 -134
- package/docs/api.md +294 -234
- package/docs/authoring/assets.md +31 -0
- package/docs/authoring/dates-and-calendars.md +33 -0
- package/docs/authoring/first-note.md +48 -0
- package/docs/authoring/frontmatter.md +40 -0
- package/docs/authoring/links-and-markup.md +137 -0
- package/docs/commands.md +631 -162
- package/docs/configuration.md +176 -140
- package/docs/content-format.md +50 -4229
- package/docs/design.md +32 -0
- package/docs/diagnostics.md +29 -22
- package/docs/getting-started.md +21 -877
- package/docs/guides/book.md +153 -0
- package/docs/guides/e2e.md +143 -0
- package/docs/guides/icons.md +126 -0
- package/docs/guides/localization.md +120 -0
- package/docs/guides/module-project.md +915 -0
- package/docs/guides/packs.md +167 -0
- package/docs/guides/reference-pages.md +148 -0
- package/docs/guides/release-and-deploy.md +114 -0
- package/docs/guides/site.md +152 -0
- package/docs/guides/system-project.md +45 -0
- package/docs/index.md +16 -0
- package/docs/project-setup.md +54 -35
- package/docs/reference/format-details.md +4420 -0
- package/docs/reference/note-types.md +531 -0
- package/engine/address-render.mjs +26 -0
- package/engine/address.mjs +3 -20
- package/engine/anchors.mjs +15 -6
- package/engine/asset-bindings.mjs +6 -2
- package/engine/base-compiler.mjs +47 -11
- package/engine/being-measurements.mjs +70 -0
- package/engine/calendar-artifacts.mjs +1 -1
- package/engine/calendar-choice.mjs +32 -0
- package/engine/calendar-human.mjs +71 -0
- package/engine/calendar-notes.mjs +41 -3
- package/engine/calendars.mjs +8 -1
- package/engine/changelog-lint.mjs +2 -2
- package/engine/code-fences.mjs +23 -97
- package/engine/compile-corpus.mjs +6 -7
- package/engine/content-admonitions.mjs +114 -0
- package/engine/content-captions.mjs +181 -0
- package/engine/content-embeds.mjs +2 -2
- package/engine/content-footnotes.mjs +34 -0
- package/engine/content-format-check.mjs +2 -2
- package/engine/content-format.mjs +127 -73
- package/engine/content-format.yaml +745 -0
- package/engine/content-html.mjs +1 -1
- package/engine/content-icons.mjs +45 -92
- package/engine/content-images.mjs +22 -74
- package/engine/content-index.mjs +12 -3
- package/engine/content-links.mjs +21 -26
- package/engine/content-lint.mjs +1 -5
- package/engine/content-secrets.mjs +3 -1
- package/engine/content-tables.mjs +47 -1257
- package/engine/culture-choice.mjs +32 -0
- package/engine/date-conversion.mjs +47 -0
- package/engine/declaration-check.mjs +87 -0
- package/engine/docs-checks.mjs +140 -0
- package/engine/documentation-links.mjs +31 -0
- package/engine/exported-scene.mjs +1 -1
- package/engine/extension-attributes.mjs +74 -0
- package/engine/field-reference.mjs +1 -1
- package/engine/field-spec.mjs +4 -0
- package/engine/foreign-catalog.mjs +5 -5
- package/engine/format-generated.mjs +15 -0
- package/engine/foundry-entries.mjs +3 -1
- package/engine/frontmatter-lint.mjs +5 -1
- package/engine/frontmatter.mjs +10 -0
- package/engine/generate.mjs +2 -2
- package/engine/helpers.mjs +71 -117
- package/engine/homepage.mjs +2 -3
- package/engine/index-records.mjs +1 -0
- package/engine/index.mjs +18 -3
- package/engine/infobox-registry.mjs +3 -1
- package/engine/infobox.mjs +38 -20
- package/engine/item-compiler.mjs +10 -8
- package/engine/item-docs.mjs +7 -6
- package/engine/journals.mjs +51 -10
- package/engine/macros.mjs +1 -1
- package/engine/map-build.mjs +1 -1
- package/engine/map-dot.mjs +1 -1
- package/engine/markdown-expressions.mjs +117 -0
- package/engine/metadata-index.mjs +7 -3
- package/engine/note-addresses.mjs +1 -0
- package/engine/note-dates.mjs +283 -61
- package/engine/note-package.mjs +5 -25
- package/engine/note-state.mjs +6 -2
- package/engine/note-vocabulary.mjs +74 -19
- package/engine/number-words.mjs +75 -0
- package/engine/office-holders.mjs +188 -0
- package/engine/pack-config.mjs +2 -15
- package/engine/pack-router.mjs +24 -5
- package/engine/packages.mjs +3 -2
- package/engine/pathnames.mjs +21 -24
- package/engine/pdf-build.mjs +217 -55
- package/engine/pdf-fonts.mjs +2 -2
- package/engine/pdf-images.mjs +82 -0
- package/engine/pdf-render.mjs +174 -22
- package/engine/populations.mjs +3 -2
- package/engine/project-init.mjs +499 -0
- package/engine/prose-config.mjs +1 -1
- package/engine/prose-lint.mjs +7 -6
- package/engine/readability-lint.mjs +86 -0
- package/engine/reckoning-markers.mjs +205 -93
- package/engine/scenes.mjs +5 -2
- package/engine/schema-check.mjs +3 -3
- package/engine/site-build.mjs +87 -37
- package/engine/site-config.mjs +8 -8
- package/engine/site-index.mjs +4 -0
- package/engine/site-maps.mjs +1 -1
- package/engine/site-preview.mjs +19 -8
- package/engine/social-ties.mjs +5 -1
- package/engine/sql-tables.mjs +92 -22
- package/engine/web-wikilinks.mjs +15 -31
- package/engine/wikilink-syntax.mjs +4 -1
- package/engine/wikilinks.mjs +12 -14
- package/hm3/item-fields.mjs +1 -1
- package/hm3/items.mjs +12 -45
- package/index.mjs +2 -14
- package/manifest.mjs +31 -4
- package/markdownlint-config.mjs +1 -1
- package/package.json +32 -11
- package/prettier-config.mjs +1 -1
- package/sohl/being-info.mjs +3 -145
- package/sohl/index.mjs +1 -1
- package/sohl/infobox.mjs +2 -1
- package/sohl/item-builders.mjs +3 -27
- package/sohl/item-fields.mjs +61 -22
- package/sohl/kb-passes.mjs +2 -2
- package/sohl/note-schemas.mjs +0 -8
- package/stage.mjs +19 -0
- package/types/config.d.mts +12 -3
- package/types/content-config.d.mts +15 -81
- package/types/engine/address-render.d.mts +13 -0
- package/types/engine/address.d.mts +2 -11
- package/types/engine/anchors.d.mts +3 -4
- package/types/engine/asset-bindings.d.mts +9 -2
- package/types/engine/base-compiler.d.mts +1 -2
- package/types/engine/being-measurements.d.mts +16 -0
- package/types/engine/calendar-choice.d.mts +14 -0
- package/types/engine/calendar-human.d.mts +4 -0
- package/types/engine/calendar-notes.d.mts +2 -0
- package/types/engine/calendars.d.mts +5 -3
- package/types/engine/code-fences.d.mts +6 -72
- package/types/engine/compile-corpus.d.mts +1 -3
- package/types/engine/content-admonitions.d.mts +24 -0
- package/types/engine/content-captions.d.mts +45 -0
- package/types/engine/content-footnotes.d.mts +10 -0
- package/types/engine/content-format-check.d.mts +17 -4
- package/types/engine/content-format.d.mts +24 -11
- package/types/engine/content-icons.d.mts +14 -23
- package/types/engine/content-images.d.mts +2 -2
- package/types/engine/content-index.d.mts +9 -2
- package/types/engine/content-links.d.mts +3 -5
- package/types/engine/content-tables.d.mts +11 -140
- package/types/engine/culture-choice.d.mts +14 -0
- package/types/engine/date-conversion.d.mts +4 -0
- package/types/engine/declaration-check.d.mts +24 -0
- package/types/engine/docs-checks.d.mts +28 -0
- package/types/engine/documentation-links.d.mts +7 -0
- package/types/engine/exported-scene.d.mts +6 -2
- package/types/engine/extension-attributes.d.mts +14 -0
- package/types/engine/field-spec.d.mts +9 -0
- package/types/engine/format-generated.d.mts +7 -0
- package/types/engine/frontmatter.d.mts +14 -4
- package/types/engine/generate.d.mts +1 -1
- package/types/engine/helpers.d.mts +37 -92
- package/types/engine/homepage.d.mts +2 -3
- package/types/engine/index.d.mts +5 -0
- package/types/engine/infobox-registry.d.mts +3 -1
- package/types/engine/infobox.d.mts +17 -6
- package/types/engine/item-compiler.d.mts +4 -4
- package/types/engine/item-docs.d.mts +4 -3
- package/types/engine/journals.d.mts +10 -7
- package/types/engine/map-graphviz.d.mts +1 -1
- package/types/engine/markdown-expressions.d.mts +17 -0
- package/types/engine/note-dates.d.mts +47 -1
- package/types/engine/note-package.d.mts +3 -19
- package/types/engine/note-state.d.mts +2 -1
- package/types/engine/note-vocabulary.d.mts +9 -0
- package/types/engine/number-words.d.mts +4 -0
- package/types/engine/office-holders.d.mts +14 -0
- package/types/engine/pack-config.d.mts +1 -1
- package/types/engine/packages.d.mts +3 -2
- package/types/engine/pdf-images.d.mts +38 -0
- package/types/engine/populations.d.mts +2 -2
- package/types/engine/project-init.d.mts +17 -0
- package/types/engine/prose-config.d.mts +1 -1
- package/types/engine/prose-lint.d.mts +3 -2
- package/types/engine/readability-lint.d.mts +22 -0
- package/types/engine/reckoning-markers.d.mts +4 -2
- package/types/engine/schema-check.d.mts +3 -3
- package/types/engine/site-build.d.mts +38 -28
- package/types/engine/site-config.d.mts +2 -2
- package/types/engine/site-index.d.mts +4 -0
- package/types/engine/site-preview.d.mts +1 -1
- package/types/engine/social-ties.d.mts +8 -2
- package/types/engine/sql-tables.d.mts +13 -2
- package/types/engine/web-wikilinks.d.mts +2 -1
- package/types/engine/wikilinks.d.mts +7 -1
- package/types/hm3/items.d.mts +5 -6
- package/types/labels.d.mts +40 -0
- package/types/manifest.d.mts +3 -3
- package/types/sohl/actors.d.mts +2 -2
- package/types/sohl/being-info.d.mts +3 -43
- package/types/sohl/index.d.mts +1 -1
- package/types/sohl/infobox.d.mts +5 -2
- package/types/sohl/item-fields.d.mts +4 -13
- package/types/stage.d.mts +9 -0
- package/CONTENT.md +0 -3239
package/docs/design.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
shortcode: design
|
|
3
|
+
name: { full: "Design of the package-build toolchain" }
|
|
4
|
+
type: doc
|
|
5
|
+
subType: concept
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Design of the package-build toolchain
|
|
9
|
+
|
|
10
|
+
This document records the reasoning behind the package boundaries. [Getting started](getting-started.md) is the entry point for using the toolchain; [configuration](configuration.md), [commands](commands.md), and the [API reference](api.md) describe its current interface.
|
|
11
|
+
|
|
12
|
+
## One authored source
|
|
13
|
+
|
|
14
|
+
A note is the source for its readable page, content-index record, and any Foundry document it describes. The shared body lives in one system-agnostic JournalEntry. Game-system blocks supply mechanics and document-specific overrides. This boundary prevents a character or Item description from diverging across compendiums, website pages, and books.
|
|
15
|
+
|
|
16
|
+
The repository's `package-build.config.yaml` is the source for its package kind, content namespace, packs, publishing choices, and Foundry manifest. The build derives transient output under `build/`. It does not rewrite authored notes, art, or configuration during an ordinary build.
|
|
17
|
+
|
|
18
|
+
## Address identity
|
|
19
|
+
|
|
20
|
+
An Address identifies a subject by package, system, type, and shortcode. It is independent of the note's folder and display name, so authors can reorganize prose without changing links. The `note` system identifies readable content; a game-system segment identifies its Actor or Item; `none` identifies systemless assets and documents. A dependency's published content index lets a build resolve foreign Addresses without compiling that dependency's packs.
|
|
21
|
+
|
|
22
|
+
The content index uses JSON Lines. A record can retain the note's full frontmatter, anchors, and outgoing links, and streams without loading one giant JSON array. It is derived, disposable, and stable for a fixed source tree and toolchain version. SQL queries and editor navigation read that index rather than guessing from filenames.
|
|
23
|
+
|
|
24
|
+
## Build boundaries
|
|
25
|
+
|
|
26
|
+
The content pass reads `assets/content/` and addressable assets. It emits the content index, page source, and Foundry documents. Site rendering and book typesetting consume those outputs; their layout decisions do not become fields of a Foundry DataModel. Packaging stages only the files a Foundry manifest declares. The build checks emitted fields against the target system schema because Foundry can otherwise discard an unknown field without an error.
|
|
27
|
+
|
|
28
|
+
Passes declare their inputs and outputs so compile order follows dependencies while pack order stays a choice for readers. A document's identity is derived once and reused across passes that cannot inspect one another's output. An Item's description pointer and its JournalEntryPage therefore agree on the page ID without shared mutable state.
|
|
29
|
+
|
|
30
|
+
## Verification
|
|
31
|
+
|
|
32
|
+
The command and API references have tests that derive their surfaces from source. The note-format contract lives in structured data and code declarations so editorial changes to Markdown do not change validation. Generated field references are checked against those declarations. Tests check emitted documents as well as input acceptance: a build that exits successfully but drops a value is still wrong. A consumer regression run compares `build/packs-json` across toolchain versions against a real content tree.
|
package/docs/diagnostics.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
shortcode: diagnostics
|
|
3
|
+
name: { full: "Diagnostics" }
|
|
4
|
+
type: doc
|
|
5
|
+
subType: reference
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
# Diagnostics
|
|
2
9
|
|
|
3
10
|
Every warning or error this toolchain emits is machine-parseable and says
|
|
@@ -18,7 +25,7 @@ file:line:column: severity: message
|
|
|
18
25
|
For example:
|
|
19
26
|
|
|
20
27
|
```text
|
|
21
|
-
assets/content/Regions/Capital_Nome.md:43:635: error: address [[place-kenbetpat]] resolves to no note — no package publishes it. Fix the shortcode, or declare the package that does as a dependency and run `
|
|
28
|
+
assets/content/Regions/Capital_Nome.md:43:635: error: address [[place-kenbetpat]] resolves to no note — no package publishes it. Fix the shortcode, or declare the package that does as a dependency and run `package-build deps fetch` — in "The Capital Nome".
|
|
22
29
|
```
|
|
23
30
|
|
|
24
31
|
That is the same shape every C-family compiler, `tsc` and ESLint already use,
|
|
@@ -235,13 +242,13 @@ stderr, including every warning.
|
|
|
235
242
|
The rule that recurs everywhere a command reports diagnostics: **a run fails
|
|
236
243
|
when it reports at least one `error`-severity diagnostic. A `warning` alone
|
|
237
244
|
never fails a run.** `bin/report.mjs`'s `reportFindings` draws this line once
|
|
238
|
-
for the commands built from the package's pure rule functions (`
|
|
245
|
+
for the commands built from the package's pure rule functions (`package-build
|
|
239
246
|
lint`, `package-build lang check`, `package-build lang coverage`,
|
|
240
247
|
`package-build yaml`, `package-build labels check`): it emits every finding
|
|
241
248
|
and returns only the count whose `severity` is `error`, and the command sets
|
|
242
249
|
`process.exitCode = 1` exactly when that count is nonzero. Commands whose
|
|
243
|
-
findings are hand-assembled — `
|
|
244
|
-
reachability`, `
|
|
250
|
+
findings are hand-assembled — `package-build links`, `package-build
|
|
251
|
+
reachability`, `package-build site`, `package-build package compile` — apply
|
|
245
252
|
the same rule by construction: everything they can report is a broken
|
|
246
253
|
address, a dead link or a document Foundry would silently drop a field from,
|
|
247
254
|
so every finding they emit is already `severity: "error"` and any finding at
|
|
@@ -275,27 +282,27 @@ over one would teach people to stop reading the report.
|
|
|
275
282
|
|
|
276
283
|
| command | fails when |
|
|
277
284
|
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
278
|
-
| `
|
|
279
|
-
| `
|
|
280
|
-
| `
|
|
281
|
-
| `
|
|
282
|
-
| `
|
|
283
|
-
| `
|
|
284
|
-
| `
|
|
285
|
-
| `
|
|
286
|
-
| `
|
|
287
|
-
| `
|
|
288
|
-
| `
|
|
289
|
-
| `
|
|
290
|
-
| `
|
|
291
|
-
| `
|
|
292
|
-
| `
|
|
285
|
+
| `package-build lint [root]` | an address, frontmatter, schema, charset, icon or HTML finding is `error`-severity, or the corpus cannot be indexed |
|
|
286
|
+
| `package-build content-format notes [root]` | `--strict` was passed and it reported any finding (all findings are `error`-severity only under `--strict`), or the corpus cannot be indexed |
|
|
287
|
+
| `package-build content-format schema` | it reports any finding at all |
|
|
288
|
+
| `package-build content-format fields` | it reports any finding at all |
|
|
289
|
+
| `package-build links [root]` | it reports any finding at all, an index is unusable (a stale or unaddressable foreign manifest), or the corpus cannot be indexed |
|
|
290
|
+
| `package-build reachability <dir> [file]` | it reports any orphaned document, or the corpus cannot be indexed |
|
|
291
|
+
| `package-build addresses diff --from <artifact>` | the corpus cannot be indexed (always); otherwise only with `--strict`, and only then are the address findings `error`-severity |
|
|
292
|
+
| `package-build format [paths..]` | a file it checked is not formatted (or, under `--write`, could not be brought to a fixpoint) — never on a shared-convention divergence, which is always advisory |
|
|
293
|
+
| `package-build markdown [paths..]` | it reports any markdownlint finding |
|
|
294
|
+
| `package-build site` | any gate finding (no homepage, a wikilink in frontmatter, an address that cannot be derived, an unusable or unaddressable foreign manifest, a conflicting address) or any table or wikilink error while writing pages — the run stops at the first gate that fires |
|
|
295
|
+
| `package-build pdf` | it could not build the book for a reason other than a deliberate no-op — never on a reported finding by itself |
|
|
296
|
+
| `package-build map` | `--tree` reports an `error`-severity finding (a place with no parent, a parent that does not resolve, a cycle), a named place is not one, the renderer fails, or the corpus cannot be indexed — never on a warning |
|
|
297
|
+
| `package-build docs item-fields --check` | the generated page differs from what is committed |
|
|
298
|
+
| `package-build package compile` | pack JSON generation reported any `error`-severity finding (checked, and the compile refused, before any pack is written), or a compiled pack fails its Scene/Level integrity check |
|
|
299
|
+
| `package-build deps fetch` | the fetch itself throws — it emits no diagnostics |
|
|
293
300
|
| `package-build lang check` | any localization finding is `error`-severity |
|
|
294
301
|
| `package-build lang coverage` | a referenced key is missing (`error`-severity); an unreferenced key is always advisory and never fails the run |
|
|
295
302
|
| `package-build yaml [paths..]` | any YAML finding is `error`-severity |
|
|
296
303
|
| `package-build labels check` | the label registry and the documented table disagree on any label |
|
|
297
304
|
|
|
298
|
-
Every command
|
|
305
|
+
Every command also fails on a thrown error unrelated to a
|
|
299
306
|
diagnostic — a missing configuration, an unreadable file, a network failure —
|
|
300
307
|
through the same `process.exitCode = 1` (or `process.exit(1)`), reported as
|
|
301
308
|
one line with no stack.
|
|
@@ -321,7 +328,7 @@ emitDiagnostic({
|
|
|
321
328
|
message:
|
|
322
329
|
"address [[place-kenbetpat]] resolves to no note — no package publishes it. " +
|
|
323
330
|
"Fix the shortcode, or declare the package that does as a dependency and " +
|
|
324
|
-
'run `
|
|
331
|
+
'run `package-build deps fetch` — in "The Capital Nome".',
|
|
325
332
|
});
|
|
326
333
|
emitDiagnostic({
|
|
327
334
|
file: "assets/content/Regions/Capital_Nome.md",
|
|
@@ -390,7 +397,7 @@ Running `node parse.mjs` prints:
|
|
|
390
397
|
```text
|
|
391
398
|
2 error(s), 1 warning(s):
|
|
392
399
|
|
|
393
|
-
[error] assets/content/Regions/Capital_Nome.md:43:635 — address [[place-kenbetpat]] resolves to no note — no package publishes it. Fix the shortcode, or declare the package that does as a dependency and run `
|
|
400
|
+
[error] assets/content/Regions/Capital_Nome.md:43:635 — address [[place-kenbetpat]] resolves to no note — no package publishes it. Fix the shortcode, or declare the package that does as a dependency and run `package-build deps fetch` — in "The Capital Nome".
|
|
394
401
|
[warning] assets/content/Regions/Capital_Nome.md:12 — `system.sohl.unemitted` is declared but no builder ever sets it
|
|
395
402
|
[error] assets/content/Regions/Capital_Nome.md — duplicate frontmatter key `name` — the second declaration wins and the first is dead
|
|
396
403
|
```
|