@abhinav2203/codeflow-analysis 0.1.0 → 0.1.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/dist/app/api/analysis/cycles/route.test.d.ts +2 -0
- package/dist/app/api/analysis/cycles/route.test.d.ts.map +1 -0
- package/dist/app/api/analysis/cycles/route.test.js +92 -0
- package/dist/app/api/analysis/metrics/route.test.d.ts +2 -0
- package/dist/app/api/analysis/metrics/route.test.d.ts.map +1 -0
- package/dist/app/api/analysis/metrics/route.test.js +82 -0
- package/dist/app/api/analysis/smells/route.test.d.ts +2 -0
- package/dist/app/api/analysis/smells/route.test.d.ts.map +1 -0
- package/dist/app/api/analysis/smells/route.test.js +102 -0
- package/dist/app/api/conflicts/route.test.d.ts +2 -0
- package/dist/app/api/conflicts/route.test.d.ts.map +1 -0
- package/dist/app/api/conflicts/route.test.js +58 -0
- package/dist/app/api/refactor/detect/route.test.d.ts +2 -0
- package/dist/app/api/refactor/detect/route.test.d.ts.map +1 -0
- package/dist/app/api/refactor/detect/route.test.js +61 -0
- package/dist/app/api/refactor/heal/route.test.d.ts +2 -0
- package/dist/app/api/refactor/heal/route.test.d.ts.map +1 -0
- package/dist/app/api/refactor/heal/route.test.js +62 -0
- package/dist/bin/cli.js +5 -41
- package/dist/conflicts.d.ts +12 -0
- package/dist/conflicts.d.ts.map +1 -0
- package/dist/conflicts.js +77 -0
- package/dist/conflicts.test.d.ts +2 -0
- package/dist/conflicts.test.d.ts.map +1 -0
- package/dist/conflicts.test.js +98 -0
- package/dist/cycles.d.ts +39 -0
- package/dist/cycles.d.ts.map +1 -0
- package/dist/cycles.js +129 -0
- package/dist/cycles.test.d.ts +2 -0
- package/dist/cycles.test.d.ts.map +1 -0
- package/dist/cycles.test.js +82 -0
- package/dist/handlers/conflicts.d.ts +28 -0
- package/dist/handlers/conflicts.d.ts.map +1 -0
- package/dist/handlers/conflicts.js +24 -0
- package/dist/handlers/cycles.d.ts +30 -0
- package/dist/handlers/cycles.d.ts.map +1 -0
- package/dist/handlers/cycles.js +24 -0
- package/dist/handlers/metrics.d.ts +35 -0
- package/dist/handlers/metrics.d.ts.map +1 -0
- package/dist/handlers/metrics.js +23 -0
- package/dist/handlers/refactor-detect.d.ts +15 -0
- package/dist/handlers/refactor-detect.d.ts.map +1 -0
- package/dist/handlers/refactor-detect.js +23 -0
- package/dist/handlers/refactor-heal.d.ts +19 -0
- package/dist/handlers/refactor-heal.d.ts.map +1 -0
- package/dist/handlers/refactor-heal.js +27 -0
- package/dist/handlers/smells.d.ts +27 -0
- package/dist/handlers/smells.d.ts.map +1 -0
- package/dist/handlers/smells.js +24 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/invoke.d.ts +3 -0
- package/dist/invoke.d.ts.map +1 -0
- package/dist/invoke.js +162 -0
- package/dist/metrics.d.ts +33 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +159 -0
- package/dist/metrics.test.d.ts +2 -0
- package/dist/metrics.test.d.ts.map +1 -0
- package/dist/metrics.test.js +98 -0
- package/dist/refactor.d.ts +84 -0
- package/dist/refactor.d.ts.map +1 -0
- package/dist/refactor.js +183 -0
- package/dist/refactor.test.d.ts +2 -0
- package/dist/refactor.test.d.ts.map +1 -0
- package/dist/refactor.test.js +269 -0
- package/dist/smells.d.ts +39 -0
- package/dist/smells.d.ts.map +1 -0
- package/dist/smells.js +186 -0
- package/dist/smells.test.d.ts +2 -0
- package/dist/smells.test.d.ts.map +1 -0
- package/dist/smells.test.js +120 -0
- package/package.json +3 -3
- package/src/app/api/analysis/cycles/route.test.ts +2 -2
- package/src/app/api/analysis/metrics/route.test.ts +2 -2
- package/src/app/api/analysis/smells/route.test.ts +7 -7
- package/src/app/api/conflicts/route.test.ts +2 -2
- package/src/app/api/refactor/detect/route.test.ts +2 -2
- package/src/app/api/refactor/heal/route.test.ts +2 -2
- package/src/conflicts.test.ts +2 -2
- package/src/conflicts.ts +2 -2
- package/src/cycles.test.ts +2 -2
- package/src/cycles.ts +1 -1
- package/src/handlers/conflicts.ts +1 -1
- package/src/handlers/cycles.ts +1 -1
- package/src/handlers/metrics.ts +1 -1
- package/src/handlers/refactor-detect.ts +1 -1
- package/src/handlers/refactor-heal.ts +1 -1
- package/src/handlers/smells.ts +1 -1
- package/src/invoke.ts +116 -113
- package/src/metrics.test.ts +3 -3
- package/src/metrics.ts +1 -1
- package/src/refactor.test.ts +4 -4
- package/src/refactor.ts +1 -1
- package/src/smells.test.ts +7 -7
- package/src/smells.ts +1 -1
- package/vitest.config.ts +0 -8
package/src/invoke.ts
CHANGED
|
@@ -8,102 +8,62 @@ import { detectSmells } from "./smells.js";
|
|
|
8
8
|
import { computeGraphMetrics } from "./metrics.js";
|
|
9
9
|
import { detectDrift, healGraph } from "./refactor.js";
|
|
10
10
|
import { detectGraphConflicts } from "./conflicts.js";
|
|
11
|
-
import { blueprintGraphSchema } from "
|
|
11
|
+
import { blueprintGraphSchema } from "@abhinav2203/codeflow-core/schema";
|
|
12
12
|
|
|
13
13
|
// ── CLI ─────────────────────────────────────────────────────────────────────
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
export const runCLI = async () => {
|
|
16
|
+
const [command, ...args] = process.argv.slice(2);
|
|
16
17
|
|
|
17
|
-
const readBlueprint = (arg: string):
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const parseBlueprint = (content: string) => {
|
|
23
|
-
return blueprintGraphSchema.parse(JSON.parse(content));
|
|
24
|
-
};
|
|
18
|
+
const readBlueprint = (arg: string): string => {
|
|
19
|
+
const filePath = resolve(arg);
|
|
20
|
+
return readFileSync(filePath, "utf-8");
|
|
21
|
+
};
|
|
25
22
|
|
|
26
|
-
const
|
|
27
|
-
console.log(JSON.stringify(data, null, 2));
|
|
28
|
-
};
|
|
23
|
+
const parseBlueprint = (content: string) => blueprintGraphSchema.parse(JSON.parse(content));
|
|
29
24
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
25
|
+
const printJson = (data: unknown) => {
|
|
26
|
+
console.log(JSON.stringify(data, null, 2));
|
|
27
|
+
};
|
|
34
28
|
|
|
35
|
-
const
|
|
36
|
-
|
|
29
|
+
const exit = (code: number, message?: string) => {
|
|
30
|
+
if (message) console.error(message);
|
|
31
|
+
process.exit(code);
|
|
32
|
+
};
|
|
37
33
|
|
|
38
|
-
const
|
|
39
|
-
|
|
34
|
+
const MISSING_ARG = (cmd: string) =>
|
|
35
|
+
`codeflow-analysis ${cmd}: missing required argument <blueprint-path>`;
|
|
40
36
|
|
|
41
|
-
const
|
|
42
|
-
|
|
37
|
+
const UNREADABLE = (path: string) =>
|
|
38
|
+
`codeflow-analysis: could not read file "${path}"`;
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// ── cycles ────────────────────────────────────────────────────────────────
|
|
47
|
-
case "cycles": {
|
|
48
|
-
const [blueprintPath] = args;
|
|
49
|
-
if (!blueprintPath) exit(1, MISSING_ARG("cycles"));
|
|
40
|
+
const INVALID_BLUEPRINT = (path: string, error: unknown) =>
|
|
41
|
+
`codeflow-analysis: invalid blueprint at "${path}": ${error instanceof Error ? error.message : error}`;
|
|
50
42
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
exit(1,
|
|
57
|
-
}
|
|
43
|
+
try {
|
|
44
|
+
switch (command) {
|
|
45
|
+
// ── cycles ────────────────────────────────────────────────────────────────
|
|
46
|
+
case "cycles": {
|
|
47
|
+
const [blueprintPath] = args;
|
|
48
|
+
if (!blueprintPath) exit(1, MISSING_ARG("cycles"));
|
|
58
49
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const [blueprintPath] = args;
|
|
67
|
-
if (!blueprintPath) exit(1, MISSING_ARG("smells"));
|
|
68
|
-
|
|
69
|
-
let graph;
|
|
70
|
-
try {
|
|
71
|
-
graph = parseBlueprint(readBlueprint(blueprintPath));
|
|
72
|
-
} catch (e: unknown) {
|
|
73
|
-
if ((e as NodeJS.ErrnoException).code === "ENOENT") exit(1, UNREADABLE(blueprintPath));
|
|
74
|
-
exit(1, INVALID_BLUEPRINT(blueprintPath, e));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const report = detectSmells(graph);
|
|
78
|
-
printJson({ report });
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
50
|
+
let graph;
|
|
51
|
+
try {
|
|
52
|
+
graph = parseBlueprint(readBlueprint(blueprintPath));
|
|
53
|
+
} catch (e: unknown) {
|
|
54
|
+
if ((e as NodeJS.ErrnoException).code === "ENOENT") exit(1, UNREADABLE(blueprintPath));
|
|
55
|
+
exit(1, INVALID_BLUEPRINT(blueprintPath, e));
|
|
56
|
+
}
|
|
81
57
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (!blueprintPath) exit(1, MISSING_ARG("metrics"));
|
|
86
|
-
|
|
87
|
-
let graph;
|
|
88
|
-
try {
|
|
89
|
-
graph = parseBlueprint(readBlueprint(blueprintPath));
|
|
90
|
-
} catch (e: unknown) {
|
|
91
|
-
if ((e as NodeJS.ErrnoException).code === "ENOENT") exit(1, UNREADABLE(blueprintPath));
|
|
92
|
-
exit(1, INVALID_BLUEPRINT(blueprintPath, e));
|
|
58
|
+
const report = detectCycles(graph as Parameters<typeof detectCycles>[0]);
|
|
59
|
+
printJson({ report, hasCycles: hasCycles(graph as Parameters<typeof hasCycles>[0]) });
|
|
60
|
+
break;
|
|
93
61
|
}
|
|
94
62
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
// ── refactor detect ──────────────────────────────────────────────────────
|
|
101
|
-
case "refactor": {
|
|
102
|
-
const sub = args[0];
|
|
103
|
-
const [blueprintPath] = args.slice(1);
|
|
104
|
-
|
|
105
|
-
if (sub === "detect") {
|
|
106
|
-
if (!blueprintPath) exit(1, MISSING_ARG("refactor detect"));
|
|
63
|
+
// ── smells ───────────────────────────────────────────────────────────────
|
|
64
|
+
case "smells": {
|
|
65
|
+
const [blueprintPath] = args;
|
|
66
|
+
if (!blueprintPath) exit(1, MISSING_ARG("smells"));
|
|
107
67
|
|
|
108
68
|
let graph;
|
|
109
69
|
try {
|
|
@@ -113,13 +73,15 @@ try {
|
|
|
113
73
|
exit(1, INVALID_BLUEPRINT(blueprintPath, e));
|
|
114
74
|
}
|
|
115
75
|
|
|
116
|
-
const report =
|
|
76
|
+
const report = detectSmells(graph as Parameters<typeof detectSmells>[0]);
|
|
117
77
|
printJson({ report });
|
|
118
78
|
break;
|
|
119
79
|
}
|
|
120
80
|
|
|
121
|
-
|
|
122
|
-
|
|
81
|
+
// ── metrics ─────────────────────────────────────────────────────────────
|
|
82
|
+
case "metrics": {
|
|
83
|
+
const [blueprintPath] = args;
|
|
84
|
+
if (!blueprintPath) exit(1, MISSING_ARG("metrics"));
|
|
123
85
|
|
|
124
86
|
let graph;
|
|
125
87
|
try {
|
|
@@ -129,37 +91,74 @@ try {
|
|
|
129
91
|
exit(1, INVALID_BLUEPRINT(blueprintPath, e));
|
|
130
92
|
}
|
|
131
93
|
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
printJson({ report, result });
|
|
94
|
+
const metrics = computeGraphMetrics(graph as Parameters<typeof computeGraphMetrics>[0]);
|
|
95
|
+
printJson({ metrics });
|
|
135
96
|
break;
|
|
136
97
|
}
|
|
137
98
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
99
|
+
// ── refactor detect ──────────────────────────────────────────────────────
|
|
100
|
+
case "refactor": {
|
|
101
|
+
const sub = args[0];
|
|
102
|
+
const [blueprintPath] = args.slice(1);
|
|
103
|
+
|
|
104
|
+
if (sub === "detect") {
|
|
105
|
+
if (!blueprintPath) exit(1, MISSING_ARG("refactor detect"));
|
|
106
|
+
|
|
107
|
+
let graph;
|
|
108
|
+
try {
|
|
109
|
+
graph = parseBlueprint(readBlueprint(blueprintPath));
|
|
110
|
+
} catch (e: unknown) {
|
|
111
|
+
if ((e as NodeJS.ErrnoException).code === "ENOENT") exit(1, UNREADABLE(blueprintPath));
|
|
112
|
+
exit(1, INVALID_BLUEPRINT(blueprintPath, e));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const report = detectDrift(graph as Parameters<typeof detectDrift>[0]);
|
|
116
|
+
printJson({ report });
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (sub === "heal") {
|
|
121
|
+
if (!blueprintPath) exit(1, MISSING_ARG("refactor heal"));
|
|
122
|
+
|
|
123
|
+
let graph;
|
|
124
|
+
try {
|
|
125
|
+
graph = parseBlueprint(readBlueprint(blueprintPath));
|
|
126
|
+
} catch (e: unknown) {
|
|
127
|
+
if ((e as NodeJS.ErrnoException).code === "ENOENT") exit(1, UNREADABLE(blueprintPath));
|
|
128
|
+
exit(1, INVALID_BLUEPRINT(blueprintPath, e));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const report = detectDrift(graph as Parameters<typeof detectDrift>[0]);
|
|
132
|
+
const result = healGraph(graph as Parameters<typeof healGraph>[0], report);
|
|
133
|
+
printJson({ report, result });
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
141
136
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const [blueprintPath, repoPath] = args;
|
|
145
|
-
if (!blueprintPath) exit(1, MISSING_ARG("conflicts"));
|
|
146
|
-
|
|
147
|
-
let graph;
|
|
148
|
-
try {
|
|
149
|
-
graph = parseBlueprint(readBlueprint(blueprintPath));
|
|
150
|
-
} catch (e: unknown) {
|
|
151
|
-
if ((e as NodeJS.ErrnoException).code === "ENOENT") exit(1, UNREADABLE(blueprintPath));
|
|
152
|
-
exit(1, INVALID_BLUEPRINT(blueprintPath, e));
|
|
137
|
+
exit(1, `codeflow-analysis refactor: unknown subcommand "${sub}". Use "detect" or "heal".`);
|
|
138
|
+
break;
|
|
153
139
|
}
|
|
154
140
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
141
|
+
// ── conflicts ────────────────────────────────────────────────────────────
|
|
142
|
+
case "conflicts": {
|
|
143
|
+
const [blueprintPath, repoPath] = args;
|
|
144
|
+
if (!blueprintPath) exit(1, MISSING_ARG("conflicts"));
|
|
160
145
|
|
|
161
|
-
|
|
162
|
-
|
|
146
|
+
let graph;
|
|
147
|
+
try {
|
|
148
|
+
graph = parseBlueprint(readBlueprint(blueprintPath));
|
|
149
|
+
} catch (e: unknown) {
|
|
150
|
+
if ((e as NodeJS.ErrnoException).code === "ENOENT") exit(1, UNREADABLE(blueprintPath));
|
|
151
|
+
exit(1, INVALID_BLUEPRINT(blueprintPath, e));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const resolvedRepoPath = repoPath ?? process.cwd();
|
|
155
|
+
const report = await detectGraphConflicts(graph as Parameters<typeof detectGraphConflicts>[0], resolvedRepoPath);
|
|
156
|
+
printJson({ report });
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
case undefined:
|
|
161
|
+
exit(1, `codeflow-analysis: missing command. Usage:
|
|
163
162
|
|
|
164
163
|
codeflow-analysis cycles <blueprint-path>
|
|
165
164
|
codeflow-analysis smells <blueprint-path>
|
|
@@ -168,9 +167,13 @@ try {
|
|
|
168
167
|
codeflow-analysis refactor heal <blueprint-path>
|
|
169
168
|
codeflow-analysis conflicts <blueprint-path> [repo-path]`);
|
|
170
169
|
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
default:
|
|
171
|
+
exit(1, `codeflow-analysis: unknown command "${command}". Use cycles, smells, metrics, refactor, or conflicts.`);
|
|
172
|
+
}
|
|
173
|
+
} catch (error) {
|
|
174
|
+
exit(1, `codeflow-analysis: unexpected error: ${error instanceof Error ? error.message : error}`);
|
|
173
175
|
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// Run when executed directly
|
|
179
|
+
runCLI();
|
package/src/metrics.test.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
3
|
import { computeGraphMetrics } from "./metrics";
|
|
4
|
-
import type { BlueprintGraph } from "
|
|
5
|
-
import { emptyContract } from "
|
|
4
|
+
import type { BlueprintGraph, BlueprintEdge } from "@abhinav2203/codeflow-core/schema";
|
|
5
|
+
import { emptyContract } from "@abhinav2203/codeflow-core/schema";
|
|
6
6
|
|
|
7
7
|
const node = (id: string, kind: BlueprintGraph["nodes"][number]["kind"] = "function"): BlueprintGraph["nodes"][number] => ({
|
|
8
8
|
id,
|
|
@@ -15,7 +15,7 @@ const node = (id: string, kind: BlueprintGraph["nodes"][number]["kind"] = "funct
|
|
|
15
15
|
traceRefs: [],
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
const edge = (from: string, to: string, kind = "calls"): BlueprintGraph["edges"][number] => ({
|
|
18
|
+
const edge = (from: string, to: string, kind: BlueprintEdge["kind"] = "calls"): BlueprintGraph["edges"][number] => ({
|
|
19
19
|
from,
|
|
20
20
|
to,
|
|
21
21
|
kind,
|
package/src/metrics.ts
CHANGED
package/src/refactor.test.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
3
|
import { detectDrift, healGraph } from "./refactor";
|
|
4
|
-
import type { BlueprintEdge, BlueprintGraph } from "
|
|
5
|
-
import { emptyContract } from "
|
|
4
|
+
import type { BlueprintEdge, BlueprintGraph, DesignCall } from "@abhinav2203/codeflow-core/schema";
|
|
5
|
+
import { emptyContract } from "@abhinav2203/codeflow-core/schema";
|
|
6
6
|
|
|
7
7
|
// ── Fixtures ───────────────────────────────────────────────────────────────
|
|
8
8
|
|
|
@@ -29,7 +29,7 @@ const makeNode = (
|
|
|
29
29
|
inputs: [] as { name: string; type: string; description?: string }[],
|
|
30
30
|
outputs: [] as { name: string; type: string; description?: string }[],
|
|
31
31
|
sideEffects: [] as string[],
|
|
32
|
-
calls: [] as
|
|
32
|
+
calls: [] as DesignCall[],
|
|
33
33
|
},
|
|
34
34
|
]
|
|
35
35
|
: [];
|
|
@@ -51,7 +51,7 @@ const makeNode = (
|
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
const edge = (from: string, to: string, kind = "calls"): BlueprintEdge => ({
|
|
54
|
+
const edge = (from: string, to: string, kind: BlueprintEdge["kind"] = "calls"): BlueprintEdge => ({
|
|
55
55
|
from,
|
|
56
56
|
to,
|
|
57
57
|
kind,
|
package/src/refactor.ts
CHANGED
package/src/smells.test.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
3
|
import { detectSmells } from "./smells";
|
|
4
|
-
import type { BlueprintGraph } from "
|
|
5
|
-
import { emptyContract } from "
|
|
4
|
+
import type { BlueprintGraph, MethodSpec } from "@abhinav2203/codeflow-core/schema";
|
|
5
|
+
import { emptyContract } from "@abhinav2203/codeflow-core/schema";
|
|
6
6
|
|
|
7
7
|
const node = (
|
|
8
8
|
id: string,
|
|
@@ -41,13 +41,13 @@ const graph = (
|
|
|
41
41
|
edges,
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
const makeMethod = (name: string) => ({
|
|
44
|
+
const makeMethod = (name: string): MethodSpec => ({
|
|
45
45
|
name,
|
|
46
46
|
summary: `Does ${name}.`,
|
|
47
|
-
inputs: []
|
|
48
|
-
outputs: []
|
|
49
|
-
sideEffects: []
|
|
50
|
-
calls: []
|
|
47
|
+
inputs: [],
|
|
48
|
+
outputs: [],
|
|
49
|
+
sideEffects: [],
|
|
50
|
+
calls: [],
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
describe("detectSmells", () => {
|
package/src/smells.ts
CHANGED
package/vitest.config.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { defineConfig } from "vitest/config";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
|
|
5
|
-
const monorepoRoot = path.resolve(fileURLToPath(import.meta.url), "../../..");
|
|
6
5
|
|
|
7
6
|
export default defineConfig({
|
|
8
7
|
test: {
|
|
@@ -12,11 +11,4 @@ export default defineConfig({
|
|
|
12
11
|
// Allow tests to run from the package directory
|
|
13
12
|
cwd: path.resolve(fileURLToPath(import.meta.url), ".."),
|
|
14
13
|
},
|
|
15
|
-
resolve: {
|
|
16
|
-
alias: {
|
|
17
|
-
// Resolve @/* to the monorepo source so that the package's tests
|
|
18
|
-
// can import types from the unextracted codeflow-core modules.
|
|
19
|
-
"@": monorepoRoot + "/src",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
14
|
});
|