-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.dependency-cruiser.cjs
More file actions
86 lines (86 loc) · 2.77 KB
/
Copy path.dependency-cruiser.cjs
File metadata and controls
86 lines (86 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/** @type {import("dependency-cruiser").IConfiguration} */
module.exports = {
forbidden: [
{
name: "no-cli-to-server",
severity: "error",
comment: "The CLI host must consume shared behavior through published engine packages, not the API server.",
from: { path: "^packages/cli/" },
to: { path: "^apps/server/" },
},
{
name: "no-server-to-cli",
severity: "error",
comment: "The API server must consume shared behavior through published engine packages, not CLI code.",
from: { path: "^apps/server/" },
to: { path: "^packages/cli/" },
},
{
name: "no-sdk-to-hosts-or-apps",
severity: "error",
comment: "@openagentpack/sdk is the shared engine and must not depend on host packages or applications.",
from: { path: "^packages/sdk/" },
to: { path: "^(packages/cli|packages/playground|apps/server|apps/webui)/" },
},
{
name: "no-sdk-core-to-project-services",
severity: "error",
comment:
"Core SDK modules must not pull Node project services into the default entry or create dependency cycles.",
from: {
path: "^packages/sdk/src/",
pathNot: "^packages/sdk/src/(internal/project-(versions|workspace)/|project-(versions|workspace)\\.ts$)",
},
to: { path: "^packages/sdk/src/(internal/project-(versions|workspace)/|project-(versions|workspace)\\.ts$)" },
},
{
name: "no-project-versions-to-workspace",
severity: "error",
comment: "Snapshot storage must remain independent of the directory workspace adapter.",
from: { path: "^packages/sdk/src/(internal/project-versions/|project-versions\\.ts$)" },
to: { path: "^packages/sdk/src/(internal/project-workspace/|project-workspace\\.ts$)" },
},
{
name: "no-sdk-deep-imports",
severity: "error",
comment: "Non-SDK code must use the @openagentpack/sdk public export surface instead of SDK internals.",
from: {
path: "^(apps|packages)/",
pathNot: "^packages/sdk/",
},
to: {
path: "^packages/sdk/src/internal/",
},
},
{
name: "no-webui-sdk-runtime-import",
severity: "error",
comment:
"Browser-facing webui code may import @openagentpack/sdk types only; runtime imports would bundle SDK server/runtime code.",
from: { path: "^apps/webui/src/" },
to: { path: "^packages/sdk/" },
},
],
options: {
doNotFollow: {
path: ["node_modules", "^packages/sdk/dist/"],
},
tsConfig: {
fileName: "tsconfig.base.json",
},
// Keep post-compilation semantics: TypeScript `import type` edges are erased
// and therefore allowed, while runtime imports remain visible and enforceable.
tsPreCompilationDeps: false,
combinedDependencies: true,
moduleSystems: ["es6", "cjs"],
detectProcessBuiltinModuleCalls: true,
progress: {
type: "none",
},
reporterOptions: {
text: {
highlightFocused: true,
},
},
},
};