decode-deps
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -138,3 +138,3 @@ var __awaiter = | ||
}; | ||
import { maxNodes, port, width, height } from "./graphConstant.js"; | ||
import { maxNodes, port } from "./constant.js"; | ||
import { | ||
@@ -146,8 +146,10 @@ applyInitialCharge, | ||
ticked, | ||
} from "./graphUtil.js"; | ||
var savedNodeSize = 30; | ||
} from "./utils/graphUtil.js"; | ||
var savedNodeSize = 20; | ||
var savedLinkDistance = 125; | ||
var savedFontSize = 12; | ||
var width = window.innerWidth; | ||
var height = window.innerHeight; | ||
window.onload = function () { | ||
savedNodeSize = Number(localStorage.getItem("nodeSize")) || 30; | ||
savedNodeSize = Number(localStorage.getItem("nodeSize")) || 20; | ||
savedLinkDistance = Number(localStorage.getItem("linkDistance")) || 125; | ||
@@ -215,3 +217,3 @@ savedFontSize = Number(localStorage.getItem("fontSize")) || 12; | ||
.zoom() | ||
.scaleExtent([1, 40]) | ||
.scaleExtent([0.1, 30]) | ||
.translateExtent([ | ||
@@ -313,6 +315,7 @@ [-100, -100], | ||
d3.forceCollide().radius(function (d) { | ||
return d.size + 5; | ||
return d.size + 25; | ||
}) | ||
) | ||
.force("center", d3.forceCenter(width / 2, height / 2)) | ||
.alphaDecay(0.02) | ||
.on("tick", ticked(link, node)); | ||
@@ -319,0 +322,0 @@ simulation.on("tick", function () { |
import express from "express"; | ||
import { fileURLToPath } from "url"; | ||
import path, { dirname } from "path"; | ||
import { buildTree, extractNodesAndLinks, getDependencies } from "./utils.js"; | ||
import { | ||
buildTree, | ||
detectCircularDeps, | ||
extractNodesAndLinks, | ||
removeCircularDeps, | ||
removeDuplicateCircularDeps, | ||
} from "./utils/depUtils.js"; | ||
import { getDependencies } from "./utils/fileUtils.js"; | ||
import { port } from "./constant.js"; | ||
export default function startDepTrack(sourceDir) { | ||
var port = 5001; | ||
var _filename = fileURLToPath(import.meta.url); | ||
var _dirname = dirname(_filename); | ||
var app = express(); | ||
app.use(express.static(path.join(_dirname, "/"))); | ||
app.use(express.static(path.join(_dirname, "/"))); // for publish | ||
// app.use(express.static(path.join(_dirname, "../public"))); // dev | ||
app.get("/", function (req, res) { | ||
res.sendFile(path.join(_dirname, "/", "index.html")); | ||
// res.sendFile(path.join(_dirname, "public", "index.html")); // dev | ||
res.sendFile(path.join(_dirname, "/", "index.html")); // for publish | ||
}); | ||
@@ -18,3 +27,16 @@ app.get("/track", function (req, res) { | ||
var resultData = extractNodesAndLinks(dependencyTree); | ||
res.json(resultData); | ||
var circularNodes = detectCircularDeps(resultData.links); | ||
var uniqueCircularNodes = removeDuplicateCircularDeps(circularNodes); | ||
if (uniqueCircularNodes.length > 0) { | ||
for ( | ||
var _i = 0, uniqueCircularNodes_1 = uniqueCircularNodes; | ||
_i < uniqueCircularNodes_1.length; | ||
_i++ | ||
) { | ||
var el = uniqueCircularNodes_1[_i]; | ||
resultData.warning.push(el); | ||
} | ||
} | ||
var safeResultData = removeCircularDeps(resultData); | ||
res.json(safeResultData); | ||
}); | ||
@@ -21,0 +43,0 @@ app.listen(port, function () { |
{ | ||
"name": "decode-deps", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "node dist/test.js", | ||
"dev": "tsx test/test.ts", | ||
"build": "rm -fr dist && tsc --project tsconfig.json && cp -R public/* dist/" | ||
@@ -18,2 +18,3 @@ }, | ||
"d3": "^7.9.0", | ||
"tsx": "^4.19.2", | ||
"typescript": "^5.6.3" | ||
@@ -20,0 +21,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
46830
22
892
4