pi-lens 2.0.7 → 2.0.8

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.
Files changed (34) hide show
  1. package/clients/ast-grep-client.test.ts +146 -116
  2. package/clients/ast-grep-client.ts +645 -551
  3. package/clients/biome-client.test.ts +154 -137
  4. package/clients/biome-client.ts +397 -337
  5. package/clients/complexity-client.test.ts +188 -200
  6. package/clients/complexity-client.ts +815 -667
  7. package/clients/dependency-checker.test.ts +55 -55
  8. package/clients/dependency-checker.ts +358 -333
  9. package/clients/go-client.test.ts +121 -111
  10. package/clients/go-client.ts +218 -216
  11. package/clients/jscpd-client.test.ts +132 -132
  12. package/clients/jscpd-client.ts +155 -118
  13. package/clients/knip-client.test.ts +123 -133
  14. package/clients/knip-client.ts +231 -218
  15. package/clients/metrics-client.test.ts +171 -167
  16. package/clients/metrics-client.ts +283 -252
  17. package/clients/ruff-client.test.ts +128 -117
  18. package/clients/ruff-client.ts +300 -269
  19. package/clients/rust-client.test.ts +104 -85
  20. package/clients/rust-client.ts +241 -234
  21. package/clients/subprocess-client.ts +1 -1
  22. package/clients/test-runner-client.test.ts +248 -215
  23. package/clients/test-runner-client.ts +728 -608
  24. package/clients/test-utils.ts +10 -3
  25. package/clients/todo-scanner.test.ts +288 -202
  26. package/clients/todo-scanner.ts +225 -187
  27. package/clients/type-coverage-client.test.ts +119 -119
  28. package/clients/type-coverage-client.ts +142 -115
  29. package/clients/types.ts +28 -28
  30. package/clients/typescript-client.test.ts +99 -93
  31. package/clients/typescript-client.ts +527 -502
  32. package/index.ts +662 -212
  33. package/package.json +1 -1
  34. package/tsconfig.json +12 -12
@@ -1,71 +1,71 @@
1
- import { describe, it, expect, beforeEach, afterEach } from "vitest";
1
+ import { afterEach, beforeEach, describe, expect, it } from "vitest";
2
2
  import { DependencyChecker } from "./dependency-checker.js";
3
3
  import { setupTestEnvironment } from "./test-utils.js";
4
4
 
5
5
  describe("DependencyChecker", () => {
6
- let client: DependencyChecker;
7
- let tmpDir: string;
8
- let cleanup: () => void;
6
+ let client: DependencyChecker;
7
+ let tmpDir: string;
8
+ let cleanup: () => void;
9
9
 
10
- beforeEach(() => {
11
- client = new DependencyChecker();
12
- ({ tmpDir, cleanup } = setupTestEnvironment("pi-lens-dep-test-"));
13
- });
10
+ beforeEach(() => {
11
+ client = new DependencyChecker();
12
+ ({ tmpDir, cleanup } = setupTestEnvironment("pi-lens-dep-test-"));
13
+ });
14
14
 
15
- afterEach(() => {
16
- cleanup();
17
- });
15
+ afterEach(() => {
16
+ cleanup();
17
+ });
18
18
 
19
- describe("isAvailable", () => {
20
- it("should check madge availability", () => {
21
- const available = client.isAvailable();
22
- expect(typeof available).toBe("boolean");
23
- });
24
- });
19
+ describe("isAvailable", () => {
20
+ it("should check madge availability", () => {
21
+ const available = client.isAvailable();
22
+ expect(typeof available).toBe("boolean");
23
+ });
24
+ });
25
25
 
26
- describe("checkFile", () => {
27
- it("should return no circular deps for non-existent files", () => {
28
- const result = client.checkFile("/nonexistent/file.ts");
29
- expect(result.hasCircular).toBe(false);
30
- expect(result.circular).toEqual([]);
31
- });
26
+ describe("checkFile", () => {
27
+ it("should return no circular deps for non-existent files", () => {
28
+ const result = client.checkFile("/nonexistent/file.ts");
29
+ expect(result.hasCircular).toBe(false);
30
+ expect(result.circular).toEqual([]);
31
+ });
32
32
 
33
- it("should return correct structure when not available", () => {
34
- const mockChecker = new DependencyChecker();
35
- if (mockChecker.isAvailable()) return; // Skip if available
33
+ it("should return correct structure when not available", () => {
34
+ const mockChecker = new DependencyChecker();
35
+ if (mockChecker.isAvailable()) return; // Skip if available
36
36
 
37
- const result = mockChecker.checkFile("/some/file.ts");
38
- expect(result).toHaveProperty("hasCircular");
39
- expect(result).toHaveProperty("circular");
40
- expect(result).toHaveProperty("checked");
41
- });
42
- });
37
+ const result = mockChecker.checkFile("/some/file.ts");
38
+ expect(result).toHaveProperty("hasCircular");
39
+ expect(result).toHaveProperty("circular");
40
+ expect(result).toHaveProperty("checked");
41
+ });
42
+ });
43
43
 
44
- describe("scanProject", () => {
45
- it("should return correct structure", () => {
46
- const mockChecker = new DependencyChecker();
47
- // When not available, should still return expected structure
48
- const result = mockChecker.scanProject(tmpDir);
49
- expect(result).toHaveProperty("circular");
50
- expect(result).toHaveProperty("count");
51
- expect(Array.isArray(result.circular)).toBe(true);
52
- });
53
- });
44
+ describe("scanProject", () => {
45
+ it("should return correct structure", () => {
46
+ const mockChecker = new DependencyChecker();
47
+ // When not available, should still return expected structure
48
+ const result = mockChecker.scanProject(tmpDir);
49
+ expect(result).toHaveProperty("circular");
50
+ expect(result).toHaveProperty("count");
51
+ expect(Array.isArray(result.circular)).toBe(true);
52
+ });
53
+ });
54
54
 
55
- describe("formatWarning", () => {
56
- it("should format circular dependency warning", () => {
57
- const circularDeps = ["b.ts", "c.ts", "a.ts"];
58
- const formatted = client.formatWarning("a.ts", circularDeps);
55
+ describe("formatWarning", () => {
56
+ it("should format circular dependency warning", () => {
57
+ const circularDeps = ["b.ts", "c.ts", "a.ts"];
58
+ const formatted = client.formatWarning("a.ts", circularDeps);
59
59
 
60
- expect(formatted).toContain("cycle");
61
- expect(formatted).toContain("a.ts");
62
- });
60
+ expect(formatted).toContain("cycle");
61
+ expect(formatted).toContain("a.ts");
62
+ });
63
63
 
64
- it("should show the circular path", () => {
65
- const circularDeps = ["b.ts", "a.ts"];
66
- const formatted = client.formatWarning("a.ts", circularDeps);
64
+ it("should show the circular path", () => {
65
+ const circularDeps = ["b.ts", "a.ts"];
66
+ const formatted = client.formatWarning("a.ts", circularDeps);
67
67
 
68
- expect(formatted).toContain("b.ts");
69
- });
70
- });
68
+ expect(formatted).toContain("b.ts");
69
+ });
70
+ });
71
71
  });