@heroiclands/package-build 22.17.1 → 22.18.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 +24 -0
- package/bin/content-commands.mjs +21 -23
- package/docs/api.md +4 -14
- package/docs/authoring/frontmatter.md +2 -2
- package/docs/commands.md +19 -18
- package/docs/guides/icons.md +3 -0
- package/docs/reference/format-details.md +31 -45
- package/docs/reference/note-types.md +1 -1
- package/engine/actor-compiler.mjs +4 -5
- package/engine/address-diff.mjs +32 -279
- package/engine/art-fields.mjs +9 -11
- package/engine/content-format.yaml +4 -4
- package/engine/content-index.mjs +28 -3
- package/engine/content-lint.mjs +3 -182
- package/engine/frontmatter-lint.mjs +112 -59
- package/engine/helpers.mjs +15 -3
- package/engine/index.mjs +0 -3
- package/engine/infobox.mjs +13 -2
- package/engine/map-graphviz.mjs +4 -1
- package/engine/note-frontmatter.mjs +1 -0
- package/engine/note-vocabulary.mjs +1 -13
- package/engine/subtype-registry.mjs +2 -6
- package/engine/systems.mjs +11 -13
- package/package.json +1 -1
- package/types/engine/actor-compiler.d.mts +4 -5
- package/types/engine/address-diff.d.mts +18 -107
- package/types/engine/art-fields.d.mts +6 -8
- package/types/engine/frontmatter-lint.d.mts +14 -0
- package/types/engine/helpers.d.mts +12 -1
- package/types/engine/index.d.mts +0 -1
- package/types/engine/infobox.d.mts +3 -2
- package/types/engine/note-vocabulary.d.mts +0 -9
- package/types/engine/subtype-registry.d.mts +2 -6
- package/types/engine/systems.d.mts +6 -6
- package/engine/note-renames.mjs +0 -134
- package/types/engine/note-renames.d.mts +0 -102
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The shortcodes a note declares it used to be published under.
|
|
3
|
-
*
|
|
4
|
-
* A package's `(type, shortcode)` addresses are a published interface, and
|
|
5
|
-
* `addresses diff` reports what a build stopped publishing — telling a
|
|
6
|
-
* **rename** from a **withdrawal** by matching document ids across two
|
|
7
|
-
* releases. The property that rested on is gone: an id is derived from
|
|
8
|
-
* the canonical address, which carries the shortcode, so renaming a shortcode
|
|
9
|
-
* moves the id too: both sides of the join move together, the match finds
|
|
10
|
-
* nothing, and a rename is reported as a withdrawal with no successor named.
|
|
11
|
-
*
|
|
12
|
-
* **The remaining lever needed foresight, which is the wrong thing to ask for.**
|
|
13
|
-
* An authored `id:` still wins, and pinning one does keep a document's identity
|
|
14
|
-
* across a rename — but it has to be written *before* the rename, by an author
|
|
15
|
-
* who does not yet know they will make one. An author who has just renamed a
|
|
16
|
-
* shortcode knows exactly what the old one was, and that is the only moment
|
|
17
|
-
* anyone does.
|
|
18
|
-
*
|
|
19
|
-
* So a note states it:
|
|
20
|
-
*
|
|
21
|
-
* ```yaml
|
|
22
|
-
* type: weapongear
|
|
23
|
-
* shortcode: Taburi
|
|
24
|
-
* renamedFrom: Tabri
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* **A declaration is an assertion, not a match, and the diagnostic says which
|
|
28
|
-
* it had.** That distinction is the whole ethos of `address-diff.mjs`: it
|
|
29
|
-
* refuses to guess a successor from a similar-looking string, because a wrong
|
|
30
|
-
* one sends the reader to the wrong fix. An author's declaration is neither a
|
|
31
|
-
* guess nor an identity match — it is testimony from the one party that knows —
|
|
32
|
-
* so it is used, attributed, and never silently blended with an id match.
|
|
33
|
-
*
|
|
34
|
-
* **It is a list, because renames chain.** The diff is release-to-release and a
|
|
35
|
-
* shortcode may be renamed more than once between two releases; a baseline
|
|
36
|
-
* several releases back published a name two renames ago. A single value would
|
|
37
|
-
* report that as a withdrawal again, which is the bug this closes.
|
|
38
|
-
*
|
|
39
|
-
* **It is transient.** Once every baseline a build is compared against post-dates
|
|
40
|
-
* the rename, the declaration has nothing left to say and may be deleted. That
|
|
41
|
-
* is the difference from an `id:` pin, which is permanent, opaque, and a second
|
|
42
|
-
* identity for a thing that already has one.
|
|
43
|
-
*
|
|
44
|
-
* **It is one key per note, at the top level, however many systems the note
|
|
45
|
-
* compiles into.** A shortcode is the note's, not a system block's: a note
|
|
46
|
-
* carrying `sohl:` and `hm3:` blocks compiles into two documents that share one
|
|
47
|
-
* shortcode, so a rename moves both and one declaration covers both.
|
|
48
|
-
*
|
|
49
|
-
* This module reads the key and says nothing about whether the values are
|
|
50
|
-
* *sound* — that a value is a well-formed shortcode, is not the note's own, and
|
|
51
|
-
* does not name an address some live note still publishes are cross-note
|
|
52
|
-
* questions, and `engine/content-lint.mjs` owns them. Composing a value into an
|
|
53
|
-
* address key is likewise not here: the diff defines that space and spells the
|
|
54
|
-
* key once, in `engine/address-diff.mjs`.
|
|
55
|
-
*
|
|
56
|
-
* @module
|
|
57
|
-
*/
|
|
58
|
-
/**
|
|
59
|
-
* The `renamedFrom:` entries a note authors, exactly as authored.
|
|
60
|
-
*
|
|
61
|
-
* Scalar or list, because one predecessor is the overwhelmingly common case and
|
|
62
|
-
* requiring `- ` on it would be friction with nothing behind it; both normalize
|
|
63
|
-
* here so no reader has to ask which form it got.
|
|
64
|
-
*
|
|
65
|
-
* Entries are returned **unvalidated** — a number, a nested list, a blank
|
|
66
|
-
* string all come back as they were written. The lint needs to see them to
|
|
67
|
-
* report them, and a reader that quietly dropped them would report a correct
|
|
68
|
-
* tree clean while a typo silently did nothing.
|
|
69
|
-
*
|
|
70
|
-
* @param {object|null|undefined} fm - Parsed frontmatter.
|
|
71
|
-
* @returns {readonly unknown[]} The authored entries, in authored order; empty
|
|
72
|
-
* when the note declares none.
|
|
73
|
-
*/
|
|
74
|
-
export function renamedFromEntries(fm: object | null | undefined): readonly unknown[];
|
|
75
|
-
/**
|
|
76
|
-
* The well-formed shortcodes among a note's `renamedFrom:` entries.
|
|
77
|
-
*
|
|
78
|
-
* Trimmed, de-duplicated, and in authored order. Anything that is not a
|
|
79
|
-
* non-blank string is skipped rather than coerced: it is reported by the lint,
|
|
80
|
-
* and a diff that guessed at what a number meant would claim a rename nobody
|
|
81
|
-
* declared.
|
|
82
|
-
*
|
|
83
|
-
* De-duplicating here rather than leaving it to callers is not tidiness — the
|
|
84
|
-
* predecessor index is a map, so a repeated entry would otherwise be indexed
|
|
85
|
-
* twice and the second write would look like a conflicting claim.
|
|
86
|
-
*
|
|
87
|
-
* @param {object|null|undefined} fm - Parsed frontmatter.
|
|
88
|
-
* @returns {string[]} The declared predecessor shortcodes.
|
|
89
|
-
*/
|
|
90
|
-
export function renamedFrom(fm: object | null | undefined): string[];
|
|
91
|
-
/**
|
|
92
|
-
* Whether a note declares the key at all, however malformed its value.
|
|
93
|
-
*
|
|
94
|
-
* Separate from {@link renamedFrom} returning nothing, because the two mean
|
|
95
|
-
* opposite things to a lint: a note declaring no key is silent and correct,
|
|
96
|
-
* while one declaring `renamedFrom: []` — or a single blank string — has said
|
|
97
|
-
* something that does nothing, which is worth a word.
|
|
98
|
-
*
|
|
99
|
-
* @param {object|null|undefined} fm - Parsed frontmatter.
|
|
100
|
-
* @returns {boolean} `true` when the key is present and not null.
|
|
101
|
-
*/
|
|
102
|
-
export function declaresRenamedFrom(fm: object | null | undefined): boolean;
|