@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/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 the **content index** of every
991
- declared dependency, and the **item catalogue** of those that additionally
992
- declare `itemCatalog: true`. Its own command rather than a step of
993
- `package compile`, so a compile never reaches the network — a build that
994
- downloads silently is not reproducible and hides a dependency's version
995
- change behind a passing run. `--from` fills the cache from a locally built
996
- artifact a package zip, or the directory it was built from instead of a
997
- release, which is what makes testing a dependency change against its
998
- consumers possible before any of it ships; `--id` names which declared
999
- dependency `--from` supplies, needed only when the repository declares more
1000
- than one. Writes into the configured foreign-cache directory.
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
- Publish the content tree as a Hugo content mount.
1530
+ Build the Hugo source tree from the content tree.
1519
1531
 
1520
1532
  **SYNOPSIS**
1521
1533
 
1522
1534
  ```
1523
- content-build site [--out <dir>]
1535
+ content-build site
1524
1536
  ```
1525
1537
 
1526
1538
  **DESCRIPTION**
1527
1539
 
1528
- Publishes the content tree as a Hugo content mount — the sibling of
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 and
1533
- the section-landing backfill. Every gate is checked and reported, and the
1534
- run stops at the first that fires, ordered so the report names the cause
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`; writes into
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
- | Option | Type | Default | Description |
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 `site.out` is unset and `--out` is not given (an unset output would
1550
- resolve to the repository root, which this command refuses to wipe). 1 if
1551
- any gate fires no homepage or two competing for it, a frontmatter
1552
- wikilink, an address that cannot be derived, a stale or unaddressable
1553
- dependency manifest, an address published twice, a table that failed to
1554
- expand, or a dead wikilink. Otherwise 0.
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/site
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`