@dependency-maritime/cli 0.1.0-beta.1
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 +129 -0
- package/dist/cli/cli/analyze/adapters.d.ts +32 -0
- package/dist/cli/cli/analyze/calculate-metrics.d.ts +6 -0
- package/dist/cli/cli/analyze/environment.d.ts +10 -0
- package/dist/cli/cli/analyze/models.d.ts +47 -0
- package/dist/cli/cli/analyze/parse-eslint.d.ts +2 -0
- package/dist/cli/cli/analyze/render-markdown-report.d.ts +2 -0
- package/dist/cli/cli/commands/analyze.d.ts +1 -0
- package/dist/cli/cli/commands/validate.d.ts +1 -0
- package/dist/cli/cli/index.d.ts +25 -0
- package/dist/cli/cli/main.d.ts +1 -0
- package/dist/cli/cli/validate/validate.d.ts +10 -0
- package/dist/cli/index.d.ts +25 -0
- package/dist/cli/index.js +1197 -0
- package/dist/cli/main.js +1172 -0
- package/dist/cli/schema/complexity-metrics.d.ts +18 -0
- package/dist/cli/schema/dependency-cruiser.d.ts +180 -0
- package/dist/cli/schema/manifest.d.ts +33 -0
- package/package.json +109 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ComplexityMetricSchema: z.ZodObject<{
|
|
3
|
+
complexity: z.ZodNumber;
|
|
4
|
+
loc: z.ZodNumber;
|
|
5
|
+
instability: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
fanIn: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
fanOut: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
scanned: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare const ComplexityMetricsMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
11
|
+
complexity: z.ZodNumber;
|
|
12
|
+
loc: z.ZodNumber;
|
|
13
|
+
instability: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
fanIn: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
fanOut: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
scanned: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
export type ComplexityMetricsMap = z.infer<typeof ComplexityMetricsMapSchema>;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ICruiseResult, IModule, IDependency } from 'dependency-cruiser';
|
|
3
|
+
/**
|
|
4
|
+
* Re-export official types as the source of truth for the application.
|
|
5
|
+
*/
|
|
6
|
+
export type { ICruiseResult, IModule, IDependency };
|
|
7
|
+
/**
|
|
8
|
+
* Schema for a single dependency relation.
|
|
9
|
+
* Represents a 'to' edge in the dependency graph.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DependencySchema: z.ZodObject<{
|
|
12
|
+
circular: z.ZodBoolean;
|
|
13
|
+
coreModule: z.ZodBoolean;
|
|
14
|
+
couldNotResolve: z.ZodBoolean;
|
|
15
|
+
dependencyTypes: z.ZodArray<z.ZodString>;
|
|
16
|
+
dynamic: z.ZodBoolean;
|
|
17
|
+
exoticallyRequired: z.ZodBoolean;
|
|
18
|
+
followable: z.ZodBoolean;
|
|
19
|
+
instability: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
protocol: z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
"data:": "data:";
|
|
22
|
+
"file:": "file:";
|
|
23
|
+
"node:": "node:";
|
|
24
|
+
}>>;
|
|
25
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
26
|
+
moduleSystem: z.ZodEnum<{
|
|
27
|
+
amd: "amd";
|
|
28
|
+
cjs: "cjs";
|
|
29
|
+
es6: "es6";
|
|
30
|
+
tsd: "tsd";
|
|
31
|
+
}>;
|
|
32
|
+
module: z.ZodString;
|
|
33
|
+
resolved: z.ZodString;
|
|
34
|
+
valid: z.ZodBoolean;
|
|
35
|
+
preCompilationOnly: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
typeOnly: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
cycle: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
dependencyTypes: z.ZodArray<z.ZodString>;
|
|
40
|
+
}, z.core.$strip>>>;
|
|
41
|
+
}, z.core.$loose>;
|
|
42
|
+
/**
|
|
43
|
+
* Schema for a module (file) in the graph.
|
|
44
|
+
* Represents a node in the dependency graph.
|
|
45
|
+
*/
|
|
46
|
+
export declare const ModuleSchema: z.ZodObject<{
|
|
47
|
+
source: z.ZodString;
|
|
48
|
+
valid: z.ZodBoolean;
|
|
49
|
+
dependencies: z.ZodArray<z.ZodObject<{
|
|
50
|
+
circular: z.ZodBoolean;
|
|
51
|
+
coreModule: z.ZodBoolean;
|
|
52
|
+
couldNotResolve: z.ZodBoolean;
|
|
53
|
+
dependencyTypes: z.ZodArray<z.ZodString>;
|
|
54
|
+
dynamic: z.ZodBoolean;
|
|
55
|
+
exoticallyRequired: z.ZodBoolean;
|
|
56
|
+
followable: z.ZodBoolean;
|
|
57
|
+
instability: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
protocol: z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
"data:": "data:";
|
|
60
|
+
"file:": "file:";
|
|
61
|
+
"node:": "node:";
|
|
62
|
+
}>>;
|
|
63
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
64
|
+
moduleSystem: z.ZodEnum<{
|
|
65
|
+
amd: "amd";
|
|
66
|
+
cjs: "cjs";
|
|
67
|
+
es6: "es6";
|
|
68
|
+
tsd: "tsd";
|
|
69
|
+
}>;
|
|
70
|
+
module: z.ZodString;
|
|
71
|
+
resolved: z.ZodString;
|
|
72
|
+
valid: z.ZodBoolean;
|
|
73
|
+
preCompilationOnly: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
typeOnly: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
cycle: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
76
|
+
name: z.ZodString;
|
|
77
|
+
dependencyTypes: z.ZodArray<z.ZodString>;
|
|
78
|
+
}, z.core.$strip>>>;
|
|
79
|
+
}, z.core.$loose>>;
|
|
80
|
+
dependents: z.ZodArray<z.ZodString>;
|
|
81
|
+
coreModule: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
+
couldNotResolve: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
orphan: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
+
}, z.core.$loose>;
|
|
85
|
+
/**
|
|
86
|
+
* Schema for a violation found by dependency-cruiser.
|
|
87
|
+
*/
|
|
88
|
+
export declare const ViolationSchema: z.ZodObject<{
|
|
89
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
90
|
+
instability: "instability";
|
|
91
|
+
module: "module";
|
|
92
|
+
cycle: "cycle";
|
|
93
|
+
dependency: "dependency";
|
|
94
|
+
reachability: "reachability";
|
|
95
|
+
}>>;
|
|
96
|
+
from: z.ZodString;
|
|
97
|
+
to: z.ZodString;
|
|
98
|
+
rule: z.ZodObject<{
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
severity: z.ZodEnum<{
|
|
101
|
+
error: "error";
|
|
102
|
+
warn: "warn";
|
|
103
|
+
info: "info";
|
|
104
|
+
ignore: "ignore";
|
|
105
|
+
}>;
|
|
106
|
+
}, z.core.$loose>;
|
|
107
|
+
}, z.core.$loose>;
|
|
108
|
+
/**
|
|
109
|
+
* Schema for the top-level dependency-cruiser output.
|
|
110
|
+
*/
|
|
111
|
+
export declare const CruiseResultSchema: z.ZodObject<{
|
|
112
|
+
modules: z.ZodArray<z.ZodObject<{
|
|
113
|
+
source: z.ZodString;
|
|
114
|
+
valid: z.ZodBoolean;
|
|
115
|
+
dependencies: z.ZodArray<z.ZodObject<{
|
|
116
|
+
circular: z.ZodBoolean;
|
|
117
|
+
coreModule: z.ZodBoolean;
|
|
118
|
+
couldNotResolve: z.ZodBoolean;
|
|
119
|
+
dependencyTypes: z.ZodArray<z.ZodString>;
|
|
120
|
+
dynamic: z.ZodBoolean;
|
|
121
|
+
exoticallyRequired: z.ZodBoolean;
|
|
122
|
+
followable: z.ZodBoolean;
|
|
123
|
+
instability: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
protocol: z.ZodOptional<z.ZodEnum<{
|
|
125
|
+
"data:": "data:";
|
|
126
|
+
"file:": "file:";
|
|
127
|
+
"node:": "node:";
|
|
128
|
+
}>>;
|
|
129
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
130
|
+
moduleSystem: z.ZodEnum<{
|
|
131
|
+
amd: "amd";
|
|
132
|
+
cjs: "cjs";
|
|
133
|
+
es6: "es6";
|
|
134
|
+
tsd: "tsd";
|
|
135
|
+
}>;
|
|
136
|
+
module: z.ZodString;
|
|
137
|
+
resolved: z.ZodString;
|
|
138
|
+
valid: z.ZodBoolean;
|
|
139
|
+
preCompilationOnly: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
+
typeOnly: z.ZodOptional<z.ZodBoolean>;
|
|
141
|
+
cycle: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
142
|
+
name: z.ZodString;
|
|
143
|
+
dependencyTypes: z.ZodArray<z.ZodString>;
|
|
144
|
+
}, z.core.$strip>>>;
|
|
145
|
+
}, z.core.$loose>>;
|
|
146
|
+
dependents: z.ZodArray<z.ZodString>;
|
|
147
|
+
coreModule: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
+
couldNotResolve: z.ZodOptional<z.ZodBoolean>;
|
|
149
|
+
orphan: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
+
}, z.core.$loose>>;
|
|
151
|
+
summary: z.ZodObject<{
|
|
152
|
+
error: z.ZodNumber;
|
|
153
|
+
ignore: z.ZodNumber;
|
|
154
|
+
info: z.ZodNumber;
|
|
155
|
+
totalCruised: z.ZodNumber;
|
|
156
|
+
totalDependenciesCruised: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
violations: z.ZodArray<z.ZodObject<{
|
|
158
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
159
|
+
instability: "instability";
|
|
160
|
+
module: "module";
|
|
161
|
+
cycle: "cycle";
|
|
162
|
+
dependency: "dependency";
|
|
163
|
+
reachability: "reachability";
|
|
164
|
+
}>>;
|
|
165
|
+
from: z.ZodString;
|
|
166
|
+
to: z.ZodString;
|
|
167
|
+
rule: z.ZodObject<{
|
|
168
|
+
name: z.ZodString;
|
|
169
|
+
severity: z.ZodEnum<{
|
|
170
|
+
error: "error";
|
|
171
|
+
warn: "warn";
|
|
172
|
+
info: "info";
|
|
173
|
+
ignore: "ignore";
|
|
174
|
+
}>;
|
|
175
|
+
}, z.core.$loose>;
|
|
176
|
+
}, z.core.$loose>>;
|
|
177
|
+
warn: z.ZodNumber;
|
|
178
|
+
optionsUsed: z.ZodUnknown;
|
|
179
|
+
}, z.core.$loose>;
|
|
180
|
+
}, z.core.$loose>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const MANIFEST_SCHEMA_VERSION = "1.0.0";
|
|
3
|
+
export declare const ArtifactManifestArtifactsSchema: z.ZodObject<{
|
|
4
|
+
graph: z.ZodString;
|
|
5
|
+
metrics: z.ZodString;
|
|
6
|
+
report: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const ArtifactManifestSummarySchema: z.ZodObject<{
|
|
9
|
+
totalFiles: z.ZodNumber;
|
|
10
|
+
healthScore: z.ZodNumber;
|
|
11
|
+
scannedCount: z.ZodNumber;
|
|
12
|
+
skippedCount: z.ZodNumber;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const ArtifactManifestSchema: z.ZodObject<{
|
|
15
|
+
schemaVersion: z.ZodLiteral<"1.0.0">;
|
|
16
|
+
toolVersion: z.ZodString;
|
|
17
|
+
generatedAt: z.ZodString;
|
|
18
|
+
sourceRoots: z.ZodArray<z.ZodString>;
|
|
19
|
+
artifacts: z.ZodObject<{
|
|
20
|
+
graph: z.ZodString;
|
|
21
|
+
metrics: z.ZodString;
|
|
22
|
+
report: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
summary: z.ZodObject<{
|
|
25
|
+
totalFiles: z.ZodNumber;
|
|
26
|
+
healthScore: z.ZodNumber;
|
|
27
|
+
scannedCount: z.ZodNumber;
|
|
28
|
+
skippedCount: z.ZodNumber;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export type ArtifactManifestArtifacts = z.infer<typeof ArtifactManifestArtifactsSchema>;
|
|
32
|
+
export type ArtifactManifestSummary = z.infer<typeof ArtifactManifestSummarySchema>;
|
|
33
|
+
export type ArtifactManifest = z.infer<typeof ArtifactManifestSchema>;
|
package/package.json
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dependency-maritime/cli",
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/cli/index.js",
|
|
6
|
+
"types": "./dist/cli/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"maritime": "./dist/cli/main.js"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/cli/index.d.ts",
|
|
13
|
+
"default": "./dist/cli/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/g1ddy/dependency-maritime.git"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=20.19.0"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist/cli",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE"
|
|
31
|
+
],
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"eslint": ">=9.0.0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"dev": "vite",
|
|
37
|
+
"build:cli": "esbuild src/cli/main.ts --bundle --platform=node --format=esm --packages=external --banner:js=\"#!/usr/bin/env node\" --outfile=dist/cli/main.js && esbuild src/cli/index.ts --bundle --platform=node --format=esm --packages=external --outfile=dist/cli/index.js && tsc -p tsconfig.cli.json && node -e \"fs.copyFileSync('dist/cli/cli/index.d.ts', 'dist/cli/index.d.ts')\"",
|
|
38
|
+
"build": "npm run build:cli && tsc -b && vite build",
|
|
39
|
+
"lint": "eslint .",
|
|
40
|
+
"depcruise": "depcruise src --config config/.dependency-cruiser.cjs",
|
|
41
|
+
"check:arch": "depcruise src --config config/.dependency-cruiser.cjs",
|
|
42
|
+
"generate:dot": "depcruise-fmt -T dot .maritime/dependency-graph.json > config/dependency-graph.dot",
|
|
43
|
+
"generate:graph": "dot -T svg config/dependency-graph.dot > docs/images/dependency-graph.svg && dot -T png config/dependency-graph.dot > docs/images/dependency-graph.png",
|
|
44
|
+
"preview": "vite preview",
|
|
45
|
+
"test": "vitest",
|
|
46
|
+
"test:unit": "vitest",
|
|
47
|
+
"test:bench": "vitest bench -c vitest.bench.config.ts",
|
|
48
|
+
"test:cli-package": "vitest run tests/cli-pack-smoke.test.ts",
|
|
49
|
+
"test:e2e": "playwright test",
|
|
50
|
+
"test:screenshots": "playwright test -c config/playwright.screenshots.config.ts"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"dependency-cruiser": "^17.3.7",
|
|
54
|
+
"zod": "^4.3.6"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@eslint/js": "^9.39.2",
|
|
58
|
+
"@playwright/test": "^1.58.0",
|
|
59
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
60
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
61
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
62
|
+
"@radix-ui/react-separator": "^1.1.8",
|
|
63
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
64
|
+
"@radix-ui/react-switch": "^1.2.6",
|
|
65
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
66
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
67
|
+
"@testing-library/react": "^16.3.2",
|
|
68
|
+
"@types/d3": "^7.4.3",
|
|
69
|
+
"@types/dagre": "^0.7.53",
|
|
70
|
+
"@types/js-yaml": "^4.0.9",
|
|
71
|
+
"@types/node": "^25.0.10",
|
|
72
|
+
"@types/papaparse": "^5.5.2",
|
|
73
|
+
"@types/react": "^19.2.9",
|
|
74
|
+
"@types/react-dom": "^19.2.3",
|
|
75
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
76
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
77
|
+
"@xyflow/react": "^12.10.0",
|
|
78
|
+
"autoprefixer": "^10.4.23",
|
|
79
|
+
"class-variance-authority": "^0.7.1",
|
|
80
|
+
"clsx": "^2.1.1",
|
|
81
|
+
"d3": "^7.9.0",
|
|
82
|
+
"dagre": "^0.8.5",
|
|
83
|
+
"elkjs": "^0.11.0",
|
|
84
|
+
"eslint": "^9.39.2",
|
|
85
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
86
|
+
"eslint-plugin-react-refresh": "^0.4.26",
|
|
87
|
+
"globals": "^17.1.0",
|
|
88
|
+
"graphology": "^0.26.0",
|
|
89
|
+
"graphology-metrics": "^2.4.0",
|
|
90
|
+
"graphology-types": "^0.24.8",
|
|
91
|
+
"jsdom": "^27.4.0",
|
|
92
|
+
"lucide-react": "^0.563.0",
|
|
93
|
+
"papaparse": "^5.5.3",
|
|
94
|
+
"postcss": "^8.5.6",
|
|
95
|
+
"react": "^19.2.3",
|
|
96
|
+
"react-dom": "^19.2.3",
|
|
97
|
+
"react-router-dom": "^7.13.0",
|
|
98
|
+
"tailwind-merge": "^3.4.0",
|
|
99
|
+
"tailwindcss": "^4.1.18",
|
|
100
|
+
"tailwindcss-animate": "^1.0.7",
|
|
101
|
+
"tsx": "^4.23.12",
|
|
102
|
+
"typescript": "~5.9.3",
|
|
103
|
+
"typescript-eslint": "^8.53.1",
|
|
104
|
+
"vite": "^7.3.1",
|
|
105
|
+
"vitest": "^4.0.18",
|
|
106
|
+
"web-worker": "^1.5.0",
|
|
107
|
+
"zustand": "^5.0.10"
|
|
108
|
+
}
|
|
109
|
+
}
|