@heroiclands/package-build 22.0.3 → 22.1.1
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 +66 -0
- package/CONTENT.md +56 -18
- package/README.md +1 -1
- package/bin/content-build.mjs +67 -23
- package/bin/package-build.mjs +3 -2
- package/config.mjs +52 -1
- package/content-config.mjs +264 -8
- package/docs/api.md +33 -30
- package/docs/commands.md +68 -32
- package/docs/configuration.md +276 -62
- package/docs/getting-started.md +15 -4
- package/docs/project-setup.md +45 -20
- package/engine/content-links.mjs +19 -9
- package/engine/helpers.mjs +2 -1
- package/engine/metadata-index.mjs +32 -0
- package/engine/note-vocabulary.mjs +20 -0
- package/engine/pack-config.mjs +21 -2
- package/engine/site-build.mjs +29 -55
- package/engine/site-config.mjs +503 -0
- package/engine/site-index.mjs +10 -1
- package/engine/web-wikilinks.mjs +16 -6
- package/engine/wikilink-syntax.mjs +10 -0
- package/engine/wikilinks.mjs +34 -7
- package/manifest.mjs +12 -7
- package/package.json +2 -1
- package/stage.mjs +4 -3
- package/types/config.d.mts +24 -0
- package/types/content-config.d.mts +64 -0
- package/types/engine/content-links.d.mts +3 -2
- package/types/engine/metadata-index.d.mts +22 -0
- package/types/engine/note-vocabulary.d.mts +12 -0
- package/types/engine/site-build.d.mts +8 -26
- package/types/engine/site-config.d.mts +236 -0
- package/types/engine/site-index.d.mts +6 -1
- package/types/engine/web-wikilinks.d.mts +9 -5
- package/types/engine/wikilink-syntax.d.mts +3 -0
- package/types/engine/wikilinks.d.mts +16 -5
- package/types/manifest.d.mts +4 -4
- package/types/stage.d.mts +4 -3
package/docs/commands.md
CHANGED
|
@@ -987,17 +987,28 @@ content-build deps fetch [--from <zip|dir>] [--id <id>]
|
|
|
987
987
|
|
|
988
988
|
**DESCRIPTION**
|
|
989
989
|
|
|
990
|
-
The only action is `fetch`, which fills
|
|
991
|
-
declared dependency,
|
|
992
|
-
declare `itemCatalog: true
|
|
993
|
-
`
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
990
|
+
The only action is `fetch`, which fills three caches under `build/cache/`:
|
|
991
|
+
the **content index** of every declared dependency, the **item catalogue**
|
|
992
|
+
of those that additionally declare `itemCatalog: true`, and the **site
|
|
993
|
+
navigation** — `https://www.heroiclands.org/nav.json`, the header menu
|
|
994
|
+
every package site renders, fetched for every package because every package
|
|
995
|
+
publishes a site. Its own command rather than a step of `package compile`
|
|
996
|
+
or `site`, so neither reaches the network — a build that downloads silently
|
|
997
|
+
is not reproducible and hides a dependency's version change behind a
|
|
998
|
+
passing run. Each cache is stamped complete only once its fetch finishes,
|
|
999
|
+
so a half-finished one reads as cold.
|
|
1000
|
+
|
|
1001
|
+
The navigation is fetched first, because every package needs it and it
|
|
1002
|
+
depends on nothing a repository declares — so a dependency whose release
|
|
1003
|
+
cannot be read stops the run with the navigation already cached.
|
|
1004
|
+
|
|
1005
|
+
`--from` fills the cache from a locally built artifact — a package zip, or
|
|
1006
|
+
the directory it was built from — instead of a release, which is what makes
|
|
1007
|
+
testing a dependency change against its consumers possible before any of it
|
|
1008
|
+
ships; `--id` names which declared dependency `--from` supplies, needed only
|
|
1009
|
+
when the repository declares more than one. `--from` fills that one
|
|
1010
|
+
dependency's caches and nothing else: the navigation is not an artifact of
|
|
1011
|
+
any dependency, and is fetched by a plain `deps fetch`.
|
|
1001
1012
|
|
|
1002
1013
|
**OPTIONS**
|
|
1003
1014
|
|
|
@@ -1016,6 +1027,7 @@ including when the repository declares no dependencies at all.
|
|
|
1016
1027
|
|
|
1017
1028
|
```
|
|
1018
1029
|
$ content-build deps fetch
|
|
1030
|
+
[…] Fetched the site navigation to build/cache/navigation/nav.json.
|
|
1019
1031
|
[…] No relationship declares `itemCatalog: true`; nothing to fetch.
|
|
1020
1032
|
[…] This package declares no dependencies.
|
|
1021
1033
|
|
|
@@ -1025,7 +1037,7 @@ $ content-build deps fetch --from build/dist/module.zip
|
|
|
1025
1037
|
|
|
1026
1038
|
**SEE ALSO**
|
|
1027
1039
|
|
|
1028
|
-
`content-build addresses diff`, [Configuration](configuration.md).
|
|
1040
|
+
`content-build site`, `content-build addresses diff`, [Configuration](configuration.md).
|
|
1029
1041
|
|
|
1030
1042
|
### `content-build docs item-fields`
|
|
1031
1043
|
|
|
@@ -1515,54 +1527,78 @@ $ content-build content-index
|
|
|
1515
1527
|
|
|
1516
1528
|
**NAME**
|
|
1517
1529
|
|
|
1518
|
-
|
|
1530
|
+
Build the Hugo source tree from the content tree.
|
|
1519
1531
|
|
|
1520
1532
|
**SYNOPSIS**
|
|
1521
1533
|
|
|
1522
1534
|
```
|
|
1523
|
-
content-build site
|
|
1535
|
+
content-build site
|
|
1524
1536
|
```
|
|
1525
1537
|
|
|
1526
1538
|
**DESCRIPTION**
|
|
1527
1539
|
|
|
1528
|
-
|
|
1540
|
+
Writes the whole Hugo source tree under `build/hugo/` — the sibling of
|
|
1529
1541
|
`package compile`: the same tree, rendered as pages instead of compiled
|
|
1530
1542
|
into packs. Everything a consumer would otherwise write for itself happens
|
|
1531
1543
|
here: the walk, address derivation, the address index, table expansion,
|
|
1532
|
-
wikilink resolution, code-fence protection, the foreign-manifest merge
|
|
1533
|
-
|
|
1534
|
-
|
|
1544
|
+
wikilink resolution, code-fence protection, the foreign-manifest merge, the
|
|
1545
|
+
section-landing backfill, and the Hugo configuration itself. The consumer's
|
|
1546
|
+
script then runs Hugo over the tree — `hugo --source build/hugo` — and this
|
|
1547
|
+
command never does.
|
|
1548
|
+
|
|
1549
|
+
Three things are written, and nothing outside `build/`:
|
|
1550
|
+
|
|
1551
|
+
- `build/hugo/hugo.toml`, generated on every run from `package.json`
|
|
1552
|
+
(`homepage`, `description`, `author`), `package-build.config.yaml`
|
|
1553
|
+
(`packageBuild.manifest.title`, `site.assets`, `site.list`,
|
|
1554
|
+
`site.notfound`, `site.hugo`), the organisation's constants, the installed
|
|
1555
|
+
`@heroiclands/hugo-theme`'s location, and the navigation `deps fetch`
|
|
1556
|
+
cached. Every value's source is listed under
|
|
1557
|
+
[the generated Hugo configuration](configuration.md#the-generated-hugo-configuration).
|
|
1558
|
+
- `build/hugo/content/`, the content mount — the homepage at its root, and
|
|
1559
|
+
the content tree's pages below `publish.address.prefix`. Wiped on every
|
|
1560
|
+
run.
|
|
1561
|
+
- `publishDir` pointing Hugo at `build/site/<contentPackage>/`, the
|
|
1562
|
+
deployment root `package-build site-root` writes beside. Nothing Hugo
|
|
1563
|
+
reads lands in what is published.
|
|
1564
|
+
|
|
1565
|
+
The configuration's sources are read before the output tree is touched, so
|
|
1566
|
+
a missing `homepage`, a cold navigation cache or an uninstalled theme fails
|
|
1567
|
+
with the previous site intact. Every gate is then checked and reported, and
|
|
1568
|
+
the run stops at the first that fires, ordered so the report names the cause
|
|
1535
1569
|
rather than its symptoms — an unusable dependency manifest, reported after
|
|
1536
1570
|
the links that failed because of it, would otherwise read as a pile of
|
|
1537
|
-
broken notes. Reads the content tree named by `paths.content
|
|
1538
|
-
`--out`, defaulting to the configured `site.out`, which is wiped on every
|
|
1539
|
-
run.
|
|
1571
|
+
broken notes. Reads the content tree named by `paths.content`.
|
|
1540
1572
|
|
|
1541
1573
|
**OPTIONS**
|
|
1542
1574
|
|
|
1543
|
-
|
|
1544
|
-
| ------- | ------ | ------------------------- | -------------------------------------------------------- |
|
|
1545
|
-
| `--out` | string | the configured `site.out` | Write the mount here instead of the configured location. |
|
|
1575
|
+
None.
|
|
1546
1576
|
|
|
1547
1577
|
**EXIT STATUS**
|
|
1548
1578
|
|
|
1549
|
-
1 if `
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1579
|
+
1 if `package.json` declares no `homepage`, or one that does not end
|
|
1580
|
+
`/<contentPackage>/`; if `packageBuild.manifest.title` is undeclared; if the
|
|
1581
|
+
navigation has not been fetched (`content-build deps fetch` fills the cache
|
|
1582
|
+
and is named in the message); or if `@heroiclands/hugo-theme` is not
|
|
1583
|
+
installed. 1 if any gate fires — no homepage or two competing for it, a
|
|
1584
|
+
frontmatter wikilink, an address that cannot be derived, a stale or
|
|
1585
|
+
unaddressable dependency manifest, an address published twice, a table that
|
|
1586
|
+
failed to expand, or a dead wikilink. Otherwise 0.
|
|
1555
1587
|
|
|
1556
1588
|
**EXAMPLES**
|
|
1557
1589
|
|
|
1558
1590
|
```
|
|
1559
1591
|
$ content-build site
|
|
1560
|
-
[…] wrote 1 homepage(s) + 1 content page(s) + 0 tree page(s) + 0 landing(s) to build/
|
|
1592
|
+
[…] wrote 1 homepage(s) + 1 content page(s) + 0 tree page(s) + 0 landing(s) to build/hugo/content
|
|
1593
|
+
[…] wrote build/hugo/hugo.toml
|
|
1594
|
+
|
|
1595
|
+
$ content-build site
|
|
1596
|
+
[…] ERROR: the site navigation has not been fetched. Run `content-build deps fetch` first.
|
|
1561
1597
|
```
|
|
1562
1598
|
|
|
1563
1599
|
**SEE ALSO**
|
|
1564
1600
|
|
|
1565
|
-
`content-build package <action> [pack] [entry]`, `content-build pdf`, `content-build content-index [root]`,
|
|
1601
|
+
`content-build deps fetch`, `package-build site-root`, `content-build package <action> [pack] [entry]`, `content-build pdf`, `content-build content-index [root]`,
|
|
1566
1602
|
[Diagnostics](diagnostics.md), [Configuration](configuration.md).
|
|
1567
1603
|
|
|
1568
1604
|
### `content-build pdf`
|