@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.
@@ -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 address at all.
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>;