impact-analysis 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/index.mjs +35 -45
  2. 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
- .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;
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 {
@@ -230,28 +230,27 @@ const htmlContent = `
230
230
  background: #fff;
231
231
  color: #1f4afe;
232
232
  border: 1px solid #1F4AFE
233
- }
234
-
235
- .btn-svg {
236
- width: 20px;
237
- height: 20px;
238
- margin-right: 10px;
239
- }
233
+ }
240
234
 
241
- .btn-svg path {
242
- fill: #fefefe;
243
- }
235
+ .btn-svg {
236
+ width: 20px;
237
+ height: 20px;
238
+ margin-right: 10px;
239
+ }
244
240
 
245
- th {
246
- background: #1f4afe;
247
- background: linear-gradient(90deg,#1f4afe 35%,#167cfc);
248
- }
241
+ .btn-svg path {
242
+ fill: #fefefe;
243
+ }
249
244
 
250
- th:last-child {
251
- background: #1f4afe;
252
- background: linear-gradient(-90deg,#1f4afe 35%,#167cfc);
253
- }
245
+ th {
246
+ background: #1f4afe;
247
+ background: linear-gradient(90deg,#1f4afe 35%,#167cfc);
248
+ }
254
249
 
250
+ th:last-child {
251
+ background: #1f4afe;
252
+ background: linear-gradient(-90deg,#1f4afe 35%,#167cfc);
253
+ }
255
254
  </style>
256
255
  </head>
257
256
  <body>
@@ -350,8 +349,6 @@ const htmlContent = `
350
349
  .attr("x", d => clamp(d.x + 20, 10, width - 10))
351
350
  .attr("y", d => clamp(d.y + 6, 10, height - 10));
352
351
  });
353
-
354
- // Helper function to keep nodes within boundaries
355
352
  function clamp(value, min, max) {
356
353
  return Math.max(min, Math.min(max, value));
357
354
  }
@@ -408,7 +405,6 @@ document.getElementById("tableViewBtn").addEventListener("click", function () {
408
405
  generateTableView(${JSON.stringify(dependencyJson)});
409
406
  });
410
407
 
411
- // Function to highlight the active button
412
408
  function setActiveButton(activeBtn) {
413
409
  document.querySelectorAll(".btn-theme").forEach(button => {
414
410
  button.classList.remove("btn-active");
@@ -416,19 +412,14 @@ function setActiveButton(activeBtn) {
416
412
  activeBtn.classList.add("btn-active");
417
413
  }
418
414
 
419
- // Function to generate the table
420
415
  function generateTableView(data) {
421
416
  const tableData = data;
422
417
  var tableBody = document.getElementById("tableBody");
423
- tableBody.innerHTML = ""; // Clear previous content
424
-
425
- // Ensure tableData is an array
418
+ tableBody.innerHTML = "";
426
419
  if (!Array.isArray(tableData) || tableData.length === 0) {
427
420
  tableBody.innerHTML = '<tr><td colspan="2">No data available</td></tr>';
428
421
  return;
429
422
  }
430
-
431
- // Populate table
432
423
  tableData.forEach(function (result) {
433
424
  var row = document.createElement("tr");
434
425
 
@@ -452,6 +443,5 @@ function generateTableView(data) {
452
443
  </html>
453
444
  `;
454
445
 
455
- // Write HTML file
456
446
  fs.writeFileSync('impact-analysis.html', htmlContent);
457
447
  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.0",
3
+ "version": "1.0.1",
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": "ISC",
19
+ "license": "MIT",
20
20
  "dependencies": {
21
21
  "simple-git": "^3.27.0"
22
22
  }