create-project-arch 1.0.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/README.md +58 -0
- package/dist/cli.js +232 -0
- package/dist/cli.test.js +8 -0
- package/package.json +29 -0
- package/templates/arch-ui/.arch/edges/decision_to_domain.json +4 -0
- package/templates/arch-ui/.arch/edges/milestone_to_task.json +4 -0
- package/templates/arch-ui/.arch/edges/task_to_decision.json +4 -0
- package/templates/arch-ui/.arch/edges/task_to_module.json +4 -0
- package/templates/arch-ui/.arch/graph.json +17 -0
- package/templates/arch-ui/.arch/nodes/decisions.json +4 -0
- package/templates/arch-ui/.arch/nodes/domains.json +4 -0
- package/templates/arch-ui/.arch/nodes/milestones.json +4 -0
- package/templates/arch-ui/.arch/nodes/modules.json +4 -0
- package/templates/arch-ui/.arch/nodes/tasks.json +4 -0
- package/templates/arch-ui/app/api/architecture/map/route.ts +13 -0
- package/templates/arch-ui/app/api/decisions/route.ts +23 -0
- package/templates/arch-ui/app/api/domain-docs/route.ts +89 -0
- package/templates/arch-ui/app/api/domains/route.ts +10 -0
- package/templates/arch-ui/app/api/graph/route.ts +16 -0
- package/templates/arch-ui/app/api/health/route.ts +44 -0
- package/templates/arch-ui/app/api/node-files/route.ts +173 -0
- package/templates/arch-ui/app/api/phases/route.ts +10 -0
- package/templates/arch-ui/app/api/route.ts +22 -0
- package/templates/arch-ui/app/api/search/route.ts +56 -0
- package/templates/arch-ui/app/api/task-doc/[taskId]/route.ts +60 -0
- package/templates/arch-ui/app/api/tasks/route.ts +36 -0
- package/templates/arch-ui/app/api/trace/file/route.ts +40 -0
- package/templates/arch-ui/app/api/trace/task/[taskId]/route.ts +12 -0
- package/templates/arch-ui/app/architecture/page.tsx +5 -0
- package/templates/arch-ui/app/globals.css +240 -0
- package/templates/arch-ui/app/health/page.tsx +48 -0
- package/templates/arch-ui/app/layout.tsx +19 -0
- package/templates/arch-ui/app/page.tsx +5 -0
- package/templates/arch-ui/app/work/page.tsx +265 -0
- package/templates/arch-ui/components/app-shell.tsx +171 -0
- package/templates/arch-ui/components/error-boundary.tsx +53 -0
- package/templates/arch-ui/components/graph/arch-node.tsx +77 -0
- package/templates/arch-ui/components/graph/build-graph-from-dataset.ts +196 -0
- package/templates/arch-ui/components/graph/build-initial-graph.ts +245 -0
- package/templates/arch-ui/components/graph/graph-context-menu.tsx +84 -0
- package/templates/arch-ui/components/graph/graph-doc-panel.tsx +46 -0
- package/templates/arch-ui/components/graph/graph-types.ts +82 -0
- package/templates/arch-ui/components/graph/use-auto-layout.ts +65 -0
- package/templates/arch-ui/components/graph/use-connection-validation.ts +62 -0
- package/templates/arch-ui/components/graph/use-flow-persistence.ts +48 -0
- package/templates/arch-ui/components/graph-canvas.tsx +670 -0
- package/templates/arch-ui/components/health-panel.tsx +49 -0
- package/templates/arch-ui/components/inspector-context.tsx +35 -0
- package/templates/arch-ui/components/inspector.tsx +895 -0
- package/templates/arch-ui/components/markdown-viewer.tsx +74 -0
- package/templates/arch-ui/components/sidebar.tsx +531 -0
- package/templates/arch-ui/components/topbar.tsx +187 -0
- package/templates/arch-ui/components/work-table.tsx +57 -0
- package/templates/arch-ui/components/workspace-context.tsx +274 -0
- package/templates/arch-ui/eslint.config.js +2 -0
- package/templates/arch-ui/global.d.ts +1 -0
- package/templates/arch-ui/lib/api.ts +93 -0
- package/templates/arch-ui/lib/arch-model.ts +113 -0
- package/templates/arch-ui/lib/graph-dataset.ts +756 -0
- package/templates/arch-ui/lib/graph-schema.ts +408 -0
- package/templates/arch-ui/lib/project-root.ts +52 -0
- package/templates/arch-ui/lib/types.ts +116 -0
- package/templates/arch-ui/next-env.d.ts +6 -0
- package/templates/arch-ui/next.config.js +17 -0
- package/templates/arch-ui/package.json +38 -0
- package/templates/arch-ui/postcss.config.mjs +6 -0
- package/templates/arch-ui/tailwind.config.ts +11 -0
- package/templates/arch-ui/tsconfig.json +21 -0
- package/templates/ui-package/eslint.config.mjs +4 -0
- package/templates/ui-package/package.json +26 -0
- package/templates/ui-package/src/accordion.tsx +10 -0
- package/templates/ui-package/src/badge.tsx +12 -0
- package/templates/ui-package/src/button.tsx +32 -0
- package/templates/ui-package/src/card.tsx +22 -0
- package/templates/ui-package/src/code.tsx +6 -0
- package/templates/ui-package/src/command.tsx +18 -0
- package/templates/ui-package/src/dialog.tsx +6 -0
- package/templates/ui-package/src/dropdown-menu.tsx +10 -0
- package/templates/ui-package/src/input.tsx +6 -0
- package/templates/ui-package/src/navigation-menu.tsx +6 -0
- package/templates/ui-package/src/scroll-area.tsx +6 -0
- package/templates/ui-package/src/select.tsx +6 -0
- package/templates/ui-package/src/separator.tsx +6 -0
- package/templates/ui-package/src/sheet.tsx +6 -0
- package/templates/ui-package/src/skeleton.tsx +6 -0
- package/templates/ui-package/src/table.tsx +26 -0
- package/templates/ui-package/src/tabs.tsx +14 -0
- package/templates/ui-package/src/toggle-group.tsx +10 -0
- package/templates/ui-package/src/utils.ts +3 -0
- package/templates/ui-package/tsconfig.json +10 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { getProjectRoot } from "./project-root";
|
|
4
|
+
import type { ArchitectureMapData, TaskNode } from "./types";
|
|
5
|
+
|
|
6
|
+
async function readArchJson<T>(root: string, relativePath: string): Promise<T> {
|
|
7
|
+
const raw = await readFile(path.join(root, ".arch", relativePath), "utf8");
|
|
8
|
+
return JSON.parse(raw) as T;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export async function readDomains(
|
|
12
|
+
root?: string,
|
|
13
|
+
): Promise<{ domains: Array<{ name: string; description?: string; ownedPackages?: string[] }> }> {
|
|
14
|
+
const projectRoot = root ?? getProjectRoot();
|
|
15
|
+
const raw = await readFile(path.join(projectRoot, "arch-domains", "domains.json"), "utf8");
|
|
16
|
+
return JSON.parse(raw) as {
|
|
17
|
+
domains: Array<{ name: string; description?: string; ownedPackages?: string[] }>;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function readTasksNode(root?: string): Promise<{ tasks: TaskNode[] }> {
|
|
22
|
+
const projectRoot = root ?? getProjectRoot();
|
|
23
|
+
return readArchJson<{ tasks: TaskNode[] }>(projectRoot, path.join("nodes", "tasks.json"));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function readTaskToModuleEdges(
|
|
27
|
+
root?: string,
|
|
28
|
+
): Promise<{ edges: Array<{ task: string; module: string }> }> {
|
|
29
|
+
const projectRoot = root ?? getProjectRoot();
|
|
30
|
+
return readArchJson<{ edges: Array<{ task: string; module: string }> }>(
|
|
31
|
+
projectRoot,
|
|
32
|
+
path.join("edges", "task_to_module.json"),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export async function readTaskToDecisionEdges(
|
|
37
|
+
root?: string,
|
|
38
|
+
): Promise<{ edges: Array<{ task: string; decision: string }> }> {
|
|
39
|
+
const projectRoot = root ?? getProjectRoot();
|
|
40
|
+
return readArchJson<{ edges: Array<{ task: string; decision: string }> }>(
|
|
41
|
+
projectRoot,
|
|
42
|
+
path.join("edges", "task_to_decision.json"),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export async function readArchitectureMap(root?: string): Promise<ArchitectureMapData> {
|
|
47
|
+
const projectRoot = root ?? getProjectRoot();
|
|
48
|
+
|
|
49
|
+
const [
|
|
50
|
+
graphSummary,
|
|
51
|
+
domains,
|
|
52
|
+
decisions,
|
|
53
|
+
milestones,
|
|
54
|
+
tasksNode,
|
|
55
|
+
modules,
|
|
56
|
+
taskToDecision,
|
|
57
|
+
taskToModule,
|
|
58
|
+
decisionToDomain,
|
|
59
|
+
milestoneToTask,
|
|
60
|
+
] = await Promise.all([
|
|
61
|
+
readArchJson<Record<string, unknown>>(projectRoot, "graph.json"),
|
|
62
|
+
readArchJson<{ domains?: ArchitectureMapData["nodes"]["domains"] }>(
|
|
63
|
+
projectRoot,
|
|
64
|
+
path.join("nodes", "domains.json"),
|
|
65
|
+
),
|
|
66
|
+
readArchJson<{ decisions?: ArchitectureMapData["nodes"]["decisions"] }>(
|
|
67
|
+
projectRoot,
|
|
68
|
+
path.join("nodes", "decisions.json"),
|
|
69
|
+
),
|
|
70
|
+
readArchJson<{ milestones?: ArchitectureMapData["nodes"]["milestones"] }>(
|
|
71
|
+
projectRoot,
|
|
72
|
+
path.join("nodes", "milestones.json"),
|
|
73
|
+
),
|
|
74
|
+
readArchJson<{ tasks?: TaskNode[] }>(projectRoot, path.join("nodes", "tasks.json")),
|
|
75
|
+
readArchJson<{ modules?: ArchitectureMapData["nodes"]["modules"] }>(
|
|
76
|
+
projectRoot,
|
|
77
|
+
path.join("nodes", "modules.json"),
|
|
78
|
+
),
|
|
79
|
+
readArchJson<{ edges?: ArchitectureMapData["edges"]["taskToDecision"] }>(
|
|
80
|
+
projectRoot,
|
|
81
|
+
path.join("edges", "task_to_decision.json"),
|
|
82
|
+
),
|
|
83
|
+
readArchJson<{ edges?: ArchitectureMapData["edges"]["taskToModule"] }>(
|
|
84
|
+
projectRoot,
|
|
85
|
+
path.join("edges", "task_to_module.json"),
|
|
86
|
+
),
|
|
87
|
+
readArchJson<{ edges?: ArchitectureMapData["edges"]["decisionToDomain"] }>(
|
|
88
|
+
projectRoot,
|
|
89
|
+
path.join("edges", "decision_to_domain.json"),
|
|
90
|
+
),
|
|
91
|
+
readArchJson<{ edges?: ArchitectureMapData["edges"]["milestoneToTask"] }>(
|
|
92
|
+
projectRoot,
|
|
93
|
+
path.join("edges", "milestone_to_task.json"),
|
|
94
|
+
),
|
|
95
|
+
]);
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
summary: graphSummary as ArchitectureMapData["summary"],
|
|
99
|
+
nodes: {
|
|
100
|
+
domains: domains.domains ?? [],
|
|
101
|
+
decisions: decisions.decisions ?? [],
|
|
102
|
+
milestones: milestones.milestones ?? [],
|
|
103
|
+
tasks: tasksNode.tasks ?? [],
|
|
104
|
+
modules: modules.modules ?? [],
|
|
105
|
+
},
|
|
106
|
+
edges: {
|
|
107
|
+
taskToDecision: taskToDecision.edges ?? [],
|
|
108
|
+
taskToModule: taskToModule.edges ?? [],
|
|
109
|
+
decisionToDomain: decisionToDomain.edges ?? [],
|
|
110
|
+
milestoneToTask: milestoneToTask.edges ?? [],
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|