impact-analysis 1.0.0 → 1.0.2
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/index.mjs +40 -46
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -197,23 +197,23 @@ const htmlContent = `
|
|
|
197
197
|
}
|
|
198
198
|
td:first-child {
|
|
199
199
|
background: #91fd9117;
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
200
|
+
}
|
|
201
|
+
.btn-theme {
|
|
202
|
+
min-width: 142px;
|
|
203
|
+
padding: 12px 16px;
|
|
204
|
+
font-size: 14px;
|
|
205
|
+
border-radius: 100px;
|
|
206
|
+
border: 1px solid #565454;
|
|
207
|
+
outline: none;
|
|
208
|
+
box-shadow: none;
|
|
209
|
+
cursor: pointer;
|
|
210
|
+
transition: all .3s ease-in-out;
|
|
211
|
+
text-decoration: none;
|
|
212
|
+
display: inline-flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
font-family: "Exo 2", serif;
|
|
215
|
+
background: #222;
|
|
216
|
+
color: #fff;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
.btn-active {
|
|
@@ -222,36 +222,39 @@ const htmlContent = `
|
|
|
222
222
|
color: #fff
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
.btn-svg path {
|
|
226
|
+
fill: #fefefe;
|
|
227
|
+
}
|
|
228
|
+
|
|
225
229
|
.btn-active:hover svg path {
|
|
226
230
|
fill: #1f4afe;
|
|
227
231
|
}
|
|
228
232
|
|
|
233
|
+
.btn-theme:hover svg path {
|
|
234
|
+
fill: #1f4afe;
|
|
235
|
+
}
|
|
236
|
+
|
|
229
237
|
.btn-theme:hover {
|
|
230
238
|
background: #fff;
|
|
231
239
|
color: #1f4afe;
|
|
232
240
|
border: 1px solid #1F4AFE
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
.btn-svg {
|
|
236
|
-
width: 20px;
|
|
237
|
-
height: 20px;
|
|
238
|
-
margin-right: 10px;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.btn-svg path {
|
|
242
|
-
fill: #fefefe;
|
|
243
|
-
}
|
|
241
|
+
}
|
|
244
242
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
243
|
+
.btn-svg {
|
|
244
|
+
width: 20px;
|
|
245
|
+
height: 20px;
|
|
246
|
+
margin-right: 10px;
|
|
247
|
+
}
|
|
249
248
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
249
|
+
th {
|
|
250
|
+
background: #1f4afe;
|
|
251
|
+
background: linear-gradient(90deg,#1f4afe 35%,#167cfc);
|
|
252
|
+
}
|
|
254
253
|
|
|
254
|
+
th:last-child {
|
|
255
|
+
background: #1f4afe;
|
|
256
|
+
background: linear-gradient(-90deg,#1f4afe 35%,#167cfc);
|
|
257
|
+
}
|
|
255
258
|
</style>
|
|
256
259
|
</head>
|
|
257
260
|
<body>
|
|
@@ -350,8 +353,6 @@ const htmlContent = `
|
|
|
350
353
|
.attr("x", d => clamp(d.x + 20, 10, width - 10))
|
|
351
354
|
.attr("y", d => clamp(d.y + 6, 10, height - 10));
|
|
352
355
|
});
|
|
353
|
-
|
|
354
|
-
// Helper function to keep nodes within boundaries
|
|
355
356
|
function clamp(value, min, max) {
|
|
356
357
|
return Math.max(min, Math.min(max, value));
|
|
357
358
|
}
|
|
@@ -408,7 +409,6 @@ document.getElementById("tableViewBtn").addEventListener("click", function () {
|
|
|
408
409
|
generateTableView(${JSON.stringify(dependencyJson)});
|
|
409
410
|
});
|
|
410
411
|
|
|
411
|
-
// Function to highlight the active button
|
|
412
412
|
function setActiveButton(activeBtn) {
|
|
413
413
|
document.querySelectorAll(".btn-theme").forEach(button => {
|
|
414
414
|
button.classList.remove("btn-active");
|
|
@@ -416,19 +416,14 @@ function setActiveButton(activeBtn) {
|
|
|
416
416
|
activeBtn.classList.add("btn-active");
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
// Function to generate the table
|
|
420
419
|
function generateTableView(data) {
|
|
421
420
|
const tableData = data;
|
|
422
421
|
var tableBody = document.getElementById("tableBody");
|
|
423
|
-
tableBody.innerHTML = "";
|
|
424
|
-
|
|
425
|
-
// Ensure tableData is an array
|
|
422
|
+
tableBody.innerHTML = "";
|
|
426
423
|
if (!Array.isArray(tableData) || tableData.length === 0) {
|
|
427
424
|
tableBody.innerHTML = '<tr><td colspan="2">No data available</td></tr>';
|
|
428
425
|
return;
|
|
429
426
|
}
|
|
430
|
-
|
|
431
|
-
// Populate table
|
|
432
427
|
tableData.forEach(function (result) {
|
|
433
428
|
var row = document.createElement("tr");
|
|
434
429
|
|
|
@@ -452,6 +447,5 @@ function generateTableView(data) {
|
|
|
452
447
|
</html>
|
|
453
448
|
`;
|
|
454
449
|
|
|
455
|
-
// Write HTML file
|
|
456
450
|
fs.writeFileSync('impact-analysis.html', htmlContent);
|
|
457
451
|
console.log('✅ Dependency graph generated: impact-analysis.html');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "impact-analysis",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Tool to analyze code impact based on changed files and dependencies.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"npm"
|
|
17
17
|
],
|
|
18
18
|
"author": "Sushant Keshav Thorat",
|
|
19
|
-
"license": "
|
|
19
|
+
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"simple-git": "^3.27.0"
|
|
22
22
|
}
|