@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.
@@ -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;