archidocs 0.0.0-stage → 1.2.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/README.md +181 -2
- package/dist/cli/commands.d.ts +322 -0
- package/dist/cli/commands.js +174 -0
- package/dist/cli/dev.d.ts +31 -0
- package/dist/cli/dev.js +156 -0
- package/dist/cli/diff-format.d.ts +9 -0
- package/dist/cli/diff-format.js +50 -0
- package/dist/cli/format.d.ts +15 -0
- package/dist/cli/format.js +64 -0
- package/dist/cli/init.d.ts +17 -0
- package/dist/cli/init.js +82 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +330 -0
- package/dist/core/adr.d.ts +28 -0
- package/dist/core/adr.js +88 -0
- package/dist/core/adrs.d.ts +20 -0
- package/dist/core/adrs.js +86 -0
- package/dist/core/catalogue.d.ts +7 -0
- package/dist/core/catalogue.js +35 -0
- package/dist/core/compare.d.ts +21 -0
- package/dist/core/compare.js +62 -0
- package/dist/core/deployment-views.d.ts +28 -0
- package/dist/core/deployment-views.js +108 -0
- package/dist/core/deployments.d.ts +18 -0
- package/dist/core/deployments.js +21 -0
- package/dist/core/diff.d.ts +44 -0
- package/dist/core/diff.js +138 -0
- package/dist/core/dynamic-views.d.ts +73 -0
- package/dist/core/dynamic-views.js +162 -0
- package/dist/core/files.d.ts +2 -0
- package/dist/core/files.js +1 -0
- package/dist/core/fs.d.ts +19 -0
- package/dist/core/fs.js +21 -0
- package/dist/core/history-scope.d.ts +40 -0
- package/dist/core/history-scope.js +63 -0
- package/dist/core/impact.d.ts +34 -0
- package/dist/core/impact.js +62 -0
- package/dist/core/index.d.ts +20 -0
- package/dist/core/index.js +18 -0
- package/dist/core/load.d.ts +32 -0
- package/dist/core/load.js +465 -0
- package/dist/core/model.d.ts +150 -0
- package/dist/core/model.js +1 -0
- package/dist/core/ownership.d.ts +34 -0
- package/dist/core/ownership.js +65 -0
- package/dist/core/paths.d.ts +47 -0
- package/dist/core/paths.js +115 -0
- package/dist/core/query.d.ts +51 -0
- package/dist/core/query.js +77 -0
- package/dist/core/refs.d.ts +31 -0
- package/dist/core/refs.js +50 -0
- package/dist/core/rules.d.ts +41 -0
- package/dist/core/rules.js +1033 -0
- package/dist/core/save-as-view.d.ts +45 -0
- package/dist/core/save-as-view.js +114 -0
- package/dist/core/saved-views.d.ts +48 -0
- package/dist/core/saved-views.js +243 -0
- package/dist/core/schema-check.d.ts +13 -0
- package/dist/core/schema-check.js +79 -0
- package/dist/core/search.d.ts +27 -0
- package/dist/core/search.js +63 -0
- package/dist/core/suggest.d.ts +3 -0
- package/dist/core/suggest.js +30 -0
- package/dist/core/views.d.ts +126 -0
- package/dist/core/views.js +217 -0
- package/dist/core/yaml.d.ts +16 -0
- package/dist/core/yaml.js +52 -0
- package/dist/git.d.ts +7 -0
- package/dist/git.js +23 -0
- package/dist/guide/index.d.ts +53 -0
- package/dist/guide/index.js +57 -0
- package/dist/history/git.d.ts +39 -0
- package/dist/history/git.js +126 -0
- package/dist/history/index.d.ts +118 -0
- package/dist/history/index.js +223 -0
- package/dist/history/migrate.d.ts +16 -0
- package/dist/history/migrate.js +30 -0
- package/dist/mcp/history.d.ts +36 -0
- package/dist/mcp/history.js +175 -0
- package/dist/mcp/http.d.ts +23 -0
- package/dist/mcp/http.js +85 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/server.d.ts +54 -0
- package/dist/mcp/server.js +824 -0
- package/dist/mcp/source.d.ts +50 -0
- package/dist/mcp/source.js +132 -0
- package/dist/mcp/writes.d.ts +10 -0
- package/dist/mcp/writes.js +267 -0
- package/dist/render/font.d.ts +14 -0
- package/dist/render/font.js +11 -0
- package/dist/render/index.d.ts +8 -0
- package/dist/render/index.js +8 -0
- package/dist/render/layout.d.ts +53 -0
- package/dist/render/layout.js +199 -0
- package/dist/render/node.d.ts +3 -0
- package/dist/render/node.js +8 -0
- package/dist/render/png.d.ts +11 -0
- package/dist/render/png.js +29 -0
- package/dist/render/sequence-svg.d.ts +33 -0
- package/dist/render/sequence-svg.js +98 -0
- package/dist/render/sequence.d.ts +103 -0
- package/dist/render/sequence.js +142 -0
- package/dist/render/svg.d.ts +36 -0
- package/dist/render/svg.js +222 -0
- package/dist/render/teams.d.ts +12 -0
- package/dist/render/teams.js +31 -0
- package/dist/render/text.d.ts +15 -0
- package/dist/render/text.js +29 -0
- package/dist/render/tokens.d.ts +53 -0
- package/dist/render/tokens.js +71 -0
- package/dist/schema/adr.d.ts +36 -0
- package/dist/schema/adr.js +27 -0
- package/dist/schema/bundle.d.ts +726 -0
- package/dist/schema/bundle.js +171 -0
- package/dist/schema/index.d.ts +4 -0
- package/dist/schema/index.js +4 -0
- package/dist/schema/json-schema.d.ts +8 -0
- package/dist/schema/json-schema.js +19 -0
- package/dist/schema/workspace.d.ts +1066 -0
- package/dist/schema/workspace.js +271 -0
- package/dist/viewer/assets/index-DvKgCpBr.css +1 -0
- package/dist/viewer/assets/index-gucix3xm.js +113 -0
- package/dist/viewer/assets/index_bg-Blvrv-U2.wasm +0 -0
- package/dist/viewer/assets/index_bg-D3t31u3-.js +1 -0
- package/dist/viewer/assets/layout.worker-Bg-OaLVN.js +26 -0
- package/dist/viewer/assets/overpass-latin-QyaMbcmi.woff2 +0 -0
- package/dist/viewer/assets/overpass-latin-ext-DSRhPfzW.woff2 +0 -0
- package/dist/viewer/assets/overpass-mono-latin-BTquVRaO.woff2 +0 -0
- package/dist/viewer/assets/overpass-mono-latin-ext-D47EiU4_.woff2 +0 -0
- package/dist/viewer/assets/png-BDKIXtm5.js +1 -0
- package/dist/viewer/assets/svg-Bulv5YWn.js +2 -0
- package/dist/viewer/favicon.svg +1 -0
- package/dist/viewer/index.html +53 -0
- package/dist/writer/adrs.d.ts +21 -0
- package/dist/writer/adrs.js +72 -0
- package/dist/writer/deployments.d.ts +51 -0
- package/dist/writer/deployments.js +145 -0
- package/dist/writer/diff.d.ts +6 -0
- package/dist/writer/diff.js +77 -0
- package/dist/writer/document.d.ts +25 -0
- package/dist/writer/document.js +79 -0
- package/dist/writer/edit.d.ts +78 -0
- package/dist/writer/edit.js +63 -0
- package/dist/writer/index.d.ts +67 -0
- package/dist/writer/index.js +310 -0
- package/dist/writer/overlay.d.ts +7 -0
- package/dist/writer/overlay.js +26 -0
- package/dist/writer/views.d.ts +29 -0
- package/dist/writer/views.js +78 -0
- package/dist/writer/workspace.d.ts +25 -0
- package/dist/writer/workspace.js +56 -0
- package/guide/SKILL.md +36 -0
- package/guide/topics/add-service.md +30 -0
- package/guide/topics/bootstrap.md +28 -0
- package/guide/topics/change.md +32 -0
- package/guide/topics/deployments.md +36 -0
- package/guide/topics/dynamic-view.md +39 -0
- package/guide/topics/propose-adr.md +12 -0
- package/guide/topics/relationships.md +39 -0
- package/guide/topics/saved-view.md +36 -0
- package/package.json +75 -4
- package/schemas/adr.schema.json +82 -0
- package/schemas/model.schema.json +1381 -0
- package/schemas/project.schema.json +24 -0
- package/schemas/workspace.schema.json +72 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface DirEntry {
|
|
2
|
+
name: string;
|
|
3
|
+
isDirectory: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The file system the core engine reads a Workspace through. Paths are
|
|
7
|
+
* absolute, in the host's own syntax. Swapping this lets Load read an
|
|
8
|
+
* in-memory overlay or a git commit instead of the working tree.
|
|
9
|
+
*/
|
|
10
|
+
export interface FileSystem {
|
|
11
|
+
readFile(path: string): Promise<string>;
|
|
12
|
+
readDir(path: string): Promise<DirEntry[]>;
|
|
13
|
+
exists(path: string): Promise<boolean>;
|
|
14
|
+
}
|
|
15
|
+
/** A FileSystem the YAML writer can also write through. `writeFile` creates missing folders. */
|
|
16
|
+
export interface WritableFileSystem extends FileSystem {
|
|
17
|
+
writeFile(path: string, text: string): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare function nodeFileSystem(): WritableFileSystem;
|
package/dist/core/fs.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { mkdir, readdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname } from "node:path";
|
|
3
|
+
export function nodeFileSystem() {
|
|
4
|
+
return {
|
|
5
|
+
writeFile: async (path, text) => {
|
|
6
|
+
await mkdir(dirname(path), { recursive: true });
|
|
7
|
+
await writeFile(path, text);
|
|
8
|
+
},
|
|
9
|
+
readFile: (path) => readFile(path, "utf8"),
|
|
10
|
+
readDir: async (path) => (await readdir(path, { withFileTypes: true })).map((d) => ({ name: d.name, isDirectory: d.isDirectory() })),
|
|
11
|
+
exists: async (path) => {
|
|
12
|
+
try {
|
|
13
|
+
await stat(path);
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Bundle } from "../schema/bundle.ts";
|
|
2
|
+
import { type Change, type ChangeKind } from "./diff.ts";
|
|
3
|
+
/** What a history question is narrowed to: an Element (with its descendants), a Team or a Project. */
|
|
4
|
+
export interface HistoryScope {
|
|
5
|
+
kind: "element" | "team" | "project";
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
export type ScopeResolution = {
|
|
9
|
+
ok: true;
|
|
10
|
+
scope: HistoryScope;
|
|
11
|
+
} | {
|
|
12
|
+
ok: false;
|
|
13
|
+
reason: "not_found" | "ambiguous";
|
|
14
|
+
candidates: HistoryScope[];
|
|
15
|
+
known: string[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Works out what `id` names in any of `bundles`: an Element (by qualified
|
|
19
|
+
* id), a Team or a Project. `kind` picks one when a Team and a Project share
|
|
20
|
+
* an id. `elementIds` adds Element ids known from elsewhere, such as the
|
|
21
|
+
* Revision index, for Elements that exist in none of the Bundles.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveScope(id: string, bundles: Bundle[], kind?: HistoryScope["kind"], elementIds?: string[]): ScopeResolution;
|
|
24
|
+
/**
|
|
25
|
+
* A test of the ids a Change or a Revision touched (see `changedIds`)
|
|
26
|
+
* against a scope, as it stands in `bundles`: an Element and its
|
|
27
|
+
* descendants; a Team and everything it owns; a Project and every id in it.
|
|
28
|
+
*/
|
|
29
|
+
export declare function scopeMatcher(scope: HistoryScope, bundles: Bundle[]): (ids: string[]) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The Changes between `before` and `after` within a scope and of some kinds.
|
|
32
|
+
* A Team's scope takes what it owns at either side, so an item handed to or
|
|
33
|
+
* from it is listed.
|
|
34
|
+
*/
|
|
35
|
+
export declare function filterChanges(changes: Change[], options: {
|
|
36
|
+
before: Bundle;
|
|
37
|
+
after: Bundle;
|
|
38
|
+
scope?: HistoryScope;
|
|
39
|
+
kinds?: ChangeKind[];
|
|
40
|
+
}): Change[];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { changedIds } from "./diff.js";
|
|
2
|
+
/**
|
|
3
|
+
* Works out what `id` names in any of `bundles`: an Element (by qualified
|
|
4
|
+
* id), a Team or a Project. `kind` picks one when a Team and a Project share
|
|
5
|
+
* an id. `elementIds` adds Element ids known from elsewhere, such as the
|
|
6
|
+
* Revision index, for Elements that exist in none of the Bundles.
|
|
7
|
+
*/
|
|
8
|
+
export function resolveScope(id, bundles, kind, elementIds = []) {
|
|
9
|
+
const ids = {
|
|
10
|
+
element: new Set([...bundles.flatMap((b) => b.elements.map((e) => e.id)), ...elementIds.filter((i) => i.includes(":"))]),
|
|
11
|
+
team: new Set(bundles.flatMap((b) => b.teams.map((t) => t.id))),
|
|
12
|
+
project: new Set(bundles.flatMap((b) => b.projects.map((p) => p.id))),
|
|
13
|
+
};
|
|
14
|
+
const candidates = Object.keys(ids).filter((k) => (kind === undefined || k === kind) && ids[k].has(id)).map((k) => ({ kind: k, id }));
|
|
15
|
+
if (candidates.length === 1)
|
|
16
|
+
return { ok: true, scope: candidates[0] };
|
|
17
|
+
const known = [...new Set(Object.values(ids).flatMap((s) => [...s]))];
|
|
18
|
+
return { ok: false, reason: candidates.length ? "ambiguous" : "not_found", candidates, known };
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A test of the ids a Change or a Revision touched (see `changedIds`)
|
|
22
|
+
* against a scope, as it stands in `bundles`: an Element and its
|
|
23
|
+
* descendants; a Team and everything it owns; a Project and every id in it.
|
|
24
|
+
*/
|
|
25
|
+
export function scopeMatcher(scope, bundles) {
|
|
26
|
+
if (scope.kind === "project") {
|
|
27
|
+
const prefix = `${scope.id}:`;
|
|
28
|
+
return (ids) => ids.some((i) => i === scope.id || i.startsWith(prefix));
|
|
29
|
+
}
|
|
30
|
+
const inScope = new Set([scope.id]);
|
|
31
|
+
for (const b of bundles) {
|
|
32
|
+
if (scope.kind === "team") {
|
|
33
|
+
for (const item of [...b.elements, ...b.targets, ...b.projects])
|
|
34
|
+
if (item.owner === scope.id)
|
|
35
|
+
inScope.add(item.id);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
// Descendants: walk parents until nothing more joins.
|
|
39
|
+
let grew = true;
|
|
40
|
+
while (grew) {
|
|
41
|
+
grew = false;
|
|
42
|
+
for (const e of b.elements) {
|
|
43
|
+
if (e.parent !== null && inScope.has(e.parent) && !inScope.has(e.id)) {
|
|
44
|
+
inScope.add(e.id);
|
|
45
|
+
grew = true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return (ids) => ids.some((i) => inScope.has(i));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The Changes between `before` and `after` within a scope and of some kinds.
|
|
55
|
+
* A Team's scope takes what it owns at either side, so an item handed to or
|
|
56
|
+
* from it is listed.
|
|
57
|
+
*/
|
|
58
|
+
export function filterChanges(changes, options) {
|
|
59
|
+
const { scope, kinds } = options;
|
|
60
|
+
const matches = scope ? scopeMatcher(scope, [options.before, options.after]) : undefined;
|
|
61
|
+
const ownedBy = (c) => scope?.kind === "team" && [c.before, c.after].some((item) => item?.owner === scope.id);
|
|
62
|
+
return changes.filter((c) => (!kinds || kinds.includes(c.kind)) && (!matches || matches(changedIds([c])) || ownedBy(c)));
|
|
63
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Bundle, BundleElement, BundleRelationship } from "../schema/bundle.ts";
|
|
2
|
+
export type Direction = "upstream" | "downstream" | "both";
|
|
3
|
+
/** An Element reached by the impact, with the Relationships that carry it there from the ring before. */
|
|
4
|
+
export interface ImpactedElement {
|
|
5
|
+
id: string;
|
|
6
|
+
kind: BundleElement["kind"];
|
|
7
|
+
name: string;
|
|
8
|
+
owner: string;
|
|
9
|
+
relationships: BundleRelationship[];
|
|
10
|
+
}
|
|
11
|
+
/** The Elements at one distance from the Element given. */
|
|
12
|
+
export interface ImpactRing {
|
|
13
|
+
distance: number;
|
|
14
|
+
elements: ImpactedElement[];
|
|
15
|
+
}
|
|
16
|
+
export interface ImpactResult {
|
|
17
|
+
id: string;
|
|
18
|
+
direction: Direction;
|
|
19
|
+
maxDepth: number | null;
|
|
20
|
+
/** Everything that depends on the Element, nearest first; set unless `direction` is `downstream`. */
|
|
21
|
+
upstream?: ImpactRing[];
|
|
22
|
+
/** Everything the Element depends on, nearest first; set unless `direction` is `upstream`. */
|
|
23
|
+
downstream?: ImpactRing[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The transitive set of Elements an outage of `id` reaches, grouped by
|
|
27
|
+
* distance. Relationships declared beneath `id` count as its own; every other
|
|
28
|
+
* end is lifted to `id`'s level. A Relationship through a `via` broker makes
|
|
29
|
+
* both its consumer and its provider depend on the broker. Depth is
|
|
30
|
+
* unlimited unless `maxDepth` is given.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getImpact(bundle: Bundle, id: string, direction: Direction, options?: {
|
|
33
|
+
maxDepth?: number;
|
|
34
|
+
}): ImpactResult;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { cmp, Graph, levelOf, lifter, within } from "./query.js";
|
|
2
|
+
/**
|
|
3
|
+
* The transitive set of Elements an outage of `id` reaches, grouped by
|
|
4
|
+
* distance. Relationships declared beneath `id` count as its own; every other
|
|
5
|
+
* end is lifted to `id`'s level. A Relationship through a `via` broker makes
|
|
6
|
+
* both its consumer and its provider depend on the broker. Depth is
|
|
7
|
+
* unlimited unless `maxDepth` is given.
|
|
8
|
+
*/
|
|
9
|
+
export function getImpact(bundle, id, direction, options = {}) {
|
|
10
|
+
const byId = new Map(bundle.elements.map((e) => [e.id, e]));
|
|
11
|
+
const element = byId.get(id);
|
|
12
|
+
if (!element)
|
|
13
|
+
throw new Error(`Unknown Element "${id}"`);
|
|
14
|
+
const inside = within(bundle);
|
|
15
|
+
const lift = lifter(bundle, levelOf(element));
|
|
16
|
+
const place = (x) => (inside(x, id) ? id : lift(x));
|
|
17
|
+
const dependsOn = new Graph();
|
|
18
|
+
for (const r of bundle.relationships) {
|
|
19
|
+
dependsOn.add(place(r.from), place(r.to), r);
|
|
20
|
+
if (r.via) {
|
|
21
|
+
dependsOn.add(place(r.from), place(r.via), r);
|
|
22
|
+
dependsOn.add(place(r.to), place(r.via), r);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const maxDepth = options.maxDepth ?? Infinity;
|
|
26
|
+
const spread = (graph) => {
|
|
27
|
+
const seen = new Set([id]);
|
|
28
|
+
const rings = [];
|
|
29
|
+
let frontier = [id];
|
|
30
|
+
for (let distance = 1; distance <= maxDepth && frontier.length; distance++) {
|
|
31
|
+
const reached = new Map();
|
|
32
|
+
for (const node of frontier) {
|
|
33
|
+
for (const [next, rels] of graph.next(node)) {
|
|
34
|
+
if (seen.has(next))
|
|
35
|
+
continue;
|
|
36
|
+
reached.set(next, [...(reached.get(next) ?? []), ...rels.filter((r) => !reached.get(next)?.includes(r))]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (!reached.size)
|
|
40
|
+
break;
|
|
41
|
+
const elements = [...reached]
|
|
42
|
+
.sort(([a], [b]) => cmp(a, b))
|
|
43
|
+
.map(([x, rels]) => {
|
|
44
|
+
const e = byId.get(x);
|
|
45
|
+
const order = (r) => bundle.relationships.indexOf(r);
|
|
46
|
+
return { id: x, kind: e?.kind ?? "service", name: e?.name ?? x, owner: e?.owner ?? "", relationships: rels.sort((p, q) => order(p) - order(q)) };
|
|
47
|
+
});
|
|
48
|
+
for (const e of elements)
|
|
49
|
+
seen.add(e.id);
|
|
50
|
+
rings.push({ distance, elements });
|
|
51
|
+
frontier = elements.map((e) => e.id);
|
|
52
|
+
}
|
|
53
|
+
return rings;
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
id,
|
|
57
|
+
direction,
|
|
58
|
+
maxDepth: options.maxDepth ?? null,
|
|
59
|
+
...(direction !== "downstream" ? { upstream: spread(dependsOn.reversed()) } : {}),
|
|
60
|
+
...(direction !== "upstream" ? { downstream: spread(dependsOn) } : {}),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { load, findWorkspaceRoot, serializeBundle, type LoadOptions, type LoadResult } from "./load.ts";
|
|
2
|
+
export { nodeFileSystem, type FileSystem, type WritableFileSystem, type DirEntry } from "./fs.ts";
|
|
3
|
+
export { rules, removed, ruleDocsUrl, withDocs, RULE_DOCS_BASE_URL, type RuleDefinition, type RemovedRule } from "./rules.ts";
|
|
4
|
+
export type { Issue, Severity } from "./model.ts";
|
|
5
|
+
export type { Files } from "./files.ts";
|
|
6
|
+
export { ruleCatalogue } from "./catalogue.ts";
|
|
7
|
+
export { deriveEdges, levelOf, type DerivedEdge, type Level } from "./query.ts";
|
|
8
|
+
export { getDeployments, type DeploymentDetail, type TargetStep } from "./deployments.ts";
|
|
9
|
+
export { search, type SearchMatch, type SearchOptions, type MatchRank } from "./search.ts";
|
|
10
|
+
export { listViews, resolveView, pickedView, type ViewSummary, type ResolveOptions, type ResolvedView, type ViewKind, type ListedKind, type ViewNode, type ViewEdge, type NodeMark, type ImpactSide, type ViewDirection } from "./views.ts";
|
|
11
|
+
export { resolveSaved, type SavedResolution, type BadExpand, type UnresolvedPath } from "./saved-views.ts";
|
|
12
|
+
export { findPaths, type PathsResult, type Path, type Hop, type DirectEdge } from "./paths.ts";
|
|
13
|
+
export { getImpact, type ImpactResult, type ImpactRing, type ImpactedElement, type Direction } from "./impact.ts";
|
|
14
|
+
export { listOwned, type OwnedResult, type OwnedGroup, type OwnedItem, type OwnedKind } from "./ownership.ts";
|
|
15
|
+
export { listAdrs, adrsFor, type ListAdrsOptions, type ListedAdr } from "./adrs.ts";
|
|
16
|
+
export { resolveDynamic, resolveDynamicView, takesPart, stepViews, dynamicViewsUsing, type DynamicResolution, type DynamicProblem, type ResolvedDynamicView, type ResolvedStep, type StepKind } from "./dynamic-views.ts";
|
|
17
|
+
export { diff, countChanges, changedIds, changeKinds, type Change, type ChangeKind, type ChangeType, type ChangeItem, type ChangeCounts } from "./diff.ts";
|
|
18
|
+
export { saveAsView, type Screen, type SavedScreen, type SavedViewDefinition } from "./save-as-view.ts";
|
|
19
|
+
export { compareView, unionBundle, type CompareMark } from "./compare.ts";
|
|
20
|
+
export { resolveScope, scopeMatcher, filterChanges, type HistoryScope, type ScopeResolution } from "./history-scope.ts";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { load, findWorkspaceRoot, serializeBundle } from "./load.js";
|
|
2
|
+
export { nodeFileSystem } from "./fs.js";
|
|
3
|
+
export { rules, removed, ruleDocsUrl, withDocs, RULE_DOCS_BASE_URL } from "./rules.js";
|
|
4
|
+
export { ruleCatalogue } from "./catalogue.js";
|
|
5
|
+
export { deriveEdges, levelOf } from "./query.js";
|
|
6
|
+
export { getDeployments } from "./deployments.js";
|
|
7
|
+
export { search } from "./search.js";
|
|
8
|
+
export { listViews, resolveView, pickedView } from "./views.js";
|
|
9
|
+
export { resolveSaved } from "./saved-views.js";
|
|
10
|
+
export { findPaths } from "./paths.js";
|
|
11
|
+
export { getImpact } from "./impact.js";
|
|
12
|
+
export { listOwned } from "./ownership.js";
|
|
13
|
+
export { listAdrs, adrsFor } from "./adrs.js";
|
|
14
|
+
export { resolveDynamic, resolveDynamicView, takesPart, stepViews, dynamicViewsUsing } from "./dynamic-views.js";
|
|
15
|
+
export { diff, countChanges, changedIds, changeKinds } from "./diff.js";
|
|
16
|
+
export { saveAsView } from "./save-as-view.js";
|
|
17
|
+
export { compareView, unionBundle } from "./compare.js";
|
|
18
|
+
export { resolveScope, scopeMatcher, filterChanges } from "./history-scope.js";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Bundle } from "../schema/bundle.ts";
|
|
2
|
+
import type { FileSystem } from "./fs.ts";
|
|
3
|
+
import type { Issue, LoadedWorkspace } from "./model.ts";
|
|
4
|
+
export interface LoadOptions {
|
|
5
|
+
fs: FileSystem;
|
|
6
|
+
/** The Workspace root: the folder holding `workspace.yaml`. */
|
|
7
|
+
root: string;
|
|
8
|
+
/** Issue and source paths are relative to this. Defaults to the nearest ancestor holding `.git`, else `root`. */
|
|
9
|
+
repoRoot?: string;
|
|
10
|
+
/** Recorded in the Bundle header. */
|
|
11
|
+
commit?: string | null;
|
|
12
|
+
builtAt?: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface LoadResult {
|
|
15
|
+
bundle: Bundle;
|
|
16
|
+
issues: Issue[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Reads a Workspace: discovers Projects, parses and merges their files,
|
|
20
|
+
* resolves references and runs every check rule. The Bundle is always
|
|
21
|
+
* returned; callers must not publish it when `issues` holds an error.
|
|
22
|
+
*/
|
|
23
|
+
export declare function load(options: LoadOptions): Promise<LoadResult>;
|
|
24
|
+
/** Load, also returning the declarations as read (with their paths in each file) and the repo root paths are relative to. For the YAML writer. */
|
|
25
|
+
export declare function loadDetailed(options: LoadOptions): Promise<LoadResult & {
|
|
26
|
+
workspace: LoadedWorkspace;
|
|
27
|
+
repoRoot: string;
|
|
28
|
+
}>;
|
|
29
|
+
/** Walks up from `start` to the folder holding `workspace.yaml`, also looking in each folder's `archidocs/`. */
|
|
30
|
+
export declare function findWorkspaceRoot(fs: FileSystem, start: string): Promise<string | undefined>;
|
|
31
|
+
/** The Bundle as written to `workspace.bundle.json`: stable key order, two-space indent. */
|
|
32
|
+
export declare function serializeBundle(bundle: Bundle): string;
|