@heroiclands/package-build 22.1.0 → 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/CHANGELOG.md +15 -0
- package/CONTENT.md +22 -0
- package/bin/content-build.mjs +29 -3
- package/content-config.mjs +30 -1
- package/docs/api.md +25 -23
- package/docs/configuration.md +57 -36
- package/engine/content-links.mjs +19 -9
- package/engine/helpers.mjs +2 -1
- package/engine/metadata-index.mjs +32 -0
- package/engine/note-vocabulary.mjs +20 -0
- package/engine/site-build.mjs +14 -3
- package/engine/site-config.mjs +47 -6
- package/engine/site-index.mjs +10 -1
- package/engine/web-wikilinks.mjs +16 -6
- package/engine/wikilink-syntax.mjs +10 -0
- package/engine/wikilinks.mjs +34 -7
- package/package.json +1 -1
- package/types/content-config.d.mts +11 -0
- package/types/engine/content-links.d.mts +3 -2
- package/types/engine/metadata-index.d.mts +22 -0
- package/types/engine/note-vocabulary.d.mts +12 -0
- package/types/engine/site-build.d.mts +5 -1
- package/types/engine/site-config.d.mts +18 -5
- package/types/engine/site-index.d.mts +6 -1
- package/types/engine/web-wikilinks.d.mts +9 -5
- package/types/engine/wikilink-syntax.d.mts +3 -0
- package/types/engine/wikilinks.d.mts +16 -5
|
@@ -81,13 +81,18 @@ export function resolveItemDocType(qualifier: string, types: Set<string>): strin
|
|
|
81
81
|
* @param {Set<string>} types - Every type the content tree contains.
|
|
82
82
|
* @param {Set<string>} [packages] - Every package an address may name. Omitted
|
|
83
83
|
* by callers that resolve within one package, where the form cannot occur.
|
|
84
|
+
* @param {Set<string>} [noIndexPackages] - Packages declared `contentIndex:
|
|
85
|
+
* false` — a Foundry dependency only, with no fetched index. A fully
|
|
86
|
+
* qualified target naming one is refused with `no-content-index` before its
|
|
87
|
+
* type is even considered, since there is no index to resolve it against.
|
|
84
88
|
* @returns {{type: string, shortcode: string, itemDoc: boolean,
|
|
85
89
|
* package?: string, system?: string, reason?: undefined}
|
|
86
|
-
* | {reason: "unknown-type"} | null}
|
|
90
|
+
* | {reason: "unknown-type"|"no-content-index", package?: string} | null}
|
|
87
91
|
* The resolved qualifier; a `reason` when the target is definitely qualified
|
|
88
|
-
* but names no known type; or `null` when it is not an
|
|
92
|
+
* but names no known type or no fetched index; or `null` when it is not an
|
|
93
|
+
* address at all.
|
|
89
94
|
*/
|
|
90
|
-
export function readQualifier(target: string, types: Set<string>, packages?: Set<string>): {
|
|
95
|
+
export function readQualifier(target: string, types: Set<string>, packages?: Set<string>, noIndexPackages?: Set<string>): {
|
|
91
96
|
type: string;
|
|
92
97
|
shortcode: string;
|
|
93
98
|
itemDoc: boolean;
|
|
@@ -95,7 +100,8 @@ export function readQualifier(target: string, types: Set<string>, packages?: Set
|
|
|
95
100
|
system?: string;
|
|
96
101
|
reason?: undefined;
|
|
97
102
|
} | {
|
|
98
|
-
reason: "unknown-type";
|
|
103
|
+
reason: "unknown-type" | "no-content-index";
|
|
104
|
+
package?: string;
|
|
99
105
|
} | null;
|
|
100
106
|
/**
|
|
101
107
|
* The deterministic JournalEntryPage id for one anchor: SHA-256 of
|
|
@@ -132,6 +138,10 @@ export function anchorPageId(noteId: string, anchorSlug: string): string;
|
|
|
132
138
|
* @param {Map<string, object>} [opts.assets] - The files this package ships, by
|
|
133
139
|
* canonical address. They resolve no link — an asset is not a document — and
|
|
134
140
|
* answer only the art fields, which name a file and never a document.
|
|
141
|
+
* @param {Set<string>} [opts.noIndexPackages] - Packages declared
|
|
142
|
+
* `contentIndex: false` — a Foundry dependency only. A link naming one fails
|
|
143
|
+
* with `no-content-index` rather than resolving, ambiguously, as either a
|
|
144
|
+
* typo or an undeclared package.
|
|
135
145
|
* @returns {{byShortcode: Map<string, object>, types: Set<string>}} `types` is
|
|
136
146
|
* every type the tree actually contains, so a qualifier naming no real type
|
|
137
147
|
* can be told apart from a missing target.
|
|
@@ -144,8 +154,9 @@ export function buildWikilinkIndex(docs: Array<{
|
|
|
144
154
|
pack?: string;
|
|
145
155
|
docPack?: string;
|
|
146
156
|
draft?: boolean;
|
|
147
|
-
}>, packageId: string, foreign?: Map<string, object>, contentPackage?: string, { assets }?: {
|
|
157
|
+
}>, packageId: string, foreign?: Map<string, object>, contentPackage?: string, { assets, noIndexPackages }?: {
|
|
148
158
|
assets?: Map<string, object> | undefined;
|
|
159
|
+
noIndexPackages?: Set<string> | undefined;
|
|
149
160
|
}): {
|
|
150
161
|
byShortcode: Map<string, object>;
|
|
151
162
|
types: Set<string>;
|