@lepid-labs/weft-core 0.1.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/LICENSE +21 -0
- package/dist/anchors/__tests__/markdown.test.d.ts +2 -0
- package/dist/anchors/__tests__/markdown.test.d.ts.map +1 -0
- package/dist/anchors/__tests__/markdown.test.js +130 -0
- package/dist/anchors/__tests__/markdown.test.js.map +1 -0
- package/dist/anchors/__tests__/openapi.test.d.ts +2 -0
- package/dist/anchors/__tests__/openapi.test.d.ts.map +1 -0
- package/dist/anchors/__tests__/openapi.test.js +115 -0
- package/dist/anchors/__tests__/openapi.test.js.map +1 -0
- package/dist/anchors/index.d.ts +35 -0
- package/dist/anchors/index.d.ts.map +1 -0
- package/dist/anchors/index.js +68 -0
- package/dist/anchors/index.js.map +1 -0
- package/dist/anchors/markdown.d.ts +15 -0
- package/dist/anchors/markdown.d.ts.map +1 -0
- package/dist/anchors/markdown.js +71 -0
- package/dist/anchors/markdown.js.map +1 -0
- package/dist/anchors/openapi.d.ts +24 -0
- package/dist/anchors/openapi.d.ts.map +1 -0
- package/dist/anchors/openapi.js +75 -0
- package/dist/anchors/openapi.js.map +1 -0
- package/dist/browser.d.ts +10 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +8 -0
- package/dist/browser.js.map +1 -0
- package/dist/config.d.ts +47 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +393 -0
- package/dist/config.js.map +1 -0
- package/dist/config.test.d.ts +2 -0
- package/dist/config.test.d.ts.map +1 -0
- package/dist/config.test.js +454 -0
- package/dist/config.test.js.map +1 -0
- package/dist/content.d.ts +37 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +57 -0
- package/dist/content.js.map +1 -0
- package/dist/content.test.d.ts +2 -0
- package/dist/content.test.d.ts.map +1 -0
- package/dist/content.test.js +100 -0
- package/dist/content.test.js.map +1 -0
- package/dist/contributions.d.ts +64 -0
- package/dist/contributions.d.ts.map +1 -0
- package/dist/contributions.js +184 -0
- package/dist/contributions.js.map +1 -0
- package/dist/contributions.test.d.ts +2 -0
- package/dist/contributions.test.d.ts.map +1 -0
- package/dist/contributions.test.js +202 -0
- package/dist/contributions.test.js.map +1 -0
- package/dist/fetch/auth.d.ts +15 -0
- package/dist/fetch/auth.d.ts.map +1 -0
- package/dist/fetch/auth.js +38 -0
- package/dist/fetch/auth.js.map +1 -0
- package/dist/fetch/cache.d.ts +25 -0
- package/dist/fetch/cache.d.ts.map +1 -0
- package/dist/fetch/cache.js +68 -0
- package/dist/fetch/cache.js.map +1 -0
- package/dist/fetch/cache.test.d.ts +2 -0
- package/dist/fetch/cache.test.d.ts.map +1 -0
- package/dist/fetch/cache.test.js +73 -0
- package/dist/fetch/cache.test.js.map +1 -0
- package/dist/fetch/clone.d.ts +26 -0
- package/dist/fetch/clone.d.ts.map +1 -0
- package/dist/fetch/clone.js +105 -0
- package/dist/fetch/clone.js.map +1 -0
- package/dist/fetch/fetch.test.d.ts +2 -0
- package/dist/fetch/fetch.test.d.ts.map +1 -0
- package/dist/fetch/fetch.test.js +167 -0
- package/dist/fetch/fetch.test.js.map +1 -0
- package/dist/fetch/resolve.d.ts +34 -0
- package/dist/fetch/resolve.d.ts.map +1 -0
- package/dist/fetch/resolve.js +59 -0
- package/dist/fetch/resolve.js.map +1 -0
- package/dist/freshness.d.ts +29 -0
- package/dist/freshness.d.ts.map +1 -0
- package/dist/freshness.js +170 -0
- package/dist/freshness.js.map +1 -0
- package/dist/freshness.test.d.ts +2 -0
- package/dist/freshness.test.d.ts.map +1 -0
- package/dist/freshness.test.js +209 -0
- package/dist/freshness.test.js.map +1 -0
- package/dist/frontmatter.d.ts +15 -0
- package/dist/frontmatter.d.ts.map +1 -0
- package/dist/frontmatter.js +24 -0
- package/dist/frontmatter.js.map +1 -0
- package/dist/frontmatter.test.d.ts +2 -0
- package/dist/frontmatter.test.d.ts.map +1 -0
- package/dist/frontmatter.test.js +54 -0
- package/dist/frontmatter.test.js.map +1 -0
- package/dist/git.d.ts +55 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +127 -0
- package/dist/git.js.map +1 -0
- package/dist/git.test.d.ts +2 -0
- package/dist/git.test.d.ts.map +1 -0
- package/dist/git.test.js +198 -0
- package/dist/git.test.js.map +1 -0
- package/dist/includes.d.ts +53 -0
- package/dist/includes.d.ts.map +1 -0
- package/dist/includes.js +73 -0
- package/dist/includes.js.map +1 -0
- package/dist/includes.test.d.ts +2 -0
- package/dist/includes.test.d.ts.map +1 -0
- package/dist/includes.test.js +106 -0
- package/dist/includes.test.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/links/__tests__/markdown.test.d.ts +2 -0
- package/dist/links/__tests__/markdown.test.d.ts.map +1 -0
- package/dist/links/__tests__/markdown.test.js +173 -0
- package/dist/links/__tests__/markdown.test.js.map +1 -0
- package/dist/links/__tests__/sidecar.test.d.ts +2 -0
- package/dist/links/__tests__/sidecar.test.d.ts.map +1 -0
- package/dist/links/__tests__/sidecar.test.js +238 -0
- package/dist/links/__tests__/sidecar.test.js.map +1 -0
- package/dist/links/index.d.ts +3 -0
- package/dist/links/index.d.ts.map +1 -0
- package/dist/links/index.js +3 -0
- package/dist/links/index.js.map +1 -0
- package/dist/links/markdown.d.ts +13 -0
- package/dist/links/markdown.d.ts.map +1 -0
- package/dist/links/markdown.js +93 -0
- package/dist/links/markdown.js.map +1 -0
- package/dist/links/sidecar.d.ts +12 -0
- package/dist/links/sidecar.d.ts.map +1 -0
- package/dist/links/sidecar.js +88 -0
- package/dist/links/sidecar.js.map +1 -0
- package/dist/manifest.d.ts +45 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +269 -0
- package/dist/manifest.js.map +1 -0
- package/dist/manifest.test.d.ts +2 -0
- package/dist/manifest.test.d.ts.map +1 -0
- package/dist/manifest.test.js +625 -0
- package/dist/manifest.test.js.map +1 -0
- package/dist/multi-repo.test.d.ts +2 -0
- package/dist/multi-repo.test.d.ts.map +1 -0
- package/dist/multi-repo.test.js +179 -0
- package/dist/multi-repo.test.js.map +1 -0
- package/dist/node-path.d.ts +13 -0
- package/dist/node-path.d.ts.map +1 -0
- package/dist/node-path.js +21 -0
- package/dist/node-path.js.map +1 -0
- package/dist/node-path.test.d.ts +2 -0
- package/dist/node-path.test.d.ts.map +1 -0
- package/dist/node-path.test.js +29 -0
- package/dist/node-path.test.js.map +1 -0
- package/dist/published-links.d.ts +16 -0
- package/dist/published-links.d.ts.map +1 -0
- package/dist/published-links.js +59 -0
- package/dist/published-links.js.map +1 -0
- package/dist/published-links.test.d.ts +2 -0
- package/dist/published-links.test.d.ts.map +1 -0
- package/dist/published-links.test.js +82 -0
- package/dist/published-links.test.js.map +1 -0
- package/dist/repos.d.ts +32 -0
- package/dist/repos.d.ts.map +1 -0
- package/dist/repos.js +46 -0
- package/dist/repos.js.map +1 -0
- package/dist/repos.test.d.ts +2 -0
- package/dist/repos.test.d.ts.map +1 -0
- package/dist/repos.test.js +61 -0
- package/dist/repos.test.js.map +1 -0
- package/dist/scalar-source.d.ts +15 -0
- package/dist/scalar-source.d.ts.map +1 -0
- package/dist/scalar-source.js +21 -0
- package/dist/scalar-source.js.map +1 -0
- package/dist/search.d.ts +14 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +59 -0
- package/dist/search.js.map +1 -0
- package/dist/service-concurrency.test.d.ts +2 -0
- package/dist/service-concurrency.test.d.ts.map +1 -0
- package/dist/service-concurrency.test.js +89 -0
- package/dist/service-concurrency.test.js.map +1 -0
- package/dist/service-history.test.d.ts +2 -0
- package/dist/service-history.test.d.ts.map +1 -0
- package/dist/service-history.test.js +76 -0
- package/dist/service-history.test.js.map +1 -0
- package/dist/service.d.ts +118 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +347 -0
- package/dist/service.js.map +1 -0
- package/dist/service.test.d.ts +2 -0
- package/dist/service.test.d.ts.map +1 -0
- package/dist/service.test.js +313 -0
- package/dist/service.test.js.map +1 -0
- package/dist/types.d.ts +403 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/validate/__tests__/artifacts.test.d.ts +2 -0
- package/dist/validate/__tests__/artifacts.test.d.ts.map +1 -0
- package/dist/validate/__tests__/artifacts.test.js +167 -0
- package/dist/validate/__tests__/artifacts.test.js.map +1 -0
- package/dist/validate/__tests__/assertions.test.d.ts +2 -0
- package/dist/validate/__tests__/assertions.test.d.ts.map +1 -0
- package/dist/validate/__tests__/assertions.test.js +254 -0
- package/dist/validate/__tests__/assertions.test.js.map +1 -0
- package/dist/validate/__tests__/duplicates.test.d.ts +2 -0
- package/dist/validate/__tests__/duplicates.test.d.ts.map +1 -0
- package/dist/validate/__tests__/duplicates.test.js +130 -0
- package/dist/validate/__tests__/duplicates.test.js.map +1 -0
- package/dist/validate/__tests__/edge-resolution.test.d.ts +2 -0
- package/dist/validate/__tests__/edge-resolution.test.d.ts.map +1 -0
- package/dist/validate/__tests__/edge-resolution.test.js +279 -0
- package/dist/validate/__tests__/edge-resolution.test.js.map +1 -0
- package/dist/validate/__tests__/history.test.d.ts +2 -0
- package/dist/validate/__tests__/history.test.d.ts.map +1 -0
- package/dist/validate/__tests__/history.test.js +93 -0
- package/dist/validate/__tests__/history.test.js.map +1 -0
- package/dist/validate/__tests__/includes.test.d.ts +2 -0
- package/dist/validate/__tests__/includes.test.d.ts.map +1 -0
- package/dist/validate/__tests__/includes.test.js +93 -0
- package/dist/validate/__tests__/includes.test.js.map +1 -0
- package/dist/validate/__tests__/registry.test.d.ts +2 -0
- package/dist/validate/__tests__/registry.test.d.ts.map +1 -0
- package/dist/validate/__tests__/registry.test.js +78 -0
- package/dist/validate/__tests__/registry.test.js.map +1 -0
- package/dist/validate/__tests__/run.test.d.ts +2 -0
- package/dist/validate/__tests__/run.test.d.ts.map +1 -0
- package/dist/validate/__tests__/run.test.js +215 -0
- package/dist/validate/__tests__/run.test.js.map +1 -0
- package/dist/validate/history.d.ts +23 -0
- package/dist/validate/history.d.ts.map +1 -0
- package/dist/validate/history.js +45 -0
- package/dist/validate/history.js.map +1 -0
- package/dist/validate/index.d.ts +10 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/dist/validate/index.js +9 -0
- package/dist/validate/index.js.map +1 -0
- package/dist/validate/registry.d.ts +27 -0
- package/dist/validate/registry.d.ts.map +1 -0
- package/dist/validate/registry.js +67 -0
- package/dist/validate/registry.js.map +1 -0
- package/dist/validate/rules/artifacts.d.ts +25 -0
- package/dist/validate/rules/artifacts.d.ts.map +1 -0
- package/dist/validate/rules/artifacts.js +87 -0
- package/dist/validate/rules/artifacts.js.map +1 -0
- package/dist/validate/rules/assertions.d.ts +19 -0
- package/dist/validate/rules/assertions.d.ts.map +1 -0
- package/dist/validate/rules/assertions.js +149 -0
- package/dist/validate/rules/assertions.js.map +1 -0
- package/dist/validate/rules/duplicates.d.ts +20 -0
- package/dist/validate/rules/duplicates.d.ts.map +1 -0
- package/dist/validate/rules/duplicates.js +0 -0
- package/dist/validate/rules/duplicates.js.map +1 -0
- package/dist/validate/rules/edge-resolution.d.ts +15 -0
- package/dist/validate/rules/edge-resolution.d.ts.map +1 -0
- package/dist/validate/rules/edge-resolution.js +185 -0
- package/dist/validate/rules/edge-resolution.js.map +1 -0
- package/dist/validate/rules/includes.d.ts +21 -0
- package/dist/validate/rules/includes.d.ts.map +1 -0
- package/dist/validate/rules/includes.js +112 -0
- package/dist/validate/rules/includes.js.map +1 -0
- package/dist/validate/run.d.ts +20 -0
- package/dist/validate/run.d.ts.map +1 -0
- package/dist/validate/run.js +90 -0
- package/dist/validate/run.js.map +1 -0
- package/dist/validate/types.d.ts +101 -0
- package/dist/validate/types.d.ts.map +1 -0
- package/dist/validate/types.js +2 -0
- package/dist/validate/types.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/links/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/links/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type DocsRoot } from "../config.js";
|
|
2
|
+
import { type RepoMap } from "../repos.js";
|
|
3
|
+
import type { WeftEdge } from "../types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Extract graph edges from Markdown content.
|
|
6
|
+
* A link is a graph edge if it targets a file within any configured docs root —
|
|
7
|
+
* a link that leaves its own root but lands in another project's root becomes a
|
|
8
|
+
* cross-project edge rather than being dropped. A GitHub blob URL into a repo
|
|
9
|
+
* the `repos` map knows resolves against that checkout the same way, so the
|
|
10
|
+
* same Markdown works on GitHub and in weft; unmapped URLs stay external links.
|
|
11
|
+
*/
|
|
12
|
+
export declare function extractMarkdownLinks(content: string, filePath: string, roots: DocsRoot[], repos?: RepoMap): WeftEdge[];
|
|
13
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/links/markdown.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,QAAQ,EAA0B,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,KAAK,OAAO,EAAsB,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,aAAa,CAAC;AAsBrD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,QAAQ,EAAE,EACjB,KAAK,CAAC,EAAE,OAAO,GACb,QAAQ,EAAE,CAoEZ"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { dirname, relative, resolve, sep } from "node:path";
|
|
2
|
+
import remarkParse from "remark-parse";
|
|
3
|
+
import { unified } from "unified";
|
|
4
|
+
import { visit } from "unist-util-visit";
|
|
5
|
+
import { nodeIdFor, rootForPath } from "../config.js";
|
|
6
|
+
import { parseGitHubBlobUrl } from "../repos.js";
|
|
7
|
+
/**
|
|
8
|
+
* Template placeholders left in a link path by a renderer's source form:
|
|
9
|
+
* Handlebars/Jinja/Liquid/Quarto `{{ }}` and `{% %}`, JS `${ }`, ERB/EJS `<% %>`.
|
|
10
|
+
*/
|
|
11
|
+
const TEMPLATE_SYNTAX = /\{\{|\{%|\$\{|<%/;
|
|
12
|
+
/**
|
|
13
|
+
* Node ids are always POSIX-separated. `relative()` returns native separators,
|
|
14
|
+
* so on Windows a nested path would otherwise become `schemas\user.md` and stop
|
|
15
|
+
* matching the id the manifest records for that document.
|
|
16
|
+
*/
|
|
17
|
+
function toPosix(path) {
|
|
18
|
+
return path.split(sep).join("/");
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Extract graph edges from Markdown content.
|
|
22
|
+
* A link is a graph edge if it targets a file within any configured docs root —
|
|
23
|
+
* a link that leaves its own root but lands in another project's root becomes a
|
|
24
|
+
* cross-project edge rather than being dropped. A GitHub blob URL into a repo
|
|
25
|
+
* the `repos` map knows resolves against that checkout the same way, so the
|
|
26
|
+
* same Markdown works on GitHub and in weft; unmapped URLs stay external links.
|
|
27
|
+
*/
|
|
28
|
+
export function extractMarkdownLinks(content, filePath, roots, repos) {
|
|
29
|
+
const tree = unified().use(remarkParse).parse(content);
|
|
30
|
+
const links = [];
|
|
31
|
+
visit(tree, "link", (node) => {
|
|
32
|
+
// Skip anchor-only links
|
|
33
|
+
if (node.url.startsWith("#"))
|
|
34
|
+
return;
|
|
35
|
+
const label = node.children
|
|
36
|
+
.map((c) => ("value" in c ? c.value : ""))
|
|
37
|
+
.join("")
|
|
38
|
+
.trim();
|
|
39
|
+
links.push({ label, url: node.url });
|
|
40
|
+
});
|
|
41
|
+
const fileDir = dirname(filePath);
|
|
42
|
+
const edges = [];
|
|
43
|
+
const sourceRoot = rootForPath(roots, filePath);
|
|
44
|
+
if (!sourceRoot)
|
|
45
|
+
return edges;
|
|
46
|
+
const fromNode = nodeIdFor(sourceRoot, relative(sourceRoot.absDir, filePath));
|
|
47
|
+
for (const link of links) {
|
|
48
|
+
let absTarget;
|
|
49
|
+
let anchor;
|
|
50
|
+
let resolvedFrom;
|
|
51
|
+
if (link.url.startsWith("http://") || link.url.startsWith("https://")) {
|
|
52
|
+
const blob = parseGitHubBlobUrl(link.url);
|
|
53
|
+
const checkout = blob && repos?.get(blob.repo);
|
|
54
|
+
// Any other URL — or a blob URL into a repo with no mapped checkout —
|
|
55
|
+
// is an ordinary external link, not an edge.
|
|
56
|
+
if (!blob || !checkout)
|
|
57
|
+
continue;
|
|
58
|
+
absTarget = resolve(checkout, blob.path);
|
|
59
|
+
anchor = blob.anchor?.slice(1);
|
|
60
|
+
resolvedFrom = link.url;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
const [pathPart, fragment] = link.url.split("#");
|
|
64
|
+
if (!pathPart)
|
|
65
|
+
continue;
|
|
66
|
+
// A path still holding template syntax has not been resolved yet — the
|
|
67
|
+
// renderer decides what it points at. Recording an edge to the literal
|
|
68
|
+
// text would invent a node that never exists and report correct source
|
|
69
|
+
// as broken.
|
|
70
|
+
if (TEMPLATE_SYNTAX.test(pathPart))
|
|
71
|
+
continue;
|
|
72
|
+
absTarget = resolve(fileDir, pathPart);
|
|
73
|
+
anchor = fragment;
|
|
74
|
+
}
|
|
75
|
+
const targetRoot = rootForPath(roots, absTarget);
|
|
76
|
+
// Only treat as graph edge if the target lands inside a configured docs root
|
|
77
|
+
if (!targetRoot)
|
|
78
|
+
continue;
|
|
79
|
+
const from = { node: fromNode };
|
|
80
|
+
const to = { node: nodeIdFor(targetRoot, relative(targetRoot.absDir, absTarget)) };
|
|
81
|
+
if (anchor)
|
|
82
|
+
to.anchor = `#${anchor}`;
|
|
83
|
+
edges.push({
|
|
84
|
+
from,
|
|
85
|
+
to,
|
|
86
|
+
type: "references",
|
|
87
|
+
label: link.label || undefined,
|
|
88
|
+
...(resolvedFrom ? { resolvedFrom } : {}),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return edges;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/links/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE5D,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAiB,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAgB,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAQ/D;;;GAGG;AACH,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAE3C;;;;GAIG;AACH,SAAS,OAAO,CAAC,IAAY;IAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CACnC,OAAe,EACf,QAAgB,EAChB,KAAiB,EACjB,KAAe;IAEf,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAA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S;YAC9B,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type DocsRoot } from "../config.js";
|
|
2
|
+
import type { WeftEdge } from "../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Extract graph edges from a .weft sidecar YAML file.
|
|
5
|
+
* The sidecar sits next to a source file: `architecture.md.weft` is the sidecar for `architecture.md`.
|
|
6
|
+
*
|
|
7
|
+
* Targets are relative to the source document's own docs root. In multi-project
|
|
8
|
+
* mode a target may instead be qualified with another project's slug
|
|
9
|
+
* (`beta/api.yaml`) to point across products.
|
|
10
|
+
*/
|
|
11
|
+
export declare function extractSidecarLinks(content: string, sidecarPath: string, roots: DocsRoot[]): WeftEdge[];
|
|
12
|
+
//# sourceMappingURL=sidecar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidecar.d.ts","sourceRoot":"","sources":["../../src/links/sidecar.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAA0B,MAAM,cAAc,CAAC;AAGrE,OAAO,KAAK,EAKX,QAAQ,EACR,MAAM,aAAa,CAAC;AAkDrB;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,QAAQ,EAAE,GACf,QAAQ,EAAE,CAiDZ"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { relative } from "node:path";
|
|
2
|
+
import { isMap, isSeq, parseDocument } from "yaml";
|
|
3
|
+
import { nodeIdFor, rootForPath } from "../config.js";
|
|
4
|
+
import { CONTRIBUTES_MODES, HEADING_SHIFTS } from "../includes.js";
|
|
5
|
+
import { scalarText } from "../scalar-source.js";
|
|
6
|
+
/**
|
|
7
|
+
* True when a link declared a non-empty assertion mapping.
|
|
8
|
+
*
|
|
9
|
+
* What was asserted is not checked here: extraction records the claim, and the
|
|
10
|
+
* validation stage is where a malformed or uncheckable one gets reported, with
|
|
11
|
+
* a rule id and a severity a project can configure.
|
|
12
|
+
*/
|
|
13
|
+
function hasAssertions(value) {
|
|
14
|
+
return (typeof value === "object" &&
|
|
15
|
+
value !== null &&
|
|
16
|
+
!Array.isArray(value) &&
|
|
17
|
+
Object.keys(value).length > 0);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The recorded source hash of one link, read as written.
|
|
21
|
+
*
|
|
22
|
+
* Straight off the parsed object this would be a number whenever the hash's
|
|
23
|
+
* sixteen hex characters all happen to be digits — leading zeros gone, and the
|
|
24
|
+
* value silently no longer matching anything. Rare, and exactly the kind of
|
|
25
|
+
* intermittent failure nobody would think to look for.
|
|
26
|
+
*/
|
|
27
|
+
function sourceHashOf(doc, index) {
|
|
28
|
+
const links = doc.get("links", true);
|
|
29
|
+
if (!isSeq(links))
|
|
30
|
+
return undefined;
|
|
31
|
+
const link = links.get(index, true);
|
|
32
|
+
return isMap(link) ? scalarText(link.get("sourceHash", true)) : undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Extract graph edges from a .weft sidecar YAML file.
|
|
36
|
+
* The sidecar sits next to a source file: `architecture.md.weft` is the sidecar for `architecture.md`.
|
|
37
|
+
*
|
|
38
|
+
* Targets are relative to the source document's own docs root. In multi-project
|
|
39
|
+
* mode a target may instead be qualified with another project's slug
|
|
40
|
+
* (`beta/api.yaml`) to point across products.
|
|
41
|
+
*/
|
|
42
|
+
export function extractSidecarLinks(content, sidecarPath, roots) {
|
|
43
|
+
const doc = parseDocument(content);
|
|
44
|
+
const data = doc.toJS();
|
|
45
|
+
if (!data?.links?.length)
|
|
46
|
+
return [];
|
|
47
|
+
// Sidecar file name: strip .weft to get the source file
|
|
48
|
+
const sourceFile = sidecarPath.replace(/\.weft$/, "");
|
|
49
|
+
const sourceRoot = rootForPath(roots, sourceFile);
|
|
50
|
+
if (!sourceRoot)
|
|
51
|
+
return [];
|
|
52
|
+
const fromNode = nodeIdFor(sourceRoot, relative(sourceRoot.absDir, sourceFile));
|
|
53
|
+
const slugs = new Set(roots.map((root) => root.slug).filter(Boolean));
|
|
54
|
+
return data.links.map((link, index) => {
|
|
55
|
+
const [targetPath, targetAnchor] = link.target.split("#");
|
|
56
|
+
// A target already qualified with a known project slug is used as-is;
|
|
57
|
+
// anything else resolves within the source document's own project.
|
|
58
|
+
const qualified = slugs.has(targetPath.split("/")[0])
|
|
59
|
+
? targetPath
|
|
60
|
+
: nodeIdFor(sourceRoot, targetPath);
|
|
61
|
+
const from = { node: fromNode };
|
|
62
|
+
if (link.anchor)
|
|
63
|
+
from.anchor = link.anchor;
|
|
64
|
+
const to = { node: qualified };
|
|
65
|
+
if (targetAnchor)
|
|
66
|
+
to.anchor = `#${targetAnchor}`;
|
|
67
|
+
const sourceHash = sourceHashOf(doc, index);
|
|
68
|
+
return {
|
|
69
|
+
from,
|
|
70
|
+
to,
|
|
71
|
+
type: link.type ?? "references",
|
|
72
|
+
label: link.label,
|
|
73
|
+
...(link.pending === true ? { pending: true } : {}),
|
|
74
|
+
...(hasAssertions(link.asserts) ? { asserts: link.asserts } : {}),
|
|
75
|
+
...(sourceHash ? { sourceHash } : {}),
|
|
76
|
+
// Only a recognised value is recorded, matching how `pending` accepts
|
|
77
|
+
// only `true` — a typo falls back to the configured default rather than
|
|
78
|
+
// travelling into the manifest as an unknown mode.
|
|
79
|
+
...(HEADING_SHIFTS.includes(link.headingShift)
|
|
80
|
+
? { headingShift: link.headingShift }
|
|
81
|
+
: {}),
|
|
82
|
+
...(CONTRIBUTES_MODES.includes(link.contributes)
|
|
83
|
+
? { contributes: link.contributes }
|
|
84
|
+
: {}),
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=sidecar.js.map
|
|
@@ -0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AAI,YAAY;YAAE,EAAE,CAAC,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAEjD,MAAM,UAAU,GAAG,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAE5C,OAAO;YACN,IAAI;YACJ,EAAE;YACF,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,YAAY;YAC/B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACnD,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACrC,sEAAsE;YACtE,wEAAwE;YACxE,mDAAmD;YACnD,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAmC,CAAC;gBACpE,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE;gBACrC,CAAC,CAAC,EAAE,CAAC;YACN,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAiC,CAAC;gBACrE,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;gBACnC,CAAC,CAAC,EAAE,CAAC;SACN,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { INDEXED_EXTENSIONS, isIndexedPath, resolveIndexedExtensions } from "./anchors/index.js";
|
|
2
|
+
import { type DocsRoot } from "./config.js";
|
|
3
|
+
import { type LoadedContribution } from "./contributions.js";
|
|
4
|
+
import type { Manifest, ManifestBuild, ProjectManifest, WeftConfig, WeftEdge, WeftNode } from "./types.js";
|
|
5
|
+
export { INDEXED_EXTENSIONS, isIndexedPath, resolveIndexedExtensions };
|
|
6
|
+
/**
|
|
7
|
+
* Manifest schema version.
|
|
8
|
+
*
|
|
9
|
+
* 2 — `WeftNode.anchors` holds `Anchor` objects rather than bare slug strings,
|
|
10
|
+
* and slugs now match GitHub's own slugger, so some anchor values changed.
|
|
11
|
+
*/
|
|
12
|
+
export declare const MANIFEST_VERSION = 2;
|
|
13
|
+
/** The nodes and edges discovered in a single docs root. */
|
|
14
|
+
export interface RootGraph {
|
|
15
|
+
nodes: WeftNode[];
|
|
16
|
+
edges: WeftEdge[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Scan one docs root. `roots` is the full set, so links leaving this root into
|
|
20
|
+
* another project still resolve to a node id.
|
|
21
|
+
*
|
|
22
|
+
* Pass `dates` when a history walk has already been paid for — the service
|
|
23
|
+
* shares one walk between indexing and validation — and the scan will not run
|
|
24
|
+
* its own.
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildRootGraph(config: WeftConfig, root: DocsRoot, roots: DocsRoot[], dates?: Map<string, string>): Promise<RootGraph>;
|
|
27
|
+
/**
|
|
28
|
+
* Combine per-root graphs into the merged manifest, applying ordering config.
|
|
29
|
+
*
|
|
30
|
+
* `build` is stamped in rather than computed: this function is pure over
|
|
31
|
+
* already-scanned graphs and touches no filesystem, while computing the
|
|
32
|
+
* inputs hash requires globbing and reading. The caller runs
|
|
33
|
+
* `computeInputsHash` and passes the result in, the same way it already does
|
|
34
|
+
* for contributions.
|
|
35
|
+
*/
|
|
36
|
+
export declare function mergeGraphs(config: WeftConfig, roots: DocsRoot[], graphs: Map<string, RootGraph>, contributions?: LoadedContribution[], build?: ManifestBuild): Manifest;
|
|
37
|
+
/**
|
|
38
|
+
* Partition a merged manifest into one manifest per project. An edge belongs to
|
|
39
|
+
* the project of its source node, so the split and the merge are exact inverses.
|
|
40
|
+
* Returns an empty array in single-project mode.
|
|
41
|
+
*/
|
|
42
|
+
export declare function splitManifest(manifest: Manifest, roots: DocsRoot[]): ProjectManifest[];
|
|
43
|
+
/** Scan every configured docs root and build the merged graph manifest. */
|
|
44
|
+
export declare function buildManifest(config: WeftConfig): Promise<Manifest>;
|
|
45
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,kBAAkB,EAIlB,aAAa,EAEb,wBAAwB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,KAAK,QAAQ,EAA0D,MAAM,aAAa,CAAC;AAEpG,OAAO,EAAE,KAAK,kBAAkB,EAAyC,MAAM,oBAAoB,CAAC;AASpG,OAAO,KAAK,EACX,QAAQ,EACR,aAAa,EACb,eAAe,EAEf,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,wBAAwB,EAAE,CAAC;AAEvE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,4DAA4D;AAC5D,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CACnC,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,QAAQ,EAAE,EACjB,KAAK,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACzB,OAAO,CAAC,SAAS,CAAC,CA+EpB;AA8DD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAC1B,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,QAAQ,EAAE,EACjB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,EAC9B,aAAa,GAAE,kBAAkB,EAAO,EACxC,KAAK,CAAC,EAAE,aAAa,GACnB,QAAQ,CA0DV;AAeD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,CAetF;AAED,2EAA2E;AAC3E,wBAAsB,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAqBzE"}
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { relative, resolve } from "node:path";
|
|
3
|
+
import { glob } from "glob";
|
|
4
|
+
import { INDEXED_EXTENSIONS, extractAnchors, extractTitle, getDocType, isIndexedPath, resolveExtensionMap, resolveIndexedExtensions, } from "./anchors/index.js";
|
|
5
|
+
import { extractMarkdownDescription } from "./anchors/markdown.js";
|
|
6
|
+
import { isNamespaced, nodeIdFor, projectRefs, resolveDocsRoots } from "./config.js";
|
|
7
|
+
import { countLines, hashBytes, hashContent } from "./content.js";
|
|
8
|
+
import { applyContributions, loadContributions } from "./contributions.js";
|
|
9
|
+
import { computeInputsHash } from "./freshness.js";
|
|
10
|
+
import { parseFrontmatter } from "./frontmatter.js";
|
|
11
|
+
import { lastCommitDates } from "./git.js";
|
|
12
|
+
import { applyIncludeDefaults } from "./includes.js";
|
|
13
|
+
import { extractMarkdownLinks } from "./links/markdown.js";
|
|
14
|
+
import { extractSidecarLinks } from "./links/sidecar.js";
|
|
15
|
+
import { resolvePublishedLinks } from "./published-links.js";
|
|
16
|
+
import { resolveRepos } from "./repos.js";
|
|
17
|
+
export { INDEXED_EXTENSIONS, isIndexedPath, resolveIndexedExtensions };
|
|
18
|
+
/**
|
|
19
|
+
* Manifest schema version.
|
|
20
|
+
*
|
|
21
|
+
* 2 — `WeftNode.anchors` holds `Anchor` objects rather than bare slug strings,
|
|
22
|
+
* and slugs now match GitHub's own slugger, so some anchor values changed.
|
|
23
|
+
*/
|
|
24
|
+
export const MANIFEST_VERSION = 2;
|
|
25
|
+
/**
|
|
26
|
+
* Scan one docs root. `roots` is the full set, so links leaving this root into
|
|
27
|
+
* another project still resolve to a node id.
|
|
28
|
+
*
|
|
29
|
+
* Pass `dates` when a history walk has already been paid for — the service
|
|
30
|
+
* shares one walk between indexing and validation — and the scan will not run
|
|
31
|
+
* its own.
|
|
32
|
+
*/
|
|
33
|
+
export async function buildRootGraph(config, root, roots, dates) {
|
|
34
|
+
const docsDir = root.absDir;
|
|
35
|
+
const indexedExtensions = resolveIndexedExtensions(config);
|
|
36
|
+
const extensionMap = resolveExtensionMap(config.extensions);
|
|
37
|
+
const repoMap = resolveRepos(config.repos, config.rootDir);
|
|
38
|
+
// Find all doc files
|
|
39
|
+
const files = await glob(`**/*.{${indexedExtensions.join(",")}}`, {
|
|
40
|
+
cwd: docsDir,
|
|
41
|
+
ignore: config.ignore,
|
|
42
|
+
nodir: true,
|
|
43
|
+
});
|
|
44
|
+
// Find all sidecar files
|
|
45
|
+
const sidecarFiles = await glob("**/*.weft", {
|
|
46
|
+
cwd: docsDir,
|
|
47
|
+
ignore: config.ignore,
|
|
48
|
+
nodir: true,
|
|
49
|
+
});
|
|
50
|
+
// One history walk for the whole root, since every file read below wants a
|
|
51
|
+
// date. Empty outside a git work tree, which is not an error.
|
|
52
|
+
const modifiedDates = dates ?? (await lastCommitDates(docsDir));
|
|
53
|
+
const nodes = [];
|
|
54
|
+
const edges = [];
|
|
55
|
+
for (const file of files) {
|
|
56
|
+
const absPath = resolve(docsDir, file);
|
|
57
|
+
const docType = getDocType(file, extensionMap);
|
|
58
|
+
if (!docType)
|
|
59
|
+
continue;
|
|
60
|
+
const raw = readFileSync(absPath, "utf-8");
|
|
61
|
+
const { data: frontmatter, body } = docType === "markdown" ? parseFrontmatter(raw) : { data: {}, body: raw };
|
|
62
|
+
const anchors = extractAnchors(body, docType);
|
|
63
|
+
const title = frontmatter.title ?? extractTitle(body, docType) ?? file;
|
|
64
|
+
const description = frontmatter.description ??
|
|
65
|
+
(docType === "markdown" ? extractMarkdownDescription(body) : undefined);
|
|
66
|
+
// git reports forward slashes on every platform, glob does not.
|
|
67
|
+
const modified = modifiedDates.get(relative(docsDir, absPath).replace(/\\/g, "/"));
|
|
68
|
+
nodes.push({
|
|
69
|
+
id: nodeIdFor(root, relative(docsDir, absPath)),
|
|
70
|
+
type: docType,
|
|
71
|
+
title,
|
|
72
|
+
anchors,
|
|
73
|
+
// Computed here because the file is already in hand — no consumer of
|
|
74
|
+
// these has to re-read the docs tree to get them.
|
|
75
|
+
contentHash: hashContent(raw),
|
|
76
|
+
lineCount: countLines(raw),
|
|
77
|
+
...(frontmatter.version ? { version: frontmatter.version } : {}),
|
|
78
|
+
...(modified ? { modified } : {}),
|
|
79
|
+
...(root.slug ? { project: root.slug } : {}),
|
|
80
|
+
...(frontmatter.theme ? { theme: frontmatter.theme } : {}),
|
|
81
|
+
...(description ? { description } : {}),
|
|
82
|
+
...(frontmatter.ogImage ? { ogImage: frontmatter.ogImage } : {}),
|
|
83
|
+
});
|
|
84
|
+
// Extract links from markdown files
|
|
85
|
+
if (docType === "markdown") {
|
|
86
|
+
edges.push(...extractMarkdownLinks(body, absPath, roots, repoMap));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
nodes.push(...(await findArtifacts(config, root, new Set(nodes.map((node) => node.id)))));
|
|
90
|
+
// Extract links from sidecar files
|
|
91
|
+
for (const sidecarFile of sidecarFiles) {
|
|
92
|
+
const absPath = resolve(docsDir, sidecarFile);
|
|
93
|
+
const content = readFileSync(absPath, "utf-8");
|
|
94
|
+
edges.push(...extractSidecarLinks(content, absPath, roots));
|
|
95
|
+
}
|
|
96
|
+
return { nodes, edges };
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Register the generated outputs configured for a root.
|
|
100
|
+
*
|
|
101
|
+
* An artifact is a node so an edge has something to point at, and nothing more:
|
|
102
|
+
* no anchors to extract, no text to read, and never in the nav. The title is the
|
|
103
|
+
* file name because a node must have one and a PDF does not offer a better
|
|
104
|
+
* answer — nothing displays it, since `hiddenFromNav` keeps artifacts out of the
|
|
105
|
+
* tree and consumers are expected to skip them.
|
|
106
|
+
*/
|
|
107
|
+
async function findArtifacts(config, root, indexed) {
|
|
108
|
+
if (!config.artifacts?.length)
|
|
109
|
+
return [];
|
|
110
|
+
const files = await glob(config.artifacts, {
|
|
111
|
+
cwd: root.absDir,
|
|
112
|
+
ignore: config.ignore,
|
|
113
|
+
nodir: true,
|
|
114
|
+
posix: true,
|
|
115
|
+
});
|
|
116
|
+
// Sorted so a manifest does not change purely because the filesystem
|
|
117
|
+
// enumerated a directory differently. A pattern wide enough to catch an
|
|
118
|
+
// indexed document loses to the document: it has anchors and content, and
|
|
119
|
+
// replacing it with a hash and a file name would be a downgrade.
|
|
120
|
+
return files
|
|
121
|
+
.sort()
|
|
122
|
+
.filter((file) => !indexed.has(nodeIdFor(root, file)))
|
|
123
|
+
.map((file) => ({
|
|
124
|
+
id: nodeIdFor(root, file),
|
|
125
|
+
type: "artifact",
|
|
126
|
+
title: file.slice(file.lastIndexOf("/") + 1),
|
|
127
|
+
anchors: [],
|
|
128
|
+
// Bytes, not normalized text: an artifact is whatever it literally is.
|
|
129
|
+
// No line count either — there are no lines to count.
|
|
130
|
+
contentHash: hashBytes(readFileSync(resolve(root.absDir, file))),
|
|
131
|
+
hiddenFromNav: true,
|
|
132
|
+
...(root.slug ? { project: root.slug } : {}),
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Map a `docOrder` entry to a node id. Accepts a path relative to the project
|
|
137
|
+
* root (`products/alpha/docs/features.md`), an already-qualified node id
|
|
138
|
+
* (`alpha/features.md`), or a plain filename in single-project mode.
|
|
139
|
+
*/
|
|
140
|
+
function normalizeDocOrderEntry(entry, roots) {
|
|
141
|
+
const path = entry.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
142
|
+
// A repo-backed root's `dir` is relative to its checkout, not the project
|
|
143
|
+
// root, so matching it here would collide with a sibling root that really
|
|
144
|
+
// does live at that path. Order a repo-backed root's docs by node id instead.
|
|
145
|
+
const byDir = roots
|
|
146
|
+
.filter((root) => root.repo === undefined)
|
|
147
|
+
.sort((a, b) => b.dir.length - a.dir.length)
|
|
148
|
+
.find((root) => root.dir && path.startsWith(`${root.dir}/`));
|
|
149
|
+
return byDir ? nodeIdFor(byDir, path.slice(byDir.dir.length + 1)) : path;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Combine per-root graphs into the merged manifest, applying ordering config.
|
|
153
|
+
*
|
|
154
|
+
* `build` is stamped in rather than computed: this function is pure over
|
|
155
|
+
* already-scanned graphs and touches no filesystem, while computing the
|
|
156
|
+
* inputs hash requires globbing and reading. The caller runs
|
|
157
|
+
* `computeInputsHash` and passes the result in, the same way it already does
|
|
158
|
+
* for contributions.
|
|
159
|
+
*/
|
|
160
|
+
export function mergeGraphs(config, roots, graphs, contributions = [], build) {
|
|
161
|
+
const scanned = [];
|
|
162
|
+
const scannedEdges = [];
|
|
163
|
+
for (const root of roots) {
|
|
164
|
+
const graph = graphs.get(root.slug);
|
|
165
|
+
if (!graph)
|
|
166
|
+
continue;
|
|
167
|
+
scanned.push(...graph.nodes);
|
|
168
|
+
scannedEdges.push(...graph.edges);
|
|
169
|
+
}
|
|
170
|
+
// Contributions merge before ordering, so a contributed node sorts and
|
|
171
|
+
// honours docOrder exactly like an indexed one.
|
|
172
|
+
const merged = applyContributions({ nodes: scanned, edges: scannedEdges }, contributions);
|
|
173
|
+
let nodes = merged.nodes;
|
|
174
|
+
// After contributions, so a node the build declared can be what a published
|
|
175
|
+
// link resolves to. Include defaults are stamped last, over the full edge
|
|
176
|
+
// set, so a contributed include edge resolves the same way a sidecar's does.
|
|
177
|
+
const edges = applyIncludeDefaults(resolvePublishedLinks(merged.nodes, merged.edges), config.includes);
|
|
178
|
+
nodes.sort((a, b) => a.id.localeCompare(b.id));
|
|
179
|
+
if (config.docOrder?.length) {
|
|
180
|
+
const order = config.docOrder.map((entry) => normalizeDocOrderEntry(entry, roots));
|
|
181
|
+
nodes.sort((a, b) => {
|
|
182
|
+
const ai = order.indexOf(a.id);
|
|
183
|
+
const bi = order.indexOf(b.id);
|
|
184
|
+
if (ai === -1 && bi === -1)
|
|
185
|
+
return 0;
|
|
186
|
+
if (ai === -1)
|
|
187
|
+
return 1;
|
|
188
|
+
if (bi === -1)
|
|
189
|
+
return -1;
|
|
190
|
+
return ai - bi;
|
|
191
|
+
});
|
|
192
|
+
// Strict mode is a nav filter, not a graph filter: dropping the unlisted
|
|
193
|
+
// nodes would leave every edge touching one of them dangling, so mark
|
|
194
|
+
// them instead and let the LHN skip them.
|
|
195
|
+
if (config.docOrderStrict) {
|
|
196
|
+
nodes = nodes.map((node) => order.includes(node.id) ? node : { ...node, hiddenFromNav: true });
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const projects = projectRefs(roots);
|
|
200
|
+
const site = siteConfig(config);
|
|
201
|
+
return {
|
|
202
|
+
version: MANIFEST_VERSION,
|
|
203
|
+
nodes,
|
|
204
|
+
edges,
|
|
205
|
+
...(projects.length ? { projects } : {}),
|
|
206
|
+
...(site ? { site } : {}),
|
|
207
|
+
...(build ? { build } : {}),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/** Extract the presentation fields the UI consumes. Undefined when none are set. */
|
|
211
|
+
function siteConfig(config) {
|
|
212
|
+
const site = {};
|
|
213
|
+
if (config.defaultTheme)
|
|
214
|
+
site.defaultTheme = config.defaultTheme;
|
|
215
|
+
if (config.style)
|
|
216
|
+
site.style = config.style;
|
|
217
|
+
if (config.styleUrl)
|
|
218
|
+
site.styleUrl = config.styleUrl;
|
|
219
|
+
if (config.layout)
|
|
220
|
+
site.layout = config.layout;
|
|
221
|
+
if (config.siteTitle)
|
|
222
|
+
site.siteTitle = config.siteTitle;
|
|
223
|
+
if (config.siteUrl)
|
|
224
|
+
site.siteUrl = config.siteUrl;
|
|
225
|
+
if (config.ogImage)
|
|
226
|
+
site.ogImage = config.ogImage;
|
|
227
|
+
return Object.keys(site).length ? site : undefined;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Partition a merged manifest into one manifest per project. An edge belongs to
|
|
231
|
+
* the project of its source node, so the split and the merge are exact inverses.
|
|
232
|
+
* Returns an empty array in single-project mode.
|
|
233
|
+
*/
|
|
234
|
+
export function splitManifest(manifest, roots) {
|
|
235
|
+
if (!isNamespaced(roots))
|
|
236
|
+
return [];
|
|
237
|
+
const slugs = new Set(roots.map((root) => root.slug));
|
|
238
|
+
const slugOf = (nodeId) => {
|
|
239
|
+
const first = nodeId.split("/")[0];
|
|
240
|
+
return slugs.has(first) ? first : "";
|
|
241
|
+
};
|
|
242
|
+
return projectRefs(roots).map((project) => ({
|
|
243
|
+
version: manifest.version,
|
|
244
|
+
project,
|
|
245
|
+
nodes: manifest.nodes.filter((node) => node.project === project.slug),
|
|
246
|
+
edges: manifest.edges.filter((edge) => slugOf(edge.from.node) === project.slug),
|
|
247
|
+
}));
|
|
248
|
+
}
|
|
249
|
+
/** Scan every configured docs root and build the merged graph manifest. */
|
|
250
|
+
export async function buildManifest(config) {
|
|
251
|
+
const roots = resolveDocsRoots(config);
|
|
252
|
+
// Hashed before the scan, not after: a file edited mid-scan would otherwise
|
|
253
|
+
// land in the hash but not in the graph, and the manifest would be stale
|
|
254
|
+
// yet report itself fresh. Hashing first inverts that race to the safe
|
|
255
|
+
// side — a file edited between the hash and the scan makes the manifest
|
|
256
|
+
// report stale when it is actually current, which costs an extra rebuild
|
|
257
|
+
// rather than a wrong "fresh" answer. That's the whole point of freshness,
|
|
258
|
+
// so the window has to fail toward stale.
|
|
259
|
+
const build = {
|
|
260
|
+
builtAt: new Date().toISOString(),
|
|
261
|
+
inputsHash: await computeInputsHash(config),
|
|
262
|
+
};
|
|
263
|
+
const graphs = new Map();
|
|
264
|
+
for (const root of roots) {
|
|
265
|
+
graphs.set(root.slug, await buildRootGraph(config, root, roots));
|
|
266
|
+
}
|
|
267
|
+
return mergeGraphs(config, roots, graphs, await loadContributions(config), build);
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACN,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,wBAAwB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAiB,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAA2B,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,YA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