-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.dependency-cruiser.cjs
More file actions
68 lines (68 loc) · 1.96 KB
/
Copy path.dependency-cruiser.cjs
File metadata and controls
68 lines (68 loc) · 1.96 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
/** @type {import("dependency-cruiser").IConfiguration} */
module.exports = {
forbidden: [
{
name: "no-cli-to-server",
severity: "error",
comment: "The CLI host must consume shared behavior through @openagentpack/sdk, not by importing 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 @openagentpack/sdk, not by importing 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|apps/server|apps/webui)/" },
},
{
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,
},
},
},
};