@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.
- package/CHANGELOG.md +103 -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/itinerary-scenes.mjs +4 -2
- 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/map-raster.mjs +4 -2
- 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/project-setup.md
CHANGED
|
@@ -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/` | `
|
|
46
|
-
| `build/stage/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/` | `
|
|
49
|
-
| `build/cache/foreign/` | `
|
|
50
|
-
| `build/cache/metadata/` | `
|
|
51
|
-
| `build/tmp/packs/` | `
|
|
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
|
|
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
|
|
136
|
-
|
|
137
|
-
`
|
|
138
|
-
|
|
139
|
-
|
|
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": "
|
|
163
|
-
"lint:markdown": "
|
|
164
|
-
"lint:markdown:fix": "
|
|
165
|
-
"lint:addresses": "
|
|
166
|
-
"lint:content-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": "
|
|
216
|
+
"build:content-index": "package-build content-index",
|
|
208
217
|
"build:assets": "package-build assets",
|
|
209
|
-
"build:compiledb": "
|
|
210
|
-
"build:unpackdb": "
|
|
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": "
|
|
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": "
|
|
246
|
-
"format:check": "
|
|
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": "
|
|
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 `
|
|
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": "
|
|
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
|
-
`
|
|
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
|
|
341
|
-
|
|
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
|
-
`
|
|
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
|
-
`
|
|
403
|
-
`
|
|
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` | `
|
|
519
|
-
| `.prettierignore` | `
|
|
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`. |
|