projax 3.3.40 → 3.3.51
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/README.md +73 -0
- package/dist/__tests__/port-scanner.test.js +7 -17
- package/dist/__tests__/script-runner.test.js +7 -17
- package/dist/api/__tests__/database.test.js +7 -17
- package/dist/api/__tests__/database.test.js.map +1 -1
- package/dist/api/__tests__/routes.test.js +7 -17
- package/dist/api/__tests__/routes.test.js.map +1 -1
- package/dist/api/__tests__/scanner.test.js +7 -17
- package/dist/api/__tests__/scanner.test.js.map +1 -1
- package/dist/api/database.d.ts +20 -1
- package/dist/api/database.d.ts.map +1 -1
- package/dist/api/database.js +192 -21
- package/dist/api/database.js.map +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +17 -19
- package/dist/api/index.js.map +1 -1
- package/dist/api/migrate.js +2 -1
- package/dist/api/migrate.js.map +1 -1
- package/dist/api/package.json +3 -2
- package/dist/api/routes/backup.d.ts +3 -0
- package/dist/api/routes/backup.d.ts.map +1 -0
- package/dist/api/routes/backup.js +51 -0
- package/dist/api/routes/backup.js.map +1 -0
- package/dist/api/routes/index.d.ts.map +1 -1
- package/dist/api/routes/index.js +6 -0
- package/dist/api/routes/index.js.map +1 -1
- package/dist/api/routes/mcp.d.ts +3 -0
- package/dist/api/routes/mcp.d.ts.map +1 -0
- package/dist/api/routes/mcp.js +147 -0
- package/dist/api/routes/mcp.js.map +1 -0
- package/dist/api/routes/projects.d.ts.map +1 -1
- package/dist/api/routes/projects.js +27 -17
- package/dist/api/routes/projects.js.map +1 -1
- package/dist/api/routes/settings.d.ts.map +1 -1
- package/dist/api/routes/settings.js +119 -11
- package/dist/api/routes/settings.js.map +1 -1
- package/dist/api/routes/workspaces.d.ts +3 -0
- package/dist/api/routes/workspaces.d.ts.map +1 -0
- package/dist/api/routes/workspaces.js +504 -0
- package/dist/api/routes/workspaces.js.map +1 -0
- package/dist/api/services/scanner.js +10 -19
- package/dist/api/services/scanner.js.map +1 -1
- package/dist/api/services/test-parser.js +3 -2
- package/dist/api/services/test-parser.js.map +1 -1
- package/dist/api/types.d.ts +31 -0
- package/dist/api/types.d.ts.map +1 -1
- package/dist/core/__tests__/database.test.js +7 -17
- package/dist/core/__tests__/detector.test.js +7 -17
- package/dist/core/__tests__/index.test.js +7 -17
- package/dist/core/__tests__/scanner.test.js +7 -17
- package/dist/core/__tests__/settings.test.js +7 -17
- package/dist/core/backup-utils.d.ts +17 -0
- package/dist/core/backup-utils.js +157 -0
- package/dist/core/database.d.ts +1 -0
- package/dist/core/database.js +9 -18
- package/dist/core/detector.js +11 -21
- package/dist/core/git-utils.d.ts +12 -0
- package/dist/core/git-utils.js +87 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.js +8 -5
- package/dist/core/scanner.js +3 -2
- package/dist/core/settings.d.ts +85 -0
- package/dist/core/settings.js +306 -9
- package/dist/core/workspace-utils.d.ts +37 -0
- package/dist/core/workspace-utils.js +143 -0
- package/dist/core-bridge.js +7 -17
- package/dist/electron/core/__tests__/database.test.js +7 -17
- package/dist/electron/core/__tests__/detector.test.js +7 -17
- package/dist/electron/core/__tests__/index.test.js +7 -17
- package/dist/electron/core/__tests__/scanner.test.js +7 -17
- package/dist/electron/core/__tests__/settings.test.js +7 -17
- package/dist/electron/core/backup-utils.d.ts +17 -0
- package/dist/electron/core/backup-utils.js +157 -0
- package/dist/electron/core/database.d.ts +1 -0
- package/dist/electron/core/database.js +9 -18
- package/dist/electron/core/detector.js +11 -21
- package/dist/electron/core/git-utils.d.ts +12 -0
- package/dist/electron/core/git-utils.js +87 -0
- package/dist/electron/core/index.d.ts +3 -0
- package/dist/electron/core/index.js +8 -5
- package/dist/electron/core/scanner.js +3 -2
- package/dist/electron/core/settings.d.ts +85 -0
- package/dist/electron/core/settings.js +306 -9
- package/dist/electron/core/workspace-utils.d.ts +37 -0
- package/dist/electron/core/workspace-utils.js +143 -0
- package/dist/electron/core.js +7 -17
- package/dist/electron/main.js +663 -33
- package/dist/electron/port-extractor.js +9 -18
- package/dist/electron/port-scanner.js +11 -20
- package/dist/electron/port-utils.js +5 -4
- package/dist/electron/preload.d.ts +27 -2
- package/dist/electron/preload.js +18 -2
- package/dist/electron/renderer/assets/index-B-etDnj2.js +64 -0
- package/dist/electron/renderer/assets/index-Bx18Cyic.js +64 -0
- package/dist/electron/renderer/assets/index-C8f5yNYe.js +64 -0
- package/dist/electron/renderer/assets/index-CIZ3Wl6c.css +1 -0
- package/dist/electron/renderer/assets/index-CJbsU9y8.css +1 -0
- package/dist/electron/renderer/assets/index-CopVNRnR.js +64 -0
- package/dist/electron/renderer/assets/index-DUvcepWm.js +64 -0
- package/dist/electron/renderer/assets/index-DWe2TQFv.css +1 -0
- package/dist/electron/renderer/assets/index-DZzB20Xf.css +1 -0
- package/dist/electron/renderer/assets/index-DknLdADV.js +63 -0
- package/dist/electron/renderer/assets/index-DocuD8Lk.js +64 -0
- package/dist/electron/renderer/assets/index-DyU-xfd8.css +1 -0
- package/dist/electron/renderer/assets/index-GwC-JVUy.css +1 -0
- package/dist/electron/renderer/assets/index-fehviker.js +63 -0
- package/dist/electron/renderer/index.html +2 -2
- package/dist/electron/script-runner.js +20 -29
- package/dist/index.js +395 -21
- package/dist/port-extractor.js +9 -18
- package/dist/port-scanner.js +11 -20
- package/dist/port-utils.js +5 -4
- package/dist/script-runner.js +20 -29
- package/dist/test-parser.js +3 -2
- package/package.json +3 -2
|
@@ -0,0 +1,143 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.validateWorkspacePath = exports.generateWorkspaceFile = exports.parseWorkspaceFile = void 0;
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
/**
|
|
30
|
+
* Parse a .code-workspace file
|
|
31
|
+
* @param filePath Path to the .code-workspace file
|
|
32
|
+
* @returns Parsed workspace structure
|
|
33
|
+
*/
|
|
34
|
+
function parseWorkspaceFile(filePath) {
|
|
35
|
+
if (!fs.existsSync(filePath)) {
|
|
36
|
+
throw new Error(`Workspace file not found: ${filePath}`);
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
40
|
+
const workspace = JSON.parse(content);
|
|
41
|
+
// Validate structure
|
|
42
|
+
if (!workspace.folders || !Array.isArray(workspace.folders)) {
|
|
43
|
+
throw new Error('Invalid workspace file: missing or invalid folders array');
|
|
44
|
+
}
|
|
45
|
+
// Normalize folder paths to absolute paths
|
|
46
|
+
const workspaceDir = path.dirname(filePath);
|
|
47
|
+
workspace.folders = workspace.folders.map(folder => {
|
|
48
|
+
if (typeof folder === 'string') {
|
|
49
|
+
// Legacy format: folders can be strings
|
|
50
|
+
const absolutePath = path.isAbsolute(folder)
|
|
51
|
+
? folder
|
|
52
|
+
: path.resolve(workspaceDir, folder);
|
|
53
|
+
return { path: absolutePath };
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
// Modern format: folders are objects with path property
|
|
57
|
+
const absolutePath = path.isAbsolute(folder.path)
|
|
58
|
+
? folder.path
|
|
59
|
+
: path.resolve(workspaceDir, folder.path);
|
|
60
|
+
return {
|
|
61
|
+
...folder,
|
|
62
|
+
path: absolutePath,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return workspace;
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
if (error instanceof SyntaxError) {
|
|
70
|
+
throw new Error(`Invalid JSON in workspace file: ${error.message}`);
|
|
71
|
+
}
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.parseWorkspaceFile = parseWorkspaceFile;
|
|
76
|
+
/**
|
|
77
|
+
* Generate a .code-workspace file
|
|
78
|
+
* @param workspaceName Name of the workspace (used in comments)
|
|
79
|
+
* @param projects Array of project paths (absolute or relative)
|
|
80
|
+
* @param outputPath Path where the .code-workspace file should be created
|
|
81
|
+
* @param settings Optional workspace settings
|
|
82
|
+
* @param extensions Optional workspace extensions recommendations
|
|
83
|
+
*/
|
|
84
|
+
function generateWorkspaceFile(workspaceName, projects, outputPath, settings, extensions) {
|
|
85
|
+
const workspaceDir = path.dirname(outputPath);
|
|
86
|
+
// Convert project paths to relative paths if they're within the workspace directory
|
|
87
|
+
const folders = projects.map(projectPath => {
|
|
88
|
+
const absolutePath = path.isAbsolute(projectPath)
|
|
89
|
+
? projectPath
|
|
90
|
+
: path.resolve(process.cwd(), projectPath);
|
|
91
|
+
// Try to make path relative to workspace directory if possible
|
|
92
|
+
let relativePath;
|
|
93
|
+
try {
|
|
94
|
+
relativePath = path.relative(workspaceDir, absolutePath);
|
|
95
|
+
// If relative path goes outside workspace dir, use absolute
|
|
96
|
+
if (relativePath.startsWith('..')) {
|
|
97
|
+
relativePath = absolutePath;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
relativePath = absolutePath;
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
path: relativePath,
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
const workspace = {
|
|
108
|
+
folders,
|
|
109
|
+
...(settings && { settings }),
|
|
110
|
+
...(extensions && { extensions }),
|
|
111
|
+
};
|
|
112
|
+
// Add comment header
|
|
113
|
+
const content = JSON.stringify(workspace, null, 2);
|
|
114
|
+
const withHeader = `// ${workspaceName} Workspace\n${content}`;
|
|
115
|
+
// Ensure output directory exists
|
|
116
|
+
const outputDir = path.dirname(outputPath);
|
|
117
|
+
if (!fs.existsSync(outputDir)) {
|
|
118
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
119
|
+
}
|
|
120
|
+
fs.writeFileSync(outputPath, withHeader, 'utf-8');
|
|
121
|
+
}
|
|
122
|
+
exports.generateWorkspaceFile = generateWorkspaceFile;
|
|
123
|
+
/**
|
|
124
|
+
* Validate that a path is a valid workspace file
|
|
125
|
+
* @param filePath Path to check
|
|
126
|
+
* @returns true if the path exists and is a valid .code-workspace file
|
|
127
|
+
*/
|
|
128
|
+
function validateWorkspacePath(filePath) {
|
|
129
|
+
if (!fs.existsSync(filePath)) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
if (!filePath.endsWith('.code-workspace')) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
try {
|
|
136
|
+
parseWorkspaceFile(filePath);
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
exports.validateWorkspacePath = validateWorkspacePath;
|
package/dist/electron/core.js
CHANGED
|
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
})();
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
35
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
26
|
exports.getTestsByProject = exports.scanAllProjects = exports.scanProject = exports.getAllProjects = exports.removeProject = exports.addProject = exports.getDatabaseManager = void 0;
|
|
37
27
|
const path = __importStar(require("path"));
|