@open-agent-toolkit/cli 0.3.31 → 0.3.33
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/assets/bundle-metadata.json +1 -1
- package/assets/docs/docs-tooling/check.md +54 -30
- package/assets/docs/docs-tooling/commands.md +21 -2
- package/assets/docs/docs-tooling/workflows.md +14 -6
- package/assets/docs/reference/cli-reference.md +2 -2
- package/assets/docs/reference/config-and-local-state.md +1 -1
- package/assets/docs/reference/configuration.md +2 -2
- package/assets/docs/reference/docs-index-contract.md +3 -2
- package/assets/docs/reference/oat-directory-structure.md +1 -1
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-agent-instructions-analyze/SKILL.md +2 -2
- package/assets/skills/oat-docs-analyze/SKILL.md +63 -25
- package/assets/skills/oat-docs-analyze/references/analysis-artifact-template.md +9 -6
- package/assets/skills/oat-docs-analyze/references/quality-checklist.md +2 -2
- package/assets/skills/oat-docs-analyze/scripts/package-drift.mjs +358 -40
- package/assets/skills/oat-docs-apply/SKILL.md +22 -12
- package/assets/skills/oat-docs-apply/references/apply-plan-template.md +3 -2
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +47 -9
- package/dist/commands/docs/check/check.d.ts.map +1 -1
- package/dist/commands/docs/check/check.js +1 -0
- package/dist/commands/docs/check/checker.d.ts +2 -0
- package/dist/commands/docs/check/checker.d.ts.map +1 -1
- package/dist/commands/docs/check/checker.js +2 -0
- package/dist/commands/docs/check/commands.d.ts.map +1 -1
- package/dist/commands/docs/check/commands.js +74 -30
- package/dist/commands/docs/check/files.d.ts +2 -0
- package/dist/commands/docs/check/files.d.ts.map +1 -1
- package/dist/commands/docs/check/files.js +16 -0
- package/dist/commands/docs/check/navigation.d.ts +7 -1
- package/dist/commands/docs/check/navigation.d.ts.map +1 -1
- package/dist/commands/docs/check/navigation.js +19 -68
- package/dist/commands/docs/check/reader-rules.d.ts.map +1 -1
- package/dist/commands/docs/check/reader-rules.js +8 -3
- package/dist/commands/docs/index-generate/generator.d.ts +9 -1
- package/dist/commands/docs/index-generate/generator.d.ts.map +1 -1
- package/dist/commands/docs/index-generate/generator.js +17 -6
- package/dist/commands/docs/index-generate/index.d.ts +1 -1
- package/dist/commands/docs/index-generate/index.d.ts.map +1 -1
- package/dist/commands/docs/index-generate/index.js +24 -12
- package/dist/commands/docs/init/content.d.ts +2 -3
- package/dist/commands/docs/init/content.d.ts.map +1 -1
- package/dist/commands/docs/init/content.js +3 -10
- package/dist/commands/docs/nav/fumadocs.d.ts +29 -0
- package/dist/commands/docs/nav/fumadocs.d.ts.map +1 -1
- package/dist/commands/docs/nav/fumadocs.js +8 -5
- package/dist/commands/docs/nav/membership.d.ts +37 -0
- package/dist/commands/docs/nav/membership.d.ts.map +1 -0
- package/dist/commands/docs/nav/membership.js +475 -0
- package/dist/commands/docs/nav/sync.d.ts +26 -2
- package/dist/commands/docs/nav/sync.d.ts.map +1 -1
- package/dist/commands/docs/nav/sync.js +160 -43
- package/dist/config/documentation-ia.d.ts +19 -0
- package/dist/config/documentation-ia.d.ts.map +1 -0
- package/dist/config/documentation-ia.js +42 -0
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +5 -1
- package/package.json +3 -3
|
@@ -4,7 +4,7 @@ import { Command } from 'commander';
|
|
|
4
4
|
export declare const GENERATED_INDEX_WARNING = "<!-- AUTOGENERATED by `oat docs generate-index`. Do not hand-edit; run `oat docs generate-index` to regenerate. -->";
|
|
5
5
|
interface IndexGenerateFileDependencies {
|
|
6
6
|
generateIndex: (docsDir: string, options: import('./generator.js').GenerateIndexOptions) => Promise<import('./generator.js').IndexEntry[]>;
|
|
7
|
-
renderIndex: (entries: import('./generator.js').IndexEntry[]) => string;
|
|
7
|
+
renderIndex: (entries: import('./generator.js').IndexEntry[], options?: import('./generator.js').RenderIndexOptions) => string;
|
|
8
8
|
writeFile: (path: string, content: string, encoding: BufferEncoding) => Promise<void>;
|
|
9
9
|
readOatConfig: (repoRoot: string) => Promise<OatConfig>;
|
|
10
10
|
writeOatConfig: (repoRoot: string, config: OatConfig) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/index-generate/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,eAAO,MAAM,uBAAuB,wHACmF,CAAC;AA2BxH,UAAU,6BAA6B;IACrC,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,aAAa,EAAE,oBAAoB,KAChD,OAAO,CAAC,OAAO,aAAa,EAAE,UAAU,EAAE,CAAC,CAAC;IACjD,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/index-generate/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,eAAO,MAAM,uBAAuB,wHACmF,CAAC;AA2BxH,UAAU,6BAA6B;IACrC,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,aAAa,EAAE,oBAAoB,KAChD,OAAO,CAAC,OAAO,aAAa,EAAE,UAAU,EAAE,CAAC,CAAC;IACjD,WAAW,EAAE,CACX,OAAO,EAAE,OAAO,aAAa,EAAE,UAAU,EAAE,EAC3C,OAAO,CAAC,EAAE,OAAO,aAAa,EAAE,kBAAkB,KAC/C,MAAM,CAAC;IACZ,SAAS,EAAE,CACT,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,cAAc,KACrB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAClD,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC5D,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC7D;AAED,UAAU,yBAAyB;IACjC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,QAAQ,EAAE,6BAA6B,CAAC;CACzC;AAgsBD,wBAAgB,8BAA8B,CAC5C,SAAS,GAAE,OAAO,CAAC,yBAAyB,CAAM,GACjD,OAAO,CAgCT"}
|
|
@@ -430,19 +430,31 @@ async function runIndexGenerate(context, options, deps) {
|
|
|
430
430
|
const entries = await deps.generateIndex(docsDir, {
|
|
431
431
|
excludes: resolved.excludes,
|
|
432
432
|
});
|
|
433
|
-
|
|
433
|
+
// Links are written relative to the manifest file, which always sits outside
|
|
434
|
+
// the docs directory it indexes. When this run records the manifest in
|
|
435
|
+
// `documentation.index`, links resolve from that recorded (real) location.
|
|
436
|
+
// Otherwise only the output's directory is canonicalized: a symlinked
|
|
437
|
+
// directory alias cannot skew the prefix, and a file symlink is read from its
|
|
438
|
+
// own location.
|
|
439
|
+
const indexPath = isFumadocsManifestTransition(resolved, canonical)
|
|
440
|
+
? buildDocumentationIndexValue(resolved, canonical)
|
|
441
|
+
: null;
|
|
442
|
+
const outputDir = indexPath !== null
|
|
443
|
+
? dirname(canonical.outputPath)
|
|
444
|
+
: ((await canonicalizeOrNull(dirname(outputPath), deps, {
|
|
445
|
+
kind: 'output',
|
|
446
|
+
})) ?? dirname(outputPath));
|
|
447
|
+
const linkBase = normalizeToPosixPath(relative(outputDir, canonical.docsDir));
|
|
448
|
+
const content = buildGeneratedIndexOutput(deps.renderIndex(entries, { linkBase }), resolved.config.documentation?.tooling);
|
|
434
449
|
await deps.writeFile(outputPath, content, 'utf8');
|
|
435
|
-
if (
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
...config,
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
},
|
|
444
|
-
});
|
|
445
|
-
}
|
|
450
|
+
if (indexPath !== null && config.documentation?.index !== indexPath) {
|
|
451
|
+
await deps.writeOatConfig(repoRoot, {
|
|
452
|
+
...config,
|
|
453
|
+
documentation: {
|
|
454
|
+
...config.documentation,
|
|
455
|
+
index: indexPath,
|
|
456
|
+
},
|
|
457
|
+
});
|
|
446
458
|
}
|
|
447
459
|
if (context.json) {
|
|
448
460
|
context.logger.json({
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export type IaPreset = (typeof IA_PRESETS)[number];
|
|
1
|
+
import { type IaPresetId } from '../../../config/documentation-ia.js';
|
|
3
2
|
export interface PresetSelection {
|
|
4
|
-
iaPreset?:
|
|
3
|
+
iaPreset?: IaPresetId;
|
|
5
4
|
plannedPages?: number;
|
|
6
5
|
}
|
|
7
6
|
/** Validate the opt-in pair before planning or writing any scaffold files. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/content.ts"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/content.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC1E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,8EAA8E;AAC9E,wBAAgB,sBAAsB,CACpC,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GACtB,eAAe,CAiBjB;AAmSD,wBAAgB,sBAAsB,CAAC,KAAK,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CAErE;AAQD,sFAAsF;AACtF,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,eAAe,GAAG;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;CACnB,GACA,OAAO,CAAC;IACT,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAAC,CAwFR"}
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
|
|
4
|
-
'product-engineering-qa',
|
|
5
|
-
'consumer-maintainer',
|
|
6
|
-
'domain-engineering',
|
|
7
|
-
'task-type',
|
|
8
|
-
'toolkit-cli',
|
|
9
|
-
'flat-small',
|
|
10
|
-
];
|
|
3
|
+
import { IA_PRESET_IDS } from '../../../config/documentation-ia.js';
|
|
11
4
|
/** Validate the opt-in pair before planning or writing any scaffold files. */
|
|
12
5
|
export function resolvePresetSelection(preset, count) {
|
|
13
6
|
if (preset === undefined && count === undefined)
|
|
14
7
|
return {};
|
|
15
8
|
if (preset === undefined || count === undefined)
|
|
16
9
|
throw new Error('--ia-preset and --planned-pages are required together.');
|
|
17
|
-
if (!
|
|
18
|
-
throw new Error(`Unknown IA preset "${preset}". Choose: ${
|
|
10
|
+
if (!IA_PRESET_IDS.includes(preset))
|
|
11
|
+
throw new Error(`Unknown IA preset "${preset}". Choose: ${IA_PRESET_IDS.join(', ')}.`);
|
|
19
12
|
if (!/^\d+$/.test(String(count)) ||
|
|
20
13
|
!Number.isSafeInteger(Number(count)) ||
|
|
21
14
|
Number(count) < 1)
|
|
@@ -27,6 +27,9 @@ export interface SyncFumadocsNavigationResult {
|
|
|
27
27
|
*/
|
|
28
28
|
unlisted: string[];
|
|
29
29
|
}
|
|
30
|
+
export declare const FUMADOCS_REST_ITEMS: ReadonlySet<string>;
|
|
31
|
+
export declare const FUMADOCS_SEPARATOR: RegExp;
|
|
32
|
+
export declare const FUMADOCS_LINK: RegExp;
|
|
30
33
|
/**
|
|
31
34
|
* Reduce a Markdown heading to the plain text a sidebar shows: images and
|
|
32
35
|
* links keep their text, code spans keep their content, and emphasis and
|
|
@@ -35,6 +38,12 @@ export interface SyncFumadocsNavigationResult {
|
|
|
35
38
|
export declare function stripInlineMarkdown(text: string): string;
|
|
36
39
|
/** Folder title: frontmatter `title`, else the first H1 outside code fences. */
|
|
37
40
|
export declare function resolveFolderTitle(markdown: string): string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The URL Fumadocs assigns a page, following `getSlugs` in fumadocs-core's
|
|
43
|
+
* slugs plugin with the scaffolded `baseUrl: '/'`: group folders are dropped,
|
|
44
|
+
* segments are URI-encoded, and an `index` file maps to its folder.
|
|
45
|
+
*/
|
|
46
|
+
export declare function pageUrl(pagePath: string, nonIndexUrls?: ReadonlySet<string>): string;
|
|
38
47
|
/**
|
|
39
48
|
* The `pages` item for a page or folder in the same directory. A name the
|
|
40
49
|
* builder would read as a directive (`!hidden`, `z...a`, `---`, ...) is
|
|
@@ -42,6 +51,26 @@ export declare function resolveFolderTitle(markdown: string): string | undefined
|
|
|
42
51
|
* the same file; every other name is written as is.
|
|
43
52
|
*/
|
|
44
53
|
export declare function toFumadocsPageItem(name: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* Build one folder's `pages` from its index.md Contents map.
|
|
56
|
+
*
|
|
57
|
+
* A page in this folder or an immediate subfolder is referenced by name.
|
|
58
|
+
* Local same-name page/folder collisions use a precise source-file item, as
|
|
59
|
+
* does `../contributing.md` from its own contributing/ map: pinned core16.10.2
|
|
60
|
+
* selects the folder first for an extensionless reference. Other non-local
|
|
61
|
+
* targets become link entries. There is never a `"..."` rest entry: pages the Contents map does
|
|
62
|
+
* not list stay out of the tree and are reported instead.
|
|
63
|
+
*/
|
|
64
|
+
/**
|
|
65
|
+
* Whether the fumadocs-core 16.10.2 page-tree builder supplies this folder's
|
|
66
|
+
* `index` page on its own, given the folder's effective metadata.
|
|
67
|
+
*
|
|
68
|
+
* `buildFolder` attaches `<folder>/index` as the folder index only when the
|
|
69
|
+
* folder is not a root folder (the docs root, or a preserved `root: true`)
|
|
70
|
+
* and no `pagesIndex` names a different page. Otherwise the page is shown
|
|
71
|
+
* only if `pages` lists it.
|
|
72
|
+
*/
|
|
73
|
+
export declare function hasImplicitIndex(relativeDir: string, existing: Record<string, unknown> | null): boolean;
|
|
45
74
|
/**
|
|
46
75
|
* Write one strict `meta.json` per docs directory that has an index.md,
|
|
47
76
|
* derived from that index's Contents map, and report every page the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fumadocs.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/nav/fumadocs.ts"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,mEAAmE;IACnE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;;OAGG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"fumadocs.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/nav/fumadocs.ts"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,mEAAmE;IACnE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;;OAGG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAOD,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAGlD,CAAC;AACH,eAAO,MAAM,kBAAkB,QACoB,CAAC;AACpD,eAAO,MAAM,aAAa,QAC6D,CAAC;AAmDxF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQxD;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoCvE;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CACrB,QAAQ,EAAE,MAAM,EAChB,YAAY,GAAE,WAAW,CAAC,MAAM,CAAa,GAC5C,MAAM,CAgBR;AAYD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAOD;;;;;;;;;GASG;AACH;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GACvC,OAAO,CAUT;AA8KD;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC,GAAG,OAAO,CAAC,4BAA4B,CAAC,CA8ExC"}
|
|
@@ -10,9 +10,12 @@ const GROUP_FOLDER = /^\(.+\)$/;
|
|
|
10
10
|
// The `pages` item grammar of the fumadocs-core 16.10.2 page-tree builder
|
|
11
11
|
// (`resolveFolderItem`): exact rest entries, separators, links, and the
|
|
12
12
|
// exclude and extract prefixes are checked before an item is read as a path.
|
|
13
|
-
const FUMADOCS_REST_ITEMS = new Set([
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export const FUMADOCS_REST_ITEMS = new Set([
|
|
14
|
+
'...',
|
|
15
|
+
'z...a',
|
|
16
|
+
]);
|
|
17
|
+
export const FUMADOCS_SEPARATOR = /^---(?:\[(?<icon>[^\]]+)])?(?<name>.+)---|^---$/;
|
|
18
|
+
export const FUMADOCS_LINK = /^(?<external>external:)?(?:\[(?<icon>[^\]]+)])?\[(?<name>[^\]]+)]\((?<url>[^)]+)\)$/;
|
|
16
19
|
const FUMADOCS_PREFIXES = ['!', '...'];
|
|
17
20
|
const H1 = /^#\s+(.+?)\s*#*\s*$/;
|
|
18
21
|
const FENCE = /^\s*(```|~~~)/;
|
|
@@ -104,7 +107,7 @@ export function resolveFolderTitle(markdown) {
|
|
|
104
107
|
* slugs plugin with the scaffolded `baseUrl: '/'`: group folders are dropped,
|
|
105
108
|
* segments are URI-encoded, and an `index` file maps to its folder.
|
|
106
109
|
*/
|
|
107
|
-
function pageUrl(pagePath, nonIndexUrls = new Set()) {
|
|
110
|
+
export function pageUrl(pagePath, nonIndexUrls = new Set()) {
|
|
108
111
|
const slugs = parentDir(pagePath)
|
|
109
112
|
.split('/')
|
|
110
113
|
.filter((segment) => segment.length > 0 && segment !== '.')
|
|
@@ -160,7 +163,7 @@ function hrefFragment(href) {
|
|
|
160
163
|
* and no `pagesIndex` names a different page. Otherwise the page is shown
|
|
161
164
|
* only if `pages` lists it.
|
|
162
165
|
*/
|
|
163
|
-
function hasImplicitIndex(relativeDir, existing) {
|
|
166
|
+
export function hasImplicitIndex(relativeDir, existing) {
|
|
164
167
|
if (relativeDir === '.' ||
|
|
165
168
|
existing?.root === true ||
|
|
166
169
|
(typeof existing?.root === 'string' && existing.root.trim().length > 0)) {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type FumadocsMetaFile } from './fumadocs.js';
|
|
2
|
+
/**
|
|
3
|
+
* One way a hand-authored (or undeclared) sidebar disagrees with the authored
|
|
4
|
+
* Contents maps. The comparison checks membership and relative order only:
|
|
5
|
+
* separators, labels, link items, rest entries and pages borrowed from another
|
|
6
|
+
* folder are the author's presentation and are never compared with generator
|
|
7
|
+
* output.
|
|
8
|
+
*/
|
|
9
|
+
export interface NavMembershipIssue {
|
|
10
|
+
/** Content-relative path of the meta.json, or `mkdocs.yml`. */
|
|
11
|
+
path: string;
|
|
12
|
+
kind: 'missing' | 'dangling' | 'order' | 'malformed' | 'unreadable';
|
|
13
|
+
message: string;
|
|
14
|
+
line?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Compare present Fumadocs `meta.json` files with the Contents-derived
|
|
18
|
+
* expectation in `metaFiles` (from a `check` run of nav sync).
|
|
19
|
+
*
|
|
20
|
+
* A Contents entry is reachable when its folder's `pages` lists it, a rest
|
|
21
|
+
* entry shows it, any other `pages` entry borrows it, or a root-relative link
|
|
22
|
+
* item points at its URL. An absent meta.json or one without `pages` uses the
|
|
23
|
+
* loader's folder order and is skipped.
|
|
24
|
+
*/
|
|
25
|
+
export declare function compareFumadocsMembership(docsRoot: string, metaFiles: readonly FumadocsMetaFile[]): Promise<NavMembershipIssue[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Compare a hand-authored MkDocs `nav:` with the Contents maps: every
|
|
28
|
+
* Contents page appears, every local nav page exists, and the entries of
|
|
29
|
+
* each Contents map (pages and section landing pages) keep their order. Section labels, nesting and external
|
|
30
|
+
* links are the author's. Returns no issues when `nav` is absent.
|
|
31
|
+
*/
|
|
32
|
+
export declare function compareMkDocsMembership(options: {
|
|
33
|
+
appRoot: string;
|
|
34
|
+
docsRoot: string;
|
|
35
|
+
nonReaderPaths?: readonly string[];
|
|
36
|
+
}): Promise<NavMembershipIssue[]>;
|
|
37
|
+
//# sourceMappingURL=membership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"membership.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/nav/membership.ts"],"names":[],"mappings":"AAMA,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,WAAW,GAAG,YAAY,CAAC;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAqHD;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,SAAS,gBAAgB,EAAE,GACrC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAoS/B;AAeD;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAAC,OAAO,EAAE;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAwEhC"}
|