@heroiclands/package-build 0.6.0 → 3.0.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-content-build.md +965 -0
- package/CHANGELOG.md +95 -0
- package/CONTENT.md +824 -0
- package/MIGRATING.md +127 -0
- package/README.md +29 -17
- package/bin/content-build.mjs +1082 -0
- package/bin/package-build.mjs +2 -2
- package/bin/report.mjs +2 -2
- package/config.mjs +21 -18
- package/content-config.mjs +1424 -0
- package/coverage.mjs +1 -1
- package/e2e.mjs +1 -1
- package/engine/abbreviations.mjs +0 -0
- package/engine/base-compiler.mjs +608 -0
- package/engine/code-fences.mjs +311 -0
- package/engine/compendiums.mjs +353 -0
- package/engine/content-address.mjs +141 -0
- package/engine/content-links.mjs +438 -0
- package/engine/content-lint.mjs +204 -0
- package/engine/content-package.mjs +67 -0
- package/engine/content-slug.mjs +169 -0
- package/engine/content-tables.mjs +1216 -0
- package/engine/content-tree.mjs +56 -0
- package/engine/diagnostics.mjs +270 -0
- package/engine/field-reference.mjs +242 -0
- package/engine/field-spec.mjs +218 -0
- package/engine/foreign-catalog.mjs +450 -0
- package/engine/foreign-manifests.mjs +129 -0
- package/engine/frontmatter-lint.mjs +343 -0
- package/engine/frontmatter.mjs +258 -0
- package/engine/generate.mjs +305 -0
- package/engine/helpers.mjs +809 -0
- package/engine/ids.mjs +192 -0
- package/engine/index.mjs +142 -0
- package/engine/item-docs.mjs +153 -0
- package/engine/item-registry.mjs +129 -0
- package/engine/journals.mjs +374 -0
- package/engine/kb-manifest.mjs +473 -0
- package/engine/macros.mjs +333 -0
- package/engine/manifest-emit.mjs +339 -0
- package/engine/map-notes.mjs +1302 -0
- package/engine/pack-config.mjs +479 -0
- package/engine/pack-router.mjs +254 -0
- package/engine/prose-config.mjs +238 -0
- package/engine/prose-lint.mjs +294 -0
- package/engine/region-events.mjs +79 -0
- package/engine/scene-levels.mjs +420 -0
- package/engine/scenes.mjs +528 -0
- package/engine/site-build.mjs +778 -0
- package/engine/site-index.mjs +332 -0
- package/engine/web-wikilinks.mjs +330 -0
- package/engine/wikilink-syntax.mjs +105 -0
- package/engine/wikilinks.mjs +645 -0
- package/index.mjs +42 -25
- package/lang.mjs +1 -1
- package/manifest.mjs +79 -5
- package/markdownlint-config.mjs +45 -0
- package/package.json +78 -34
- package/prettier-config.mjs +34 -0
- package/sohl/actors.mjs +581 -0
- package/sohl/affiliation-standings.mjs +44 -0
- package/sohl/being-info.mjs +173 -0
- package/sohl/default-item-art.mjs +82 -0
- package/sohl/index.mjs +55 -0
- package/sohl/item-builders.mjs +114 -0
- package/sohl/item-fields.mjs +867 -0
- package/sohl/items.mjs +197 -0
- package/sohl/kb-passes.mjs +207 -0
- package/sohl/note-schemas.mjs +322 -0
- package/templates.mjs +1 -1
- package/types/config.d.mts +1 -1
- package/types/content-config.d.mts +571 -0
- package/types/engine/abbreviations.d.mts +44 -0
- package/types/engine/base-compiler.d.mts +320 -0
- package/types/engine/code-fences.d.mts +102 -0
- package/types/engine/compendiums.d.mts +77 -0
- package/types/engine/content-address.d.mts +61 -0
- package/types/engine/content-links.d.mts +87 -0
- package/types/engine/content-lint.d.mts +47 -0
- package/types/engine/content-package.d.mts +36 -0
- package/types/engine/content-slug.d.mts +59 -0
- package/types/engine/content-tables.d.mts +131 -0
- package/types/engine/content-tree.d.mts +12 -0
- package/types/engine/diagnostics.d.mts +152 -0
- package/types/engine/field-reference.d.mts +20 -0
- package/types/engine/field-spec.d.mts +181 -0
- package/types/engine/foreign-catalog.d.mts +103 -0
- package/types/engine/foreign-manifests.d.mts +43 -0
- package/types/engine/frontmatter-lint.d.mts +74 -0
- package/types/engine/frontmatter.d.mts +99 -0
- package/types/engine/generate.d.mts +56 -0
- package/types/engine/helpers.d.mts +348 -0
- package/types/engine/ids.d.mts +126 -0
- package/types/engine/index.d.mts +33 -0
- package/types/engine/item-docs.d.mts +73 -0
- package/types/engine/item-registry.d.mts +57 -0
- package/types/engine/journals.d.mts +121 -0
- package/types/engine/kb-manifest.d.mts +214 -0
- package/types/engine/macros.d.mts +201 -0
- package/types/engine/manifest-emit.d.mts +137 -0
- package/types/engine/map-notes.d.mts +283 -0
- package/types/engine/pack-config.d.mts +77 -0
- package/types/engine/pack-router.d.mts +53 -0
- package/types/engine/prose-config.d.mts +121 -0
- package/types/engine/prose-lint.d.mts +59 -0
- package/types/engine/region-events.d.mts +43 -0
- package/types/engine/scene-levels.d.mts +36 -0
- package/types/engine/scenes.d.mts +48 -0
- package/types/engine/site-build.d.mts +214 -0
- package/types/engine/site-index.d.mts +141 -0
- package/types/engine/web-wikilinks.d.mts +67 -0
- package/types/engine/wikilink-syntax.d.mts +101 -0
- package/types/engine/wikilinks.d.mts +172 -0
- package/types/index.d.mts +3 -0
- package/types/manifest.d.mts +52 -4
- package/types/markdownlint-config.d.mts +8 -0
- package/types/prettier-config.d.mts +1 -0
- package/types/sohl/actors.d.mts +65 -0
- package/types/sohl/affiliation-standings.d.mts +22 -0
- package/types/sohl/being-info.d.mts +78 -0
- package/types/sohl/default-item-art.d.mts +28 -0
- package/types/sohl/index.d.mts +7 -0
- package/types/sohl/item-builders.d.mts +11 -0
- package/types/sohl/item-fields.d.mts +20 -0
- package/types/sohl/items.d.mts +19 -0
- package/types/sohl/kb-passes.d.mts +71 -0
- package/types/sohl/note-schemas.d.mts +7 -0
package/bin/package-build.mjs
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*
|
|
27
27
|
* It is the same shape the configuration had before it became data: not logic,
|
|
28
28
|
* but the boilerplate a code file needs in order to state a literal. So the
|
|
29
|
-
* literals move into `
|
|
29
|
+
* literals move into `package-build.config.yaml`'s reserved `packageBuild:`
|
|
30
30
|
* section, and the boilerplate lives here, once.
|
|
31
31
|
*
|
|
32
32
|
* **Every side effect lives in this file.** argv parsing, the environment,
|
|
@@ -78,7 +78,7 @@ import yargs from "yargs";
|
|
|
78
78
|
import { hideBin } from "yargs/helpers";
|
|
79
79
|
|
|
80
80
|
import { loadPackageBuildConfig } from "../config.mjs";
|
|
81
|
-
import { loadPackConfig } from "
|
|
81
|
+
import { loadPackConfig } from "../engine/pack-config.mjs";
|
|
82
82
|
import { cleanBuildArtifacts, stageAssets } from "../stage.mjs";
|
|
83
83
|
import { validateLangSource } from "../lang.mjs";
|
|
84
84
|
import {
|
package/bin/report.mjs
CHANGED
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
*
|
|
29
29
|
* The emitted form is the toolchain's diagnostic contract —
|
|
30
30
|
* `file:line:column: severity: message`, the path starting the line, a field
|
|
31
|
-
* dropped rather than guessed — which `@heroiclands/
|
|
31
|
+
* dropped rather than guessed — which `@heroiclands/package-build` already
|
|
32
32
|
* owns. This module maps findings onto it rather than restating it, so the two
|
|
33
33
|
* packages cannot drift into two nearly-identical formats.
|
|
34
34
|
*
|
|
35
35
|
* @module
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
|
-
import { emitDiagnostic } from "
|
|
38
|
+
import { emitDiagnostic } from "../engine/diagnostics.mjs";
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* A finding as the pure rules report one.
|
package/config.mjs
CHANGED
|
@@ -15,26 +15,29 @@
|
|
|
15
15
|
* The per-repository configuration this package reads.
|
|
16
16
|
*
|
|
17
17
|
* **One repository, one configuration file.** A repository already declares
|
|
18
|
-
* itself in `
|
|
18
|
+
* itself in `package-build.config.yaml`, and two of the values this package
|
|
19
19
|
* needs — `packageKind` and `foundryPackage` — are already in it. A second file
|
|
20
20
|
* would restate them, which is two places for one fact; that is precisely what
|
|
21
21
|
* every consumer's `push-stage.mjs` did, hard-coding `packageKind: "systems"`
|
|
22
22
|
* and `packageId: "sohl"` beside a config that already said both.
|
|
23
23
|
*
|
|
24
|
-
* So
|
|
25
|
-
* takes its own settings from the
|
|
26
|
-
*
|
|
27
|
-
* reads `lang/`, `styles/`, `src/`, the assets
|
|
28
|
-
* neither validates the other's keys.
|
|
29
|
-
* a mapping and hands it back frozen;
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
24
|
+
* So the packaging half reads the *same* file, through the content half's
|
|
25
|
+
* loader (`engine/pack-config.mjs`), and takes its own settings from the
|
|
26
|
+
* `packageBuild:` section. The two halves split by **input** — the content half
|
|
27
|
+
* reads the content tree, this one reads `lang/`, `styles/`, `src/`, the assets
|
|
28
|
+
* and the manifest template — and neither validates the other's keys. The
|
|
29
|
+
* loader checks that the section is a mapping and hands it back frozen;
|
|
30
|
+
* everything inside it is validated here.
|
|
31
|
+
*
|
|
32
|
+
* **That section used to be a reservation.** Until 2.0.0 these were two
|
|
33
|
+
* packages, and `packageBuild:` was a block `@heroiclands/content-build`
|
|
34
|
+
* carried on behalf of a toolchain it knew nothing about. One package now owns
|
|
35
|
+
* the whole file, so it is an ordinary section — but the validation split is
|
|
36
|
+
* kept, because it is what stops a key being checked twice against two
|
|
37
|
+
* disagreeing ideas of what it means.
|
|
35
38
|
*
|
|
36
39
|
* ```yaml
|
|
37
|
-
* #
|
|
40
|
+
* # package-build.config.yaml
|
|
38
41
|
* packageKind: systems # read from the top level, not restated below
|
|
39
42
|
* foundryPackage: sohl
|
|
40
43
|
*
|
|
@@ -56,7 +59,7 @@
|
|
|
56
59
|
*/
|
|
57
60
|
|
|
58
61
|
import path from "node:path";
|
|
59
|
-
import { loadPackConfig } from "
|
|
62
|
+
import { loadPackConfig } from "./engine/pack-config.mjs";
|
|
60
63
|
|
|
61
64
|
/** Keys the reserved section may declare. */
|
|
62
65
|
const SECTION_KEYS = [
|
|
@@ -92,9 +95,9 @@ export const DERIVED_MANIFEST_KEYS = Object.freeze({
|
|
|
92
95
|
bugs: "package.json `repository`",
|
|
93
96
|
manifest: "package.json `repository` and the release tag",
|
|
94
97
|
download: "package.json `repository` and the release tag",
|
|
95
|
-
compatibility: "the top level of
|
|
96
|
-
relationships: "the top level of
|
|
97
|
-
packs: "the `packs` list at the top level of
|
|
98
|
+
compatibility: "the top level of package-build.config.yaml",
|
|
99
|
+
relationships: "the top level of package-build.config.yaml",
|
|
100
|
+
packs: "the `packs` list at the top level of package-build.config.yaml",
|
|
98
101
|
});
|
|
99
102
|
const ASSET_KEYS = ["from", "to"];
|
|
100
103
|
const CLEAN_KEYS = ["extra"];
|
|
@@ -496,7 +499,7 @@ function normalizeExceptions(value, field, where) {
|
|
|
496
499
|
* disk. {@link loadPackageBuildConfig} is the same function with the loading
|
|
497
500
|
* put back.
|
|
498
501
|
*
|
|
499
|
-
* @param {object} shared - The resolved content
|
|
502
|
+
* @param {object} shared - The resolved content configuration.
|
|
500
503
|
* @returns {Readonly<PackageBuildConfig>} The frozen configuration.
|
|
501
504
|
* @throws {TypeError} When the reserved section declares something malformed.
|
|
502
505
|
*/
|