@heroiclands/package-build 23.1.0 → 23.2.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 +71 -0
- package/bin/content-commands.mjs +68 -149
- package/bin/package-build.mjs +56 -10
- package/ci/check-banners.mjs +42 -6
- package/ci/confirm-npm-version.mjs +135 -0
- package/ci/content-format-reference.mjs +14 -5
- package/config.mjs +1 -0
- package/container.mjs +185 -4
- package/content-config.mjs +333 -210
- package/deploy.mjs +116 -10
- package/docs/api.md +238 -246
- package/docs/authoring/assets.md +11 -5
- package/docs/authoring/frontmatter.md +1 -1
- package/docs/authoring/links-and-markup.md +87 -0
- package/docs/commands.md +138 -99
- package/docs/configuration.md +277 -125
- package/docs/content-format.md +2 -0
- package/docs/diagnostics.md +48 -13
- package/docs/guides/book.md +341 -21
- package/docs/guides/e2e.md +13 -2
- package/docs/guides/icons.md +14 -4
- package/docs/guides/module-project.md +18 -8
- package/docs/guides/release-and-deploy.md +54 -6
- package/docs/guides/site.md +5 -2
- package/docs/project-setup.md +30 -10
- package/docs/reference/format-details.md +373 -170
- package/docs/reference/note-types.md +128 -109
- package/docs/reference/theme-pages.md +31 -6
- package/e2e.mjs +140 -28
- package/engine/actor-compiler.mjs +22 -31
- package/engine/address-charset.mjs +4 -17
- package/engine/address-fields.mjs +1 -1
- package/engine/address-render.mjs +12 -1
- package/engine/address-values.mjs +6 -0
- package/engine/address.mjs +46 -33
- package/engine/art-fields.mjs +30 -5
- package/engine/art-slots.mjs +10 -1
- package/engine/asset-bindings.mjs +12 -1
- package/engine/base-compiler.mjs +34 -65
- package/engine/being-age.mjs +2 -7
- package/engine/being-measurements.mjs +12 -1
- package/engine/calendar-artifacts.mjs +6 -0
- package/engine/calendar-choice.mjs +12 -1
- package/engine/calendar-format.mjs +12 -1
- package/engine/calendar-human.mjs +12 -1
- package/engine/compile-corpus.mjs +3 -1
- package/engine/content-address.mjs +9 -12
- package/engine/content-alerts.mjs +13 -1
- package/engine/content-blocks.mjs +14 -3
- package/engine/content-embeds.mjs +11 -3
- package/engine/content-figures.mjs +9 -0
- package/engine/content-footnotes.mjs +12 -1
- package/engine/content-format-check.mjs +11 -262
- package/engine/content-format.yaml +5 -2
- package/engine/content-images.mjs +3 -0
- package/engine/content-index.mjs +443 -20
- package/engine/content-links.mjs +29 -35
- package/engine/content-lint.mjs +2 -3
- package/engine/content-poetry.mjs +12 -1
- package/engine/content-slug.mjs +2 -14
- package/engine/content-spans.mjs +13 -1
- package/engine/content-tables.mjs +12 -1
- package/engine/culture-choice.mjs +210 -13
- package/engine/data-keys.mjs +19 -16
- package/engine/date-conversion.mjs +12 -1
- package/engine/declaration-check.mjs +9 -0
- package/engine/derived-fields.mjs +6 -7
- package/engine/diagnostics.mjs +34 -4
- package/engine/docs-checks.mjs +9 -0
- package/engine/document-subtypes.mjs +47 -34
- package/engine/event-views.mjs +139 -14
- package/engine/exported-scene.mjs +92 -28
- package/engine/extension-attributes.mjs +12 -1
- package/engine/field-spec.mjs +11 -102
- package/engine/folder-notes.mjs +0 -64
- package/engine/foreign-catalog.mjs +2 -1
- package/engine/format-generated.mjs +9 -0
- package/engine/foundry-entries.mjs +10 -28
- package/engine/frontmatter-lint.mjs +83 -392
- package/engine/frontmatter.mjs +20 -70
- package/engine/generate.mjs +10 -15
- package/engine/heading-attributes.mjs +12 -1
- package/engine/helpers.mjs +41 -102
- package/engine/holdings.mjs +1 -1
- package/engine/homepage.mjs +3 -10
- package/engine/ids.mjs +1 -167
- package/engine/index-records.mjs +6 -4
- package/engine/index.mjs +0 -3
- package/engine/infobox-render.mjs +15 -3
- package/engine/infobox.mjs +13 -14
- package/engine/item-compiler.mjs +4 -10
- package/engine/item-docs.mjs +3 -5
- package/engine/item-registry.mjs +2 -10
- package/engine/journals.mjs +1 -5
- package/engine/literature-notes.mjs +4 -12
- package/engine/macros.mjs +1 -2
- package/engine/map-graphviz.mjs +12 -1
- package/engine/markdown-expressions.mjs +12 -1
- package/engine/markdownlint-run.mjs +567 -0
- package/engine/metadata-index.mjs +42 -12
- package/engine/note-addresses.mjs +143 -35
- package/engine/note-claims.mjs +14 -28
- package/engine/note-dates.mjs +3 -3
- package/engine/note-frontmatter.mjs +6 -0
- package/engine/note-ids.mjs +8 -14
- package/engine/note-package.mjs +8 -25
- package/engine/note-state.mjs +1 -3
- package/engine/note-vocabulary.mjs +148 -84
- package/engine/number-words.mjs +12 -1
- package/engine/pack-config.mjs +15 -25
- package/engine/pack-router.mjs +10 -16
- package/engine/pathnames.mjs +8 -22
- package/engine/pdf-build.mjs +773 -121
- package/engine/pdf-coverage.mjs +188 -0
- package/engine/pdf-index.mjs +54 -7
- package/engine/pdf-pages.mjs +247 -0
- package/engine/pdf-render.mjs +114 -4
- package/engine/pdf-toc.mjs +29 -32
- package/engine/project-init.mjs +46 -6
- package/engine/prose-config.mjs +1 -1
- package/engine/prose-lint.mjs +52 -88
- package/engine/readability-lint.mjs +9 -0
- package/engine/reckoning-markers.mjs +12 -1
- package/engine/reference-targets.mjs +7 -0
- package/engine/runtime-only-fields.mjs +5 -8
- package/engine/scene-levels.mjs +2 -2
- package/engine/scenes.mjs +1 -1
- package/engine/shortcode-references.mjs +7 -0
- package/engine/site-build.mjs +30 -16
- package/engine/site-index.mjs +10 -16
- package/engine/site-preview.mjs +6 -0
- package/engine/site-root.mjs +8 -1
- package/engine/social-tie-terms.mjs +12 -1
- package/engine/social-ties.mjs +3 -0
- package/engine/sql-tables.mjs +56 -20
- package/engine/standing-terms.mjs +11 -1
- package/engine/standings.mjs +11 -27
- package/engine/system-block.mjs +39 -141
- package/engine/system-vocabulary.mjs +6 -0
- package/engine/walk-files.mjs +69 -0
- package/engine/web-wikilinks.mjs +23 -3
- package/engine/wikilink-syntax.mjs +32 -21
- package/engine/wikilinks.mjs +27 -16
- package/engine/yaml-lint.mjs +7 -4
- package/githooks/attribution.mjs +8 -0
- package/githooks/commit-message.mjs +9 -0
- package/hm3/actors.mjs +9 -48
- package/hm3/default-item-art.mjs +9 -9
- package/hm3/item-fields.mjs +2 -9
- package/hm3/template-priority.mjs +6 -7
- package/hugo-theme/data/banner-kinds.yaml +78 -0
- package/hugo-theme/data/banners.yaml +2 -3
- package/hugo-theme/layouts/404.html +3 -3
- package/hugo-theme/layouts/partials/banner-url.html +31 -7
- package/hugo-theme/layouts/partials/hero-banner.html +13 -14
- package/hugo-theme/layouts/partials/related.html +1 -1
- package/hugo-theme/layouts/partials/warn-missing-banner.html +1 -1
- package/hugo-theme/static/css/style.css +1 -1
- package/manifest.mjs +11 -4
- package/markdownlint-config.mjs +1 -1
- package/package.json +6 -3
- package/release.mjs +83 -18
- package/sohl/actors.mjs +16 -27
- package/sohl/default-item-art.mjs +3 -3
- package/sohl/document-subtypes.mjs +1 -16
- package/sohl/infobox.mjs +2 -3
- package/sohl/item-builders.mjs +5 -8
- package/sohl/item-fields.mjs +5 -35
- package/sohl/items.mjs +0 -4
- package/sohl/kb-passes.mjs +3 -3
- package/types/container.d.mts +116 -5
- package/types/content-config.d.mts +83 -35
- package/types/deploy.d.mts +42 -6
- package/types/e2e.d.mts +35 -3
- package/types/engine/address-charset.d.mts +4 -17
- package/types/engine/address.d.mts +17 -8
- package/types/engine/art-fields.d.mts +7 -4
- package/types/engine/art-slots.d.mts +6 -0
- package/types/engine/base-compiler.d.mts +15 -17
- package/types/engine/content-address.d.mts +9 -12
- package/types/engine/content-embeds.d.mts +4 -2
- package/types/engine/content-format-check.d.mts +0 -64
- package/types/engine/content-index.d.mts +82 -3
- package/types/engine/content-links.d.mts +2 -4
- package/types/engine/culture-choice.d.mts +51 -8
- package/types/engine/data-keys.d.mts +2 -2
- package/types/engine/derived-fields.d.mts +1 -2
- package/types/engine/diagnostics.d.mts +27 -4
- package/types/engine/document-subtypes.d.mts +12 -31
- package/types/engine/event-views.d.mts +14 -2
- package/types/engine/exported-scene.d.mts +3 -2
- package/types/engine/field-spec.d.mts +13 -122
- package/types/engine/folder-notes.d.mts +0 -39
- package/types/engine/foreign-catalog.d.mts +2 -1
- package/types/engine/foundry-entries.d.mts +4 -5
- package/types/engine/frontmatter-lint.d.mts +2 -2
- package/types/engine/frontmatter.d.mts +19 -45
- package/types/engine/generate.d.mts +1 -1
- package/types/engine/helpers.d.mts +25 -42
- package/types/engine/homepage.d.mts +3 -10
- package/types/engine/ids.d.mts +0 -114
- package/types/engine/index-records.d.mts +6 -4
- package/types/engine/index.d.mts +0 -1
- package/types/engine/infobox-render.d.mts +7 -1
- package/types/engine/infobox.d.mts +3 -2
- package/types/engine/item-docs.d.mts +1 -1
- package/types/engine/item-registry.d.mts +2 -4
- package/types/engine/literature-notes.d.mts +1 -1
- package/types/engine/markdownlint-run.d.mts +40 -0
- package/types/engine/metadata-index.d.mts +9 -1
- package/types/engine/note-addresses.d.mts +27 -2
- package/types/engine/note-claims.d.mts +3 -5
- package/types/engine/note-ids.d.mts +2 -4
- package/types/engine/note-package.d.mts +1 -1
- package/types/engine/note-state.d.mts +1 -3
- package/types/engine/note-vocabulary.d.mts +28 -21
- package/types/engine/pack-config.d.mts +2 -6
- package/types/engine/pack-router.d.mts +4 -4
- package/types/engine/pathnames.d.mts +3 -3
- package/types/engine/pdf-build.d.mts +98 -12
- package/types/engine/pdf-coverage.d.mts +60 -0
- package/types/engine/pdf-index.d.mts +34 -5
- package/types/engine/pdf-pages.d.mts +143 -0
- package/types/engine/pdf-render.d.mts +45 -1
- package/types/engine/pdf-toc.d.mts +12 -14
- package/types/engine/prose-config.d.mts +1 -1
- package/types/engine/prose-lint.d.mts +11 -10
- package/types/engine/runtime-only-fields.d.mts +2 -2
- package/types/engine/site-build.d.mts +9 -5
- package/types/engine/site-index.d.mts +4 -5
- package/types/engine/site-root.d.mts +1 -1
- package/types/engine/sql-tables.d.mts +31 -2
- package/types/engine/standing-terms.d.mts +2 -1
- package/types/engine/standings.d.mts +7 -9
- package/types/engine/system-block.d.mts +10 -44
- package/types/engine/walk-files.d.mts +15 -0
- package/types/engine/wikilink-syntax.d.mts +18 -19
- package/types/engine/yaml-lint.d.mts +5 -4
- package/types/hm3/actors.d.mts +1 -2
- package/types/hm3/item-fields.d.mts +2 -4
- package/types/hm3/template-priority.d.mts +6 -7
- package/types/manifest.d.mts +3 -2
- package/types/release.d.mts +12 -7
- package/types/sohl/actors.d.mts +2 -1
- package/types/sohl/document-subtypes.d.mts +1 -2
- package/types/sohl/item-fields.d.mts +3 -7
- package/engine/retired-fields.mjs +0 -631
- package/types/engine/retired-fields.d.mts +0 -354
|
@@ -54,6 +54,33 @@ also builds a PDF beside the archive. Book findings are reported without
|
|
|
54
54
|
discarding the installable archive. `package-build release --no-pdf` skips the
|
|
55
55
|
book step. The [book guide](book.md) covers selecting and checking its pages.
|
|
56
56
|
|
|
57
|
+
### Release assets
|
|
58
|
+
|
|
59
|
+
A package that declares several books in `pdf.books` publishes all of them
|
|
60
|
+
with its release. Each book is its own PDF in `pdf.out` (default
|
|
61
|
+
`build/dist`), named `<out stem>-<version>.pdf`: the stem is the book's `out`, which defaults to
|
|
62
|
+
`<contentPackage>-<id>`, and the version is the package version. A package
|
|
63
|
+
declaring `core` and `vedyara` under the content package `thalorna` releases
|
|
64
|
+
`thalorna-core-1.4.0.pdf` and `thalorna-vedyara-1.4.0.pdf`, beside the Foundry
|
|
65
|
+
archive and manifest. The release workflow attaches exactly the files
|
|
66
|
+
`package-build pdf --list-assets` names. A declared book whose file is missing
|
|
67
|
+
or empty fails the release; a package with one book attaches one.
|
|
68
|
+
|
|
69
|
+
The release notes are the top section of `CHANGELOG.md`. When the package
|
|
70
|
+
declares books, they end with a **Books** section: one line per book, in
|
|
71
|
+
`pdf.books` order, giving its title and the file attached for it.
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
**Books**
|
|
75
|
+
|
|
76
|
+
- The World of Thalorna: `thalorna-core-1.4.0.pdf`
|
|
77
|
+
- Vedyara: `thalorna-vedyara-1.4.0.pdf`
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`package-build pdf --list-assets --book-version <version>` prints each book's
|
|
81
|
+
`id`, `title` and output path as JSON without building anything, which is how
|
|
82
|
+
the workflow derives both the attachments and the lines. A package with no books gets no Books section.
|
|
83
|
+
|
|
57
84
|
The repository's build scripts decide how the staged tree is assembled. A
|
|
58
85
|
typical content build runs `package-build content-index`,
|
|
59
86
|
`package-build assets`, `package-build package compile`, and
|
|
@@ -89,6 +116,11 @@ for the package. Paths in `.env.local` are literal: `~` and shell variables
|
|
|
89
116
|
are not expanded. Keep stage paths pointed at distinct Foundry data roots.
|
|
90
117
|
The deploy command stages a complete copy beside the installed package and
|
|
91
118
|
swaps it into place, so it does not rewrite open LevelDB files one by one.
|
|
119
|
+
It then removes the previous tree, and any an earlier deploy left behind;
|
|
120
|
+
files Foundry's container wrote there are
|
|
121
|
+
removed through a throwaway container of the stage's image, and a tree that
|
|
122
|
+
still cannot be removed is reported as a warning naming it, without failing the
|
|
123
|
+
deploy.
|
|
92
124
|
For a remote destination it uses the SSH agent unless the stage names an
|
|
93
125
|
explicit key. The `container` command manages the Foundry Docker instance for
|
|
94
126
|
the same stage;
|
|
@@ -105,12 +137,28 @@ change is minor; an optional command, flag, or key is patch. A major bump
|
|
|
105
137
|
requires the maintainer's direct decision. `package-build changelog check`
|
|
106
138
|
checks the quality of any pending changeset.
|
|
107
139
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
140
|
+
The repository's primary forge is Gitea, and GitHub is its push mirror. The
|
|
141
|
+
release runs in two halves, one on each:
|
|
142
|
+
|
|
143
|
+
1. **Version, on Gitea.** Merging a changeset to `main` runs
|
|
144
|
+
`.gitea/workflows/release.yml`, which opens or updates the **Version
|
|
145
|
+
Packages** pull request. Its generated changelog section is reviewed as the
|
|
146
|
+
release note. Merging that pull request runs the same workflow again, which
|
|
147
|
+
pushes the tag `v<version>` at the merged version commit. Releasing from
|
|
148
|
+
Gitea is switched on by the repository variable `HL_RELEASE_ENABLED`.
|
|
149
|
+
2. **Publish, on GitHub.** The push mirror carries the tag to GitHub, where it
|
|
150
|
+
starts the **Publish to npm** workflow, `.github/workflows/release.yml`. It
|
|
151
|
+
refuses a tag that names a commit outside `main` or that is not
|
|
152
|
+
`v<version>` of the tagged `package.json`. When npm does not have the
|
|
153
|
+
version yet, it runs the tests and publishes through npm Trusted Publishing
|
|
154
|
+
with provenance. It then creates the GitHub Release from the version's
|
|
155
|
+
changelog section, unless one exists.
|
|
156
|
+
|
|
157
|
+
Nothing on Gitea publishes to npm, and nothing on GitHub runs for a branch
|
|
158
|
+
push. Every step of the GitHub half is safe to repeat: re-running it, or
|
|
159
|
+
dispatching it with the tag as its ref, finishes a release whose publish or
|
|
160
|
+
Release step failed and changes nothing for one that completed. The
|
|
161
|
+
[npm package page](https://www.npmjs.com/package/@heroiclands/package-build)
|
|
114
162
|
shows the published version and README.
|
|
115
163
|
|
|
116
164
|
Two scripts in this repository's own `package.json` run the same steps at a
|
package/docs/guides/site.md
CHANGED
|
@@ -153,7 +153,7 @@ tree rather than about one note, so the build replaces whatever a note wrote.
|
|
|
153
153
|
|
|
154
154
|
Artwork addresses are rewritten in place under `data`. A page's `data.icon`,
|
|
155
155
|
`data.tokenIcon` and `data.banner` carry the URLs the site serves rather than the
|
|
156
|
-
addresses the note authored, and there are
|
|
156
|
+
addresses the note authored, and there are five cases to tell apart:
|
|
157
157
|
|
|
158
158
|
| The note writes | The page carries |
|
|
159
159
|
| ---------------------------- | ---------------- |
|
|
@@ -161,12 +161,15 @@ addresses the note authored, and there are four cases to tell apart:
|
|
|
161
161
|
| an address nothing answers | no key at all |
|
|
162
162
|
| `null` | `null` |
|
|
163
163
|
| `""` | `""` |
|
|
164
|
+
| `data.banner: none` | `""` |
|
|
164
165
|
|
|
165
166
|
An address nothing answers is deleted rather than written through, so an absent
|
|
166
167
|
key is the ordinary case for a theme to render nothing against, and no page
|
|
167
168
|
reaches a reader carrying a broken image source. The two empties are distinct
|
|
168
169
|
and both survive: `null` is a note naming no art, where a default may apply,
|
|
169
|
-
and `""` is a note refusing art, where no default may replace it.
|
|
170
|
+
and `""` is a note refusing art, where no default may replace it. A note
|
|
171
|
+
writes `none` to refuse a hero image, since `""` is an error in authored
|
|
172
|
+
frontmatter.
|
|
170
173
|
|
|
171
174
|
The build writes these keys; [what the theme draws](../reference/theme-pages.md)
|
|
172
175
|
describes the panel each one feeds — the infobox, the hero band, the related
|
package/docs/project-setup.md
CHANGED
|
@@ -229,7 +229,7 @@ git worktree where `node_modules` is already correct.
|
|
|
229
229
|
|
|
230
230
|
`build:stage-reset` clears only the assembled Foundry package. Keep it before
|
|
231
231
|
every stage writer, including a repository's own code or stylesheet bundle
|
|
232
|
-
step. This keeps
|
|
232
|
+
step. This keeps moved and deleted files out of the next package while
|
|
233
233
|
preserving the content index and other generated outputs.
|
|
234
234
|
|
|
235
235
|
Within the chain, two orderings are real:
|
|
@@ -349,15 +349,35 @@ options the toolchain applies — without it they fall back to Prettier's own
|
|
|
349
349
|
defaults, and a print width that differs from the project's turns every
|
|
350
350
|
save into a diff the lint chain reverts.
|
|
351
351
|
|
|
352
|
-
`package-build markdown` needs no equivalent file: it
|
|
353
|
-
|
|
354
|
-
`.markdownlint-cli2.jsonc`
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
352
|
+
`package-build markdown` needs no equivalent file: it applies the shared rule
|
|
353
|
+
set through the markdownlint library, and a repository that declares nothing
|
|
354
|
+
gets it. A `.markdownlint-cli2.jsonc` (or `.yaml`, `.cjs`, `.mjs`) at the
|
|
355
|
+
repository root overrides it and is what the editor's markdownlint extension
|
|
356
|
+
reads, and [`@heroiclands/package-build/markdownlint`](api.md) is the export it
|
|
357
|
+
re-uses — with one trap worth knowing before writing one. A consumer file
|
|
358
|
+
overrides the shared configuration **key by key, and each key wholesale**:
|
|
359
|
+
declaring only `ignores` keeps every rule intact but _replaces_ the shared ignore
|
|
360
|
+
list rather than extending it, so such a file must restate `CHANGELOG.md` if it
|
|
361
|
+
still wants that file excluded. The command always excludes `node_modules` and
|
|
362
|
+
`.git`.
|
|
363
|
+
|
|
364
|
+
The options file accepts a closed set of keys, and any other key is refused with
|
|
365
|
+
a located diagnostic:
|
|
366
|
+
|
|
367
|
+
| Key | Where | Meaning |
|
|
368
|
+
| ---------------- | -------------------- | ------------------------------------------------------------------------- |
|
|
369
|
+
| `config` | any directory | Rule settings, merged rule by rule over the settings above it. |
|
|
370
|
+
| `customRules` | any directory | Module ids (resolved from that directory) or rule objects to add. |
|
|
371
|
+
| `frontMatter` | any directory | Regular expression source matching a front matter block. |
|
|
372
|
+
| `ignores` | any directory | Globs, relative to that directory, whose files are skipped. |
|
|
373
|
+
| `noInlineConfig` | any directory | `true` to disregard `<!-- markdownlint-... -->` comments. |
|
|
374
|
+
| `globs` | repository root only | Globs of files to lint, in addition to `**/*.md` when no paths are named. |
|
|
375
|
+
| `gitignore` | repository root only | `false` to lint files that `.gitignore` files exclude; `true` by default. |
|
|
376
|
+
|
|
377
|
+
An options file in a subdirectory applies to that directory and below, merged
|
|
378
|
+
over the root's. A `.markdownlint.jsonc`, `.json`, `.yaml`, `.yml`, `.cjs` or
|
|
379
|
+
`.mjs` file holds a rule `config` directly and replaces the merged `config` for
|
|
380
|
+
its directory.
|
|
361
381
|
|
|
362
382
|
## `.prettierignore`
|
|
363
383
|
|