projax 3.3.58 → 3.3.63

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 (84) hide show
  1. package/README.md +10 -1
  2. package/dist/electron/preload.d.ts +1 -0
  3. package/dist/electron/renderer/assets/index-CmtZriN5.js +66 -0
  4. package/dist/electron/renderer/index.html +1 -1
  5. package/dist/electron/script-runner.js +52 -20
  6. package/dist/index.js +14 -10
  7. package/dist/prxi.js +877 -109
  8. package/dist/prxi.tsx +1249 -177
  9. package/dist/script-runner.js +52 -20
  10. package/package.json +1 -1
  11. package/coverage/base.css +0 -224
  12. package/coverage/block-navigation.js +0 -87
  13. package/coverage/core-bridge.ts.html +0 -292
  14. package/coverage/favicon.png +0 -0
  15. package/coverage/index.html +0 -191
  16. package/coverage/lcov-report/base.css +0 -224
  17. package/coverage/lcov-report/block-navigation.js +0 -87
  18. package/coverage/lcov-report/core-bridge.ts.html +0 -292
  19. package/coverage/lcov-report/favicon.png +0 -0
  20. package/coverage/lcov-report/index.html +0 -191
  21. package/coverage/lcov-report/port-extractor.ts.html +0 -1174
  22. package/coverage/lcov-report/port-scanner.ts.html +0 -301
  23. package/coverage/lcov-report/port-utils.ts.html +0 -670
  24. package/coverage/lcov-report/prettify.css +0 -1
  25. package/coverage/lcov-report/prettify.js +0 -2
  26. package/coverage/lcov-report/script-runner.ts.html +0 -3346
  27. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  28. package/coverage/lcov-report/sorter.js +0 -210
  29. package/coverage/lcov-report/test-parser.ts.html +0 -799
  30. package/coverage/lcov.info +0 -1338
  31. package/coverage/port-extractor.ts.html +0 -1174
  32. package/coverage/port-scanner.ts.html +0 -301
  33. package/coverage/port-utils.ts.html +0 -670
  34. package/coverage/prettify.css +0 -1
  35. package/coverage/prettify.js +0 -2
  36. package/coverage/script-runner.ts.html +0 -3346
  37. package/coverage/sort-arrow-sprite.png +0 -0
  38. package/coverage/sorter.js +0 -210
  39. package/coverage/test-parser.ts.html +0 -799
  40. package/dist/__tests__/core-bridge.test.d.ts +0 -1
  41. package/dist/__tests__/core-bridge.test.js +0 -135
  42. package/dist/__tests__/port-extractor.test.d.ts +0 -1
  43. package/dist/__tests__/port-extractor.test.js +0 -407
  44. package/dist/__tests__/port-scanner.test.d.ts +0 -1
  45. package/dist/__tests__/port-scanner.test.js +0 -170
  46. package/dist/__tests__/port-utils.test.d.ts +0 -1
  47. package/dist/__tests__/port-utils.test.js +0 -127
  48. package/dist/__tests__/script-runner.test.d.ts +0 -1
  49. package/dist/__tests__/script-runner.test.js +0 -491
  50. package/dist/__tests__/test-parser.test.d.ts +0 -1
  51. package/dist/__tests__/test-parser.test.js +0 -276
  52. package/dist/api/__tests__/database.test.d.ts +0 -2
  53. package/dist/api/__tests__/database.test.d.ts.map +0 -1
  54. package/dist/api/__tests__/database.test.js +0 -485
  55. package/dist/api/__tests__/database.test.js.map +0 -1
  56. package/dist/api/__tests__/routes.test.d.ts +0 -2
  57. package/dist/api/__tests__/routes.test.d.ts.map +0 -1
  58. package/dist/api/__tests__/routes.test.js +0 -484
  59. package/dist/api/__tests__/routes.test.js.map +0 -1
  60. package/dist/api/__tests__/scanner.test.d.ts +0 -2
  61. package/dist/api/__tests__/scanner.test.d.ts.map +0 -1
  62. package/dist/api/__tests__/scanner.test.js +0 -403
  63. package/dist/api/__tests__/scanner.test.js.map +0 -1
  64. package/dist/core/__tests__/database.test.d.ts +0 -1
  65. package/dist/core/__tests__/database.test.js +0 -557
  66. package/dist/core/__tests__/detector.test.d.ts +0 -1
  67. package/dist/core/__tests__/detector.test.js +0 -375
  68. package/dist/core/__tests__/index.test.d.ts +0 -1
  69. package/dist/core/__tests__/index.test.js +0 -469
  70. package/dist/core/__tests__/scanner.test.d.ts +0 -1
  71. package/dist/core/__tests__/scanner.test.js +0 -406
  72. package/dist/core/__tests__/settings.test.d.ts +0 -1
  73. package/dist/core/__tests__/settings.test.js +0 -280
  74. package/dist/electron/core/__tests__/database.test.d.ts +0 -1
  75. package/dist/electron/core/__tests__/database.test.js +0 -557
  76. package/dist/electron/core/__tests__/detector.test.d.ts +0 -1
  77. package/dist/electron/core/__tests__/detector.test.js +0 -375
  78. package/dist/electron/core/__tests__/index.test.d.ts +0 -1
  79. package/dist/electron/core/__tests__/index.test.js +0 -469
  80. package/dist/electron/core/__tests__/scanner.test.d.ts +0 -1
  81. package/dist/electron/core/__tests__/scanner.test.js +0 -406
  82. package/dist/electron/core/__tests__/settings.test.d.ts +0 -1
  83. package/dist/electron/core/__tests__/settings.test.js +0 -280
  84. package/jest.config.js +0 -26
@@ -1,375 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- const fs = __importStar(require("fs"));
37
- const path = __importStar(require("path"));
38
- const detector_1 = require("../detector");
39
- // Mock fs module
40
- jest.mock('fs');
41
- const mockedFs = fs;
42
- describe('detector', () => {
43
- beforeEach(() => {
44
- jest.clearAllMocks();
45
- });
46
- describe('detectTestFramework', () => {
47
- const projectPath = '/fake/project';
48
- const packageJsonPath = path.join(projectPath, 'package.json');
49
- it('should detect jest from dependencies', () => {
50
- const packageJson = {
51
- devDependencies: {
52
- jest: '^29.0.0',
53
- },
54
- };
55
- mockedFs.existsSync.mockReturnValue(true);
56
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
57
- const result = (0, detector_1.detectTestFramework)(projectPath);
58
- expect(result).toBe('jest');
59
- });
60
- it('should detect vitest from dependencies', () => {
61
- const packageJson = {
62
- devDependencies: {
63
- vitest: '^1.0.0',
64
- },
65
- };
66
- mockedFs.existsSync.mockReturnValue(true);
67
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
68
- const result = (0, detector_1.detectTestFramework)(projectPath);
69
- expect(result).toBe('vitest');
70
- });
71
- it('should detect mocha from dependencies', () => {
72
- const packageJson = {
73
- devDependencies: {
74
- mocha: '^10.0.0',
75
- },
76
- };
77
- mockedFs.existsSync.mockReturnValue(true);
78
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
79
- const result = (0, detector_1.detectTestFramework)(projectPath);
80
- expect(result).toBe('mocha');
81
- });
82
- it('should detect jest from jest config in package.json', () => {
83
- const packageJson = {
84
- jest: {
85
- preset: 'ts-jest',
86
- },
87
- };
88
- mockedFs.existsSync.mockReturnValue(true);
89
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
90
- const result = (0, detector_1.detectTestFramework)(projectPath);
91
- expect(result).toBe('jest');
92
- });
93
- it('should detect jest from test script', () => {
94
- const packageJson = {
95
- scripts: {
96
- test: 'jest',
97
- },
98
- };
99
- mockedFs.existsSync.mockReturnValue(true);
100
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
101
- const result = (0, detector_1.detectTestFramework)(projectPath);
102
- expect(result).toBe('jest');
103
- });
104
- it('should detect framework from config files', () => {
105
- const packageJson = {};
106
- mockedFs.existsSync.mockImplementation((filePath) => {
107
- const pathStr = filePath.toString();
108
- if (pathStr === packageJsonPath)
109
- return true;
110
- if (pathStr === path.join(projectPath, 'jest.config.js'))
111
- return true;
112
- return false;
113
- });
114
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
115
- const result = (0, detector_1.detectTestFramework)(projectPath);
116
- expect(result).toBe('jest');
117
- });
118
- it('should return null if no framework is detected', () => {
119
- mockedFs.existsSync.mockImplementation((filePath) => {
120
- const pathStr = filePath.toString();
121
- return pathStr === packageJsonPath;
122
- });
123
- mockedFs.readFileSync.mockReturnValue(JSON.stringify({}));
124
- const result = (0, detector_1.detectTestFramework)(projectPath);
125
- expect(result).toBeNull();
126
- });
127
- it('should handle missing package.json', () => {
128
- mockedFs.existsSync.mockReturnValue(false);
129
- const result = (0, detector_1.detectTestFramework)(projectPath);
130
- expect(result).toBeNull();
131
- });
132
- it('should handle invalid JSON in package.json', () => {
133
- const packageJson = {};
134
- mockedFs.existsSync.mockImplementation((filePath) => {
135
- const pathStr = filePath.toString();
136
- // Return true only for package.json, false for all config files
137
- return pathStr === packageJsonPath;
138
- });
139
- mockedFs.readFileSync.mockReturnValue('invalid json');
140
- const result = (0, detector_1.detectTestFramework)(projectPath);
141
- expect(result).toBeNull();
142
- });
143
- });
144
- describe('isTestFile', () => {
145
- it('should detect test files with .test.ts extension', () => {
146
- expect((0, detector_1.isTestFile)('/path/to/file.test.ts')).toBe(true);
147
- });
148
- it('should detect test files with .spec.ts extension', () => {
149
- expect((0, detector_1.isTestFile)('/path/to/file.spec.ts')).toBe(true);
150
- });
151
- it('should detect test files with .test.js extension', () => {
152
- expect((0, detector_1.isTestFile)('/path/to/file.test.js')).toBe(true);
153
- });
154
- it('should detect test files with .spec.jsx extension', () => {
155
- expect((0, detector_1.isTestFile)('/path/to/file.spec.jsx')).toBe(true);
156
- });
157
- it('should detect files in __tests__ directory', () => {
158
- expect((0, detector_1.isTestFile)('/path/to/__tests__/mytest.ts')).toBe(true);
159
- });
160
- it('should detect files in test directory (mocha pattern)', () => {
161
- expect((0, detector_1.isTestFile)('/path/to/test/mytest.ts')).toBe(true);
162
- });
163
- it('should not detect regular files', () => {
164
- expect((0, detector_1.isTestFile)('/path/to/regular.ts')).toBe(false);
165
- });
166
- it('should not detect files in non-test directories', () => {
167
- expect((0, detector_1.isTestFile)('/path/to/src/component.tsx')).toBe(false);
168
- });
169
- it('should detect test files when framework is specified', () => {
170
- expect((0, detector_1.isTestFile)('/path/to/file.test.ts', 'jest')).toBe(true);
171
- });
172
- it('should detect files in framework-specific test directories', () => {
173
- expect((0, detector_1.isTestFile)('/path/to/__tests__/file.ts', 'jest')).toBe(true);
174
- });
175
- it('should handle files with uppercase extensions', () => {
176
- expect((0, detector_1.isTestFile)('/path/to/FILE.TEST.TS')).toBe(true);
177
- });
178
- });
179
- describe('detectProjectFramework', () => {
180
- const projectPath = '/fake/project';
181
- const packageJsonPath = path.join(projectPath, 'package.json');
182
- it('should detect Next.js projects', () => {
183
- const packageJson = {
184
- dependencies: {
185
- next: '^14.0.0',
186
- },
187
- };
188
- mockedFs.existsSync.mockReturnValue(true);
189
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
190
- const result = (0, detector_1.detectProjectFramework)(projectPath);
191
- expect(result).toBe('next.js');
192
- });
193
- it('should detect React projects', () => {
194
- const packageJson = {
195
- dependencies: {
196
- react: '^18.0.0',
197
- 'react-dom': '^18.0.0',
198
- },
199
- };
200
- mockedFs.existsSync.mockReturnValue(true);
201
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
202
- const result = (0, detector_1.detectProjectFramework)(projectPath);
203
- expect(result).toBe('react');
204
- });
205
- it('should detect Vue projects', () => {
206
- const packageJson = {
207
- dependencies: {
208
- vue: '^3.0.0',
209
- },
210
- };
211
- mockedFs.existsSync.mockReturnValue(true);
212
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
213
- const result = (0, detector_1.detectProjectFramework)(projectPath);
214
- expect(result).toBe('vue 3');
215
- });
216
- it('should detect Angular projects', () => {
217
- const packageJson = {
218
- dependencies: {
219
- '@angular/core': '^17.0.0',
220
- },
221
- };
222
- mockedFs.existsSync.mockReturnValue(true);
223
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
224
- const result = (0, detector_1.detectProjectFramework)(projectPath);
225
- expect(result).toBe('angular');
226
- });
227
- it('should detect Express projects', () => {
228
- const packageJson = {
229
- dependencies: {
230
- express: '^4.18.0',
231
- },
232
- };
233
- mockedFs.existsSync.mockReturnValue(true);
234
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
235
- const result = (0, detector_1.detectProjectFramework)(projectPath);
236
- expect(result).toBe('express');
237
- });
238
- it('should detect NestJS projects', () => {
239
- const packageJson = {
240
- dependencies: {
241
- '@nestjs/core': '^10.0.0',
242
- },
243
- };
244
- mockedFs.existsSync.mockReturnValue(true);
245
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
246
- const result = (0, detector_1.detectProjectFramework)(projectPath);
247
- expect(result).toBe('nest.js');
248
- });
249
- it('should detect Electron projects', () => {
250
- const packageJson = {
251
- devDependencies: {
252
- electron: '^28.0.0',
253
- },
254
- };
255
- mockedFs.existsSync.mockReturnValue(true);
256
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
257
- const result = (0, detector_1.detectProjectFramework)(projectPath);
258
- expect(result).toBe('electron');
259
- });
260
- it('should detect React Native projects before React', () => {
261
- const packageJson = {
262
- dependencies: {
263
- react: '^18.0.0',
264
- 'react-native': '^0.72.0',
265
- },
266
- };
267
- mockedFs.existsSync.mockReturnValue(true);
268
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
269
- const result = (0, detector_1.detectProjectFramework)(projectPath);
270
- expect(result).toBe('react-native');
271
- });
272
- it('should detect Rust projects without package.json', () => {
273
- mockedFs.existsSync.mockImplementation((filePath) => {
274
- const pathStr = filePath.toString();
275
- if (pathStr === packageJsonPath)
276
- return false;
277
- if (pathStr === path.join(projectPath, 'Cargo.toml'))
278
- return true;
279
- return false;
280
- });
281
- const result = (0, detector_1.detectProjectFramework)(projectPath);
282
- expect(result).toBe('rust');
283
- });
284
- it('should detect Go projects without package.json', () => {
285
- mockedFs.existsSync.mockImplementation((filePath) => {
286
- const pathStr = filePath.toString();
287
- if (pathStr === packageJsonPath)
288
- return false;
289
- if (pathStr === path.join(projectPath, 'go.mod'))
290
- return true;
291
- return false;
292
- });
293
- const result = (0, detector_1.detectProjectFramework)(projectPath);
294
- expect(result).toBe('go');
295
- });
296
- it('should detect Python projects without package.json', () => {
297
- mockedFs.existsSync.mockImplementation((filePath) => {
298
- const pathStr = filePath.toString();
299
- if (pathStr === packageJsonPath)
300
- return false;
301
- if (pathStr === path.join(projectPath, 'requirements.txt'))
302
- return true;
303
- return false;
304
- });
305
- const result = (0, detector_1.detectProjectFramework)(projectPath);
306
- expect(result).toBe('python');
307
- });
308
- it('should return node.js as fallback for projects with package.json', () => {
309
- const packageJson = {
310
- dependencies: {},
311
- };
312
- mockedFs.existsSync.mockReturnValue(true);
313
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
314
- const result = (0, detector_1.detectProjectFramework)(projectPath);
315
- expect(result).toBe('node.js');
316
- });
317
- it('should return null if no indicators are found', () => {
318
- mockedFs.existsSync.mockReturnValue(false);
319
- const result = (0, detector_1.detectProjectFramework)(projectPath);
320
- expect(result).toBeNull();
321
- });
322
- it('should handle invalid JSON in package.json', () => {
323
- mockedFs.existsSync.mockReturnValue(true);
324
- mockedFs.readFileSync.mockReturnValue('invalid json');
325
- const result = (0, detector_1.detectProjectFramework)(projectPath);
326
- expect(result).toBeNull();
327
- });
328
- it('should prioritize Next.js over React', () => {
329
- const packageJson = {
330
- dependencies: {
331
- next: '^14.0.0',
332
- react: '^18.0.0',
333
- },
334
- };
335
- mockedFs.existsSync.mockReturnValue(true);
336
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
337
- const result = (0, detector_1.detectProjectFramework)(projectPath);
338
- expect(result).toBe('next.js');
339
- });
340
- it('should detect Vite projects', () => {
341
- const packageJson = {
342
- devDependencies: {
343
- vite: '^5.0.0',
344
- },
345
- };
346
- mockedFs.existsSync.mockReturnValue(true);
347
- mockedFs.readFileSync.mockReturnValue(JSON.stringify(packageJson));
348
- const result = (0, detector_1.detectProjectFramework)(projectPath);
349
- expect(result).toBe('vite');
350
- });
351
- });
352
- describe('FRAMEWORKS constant', () => {
353
- it('should contain jest framework definition', () => {
354
- const jest = detector_1.FRAMEWORKS.find(f => f.name === 'jest');
355
- expect(jest).toBeDefined();
356
- expect(jest?.configFiles).toContain('jest.config.js');
357
- expect(jest?.testDirs).toContain('__tests__');
358
- });
359
- it('should contain vitest framework definition', () => {
360
- const vitest = detector_1.FRAMEWORKS.find(f => f.name === 'vitest');
361
- expect(vitest).toBeDefined();
362
- expect(vitest?.configFiles).toContain('vitest.config.ts');
363
- });
364
- it('should contain mocha framework definition', () => {
365
- const mocha = detector_1.FRAMEWORKS.find(f => f.name === 'mocha');
366
- expect(mocha).toBeDefined();
367
- expect(mocha?.testDirs).toContain('test');
368
- });
369
- it('should have test patterns for all frameworks', () => {
370
- detector_1.FRAMEWORKS.forEach(framework => {
371
- expect(framework.testPatterns.length).toBeGreaterThan(0);
372
- });
373
- });
374
- });
375
- });
@@ -1 +0,0 @@
1
- export {};