dependency-cruiser 12.10.2 → 12.11.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dependency-cruiser",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.11.0",
|
|
4
4
|
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"static analysis",
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"semver-try-require": "6.1.0",
|
|
167
167
|
"teamcity-service-messages": "0.1.14",
|
|
168
168
|
"tsconfig-paths-webpack-plugin": "4.0.1",
|
|
169
|
-
"watskeburt": "0.10.
|
|
169
|
+
"watskeburt": "0.10.1",
|
|
170
170
|
"wrap-ansi": "^7.0.0"
|
|
171
171
|
},
|
|
172
172
|
"devDependencies": {
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
document.addEventListener("contextmenu", getSelectHandler(title2ElementMap));
|
|
2
|
-
document.addEventListener("mouseover", getHoverHandler(title2ElementMap));
|
|
3
|
-
document.addEventListener("keydown", keyboardEventHandler);
|
|
4
|
-
|
|
5
1
|
var gMode = new Mode();
|
|
6
2
|
|
|
7
3
|
var title2ElementMap = (function makeElementMap() {
|
|
@@ -12,7 +8,7 @@ var title2ElementMap = (function makeElementMap() {
|
|
|
12
8
|
return new Title2ElementMap(edges, nodes);
|
|
13
9
|
})();
|
|
14
10
|
|
|
15
|
-
function getHoverHandler() {
|
|
11
|
+
function getHoverHandler(pTitle2ElementMap) {
|
|
16
12
|
/** @type {string} */
|
|
17
13
|
var currentHighlightedTitle;
|
|
18
14
|
|
|
@@ -27,13 +23,13 @@ function getHoverHandler() {
|
|
|
27
23
|
) {
|
|
28
24
|
resetNodesAndEdges();
|
|
29
25
|
addHighlight(closestNodeOrEdge);
|
|
30
|
-
|
|
26
|
+
pTitle2ElementMap.get(closestTitleText).forEach(addHighlight);
|
|
31
27
|
currentHighlightedTitle = closestTitleText;
|
|
32
28
|
}
|
|
33
29
|
};
|
|
34
30
|
}
|
|
35
31
|
|
|
36
|
-
function getSelectHandler() {
|
|
32
|
+
function getSelectHandler(pTitle2ElementMap) {
|
|
37
33
|
/** @type {string} */
|
|
38
34
|
var currentHighlightedTitle;
|
|
39
35
|
|
|
@@ -52,7 +48,7 @@ function getSelectHandler() {
|
|
|
52
48
|
if (!(currentHighlightedTitle === closestTitleText)) {
|
|
53
49
|
resetNodesAndEdges();
|
|
54
50
|
addHighlight(closestNodeOrEdge);
|
|
55
|
-
|
|
51
|
+
pTitle2ElementMap.get(closestTitleText).forEach(addHighlight);
|
|
56
52
|
currentHighlightedTitle = closestTitleText;
|
|
57
53
|
}
|
|
58
54
|
};
|
|
@@ -247,5 +243,9 @@ function keyboardEventHandler(pKeyboardEvent) {
|
|
|
247
243
|
hints.toggle();
|
|
248
244
|
}
|
|
249
245
|
}
|
|
246
|
+
|
|
247
|
+
document.addEventListener("contextmenu", getSelectHandler(title2ElementMap));
|
|
248
|
+
document.addEventListener("mouseover", getHoverHandler(title2ElementMap));
|
|
249
|
+
document.addEventListener("keydown", keyboardEventHandler);
|
|
250
250
|
document.getElementById("close-hints").addEventListener("click", hints.hide);
|
|
251
251
|
document.getElementById("button_help").addEventListener("click", hints.toggle);
|
|
@@ -4,6 +4,19 @@ const { supportedTranspilers } = require("../../../src/meta.js");
|
|
|
4
4
|
|
|
5
5
|
const typescript = tryRequire("typescript", supportedTranspilers.typescript);
|
|
6
6
|
|
|
7
|
+
function isTypeOnly(pStatement) {
|
|
8
|
+
return (
|
|
9
|
+
(pStatement.importClause && pStatement.importClause.isTypeOnly) ||
|
|
10
|
+
// for some weird reason the isTypeOnly indicator is on _statement_ level
|
|
11
|
+
// and not in exportClause as it is in the importClause ¯\_ (ツ)_/¯.
|
|
12
|
+
// Also in the case of the omission of an alias the exportClause
|
|
13
|
+
// is not there entirely. So regardless whether there is a
|
|
14
|
+
// pStatement.exportClause or not, we can directly test for the
|
|
15
|
+
// isTypeOnly attribute.
|
|
16
|
+
pStatement.isTypeOnly
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
7
20
|
/*
|
|
8
21
|
* Both extractImport* assume the imports/ exports can only occur at
|
|
9
22
|
* top level. AFAIK this the only place they're allowed, so we should
|
|
@@ -30,9 +43,7 @@ function extractImportsAndExports(pAST) {
|
|
|
30
43
|
module: pStatement.moduleSpecifier.text,
|
|
31
44
|
moduleSystem: "es6",
|
|
32
45
|
exoticallyRequired: false,
|
|
33
|
-
...(pStatement
|
|
34
|
-
? { dependencyTypes: ["type-only"] }
|
|
35
|
-
: {}),
|
|
46
|
+
...(isTypeOnly(pStatement) ? { dependencyTypes: ["type-only"] } : {}),
|
|
36
47
|
}));
|
|
37
48
|
}
|
|
38
49
|
|