@heroiclands/package-build 22.1.1 → 22.3.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 +18 -0
- package/CONTENT.md +27 -32
- package/bin/content-build.mjs +0 -3
- package/bin/package-build.mjs +9 -26
- package/config.mjs +7 -2
- package/content-config.mjs +73 -41
- package/docs/api.md +26 -25
- package/docs/commands.md +22 -22
- package/docs/configuration.md +78 -46
- package/docs/content-format.md +36 -6
- package/engine/foundry-entries.mjs +12 -1
- package/engine/frontmatter-lint.mjs +2 -3
- package/engine/helpers.mjs +4 -1
- package/engine/ids.mjs +12 -0
- package/engine/note-claims.mjs +21 -0
- package/engine/pack-config.mjs +14 -1
- package/engine/pack-router.mjs +82 -5
- package/engine/pdf-build.mjs +2 -2
- package/engine/retired-fields.mjs +2 -3
- package/engine/schema-check.mjs +6 -6
- package/engine/site-build.mjs +59 -218
- package/engine/site-config.mjs +22 -22
- package/engine/site-index.mjs +18 -62
- package/engine/web-wikilinks.mjs +2 -16
- package/engine/wikilinks.mjs +35 -14
- package/manifest.mjs +16 -10
- package/package.json +1 -1
- package/release.mjs +41 -8
- package/sohl/kb-passes.mjs +14 -85
- package/types/config.d.mts +17 -0
- package/types/content-config.d.mts +6 -6
- package/types/engine/ids.d.mts +11 -0
- package/types/engine/pack-router.d.mts +20 -2
- package/types/engine/schema-check.d.mts +5 -5
- package/types/engine/site-build.d.mts +12 -62
- package/types/engine/site-config.d.mts +6 -8
- package/types/engine/site-index.d.mts +3 -28
- package/types/engine/web-wikilinks.d.mts +1 -1
- package/types/engine/wikilinks.d.mts +6 -3
- package/types/manifest.d.mts +5 -3
- package/types/release.d.mts +7 -6
- package/types/sohl/kb-passes.d.mts +5 -36
package/types/engine/ids.d.mts
CHANGED
|
@@ -148,6 +148,17 @@ export const MAP_SUBTYPES: readonly string[];
|
|
|
148
148
|
* @type {ReadonlySet<string>}
|
|
149
149
|
*/
|
|
150
150
|
export const JOURNAL_TYPES: ReadonlySet<string>;
|
|
151
|
+
/**
|
|
152
|
+
* The `pack:` value that routes a note's document into no compendium.
|
|
153
|
+
*
|
|
154
|
+
* One reading, on the key that already decides which compendium receives a
|
|
155
|
+
* note: the note publishes to the site and compiles into nothing. Declared
|
|
156
|
+
* here, beside the pack table, so the configuration can refuse a pack of this
|
|
157
|
+
* name and the router can read the value from one spelling.
|
|
158
|
+
*
|
|
159
|
+
* @type {string}
|
|
160
|
+
*/
|
|
161
|
+
export const NO_PACK: string;
|
|
151
162
|
/**
|
|
152
163
|
* Content type → the pack its documents compile into, and the document type
|
|
153
164
|
* that pack holds.
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a note declares `pack: none` for one system's document.
|
|
3
|
+
*
|
|
4
|
+
* The same reading {@link createPackRouter}'s `resolve` applies: the system's
|
|
5
|
+
* block wins where it declares a pack, and the shared top-level value stands
|
|
6
|
+
* otherwise. Asked with no system, it reads the shared value alone, which is
|
|
7
|
+
* what every single-system build and the content index read.
|
|
8
|
+
*
|
|
9
|
+
* Pure, so the readers that never route — the Foundry-address pass, the link
|
|
10
|
+
* index, the unclaimed-type check — can ask it without a router.
|
|
11
|
+
*
|
|
12
|
+
* @param {object} fm - The note's frontmatter.
|
|
13
|
+
* @param {string} [system] - The system whose document is asked about.
|
|
14
|
+
* @returns {boolean} True when the answer for that document is `none`.
|
|
15
|
+
*/
|
|
16
|
+
export function declaresNoPack(fm: object, system?: string): boolean;
|
|
1
17
|
/**
|
|
2
18
|
* Build the router for one configured pack list.
|
|
3
19
|
*
|
|
@@ -6,13 +22,13 @@
|
|
|
6
22
|
*
|
|
7
23
|
* @param {readonly object[]} packs - The resolved `packs` list from
|
|
8
24
|
* `defineConfig`.
|
|
9
|
-
* @returns {{resolve: (fm: object, docType: string, system?: string) => string,
|
|
25
|
+
* @returns {{resolve: (fm: object, docType: string, system?: string) => string|undefined,
|
|
10
26
|
* resolveOrNull: (fm: object, docType: string, system?: string) => string|undefined,
|
|
11
27
|
* packsOfType: (docType: string) => string[],
|
|
12
28
|
* defaultOf: (docType: string) => string|undefined}} The router.
|
|
13
29
|
*/
|
|
14
30
|
export function createPackRouter(packs: readonly object[]): {
|
|
15
|
-
resolve: (fm: object, docType: string, system?: string) => string;
|
|
31
|
+
resolve: (fm: object, docType: string, system?: string) => string | undefined;
|
|
16
32
|
resolveOrNull: (fm: object, docType: string, system?: string) => string | undefined;
|
|
17
33
|
packsOfType: (docType: string) => string[];
|
|
18
34
|
defaultOf: (docType: string) => string | undefined;
|
|
@@ -52,3 +68,5 @@ export class PackRoutingError extends Error {
|
|
|
52
68
|
* says which *compendium* receives its document.
|
|
53
69
|
*/
|
|
54
70
|
export const PACK_FIELD: "pack";
|
|
71
|
+
export { NO_PACK };
|
|
72
|
+
import { NO_PACK } from "./ids.mjs";
|
|
@@ -157,8 +157,8 @@ export function compareEmittedSystem({ system, artifact, documentType, subtype,
|
|
|
157
157
|
* Two places to find it, because a system checks itself against source it owns
|
|
158
158
|
* while a module checks against a dependency it fetched:
|
|
159
159
|
*
|
|
160
|
-
* - **A system**: its own `schema.json`, generated from its `src/`
|
|
161
|
-
*
|
|
160
|
+
* - **A system**: its own `schema.json`, generated from its `src/` into
|
|
161
|
+
* `build/` by `package-build schema`.
|
|
162
162
|
* - **A module**: the copy cached by `content-build deps fetch`, from the
|
|
163
163
|
* archive of the version it pins — which is what makes the comparison happen
|
|
164
164
|
* at `verified` rather than against whatever the system's `main` holds today.
|
|
@@ -282,9 +282,9 @@ export function checkAuthoredSystemData(fm: object, { block, documentType, subTy
|
|
|
282
282
|
* subtype declares.
|
|
283
283
|
*
|
|
284
284
|
* The build-time face of {@link compareEmittedSystem}: it resolves the schema
|
|
285
|
-
* the way every other check here does — the system's own
|
|
286
|
-
* the cached one from the release a module pins — and attaches the message
|
|
287
|
-
* reader sees.
|
|
285
|
+
* the way every other check here does — the system's own published artifact,
|
|
286
|
+
* or the cached one from the release a module pins — and attaches the message
|
|
287
|
+
* a reader sees.
|
|
288
288
|
*
|
|
289
289
|
* **Silent where there is nothing to check against**, exactly as its two
|
|
290
290
|
* siblings are: a module pinning a system version released before the artifact
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every `.md` file under `dir`, depth-first in directory order.
|
|
3
|
-
*
|
|
4
|
-
* Deliberately *not* {@link walkMarkdownTree}, whose stack-based walk yields a
|
|
5
|
-
* tree in reverse. Order was load-bearing here when the address index carried
|
|
6
|
-
* first-writer-wins fallbacks for a page's name, filename and slug — reversing
|
|
7
|
-
* the walk silently changed which page an ambiguous name resolved to. Those
|
|
8
|
-
* fallbacks are gone with the bare `[[Name]]` form, so this is now
|
|
9
|
-
* ordinary reading order rather than a dependency; it is kept because a site's
|
|
10
|
-
* emitted pages should not reorder for no reason.
|
|
11
|
-
*
|
|
12
|
-
* @param {string} dir - Directory to walk.
|
|
13
|
-
* @param {readonly string[]} skip - Directory names to ignore at any depth.
|
|
14
|
-
* @returns {string[]} Absolute paths.
|
|
15
|
-
*/
|
|
16
|
-
export function walkSiteTree(dir: string, skip?: readonly string[]): string[];
|
|
17
1
|
/**
|
|
18
2
|
* The content tree's pages, and what could not be addressed.
|
|
19
3
|
*
|
|
@@ -29,29 +13,6 @@ export function collectContentPages(contentBase: string, ctx: object): {
|
|
|
29
13
|
addressFindings: object[];
|
|
30
14
|
fmLinkFindings: object[];
|
|
31
15
|
};
|
|
32
|
-
/**
|
|
33
|
-
* An extra tree's pages — a documentation tree published alongside the content.
|
|
34
|
-
*
|
|
35
|
-
* These preserve their **source layout** below the section rather than being
|
|
36
|
-
* addressed by type and slug: they are a book with chapters, and a reader
|
|
37
|
-
* follows their paths. A `README` is its directory's landing.
|
|
38
|
-
*
|
|
39
|
-
* **The section is the tree's, never the note's.** `tree.section` is the
|
|
40
|
-
* mount point a `trees` entry configures — fixed, physical, and the same
|
|
41
|
-
* value `site-index.mjs` indexes a tree page's address under. A note's own
|
|
42
|
-
* `subType` is a genre and reaches no address, the same contract
|
|
43
|
-
* `packageAddress()` holds for a content page: reading it here would move a
|
|
44
|
-
* page's URL, its file destination (`pageDestination`) and the address a
|
|
45
|
-
* wikilink cites it by, every time an author classified it.
|
|
46
|
-
*
|
|
47
|
-
* @param {object} tree - `{ from, rel, section, route }`.
|
|
48
|
-
* @param {object} ctx - `{ mount }`.
|
|
49
|
-
* @returns {{pages: object[], fmLinkFindings: object[]}}
|
|
50
|
-
*/
|
|
51
|
-
export function collectTreePages(tree: object, ctx: object): {
|
|
52
|
-
pages: object[];
|
|
53
|
-
fmLinkFindings: object[];
|
|
54
|
-
};
|
|
55
16
|
/**
|
|
56
17
|
* The package's homepage notes — the authored page at `/<contentPackage>/`.
|
|
57
18
|
*
|
|
@@ -226,15 +187,8 @@ export function sectionFrontmatter(meta: object): object;
|
|
|
226
187
|
* self-describing and makes sweeping the field out of a content tree
|
|
227
188
|
* output-preserving for a site as it already is for the packs.
|
|
228
189
|
*
|
|
229
|
-
* A **tree** page is the one that still reads `readmeSections`: a `trees` entry
|
|
230
|
-
* keeps its source layout below a named section, so its own `README` is that
|
|
231
|
-
* section's landing and takes the title and hero the section declares.
|
|
232
|
-
*
|
|
233
190
|
* @param {object} page - The page.
|
|
234
191
|
* @param {object} options
|
|
235
|
-
* @param {Record<string, object>} [options.readmeSections] - The sections a
|
|
236
|
-
* published tree declares, which a tree page's own `README` is the landing
|
|
237
|
-
* for.
|
|
238
192
|
* @param {(data: object, page: object) => void} [options.decorate] - Called
|
|
239
193
|
* with each page's frontmatter, for whatever a consumer's own pass adds.
|
|
240
194
|
* @param {(value: unknown, type: string) => string|null} [options.artSrc] -
|
|
@@ -246,8 +200,7 @@ export function sectionFrontmatter(meta: object): object;
|
|
|
246
200
|
* same way.
|
|
247
201
|
* @returns {object} The frontmatter to write.
|
|
248
202
|
*/
|
|
249
|
-
export function pageFrontmatter(page: object, {
|
|
250
|
-
readmeSections?: Record<string, object> | undefined;
|
|
203
|
+
export function pageFrontmatter(page: object, { decorate, webSrc, artSrc }: {
|
|
251
204
|
decorate?: ((data: object, page: object) => void) | undefined;
|
|
252
205
|
artSrc?: ((value: unknown, type: string) => string | null) | undefined;
|
|
253
206
|
webSrc?: ((src: string) => string) | undefined;
|
|
@@ -267,12 +220,10 @@ export function pageFrontmatter(page: object, { readmeSections, decorate, webSrc
|
|
|
267
220
|
* the same as another note's `type`, and `doc-gear.md` and `weapongear-gear.md`
|
|
268
221
|
* are distinct whatever the sections.
|
|
269
222
|
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
* addressed by their path — so a `README` there is still its directory's
|
|
273
|
-
* `_index.md`.
|
|
223
|
+
* @param {object} page - The page.
|
|
224
|
+
* @returns {string} The file, relative to the mount.
|
|
274
225
|
*/
|
|
275
|
-
export function pageDestination(page:
|
|
226
|
+
export function pageDestination(page: object): string;
|
|
276
227
|
/**
|
|
277
228
|
* Renders and writes every page.
|
|
278
229
|
*
|
|
@@ -283,10 +234,10 @@ export function pageDestination(page: any): string;
|
|
|
283
234
|
* authored as a fenced `dataview` block, which `protectCode` would otherwise
|
|
284
235
|
* stash away before the expander saw it. Expanding first leaves an ordinary
|
|
285
236
|
* markdown table to walk, with every other fence still protected.
|
|
286
|
-
* 2. **Then, inside protection**: the consumer's `beforeLinks` pass,
|
|
287
|
-
* resolution
|
|
288
|
-
*
|
|
289
|
-
*
|
|
237
|
+
* 2. **Then, inside protection**: the consumer's `beforeLinks` pass, then
|
|
238
|
+
* wikilink resolution. A `{@link}` tag may sit in prose a wikilink also
|
|
239
|
+
* touches, so the repository's own rewrite runs before the shared one
|
|
240
|
+
* rather than replacing it.
|
|
290
241
|
*
|
|
291
242
|
* @param {object[]} pages - Every page.
|
|
292
243
|
* @param {object} options - Everything the render needs.
|
|
@@ -324,9 +275,9 @@ export function renderPages(pages: object[], options: object): {
|
|
|
324
275
|
* or its own address publishes nothing. Hugo generates a section page
|
|
325
276
|
* automatically only for a *top-level* content directory; below that, a
|
|
326
277
|
* directory without an `_index.md` is not a section, so its URL 404s while its
|
|
327
|
-
* children publish normally. With content pages flat,
|
|
328
|
-
*
|
|
329
|
-
*
|
|
278
|
+
* children publish normally. With content pages flat, no note creates a
|
|
279
|
+
* directory below the mount, so this reaches only what something else
|
|
280
|
+
* placed there.
|
|
330
281
|
*
|
|
331
282
|
* **A section listing is not a page listing any more.** A layout that reads
|
|
332
283
|
* `.Pages` off a section it declares here will find nothing, because no file is
|
|
@@ -373,11 +324,10 @@ export function pluralTitle(name: string): string;
|
|
|
373
324
|
*
|
|
374
325
|
* @param {string|undefined} name - The configured name.
|
|
375
326
|
* @param {object} options - The configured options, plus `repoRoot`.
|
|
376
|
-
* @returns {{beforeLinks?: Function
|
|
327
|
+
* @returns {{beforeLinks?: Function}} The bundle.
|
|
377
328
|
*/
|
|
378
329
|
export function resolveSitePass(name: string | undefined, options: object): {
|
|
379
330
|
beforeLinks?: Function;
|
|
380
|
-
afterLinks?: Function;
|
|
381
331
|
};
|
|
382
332
|
/**
|
|
383
333
|
* Builds a Hugo content tree from a content tree, and reports what it found.
|
|
@@ -89,7 +89,6 @@ export function resolveThemesDir(rootDir: string): string;
|
|
|
89
89
|
*
|
|
90
90
|
* @param {object} options - The sources.
|
|
91
91
|
* @param {object} options.config - The resolved build configuration.
|
|
92
|
-
* @param {string} [options.description] - `package.json`'s `description`.
|
|
93
92
|
* @param {readonly NavigationEntry[]} options.navigation - The navigation.
|
|
94
93
|
* @param {string} options.themesDir - From {@link resolveThemesDir}.
|
|
95
94
|
* @param {boolean} [options.hasTags] - Whether any note the site build walked
|
|
@@ -97,11 +96,11 @@ export function resolveThemesDir(rootDir: string): string;
|
|
|
97
96
|
* `hasTags`. Defaults to `false` — no tagged note, no taxonomy pages.
|
|
98
97
|
* @returns {Record<string, any>} The configuration Hugo reads.
|
|
99
98
|
* @throws {TypeError} When `homepage` fails `checkHomepage`, or the
|
|
100
|
-
* configuration declares no `packageBuild.manifest.title
|
|
99
|
+
* configuration declares no `packageBuild.manifest.title`, no
|
|
100
|
+
* `site.description`, or no `site.assets`.
|
|
101
101
|
*/
|
|
102
|
-
export function hugoConfig({ config,
|
|
102
|
+
export function hugoConfig({ config, navigation, themesDir, hasTags }: {
|
|
103
103
|
config: object;
|
|
104
|
-
description?: string | undefined;
|
|
105
104
|
navigation: readonly NavigationEntry[];
|
|
106
105
|
themesDir: string;
|
|
107
106
|
hasTags?: boolean | undefined;
|
|
@@ -116,10 +115,9 @@ export function hugoToml(generated: Record<string, unknown>): string;
|
|
|
116
115
|
/**
|
|
117
116
|
* The Hugo configuration, every source read from the repository.
|
|
118
117
|
*
|
|
119
|
-
* Reads
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* intact.
|
|
118
|
+
* Reads the cached navigation and the installed theme's location, and
|
|
119
|
+
* composes them with {@link hugoConfig}. Nothing is written, so a caller can
|
|
120
|
+
* run this before touching the output tree and fail with it intact.
|
|
123
121
|
*
|
|
124
122
|
* @param {object} config - The resolved build configuration.
|
|
125
123
|
* @param {object} [options] - Options.
|
|
@@ -94,9 +94,9 @@ export function resolveInfoboxRef(siteIndex: SiteIndex, ref: unknown, hint?: obj
|
|
|
94
94
|
export type SiteEntry = {
|
|
95
95
|
/**
|
|
96
96
|
* `"content"` for a note compiled from the content
|
|
97
|
-
* tree
|
|
98
|
-
*
|
|
99
|
-
*
|
|
97
|
+
* tree. Only content entries take part in
|
|
98
|
+
* type-scoped indexing; anything else is carried
|
|
99
|
+
* through unindexed.
|
|
100
100
|
*/
|
|
101
101
|
kind: string;
|
|
102
102
|
/**
|
|
@@ -111,13 +111,6 @@ export type SiteEntry = {
|
|
|
111
111
|
* URL segment.
|
|
112
112
|
*/
|
|
113
113
|
slug: string;
|
|
114
|
-
/**
|
|
115
|
-
* The Hugo section a **tree** page is filed under, and
|
|
116
|
-
* the first segment of the `<sec>/<slug>` address it
|
|
117
|
-
* is reachable by. A content page has none: it is
|
|
118
|
-
* addressed by `(type, shortcode)` and emitted flat.
|
|
119
|
-
*/
|
|
120
|
-
sec?: string | undefined;
|
|
121
114
|
/**
|
|
122
115
|
* Source file's basename, e.g. `Climbing.md`.
|
|
123
116
|
*/
|
|
@@ -126,11 +119,6 @@ export type SiteEntry = {
|
|
|
126
119
|
* The page's published address.
|
|
127
120
|
*/
|
|
128
121
|
url: string;
|
|
129
|
-
/**
|
|
130
|
-
* Whether a tree page is its directory's
|
|
131
|
-
* landing.
|
|
132
|
-
*/
|
|
133
|
-
isReadme?: boolean | undefined;
|
|
134
122
|
};
|
|
135
123
|
/**
|
|
136
124
|
* The resolved index and everything a wikilink resolver reads beside it.
|
|
@@ -157,10 +145,6 @@ export type SiteIndex = {
|
|
|
157
145
|
* an address qualifier, local and foreign.
|
|
158
146
|
*/
|
|
159
147
|
contentTypes: Set<string>;
|
|
160
|
-
/**
|
|
161
|
-
* Section names, lowercased.
|
|
162
|
-
*/
|
|
163
|
-
sections: Set<string>;
|
|
164
148
|
/**
|
|
165
149
|
* `type:shortcode` → page, for callers
|
|
166
150
|
* resolving embedded references (a
|
|
@@ -171,13 +155,4 @@ export type SiteIndex = {
|
|
|
171
155
|
url: string;
|
|
172
156
|
subType?: string;
|
|
173
157
|
}>;
|
|
174
|
-
/**
|
|
175
|
-
* Addresses claimed by
|
|
176
|
-
* more than one package. Non-empty is a
|
|
177
|
-
* build failure; the caller reports it.
|
|
178
|
-
*/
|
|
179
|
-
conflicts: {
|
|
180
|
-
key: string;
|
|
181
|
-
package: string;
|
|
182
|
-
}[];
|
|
183
158
|
};
|
|
@@ -77,7 +77,7 @@ export function frontmatterWikilinks(fm: unknown): Array<{
|
|
|
77
77
|
* for the website, and what the book reads its staging list out of.
|
|
78
78
|
*
|
|
79
79
|
* @param {string} body - The markdown body.
|
|
80
|
-
* @param {object} ctx - `{ index, assets, collide,
|
|
80
|
+
* @param {object} ctx - `{ index, assets, collide, contentTypes,
|
|
81
81
|
* packages, noIndexPackages, foreign, type, errors, src, file }`.
|
|
82
82
|
* `packages` is every package an address may name, without which the leading
|
|
83
83
|
* package segment of a canonical address reads as an unknown type;
|
|
@@ -122,12 +122,14 @@ export function anchorPageId(noteId: string, anchorSlug: string): string;
|
|
|
122
122
|
* Builds the link-resolution tables for a content tree.
|
|
123
123
|
*
|
|
124
124
|
* @param {Array<{type: string, id: string, shortcode?: string|null,
|
|
125
|
-
* name?: string, pack?: string, docPack?: string,
|
|
125
|
+
* name?: string, pack?: string, docPack?: string, none?: boolean,
|
|
126
126
|
* draft?: boolean}>} docs -
|
|
127
127
|
* One entry per content note. `pack` / `docPack` name the packs the note's
|
|
128
128
|
* document and its documentation entry landed in; omitted, the conventional
|
|
129
|
-
* one-pack-per-type names stand in. `
|
|
130
|
-
*
|
|
129
|
+
* one-pack-per-type names stand in. `none` says the note declares
|
|
130
|
+
* `pack: none` and compiles into no document, so it has no UUID to link to.
|
|
131
|
+
* `draft` says the note carries the `draft` tag, which marks links *into* it
|
|
132
|
+
* and changes nothing else.
|
|
131
133
|
* @param {string} packageId - The Foundry package shipping the packs; the first
|
|
132
134
|
* segment of every emitted UUID.
|
|
133
135
|
* @param {Map<string, object>} [foreign] - Canonically keyed entries from
|
|
@@ -153,6 +155,7 @@ export function buildWikilinkIndex(docs: Array<{
|
|
|
153
155
|
name?: string;
|
|
154
156
|
pack?: string;
|
|
155
157
|
docPack?: string;
|
|
158
|
+
none?: boolean;
|
|
156
159
|
draft?: boolean;
|
|
157
160
|
}>, packageId: string, foreign?: Map<string, object>, contentPackage?: string, { assets, noIndexPackages }?: {
|
|
158
161
|
assets?: Map<string, object> | undefined;
|
package/types/manifest.d.mts
CHANGED
|
@@ -187,11 +187,13 @@ export function publishedRelationships(relationships: Record<string, unknown>):
|
|
|
187
187
|
* Three kinds of key end up in the result:
|
|
188
188
|
*
|
|
189
189
|
* - **Declared** — everything in `packageBuild.manifest`, emitted unchanged, so
|
|
190
|
-
* a key Foundry adds later needs no release of this package.
|
|
190
|
+
* a key Foundry adds later needs no release of this package. The one
|
|
191
|
+
* exception is `descriptionHtml`, folded into the description below rather
|
|
192
|
+
* than surviving under its own name.
|
|
191
193
|
* - **Derived** — the identity, the description, the release addresses, the
|
|
192
194
|
* version, the Foundry and system compatibility ranges, and the pack list.
|
|
193
|
-
* These are refused if also declared
|
|
194
|
-
* and the two would disagree with nothing to say so.
|
|
195
|
+
* These are refused if also declared (`description` directly; `descriptionHtml`
|
|
196
|
+
* is how it is authored) and the two would disagree with nothing to say so.
|
|
195
197
|
* - **Computed** — namespaced `flags` a repository works out for itself, merged
|
|
196
198
|
* over any it declared.
|
|
197
199
|
*
|
package/types/release.d.mts
CHANGED
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
* @param {boolean} [opts.pdf] - Whether to build the book that ships beside the
|
|
19
19
|
* archive. `true` by default; `false` skips the build and reports the skip.
|
|
20
20
|
* @returns {Promise<{zip: string, manifest: string, metadata?: string,
|
|
21
|
-
* pdf?: string, pdfFindings: object[], pdfSkipped: string|null,
|
|
21
|
+
* schema?: string, pdf?: string, pdfFindings: object[], pdfSkipped: string|null,
|
|
22
22
|
* bytes: number, version: string}>} The paths written, what the book build
|
|
23
23
|
* found, the archive's size, and the version the manifest declares.
|
|
24
|
-
* `metadata` is absent when the manifest advertises no content index,
|
|
25
|
-
* `
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* `pdfFindings`.
|
|
24
|
+
* `metadata` is absent when the manifest advertises no content index,
|
|
25
|
+
* `schema` is absent when the stage carries no `schema.json`, and `pdf` is
|
|
26
|
+
* absent when no book was written. `pdfSkipped` is `null` when a book was
|
|
27
|
+
* built, and otherwise the reason none was — itself `null` when the book
|
|
28
|
+
* builder could not be loaded, which is reported through `pdfFindings`.
|
|
29
29
|
* @throws {Error} When the stage has no manifest — there is nothing to release,
|
|
30
30
|
* and an archive without one installs as nothing.
|
|
31
31
|
*/
|
|
@@ -39,6 +39,7 @@ export function packRelease({ stageDir, outDir, artifact, metadataDir, pdf, }?:
|
|
|
39
39
|
zip: string;
|
|
40
40
|
manifest: string;
|
|
41
41
|
metadata?: string;
|
|
42
|
+
schema?: string;
|
|
42
43
|
pdf?: string;
|
|
43
44
|
pdfFindings: object[];
|
|
44
45
|
pdfSkipped: string | null;
|
|
@@ -17,59 +17,28 @@
|
|
|
17
17
|
* @returns {string} The body with every tag resolved.
|
|
18
18
|
*/
|
|
19
19
|
export function resolveApiLinks(body: string, symbols: Record<string, string>, apiBase: string): string;
|
|
20
|
-
/**
|
|
21
|
-
* Rewrites the relative links in a developer-doc body so they resolve on the
|
|
22
|
-
* published site.
|
|
23
|
-
*
|
|
24
|
-
* Developer docs are authored to link one another and the source tree with
|
|
25
|
-
* repository-relative paths, and neither target exists at the same path once
|
|
26
|
-
* rendered. Each link is resolved against the doc's own location:
|
|
27
|
-
*
|
|
28
|
-
* - a `*.md` link landing inside the documentation tree becomes the published
|
|
29
|
-
* route, preserving any `#anchor`; a `README` is its directory's landing, so
|
|
30
|
-
* that segment is dropped.
|
|
31
|
-
* - anything else — source, templates, a repository-root `*.md` — becomes its
|
|
32
|
-
* GitHub blob URL.
|
|
33
|
-
*
|
|
34
|
-
* Absolute URLs, anchor-only links, `mailto:` and site-root links are untouched.
|
|
35
|
-
*
|
|
36
|
-
* @param {string} body - The markdown body.
|
|
37
|
-
* @param {string} docRel - The doc's path relative to the documentation tree.
|
|
38
|
-
* @param {object} options - `{ repoRoot, docsSrc, docsRel, route, blob }`.
|
|
39
|
-
* @returns {string} The body with every relative link rewritten.
|
|
40
|
-
*/
|
|
41
|
-
export function rewriteRepoLinks(body: string, docRel: string, options: object): string;
|
|
42
20
|
/**
|
|
43
21
|
* The `sohl` knowledgebase pass bundle, built from its options.
|
|
44
22
|
*
|
|
45
|
-
* A pass bundle is
|
|
46
|
-
* resolution,
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* `{@link}` tag may sit inside prose a wikilink also touches.
|
|
50
|
-
* - `afterLinks` runs only on pages from an **extra tree** — the documentation
|
|
51
|
-
* tree — because repository-relative links are a property of how those pages
|
|
52
|
-
* are authored, not of content notes.
|
|
53
|
-
*
|
|
54
|
-
* Both run inside code-fence protection, so neither can rewrite a fenced example.
|
|
23
|
+
* A pass bundle is the hook the page renderer calls before wikilink
|
|
24
|
+
* resolution: `beforeLinks` runs on every page, before wikilinks resolve,
|
|
25
|
+
* because a `{@link}` tag may sit inside prose a wikilink also touches. It
|
|
26
|
+
* runs inside code-fence protection, so it cannot rewrite a fenced example.
|
|
55
27
|
*
|
|
56
28
|
* @param {object} options - Resolved from `site.passOptions`.
|
|
57
29
|
* @param {string} [options.symbolMap] - Path to the TypeDoc symbol map,
|
|
58
30
|
* relative to `repoRoot`. Absent means no API links; present and unusable is
|
|
59
31
|
* a build failure.
|
|
60
32
|
* @param {string} [options.apiBase] - Where the API documentation is served.
|
|
61
|
-
* @param {string} [options.blob] - GitHub blob base for repository files.
|
|
62
33
|
* @param {string} options.repoRoot - The repository root, for relative paths.
|
|
63
|
-
* @returns {{beforeLinks: Function
|
|
34
|
+
* @returns {{beforeLinks: Function}} The bundle.
|
|
64
35
|
* @throws {Error} When a configured `symbolMap` cannot be resolved, read,
|
|
65
36
|
* parsed, or is not a name → page object.
|
|
66
37
|
*/
|
|
67
38
|
export function sohlKbPass(options: {
|
|
68
39
|
symbolMap?: string | undefined;
|
|
69
40
|
apiBase?: string | undefined;
|
|
70
|
-
blob?: string | undefined;
|
|
71
41
|
repoRoot: string;
|
|
72
42
|
}): {
|
|
73
43
|
beforeLinks: Function;
|
|
74
|
-
afterLinks: Function;
|
|
75
44
|
};
|