dependency-cruiser 10.5.0 → 10.6.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": "10.
|
|
3
|
+
"version": "10.6.0",
|
|
4
4
|
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"static analysis",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"acorn-walk": "8.2.0",
|
|
139
139
|
"ajv": "8.6.3",
|
|
140
140
|
"chalk": "4.1.2",
|
|
141
|
-
"commander": "8.
|
|
141
|
+
"commander": "8.3.0",
|
|
142
142
|
"enhanced-resolve": "5.8.3",
|
|
143
143
|
"figures": "^3.2.0",
|
|
144
144
|
"get-stream": "^6.0.1",
|
|
@@ -159,9 +159,10 @@
|
|
|
159
159
|
"@babel/core": "7.15.8",
|
|
160
160
|
"@babel/plugin-transform-modules-commonjs": "7.15.4",
|
|
161
161
|
"@babel/preset-typescript": "7.15.0",
|
|
162
|
-
"@swc/core": "1.2.
|
|
163
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
164
|
-
"@typescript-eslint/parser": "5.
|
|
162
|
+
"@swc/core": "1.2.105",
|
|
163
|
+
"@typescript-eslint/eslint-plugin": "5.2.0",
|
|
164
|
+
"@typescript-eslint/parser": "5.2.0",
|
|
165
|
+
"@vue/compiler-sfc": "3.2.20",
|
|
165
166
|
"c8": "7.10.0",
|
|
166
167
|
"chai": "4.3.4",
|
|
167
168
|
"chai-json-schema": "1.5.1",
|
|
@@ -177,13 +178,14 @@
|
|
|
177
178
|
"eslint-plugin-unicorn": "37.0.1",
|
|
178
179
|
"husky": "^4.3.8",
|
|
179
180
|
"intercept-stdout": "0.1.2",
|
|
180
|
-
"lint-staged": "11.2.
|
|
181
|
+
"lint-staged": "11.2.6",
|
|
181
182
|
"mocha": "9.1.3",
|
|
182
|
-
"normalize-newline": "
|
|
183
|
+
"normalize-newline": "^3.0.0",
|
|
183
184
|
"npm-run-all": "4.1.5",
|
|
184
185
|
"prettier": "2.4.1",
|
|
186
|
+
"proxyquire": "2.1.3",
|
|
185
187
|
"shx": "0.3.3",
|
|
186
|
-
"svelte": "3.
|
|
188
|
+
"svelte": "3.44.0",
|
|
187
189
|
"symlink-dir": "5.0.1",
|
|
188
190
|
"typescript": "4.4.4",
|
|
189
191
|
"upem": "^7.0.0",
|
|
@@ -197,6 +199,11 @@
|
|
|
197
199
|
"policy": "wanted",
|
|
198
200
|
"because": "some eslint plugins (eslint-plugin-budapestian) are not compatible with eslint 8 yet "
|
|
199
201
|
},
|
|
202
|
+
{
|
|
203
|
+
"package": "eslint-plugin-budapestian",
|
|
204
|
+
"policy": "pin",
|
|
205
|
+
"because": "eslint-plugin-budapestian 3.0.0 is a bit too enthousiastic flagging things it shouldn't - keeping at 2.3.0 for the time being"
|
|
206
|
+
},
|
|
200
207
|
{
|
|
201
208
|
"package": "figures",
|
|
202
209
|
"policy": "wanted",
|
|
@@ -212,6 +219,11 @@
|
|
|
212
219
|
"policy": "wanted",
|
|
213
220
|
"because": "version 5 only exports ejs - and we use cjs and don't transpile"
|
|
214
221
|
},
|
|
222
|
+
{
|
|
223
|
+
"package": "normalize-newline",
|
|
224
|
+
"policy": "wanted",
|
|
225
|
+
"because": "version 4 only exports ejs - and we use cjs and don't transpile (this only used in unit tests - but one of'em is a cjs one ...)"
|
|
226
|
+
},
|
|
215
227
|
{
|
|
216
228
|
"package": "wrap-ansi",
|
|
217
229
|
"policy": "wanted",
|
|
@@ -246,7 +258,8 @@
|
|
|
246
258
|
"svelte": ">=3.0.0 <4.0.0",
|
|
247
259
|
"swc": ">=1.0.0 <2.0.0",
|
|
248
260
|
"typescript": ">=2.0.0 <5.0.0",
|
|
249
|
-
"vue-template-compiler": ">=2.0.0 <3.0.0"
|
|
261
|
+
"vue-template-compiler": ">=2.0.0 <3.0.0",
|
|
262
|
+
"@vue/compiler-sfc": ">=3.0.0 <4.0.0"
|
|
250
263
|
},
|
|
251
264
|
"husky": {
|
|
252
265
|
"hooks": {
|
|
@@ -20,11 +20,12 @@ function addDependencyViolations(pModule, pDependency, pRuleSet, pValidate) {
|
|
|
20
20
|
* of them added whether or not it is
|
|
21
21
|
* valid and if not which rules were violated
|
|
22
22
|
*/
|
|
23
|
-
module.exports = (pModules, pRuleSet, pValidate) =>
|
|
24
|
-
pModules.map((pModule) => ({
|
|
23
|
+
module.exports = (pModules, pRuleSet, pValidate) => {
|
|
24
|
+
return pModules.map((pModule) => ({
|
|
25
25
|
...pModule,
|
|
26
26
|
...(pValidate ? validate.module(pRuleSet, pModule) : { valid: true }),
|
|
27
27
|
dependencies: pModule.dependencies.map((pDependency) =>
|
|
28
28
|
addDependencyViolations(pModule, pDependency, pRuleSet, pValidate)
|
|
29
29
|
),
|
|
30
30
|
}));
|
|
31
|
+
};
|
|
@@ -1,15 +1,58 @@
|
|
|
1
|
+
const isEmpty = require("lodash/isEmpty");
|
|
1
2
|
const _get = require("lodash/get");
|
|
2
3
|
const tryRequire = require("semver-try-require");
|
|
3
4
|
const { supportedTranspilers } = require("../../../src/meta.js");
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/*
|
|
7
|
+
* vue-template-compiler was replaced by @vue/compiler-sfc for Vue3.
|
|
8
|
+
*
|
|
9
|
+
* if your project uses Vue3, then trying to require vue-template-compiler will
|
|
10
|
+
* cause an incompatibility error - so try @vue/compiler-sfc (which is Vue3's
|
|
11
|
+
* version of vue-template-compiler) if the first one fails
|
|
12
|
+
*/
|
|
13
|
+
function getVueTemplateCompiler() {
|
|
14
|
+
let lIsVue3 = false;
|
|
15
|
+
|
|
16
|
+
let lCompiler = tryRequire(
|
|
17
|
+
"vue-template-compiler",
|
|
18
|
+
supportedTranspilers["vue-template-compiler"]
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
if (lCompiler === false) {
|
|
22
|
+
lCompiler = tryRequire(
|
|
23
|
+
"@vue/compiler-sfc",
|
|
24
|
+
supportedTranspilers["@vue/compiler-sfc"]
|
|
25
|
+
);
|
|
26
|
+
lIsVue3 = true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return { lCompiler, lIsVue3 };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const { lCompiler: vueTemplateCompiler, lIsVue3: isVue3 } =
|
|
33
|
+
getVueTemplateCompiler();
|
|
34
|
+
|
|
35
|
+
function vue3Transpile(pSource) {
|
|
36
|
+
const parsedComponent = vueTemplateCompiler.parse(pSource);
|
|
37
|
+
const errors = _get(parsedComponent, "errors");
|
|
38
|
+
|
|
39
|
+
if (!isEmpty(errors)) {
|
|
40
|
+
return "";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return _get(parsedComponent, "descriptor.script.content", "");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function vue2Transpile(pSource) {
|
|
47
|
+
return _get(
|
|
48
|
+
vueTemplateCompiler.parseComponent(pSource),
|
|
49
|
+
"script.content",
|
|
50
|
+
""
|
|
51
|
+
);
|
|
52
|
+
}
|
|
9
53
|
|
|
10
54
|
module.exports = {
|
|
11
55
|
isAvailable: () => vueTemplateCompiler !== false,
|
|
12
|
-
|
|
13
56
|
transpile: (pSource) =>
|
|
14
|
-
|
|
57
|
+
isVue3 ? vue3Transpile(pSource) : vue2Transpile(pSource),
|
|
15
58
|
};
|
package/src/meta.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* generated - don't edit */
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
version: "10.
|
|
4
|
+
version: "10.6.0",
|
|
5
5
|
engines: {
|
|
6
6
|
node: "^12.20||^14||>=16",
|
|
7
7
|
},
|
|
@@ -14,5 +14,6 @@ module.exports = {
|
|
|
14
14
|
swc: ">=1.0.0 <2.0.0",
|
|
15
15
|
typescript: ">=2.0.0 <5.0.0",
|
|
16
16
|
"vue-template-compiler": ">=2.0.0 <3.0.0",
|
|
17
|
+
"@vue/compiler-sfc": ">=3.0.0 <4.0.0",
|
|
17
18
|
},
|
|
18
19
|
};
|