clean-jsdoc-theme 5.2.1 → 5.4.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/dist/publish.d.mts +85 -10
- package/dist/publish.d.ts +85 -10
- package/dist/publish.js +208 -38
- package/dist/publish.js.map +1 -1
- package/dist/publish.mjs +207 -40
- package/dist/publish.mjs.map +1 -1
- package/package.json +22 -9
- package/publish.js +9 -0
package/dist/publish.d.mts
CHANGED
|
@@ -4,6 +4,10 @@ import { DocInput, MenuItem, PlaygroundSiteConfig, TutorialInput } from "@clean-
|
|
|
4
4
|
interface JSDocOpts {
|
|
5
5
|
destination?: string;
|
|
6
6
|
package?: string;
|
|
7
|
+
/** JSDoc's `--private`: document `@private` symbols (any truthy value, as in JSDoc). */
|
|
8
|
+
private?: unknown;
|
|
9
|
+
/** JSDoc's `--access` (repeatable on the CLI, so usually an array). */
|
|
10
|
+
access?: string | string[];
|
|
7
11
|
/**
|
|
8
12
|
* Site identity from `jsdoc.json` (`"opts": { "siteName": ... }`). Either a
|
|
9
13
|
* string (shown in the header/footer and appended to each page's `<title>`),
|
|
@@ -241,6 +245,29 @@ interface JSDocOpts {
|
|
|
241
245
|
};
|
|
242
246
|
[key: string]: unknown;
|
|
243
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Where an option problem found outside `validateThemeOpts` is reported. The
|
|
250
|
+
* default prints a warning; `publish` passes a sink that, under `strict`,
|
|
251
|
+
* records it as an error instead (see `warnOption` there).
|
|
252
|
+
*/
|
|
253
|
+
type WarnSink = (message: string) => void;
|
|
254
|
+
/**
|
|
255
|
+
* Resolve the custom CSS/JS injection options into render-ready `ThemeConfig`
|
|
256
|
+
* fields plus the asset files to write. Inline strings (`customCss`/`customJs`)
|
|
257
|
+
* pass through; file options (`customCssFile`/`customJsFile`) are read + copied
|
|
258
|
+
* to content-hashed assets here — the bridge is the I/O layer, so dwar's
|
|
259
|
+
* `render()` stays pure and just links the resulting hrefs. `hashCustomAssets`
|
|
260
|
+
* (default `true`) toggles the content-hash suffix.
|
|
261
|
+
*/
|
|
262
|
+
declare function resolveCustomAssets(opts: JSDocOpts, hrefForServed: (servedPath: string) => string, warn?: WarnSink): Promise<{
|
|
263
|
+
theme: {
|
|
264
|
+
customCss?: string;
|
|
265
|
+
customCssLinks?: string[];
|
|
266
|
+
customJs?: string;
|
|
267
|
+
customJsLinks?: string[];
|
|
268
|
+
};
|
|
269
|
+
files: OutputFile[];
|
|
270
|
+
}>;
|
|
244
271
|
/**
|
|
245
272
|
* Resolve `opts.footer` (inline HTML `string` | `{ file }`) into the single
|
|
246
273
|
* `ThemeConfig.footer` string. The `{ file }` form is read from disk HERE — the
|
|
@@ -249,7 +276,7 @@ interface JSDocOpts {
|
|
|
249
276
|
* like the logo/custom-asset paths), and an empty value yields `undefined` so
|
|
250
277
|
* the default footer renders. Exported for testing.
|
|
251
278
|
*/
|
|
252
|
-
declare function resolveFooter(raw: unknown): Promise<string | undefined>;
|
|
279
|
+
declare function resolveFooter(raw: unknown, warn?: WarnSink): Promise<string | undefined>;
|
|
253
280
|
/**
|
|
254
281
|
* Resolve `opts.favicon` (a file path) into a served `_assets/` href + the file
|
|
255
282
|
* to write — the bridge is the I/O layer, so dwar only sees the final URL and
|
|
@@ -258,7 +285,7 @@ declare function resolveFooter(raw: unknown): Promise<string | undefined>;
|
|
|
258
285
|
* `<link>` `type`. A missing/unreadable file is warned about and dropped
|
|
259
286
|
* (resilient, like the logo/custom-asset paths). Exported for testing.
|
|
260
287
|
*/
|
|
261
|
-
declare function resolveFavicon(raw: unknown, hash: boolean, hrefForServed: (servedPath: string) => string): Promise<{
|
|
288
|
+
declare function resolveFavicon(raw: unknown, hash: boolean, hrefForServed: (servedPath: string) => string, warn?: WarnSink): Promise<{
|
|
262
289
|
href: string;
|
|
263
290
|
files: OutputFile[];
|
|
264
291
|
} | undefined>;
|
|
@@ -270,7 +297,7 @@ declare function resolveFavicon(raw: unknown, hash: boolean, hrefForServed: (ser
|
|
|
270
297
|
* identifying attribute (`name`/`property`/`http-equiv`/`charset`/`itemprop`) is
|
|
271
298
|
* dropped with a warning — dwar does the final escaping + key validation.
|
|
272
299
|
*/
|
|
273
|
-
declare function normalizeMeta(raw: unknown): MetaTag[] | undefined;
|
|
300
|
+
declare function normalizeMeta(raw: unknown, warn?: WarnSink): MetaTag[] | undefined;
|
|
274
301
|
/**
|
|
275
302
|
* Resolve JSDoc's `templates.default.outputSourceFiles` flag. The `opts` arg
|
|
276
303
|
* `publish` receives is `env.opts` — the `opts` block — which does NOT carry the
|
|
@@ -291,6 +318,20 @@ declare function outputSourceFilesEnabled(opts: JSDocOpts): boolean;
|
|
|
291
318
|
* is exactly `=== true`; otherwise `false` (the default: links jump to code).
|
|
292
319
|
*/
|
|
293
320
|
declare function sourceLinkToCommentEnabled(opts: JSDocOpts): boolean;
|
|
321
|
+
/**
|
|
322
|
+
* Whether private doclets should be documented — the private-access slice of
|
|
323
|
+
* JSDoc's `templateHelper.prune`, with its exact tests: `env.opts.private` is
|
|
324
|
+
* truthy (`--private`), or `env.opts.access` `.includes('private')` or
|
|
325
|
+
* `.includes('all')`. Like prune, `includes` runs on whatever `access` is: an
|
|
326
|
+
* array from the CLI (the flag is repeatable) or a string from `jsdoc.json`, so
|
|
327
|
+
* `"private,protected"` and `"all"` count via substring match, exactly as in
|
|
328
|
+
* JSDoc. Default: hidden.
|
|
329
|
+
*
|
|
330
|
+
* Only this slice is implemented. prune's other `--access` levels (`public`,
|
|
331
|
+
* `protected`, `package`, `undefined` — e.g. `--access public` hiding
|
|
332
|
+
* protected symbols) are NOT applied: those symbols stay documented.
|
|
333
|
+
*/
|
|
334
|
+
declare function includePrivateEnabled(opts: JSDocOpts): boolean;
|
|
294
335
|
/**
|
|
295
336
|
* Resolve `templates.default.cleanOutputDir`. Probed in the same priority order
|
|
296
337
|
* as {@link outputSourceFilesEnabled} (canonical `jsdoc/env` conf, then a nested
|
|
@@ -395,7 +436,11 @@ declare function collectDocs(dir: string): Promise<DocInput[]>;
|
|
|
395
436
|
* tutorials, README, doclet comments). `resolve(src, baseDir)` copies a local
|
|
396
437
|
* image to `_assets/<base>.<hash><ext>` (content-hashed → cache-busted, deduped
|
|
397
438
|
* across all sources via the shared caches) and returns the root-relative
|
|
398
|
-
* `/_assets/…` href
|
|
439
|
+
* `/_assets/…` href — deliberately WITHOUT `basePath`: rang's `MdxImg` adds it
|
|
440
|
+
* for HTML and dwar's `prefixRootRelativeUrls` for the companion `.md` /
|
|
441
|
+
* `llms-full.txt`, once each; `hrefForServed` is only for theme assets (logos,
|
|
442
|
+
* favicon, custom CSS/JS). The TypeDoc twin (`typedoc/src/docs.ts`) follows the
|
|
443
|
+
* same rule (#377). It accumulates each copied file on `files`, each SVG's
|
|
399
444
|
* markup on `inlineSvgs` (keyed by the rewritten href, so the renderer can inline
|
|
400
445
|
* it — its `[data-theme]` styles then track the toggle), and the absolute source
|
|
401
446
|
* path of every copied image on `consumed` (so the static-file passthrough can
|
|
@@ -421,11 +466,11 @@ declare function createImageCollector(staticDirs?: readonly string[]): ImageColl
|
|
|
421
466
|
* content-hashed `_assets/` pipeline (see {@link createImageCollector}). Each
|
|
422
467
|
* `` / `<img src>` whose `src` points to a file on disk is copied and
|
|
423
468
|
* its `src` rewritten to the root-relative `/_assets/<base>.<hash><ext>` (rang's
|
|
424
|
-
* `MdxImg` adds the base path, like it does for links
|
|
425
|
-
* project root when it starts with
|
|
426
|
-
*
|
|
427
|
-
* bridge is the I/O layer here, so
|
|
428
|
-
* paths.
|
|
469
|
+
* `MdxImg` adds the base path, like it does for links, and dwar adds it to the
|
|
470
|
+
* `.md`/llms outputs), resolved relative to the project root when it starts with
|
|
471
|
+
* `/`, else relative to the doc's own directory. Returns the docs with rewritten
|
|
472
|
+
* content plus the asset files to write. The bridge is the I/O layer here, so
|
|
473
|
+
* setu/dwar only ever see the final `_assets/` paths.
|
|
429
474
|
*/
|
|
430
475
|
declare function resolveDocImages(docs: DocInput[], docsDir: string, collector?: ImageCollector): Promise<{
|
|
431
476
|
docs: DocInput[];
|
|
@@ -541,7 +586,37 @@ declare function overlayDocs(base: ResolvedDocs, locale: ResolvedDocs): Resolved
|
|
|
541
586
|
* accepts only an array; trims string entries and drops non-strings/empties.
|
|
542
587
|
*/
|
|
543
588
|
declare function normalizeDocGroups(raw: unknown): string[] | undefined;
|
|
589
|
+
/**
|
|
590
|
+
* The template entry JSDoc calls. Wraps {@link runPublish} so a failed build
|
|
591
|
+
* fails the process: JSDoc 4 runs `publish()` inside a promise chain with no
|
|
592
|
+
* rejection handler, so a thrown error was printed as `Unhandled rejection
|
|
593
|
+
* <stack>` and JSDoc still exited 0 — invisible to CI, and to aadesh, which
|
|
594
|
+
* checks each locale build's exit code. Every failure (strict-mode option
|
|
595
|
+
* errors, a missing `plugins/markdown`, a bad build spec, a render setup
|
|
596
|
+
* error) goes through {@link reportBuildFailure} instead.
|
|
597
|
+
*/
|
|
544
598
|
declare function publish(data: unknown, opts: JSDocOpts, tutorials?: unknown): Promise<void>;
|
|
599
|
+
/** The slice of JSDoc's `jsdoc/util/logger` that {@link reportBuildFailure} uses. */
|
|
600
|
+
interface JSDocLogger {
|
|
601
|
+
error: (message: string) => void;
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Report a failed build once and make the process exit non-zero. Inside JSDoc,
|
|
605
|
+
* log through JSDoc's own logger: `logger.error` prints the message once and,
|
|
606
|
+
* through JSDoc's `logger:error` listener, marks the run as failed. Normally
|
|
607
|
+
* that sets a flag JSDoc turns into exit code 1 once `publish` settles; under
|
|
608
|
+
* `--pedantic` the listener calls `cli.exit(1)`, which registers a process
|
|
609
|
+
* `exit` handler that exits with 1 — it doesn't stop the process on the spot,
|
|
610
|
+
* so the remaining work still finishes. `process.exitCode` is set too, as a
|
|
611
|
+
* backstop.
|
|
612
|
+
* Outside a JSDoc process (`jsdoc/util/logger` isn't resolvable — a direct
|
|
613
|
+
* programmatic call, unit tests) rethrow, so the caller still gets the
|
|
614
|
+
* rejection, and leave `process.exitCode` alone: the caller decides whether
|
|
615
|
+
* the failure fails its process. `withStack` (JSDoc's `--debug`/`--verbose`)
|
|
616
|
+
* adds the stack trace for bug reports. Exported for testing (`loadLogger` is
|
|
617
|
+
* injectable).
|
|
618
|
+
*/
|
|
619
|
+
declare function reportBuildFailure(err: unknown, withStack: boolean, loadLogger?: () => JSDocLogger): void;
|
|
545
620
|
//#endregion
|
|
546
|
-
export { ImageCollector, ResolvedDocs, StaticFileEntry, StaticFilesConfig, cleanOutputDirEnabled, collectDocs, collectStaticFiles, computeRelPaths, createImageCollector, hasMarkdownPlugin, normalizeColors, normalizeCopyPage, normalizeDocGroups, normalizeMenu, normalizeMeta, normalizePageNav, normalizePlayground, normalizeSectionOrder, normalizeStaticFilesConfig, outputSourceFilesEnabled, overlayDocs, publish, readStaticFilesConfig, resolveDocImages, resolveDocletImages, resolveFavicon, resolveFooter, resolveTutorialImages, sourceLinkToCommentEnabled, staticFileIncluded, staticFileOutputName };
|
|
621
|
+
export { ImageCollector, ResolvedDocs, StaticFileEntry, StaticFilesConfig, cleanOutputDirEnabled, collectDocs, collectStaticFiles, computeRelPaths, createImageCollector, hasMarkdownPlugin, includePrivateEnabled, normalizeColors, normalizeCopyPage, normalizeDocGroups, normalizeMenu, normalizeMeta, normalizePageNav, normalizePlayground, normalizeSectionOrder, normalizeStaticFilesConfig, outputSourceFilesEnabled, overlayDocs, publish, readStaticFilesConfig, reportBuildFailure, resolveCustomAssets, resolveDocImages, resolveDocletImages, resolveFavicon, resolveFooter, resolveTutorialImages, sourceLinkToCommentEnabled, staticFileIncluded, staticFileOutputName };
|
|
547
622
|
//# sourceMappingURL=publish.d.mts.map
|
package/dist/publish.d.ts
CHANGED
|
@@ -4,6 +4,10 @@ import { DocInput, MenuItem, PlaygroundSiteConfig, TutorialInput } from "@clean-
|
|
|
4
4
|
interface JSDocOpts {
|
|
5
5
|
destination?: string;
|
|
6
6
|
package?: string;
|
|
7
|
+
/** JSDoc's `--private`: document `@private` symbols (any truthy value, as in JSDoc). */
|
|
8
|
+
private?: unknown;
|
|
9
|
+
/** JSDoc's `--access` (repeatable on the CLI, so usually an array). */
|
|
10
|
+
access?: string | string[];
|
|
7
11
|
/**
|
|
8
12
|
* Site identity from `jsdoc.json` (`"opts": { "siteName": ... }`). Either a
|
|
9
13
|
* string (shown in the header/footer and appended to each page's `<title>`),
|
|
@@ -241,6 +245,29 @@ interface JSDocOpts {
|
|
|
241
245
|
};
|
|
242
246
|
[key: string]: unknown;
|
|
243
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Where an option problem found outside `validateThemeOpts` is reported. The
|
|
250
|
+
* default prints a warning; `publish` passes a sink that, under `strict`,
|
|
251
|
+
* records it as an error instead (see `warnOption` there).
|
|
252
|
+
*/
|
|
253
|
+
type WarnSink = (message: string) => void;
|
|
254
|
+
/**
|
|
255
|
+
* Resolve the custom CSS/JS injection options into render-ready `ThemeConfig`
|
|
256
|
+
* fields plus the asset files to write. Inline strings (`customCss`/`customJs`)
|
|
257
|
+
* pass through; file options (`customCssFile`/`customJsFile`) are read + copied
|
|
258
|
+
* to content-hashed assets here — the bridge is the I/O layer, so dwar's
|
|
259
|
+
* `render()` stays pure and just links the resulting hrefs. `hashCustomAssets`
|
|
260
|
+
* (default `true`) toggles the content-hash suffix.
|
|
261
|
+
*/
|
|
262
|
+
declare function resolveCustomAssets(opts: JSDocOpts, hrefForServed: (servedPath: string) => string, warn?: WarnSink): Promise<{
|
|
263
|
+
theme: {
|
|
264
|
+
customCss?: string;
|
|
265
|
+
customCssLinks?: string[];
|
|
266
|
+
customJs?: string;
|
|
267
|
+
customJsLinks?: string[];
|
|
268
|
+
};
|
|
269
|
+
files: OutputFile[];
|
|
270
|
+
}>;
|
|
244
271
|
/**
|
|
245
272
|
* Resolve `opts.footer` (inline HTML `string` | `{ file }`) into the single
|
|
246
273
|
* `ThemeConfig.footer` string. The `{ file }` form is read from disk HERE — the
|
|
@@ -249,7 +276,7 @@ interface JSDocOpts {
|
|
|
249
276
|
* like the logo/custom-asset paths), and an empty value yields `undefined` so
|
|
250
277
|
* the default footer renders. Exported for testing.
|
|
251
278
|
*/
|
|
252
|
-
declare function resolveFooter(raw: unknown): Promise<string | undefined>;
|
|
279
|
+
declare function resolveFooter(raw: unknown, warn?: WarnSink): Promise<string | undefined>;
|
|
253
280
|
/**
|
|
254
281
|
* Resolve `opts.favicon` (a file path) into a served `_assets/` href + the file
|
|
255
282
|
* to write — the bridge is the I/O layer, so dwar only sees the final URL and
|
|
@@ -258,7 +285,7 @@ declare function resolveFooter(raw: unknown): Promise<string | undefined>;
|
|
|
258
285
|
* `<link>` `type`. A missing/unreadable file is warned about and dropped
|
|
259
286
|
* (resilient, like the logo/custom-asset paths). Exported for testing.
|
|
260
287
|
*/
|
|
261
|
-
declare function resolveFavicon(raw: unknown, hash: boolean, hrefForServed: (servedPath: string) => string): Promise<{
|
|
288
|
+
declare function resolveFavicon(raw: unknown, hash: boolean, hrefForServed: (servedPath: string) => string, warn?: WarnSink): Promise<{
|
|
262
289
|
href: string;
|
|
263
290
|
files: OutputFile[];
|
|
264
291
|
} | undefined>;
|
|
@@ -270,7 +297,7 @@ declare function resolveFavicon(raw: unknown, hash: boolean, hrefForServed: (ser
|
|
|
270
297
|
* identifying attribute (`name`/`property`/`http-equiv`/`charset`/`itemprop`) is
|
|
271
298
|
* dropped with a warning — dwar does the final escaping + key validation.
|
|
272
299
|
*/
|
|
273
|
-
declare function normalizeMeta(raw: unknown): MetaTag[] | undefined;
|
|
300
|
+
declare function normalizeMeta(raw: unknown, warn?: WarnSink): MetaTag[] | undefined;
|
|
274
301
|
/**
|
|
275
302
|
* Resolve JSDoc's `templates.default.outputSourceFiles` flag. The `opts` arg
|
|
276
303
|
* `publish` receives is `env.opts` — the `opts` block — which does NOT carry the
|
|
@@ -291,6 +318,20 @@ declare function outputSourceFilesEnabled(opts: JSDocOpts): boolean;
|
|
|
291
318
|
* is exactly `=== true`; otherwise `false` (the default: links jump to code).
|
|
292
319
|
*/
|
|
293
320
|
declare function sourceLinkToCommentEnabled(opts: JSDocOpts): boolean;
|
|
321
|
+
/**
|
|
322
|
+
* Whether private doclets should be documented — the private-access slice of
|
|
323
|
+
* JSDoc's `templateHelper.prune`, with its exact tests: `env.opts.private` is
|
|
324
|
+
* truthy (`--private`), or `env.opts.access` `.includes('private')` or
|
|
325
|
+
* `.includes('all')`. Like prune, `includes` runs on whatever `access` is: an
|
|
326
|
+
* array from the CLI (the flag is repeatable) or a string from `jsdoc.json`, so
|
|
327
|
+
* `"private,protected"` and `"all"` count via substring match, exactly as in
|
|
328
|
+
* JSDoc. Default: hidden.
|
|
329
|
+
*
|
|
330
|
+
* Only this slice is implemented. prune's other `--access` levels (`public`,
|
|
331
|
+
* `protected`, `package`, `undefined` — e.g. `--access public` hiding
|
|
332
|
+
* protected symbols) are NOT applied: those symbols stay documented.
|
|
333
|
+
*/
|
|
334
|
+
declare function includePrivateEnabled(opts: JSDocOpts): boolean;
|
|
294
335
|
/**
|
|
295
336
|
* Resolve `templates.default.cleanOutputDir`. Probed in the same priority order
|
|
296
337
|
* as {@link outputSourceFilesEnabled} (canonical `jsdoc/env` conf, then a nested
|
|
@@ -395,7 +436,11 @@ declare function collectDocs(dir: string): Promise<DocInput[]>;
|
|
|
395
436
|
* tutorials, README, doclet comments). `resolve(src, baseDir)` copies a local
|
|
396
437
|
* image to `_assets/<base>.<hash><ext>` (content-hashed → cache-busted, deduped
|
|
397
438
|
* across all sources via the shared caches) and returns the root-relative
|
|
398
|
-
* `/_assets/…` href
|
|
439
|
+
* `/_assets/…` href — deliberately WITHOUT `basePath`: rang's `MdxImg` adds it
|
|
440
|
+
* for HTML and dwar's `prefixRootRelativeUrls` for the companion `.md` /
|
|
441
|
+
* `llms-full.txt`, once each; `hrefForServed` is only for theme assets (logos,
|
|
442
|
+
* favicon, custom CSS/JS). The TypeDoc twin (`typedoc/src/docs.ts`) follows the
|
|
443
|
+
* same rule (#377). It accumulates each copied file on `files`, each SVG's
|
|
399
444
|
* markup on `inlineSvgs` (keyed by the rewritten href, so the renderer can inline
|
|
400
445
|
* it — its `[data-theme]` styles then track the toggle), and the absolute source
|
|
401
446
|
* path of every copied image on `consumed` (so the static-file passthrough can
|
|
@@ -421,11 +466,11 @@ declare function createImageCollector(staticDirs?: readonly string[]): ImageColl
|
|
|
421
466
|
* content-hashed `_assets/` pipeline (see {@link createImageCollector}). Each
|
|
422
467
|
* `` / `<img src>` whose `src` points to a file on disk is copied and
|
|
423
468
|
* its `src` rewritten to the root-relative `/_assets/<base>.<hash><ext>` (rang's
|
|
424
|
-
* `MdxImg` adds the base path, like it does for links
|
|
425
|
-
* project root when it starts with
|
|
426
|
-
*
|
|
427
|
-
* bridge is the I/O layer here, so
|
|
428
|
-
* paths.
|
|
469
|
+
* `MdxImg` adds the base path, like it does for links, and dwar adds it to the
|
|
470
|
+
* `.md`/llms outputs), resolved relative to the project root when it starts with
|
|
471
|
+
* `/`, else relative to the doc's own directory. Returns the docs with rewritten
|
|
472
|
+
* content plus the asset files to write. The bridge is the I/O layer here, so
|
|
473
|
+
* setu/dwar only ever see the final `_assets/` paths.
|
|
429
474
|
*/
|
|
430
475
|
declare function resolveDocImages(docs: DocInput[], docsDir: string, collector?: ImageCollector): Promise<{
|
|
431
476
|
docs: DocInput[];
|
|
@@ -541,7 +586,37 @@ declare function overlayDocs(base: ResolvedDocs, locale: ResolvedDocs): Resolved
|
|
|
541
586
|
* accepts only an array; trims string entries and drops non-strings/empties.
|
|
542
587
|
*/
|
|
543
588
|
declare function normalizeDocGroups(raw: unknown): string[] | undefined;
|
|
589
|
+
/**
|
|
590
|
+
* The template entry JSDoc calls. Wraps {@link runPublish} so a failed build
|
|
591
|
+
* fails the process: JSDoc 4 runs `publish()` inside a promise chain with no
|
|
592
|
+
* rejection handler, so a thrown error was printed as `Unhandled rejection
|
|
593
|
+
* <stack>` and JSDoc still exited 0 — invisible to CI, and to aadesh, which
|
|
594
|
+
* checks each locale build's exit code. Every failure (strict-mode option
|
|
595
|
+
* errors, a missing `plugins/markdown`, a bad build spec, a render setup
|
|
596
|
+
* error) goes through {@link reportBuildFailure} instead.
|
|
597
|
+
*/
|
|
544
598
|
declare function publish(data: unknown, opts: JSDocOpts, tutorials?: unknown): Promise<void>;
|
|
599
|
+
/** The slice of JSDoc's `jsdoc/util/logger` that {@link reportBuildFailure} uses. */
|
|
600
|
+
interface JSDocLogger {
|
|
601
|
+
error: (message: string) => void;
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Report a failed build once and make the process exit non-zero. Inside JSDoc,
|
|
605
|
+
* log through JSDoc's own logger: `logger.error` prints the message once and,
|
|
606
|
+
* through JSDoc's `logger:error` listener, marks the run as failed. Normally
|
|
607
|
+
* that sets a flag JSDoc turns into exit code 1 once `publish` settles; under
|
|
608
|
+
* `--pedantic` the listener calls `cli.exit(1)`, which registers a process
|
|
609
|
+
* `exit` handler that exits with 1 — it doesn't stop the process on the spot,
|
|
610
|
+
* so the remaining work still finishes. `process.exitCode` is set too, as a
|
|
611
|
+
* backstop.
|
|
612
|
+
* Outside a JSDoc process (`jsdoc/util/logger` isn't resolvable — a direct
|
|
613
|
+
* programmatic call, unit tests) rethrow, so the caller still gets the
|
|
614
|
+
* rejection, and leave `process.exitCode` alone: the caller decides whether
|
|
615
|
+
* the failure fails its process. `withStack` (JSDoc's `--debug`/`--verbose`)
|
|
616
|
+
* adds the stack trace for bug reports. Exported for testing (`loadLogger` is
|
|
617
|
+
* injectable).
|
|
618
|
+
*/
|
|
619
|
+
declare function reportBuildFailure(err: unknown, withStack: boolean, loadLogger?: () => JSDocLogger): void;
|
|
545
620
|
//#endregion
|
|
546
|
-
export { ImageCollector, ResolvedDocs, StaticFileEntry, StaticFilesConfig, cleanOutputDirEnabled, collectDocs, collectStaticFiles, computeRelPaths, createImageCollector, hasMarkdownPlugin, normalizeColors, normalizeCopyPage, normalizeDocGroups, normalizeMenu, normalizeMeta, normalizePageNav, normalizePlayground, normalizeSectionOrder, normalizeStaticFilesConfig, outputSourceFilesEnabled, overlayDocs, publish, readStaticFilesConfig, resolveDocImages, resolveDocletImages, resolveFavicon, resolveFooter, resolveTutorialImages, sourceLinkToCommentEnabled, staticFileIncluded, staticFileOutputName };
|
|
621
|
+
export { ImageCollector, ResolvedDocs, StaticFileEntry, StaticFilesConfig, cleanOutputDirEnabled, collectDocs, collectStaticFiles, computeRelPaths, createImageCollector, hasMarkdownPlugin, includePrivateEnabled, normalizeColors, normalizeCopyPage, normalizeDocGroups, normalizeMenu, normalizeMeta, normalizePageNav, normalizePlayground, normalizeSectionOrder, normalizeStaticFilesConfig, outputSourceFilesEnabled, overlayDocs, publish, readStaticFilesConfig, reportBuildFailure, resolveCustomAssets, resolveDocImages, resolveDocletImages, resolveFavicon, resolveFooter, resolveTutorialImages, sourceLinkToCommentEnabled, staticFileIncluded, staticFileOutputName };
|
|
547
622
|
//# sourceMappingURL=publish.d.ts.map
|