dependency-cruiser 10.0.2 → 10.0.6
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/bin/depcruise-fmt.js +3 -3
- package/bin/dependency-cruise.js +3 -3
- package/bin/wrap-stream-in-html.js +1 -5
- package/package.json +32 -55
- package/src/cli/defaults.js +15 -0
- package/src/cli/format.js +0 -1
- package/src/cli/index.js +1 -1
- package/src/cli/init-config/config.js.template.js +1 -106
- package/src/cli/init-config/index.js +3 -2
- package/src/cli/init-config/normalize-init-options.js +2 -2
- package/src/cli/init-config/write-config.js +3 -2
- package/src/cli/init-config/write-run-scripts-to-manifest.js +1 -1
- package/src/cli/normalize-options.js +1 -1
- package/src/cli/tools/wrap-stream-in-html.js +25 -20
- package/src/cli/validate-node-environment.js +3 -3
- package/src/config-utl/extract-babel-config.js +2 -3
- package/src/config-utl/extract-ts-config.js +5 -7
- package/src/enrich/derive/reachable/index.js +2 -8
- package/src/extract/ast-extractors/extract-typescript-deps.js +4 -7
- package/src/extract/ast-extractors/swc-dependency-visitor.js +14 -11
- package/src/extract/parse/to-swc-ast.js +3 -4
- package/src/extract/parse/to-typescript-ast.js +3 -4
- package/src/extract/transpile/babel-wrap.js +2 -2
- package/src/extract/transpile/coffeescript-wrap.js +5 -4
- package/src/extract/transpile/livescript-wrap.js +5 -5
- package/src/extract/transpile/meta.js +1 -1
- package/src/extract/transpile/svelte-wrap.js +3 -1
- package/src/extract/transpile/typescript-wrap.js +3 -4
- package/src/extract/transpile/vue-template-wrap.js +3 -1
- package/src/main/index.js +1 -1
- package/src/main/options/defaults.js +10 -0
- package/src/main/options/normalize.js +1 -1
- package/src/main/rule-set/validate.js +1 -1
- package/src/meta.js +18 -0
- package/src/report/dot/default-theme.js +145 -0
- package/src/report/dot/dot.template.js +1 -199
- package/src/report/dot/theming.js +3 -3
- package/src/report/error-html/error-html.template.js +1 -132
- package/src/report/error-html/utl.js +1 -1
- package/src/report/html/html.template.js +1 -118
- package/src/schema/README.md +2 -2
- package/src/schema/configuration.schema.js +441 -0
- package/src/schema/cruise-result.schema.js +595 -0
- package/src/cli/defaults.json +0 -15
- package/src/main/options/defaults.json +0 -10
- package/src/report/dot/default-theme.json +0 -145
- package/src/schema/configuration.schema.json +0 -697
- package/src/schema/cruise-result.schema.json +0 -988
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const fs = require("fs");
|
|
2
2
|
const path = require("path");
|
|
3
|
-
const getStream = require("get-stream");
|
|
4
3
|
|
|
5
4
|
const HEADER_FILE = path.join(
|
|
6
5
|
__dirname,
|
|
@@ -29,26 +28,32 @@ const FOOTER_FILE = path.join(
|
|
|
29
28
|
*
|
|
30
29
|
* ... but portable over node platforms
|
|
31
30
|
*
|
|
32
|
-
* @param {
|
|
33
|
-
* @param {
|
|
34
|
-
* @param {string} pFooterFileName footer
|
|
35
|
-
* @param {stream} pStream stream whose characters are to be slapped between header and footer
|
|
36
|
-
* @returns {string} yadda
|
|
31
|
+
* @param {readStream} pStream stream whose characters are to be slapped between header and footer
|
|
32
|
+
* @param {writeStream} pOutStream stream to write to
|
|
37
33
|
*/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
) {
|
|
44
|
-
const lHeader = fs.readFileSync(pHeaderFileName, "utf8");
|
|
45
|
-
const lScript = fs.readFileSync(pScriptFileName, "utf8");
|
|
46
|
-
const lFooter = fs.readFileSync(pFooterFileName, "utf8");
|
|
34
|
+
function wrap(pInStream, pOutStream) {
|
|
35
|
+
const lHeader = fs.readFileSync(HEADER_FILE, "utf8");
|
|
36
|
+
const lScript = fs.readFileSync(SCRIPT_FILE, "utf8");
|
|
37
|
+
const lEnd = fs.readFileSync(FOOTER_FILE, "utf8");
|
|
38
|
+
const lFooter = `<script>${lScript}</script>${lEnd}`;
|
|
47
39
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
pOutStream.write(lHeader);
|
|
41
|
+
pInStream
|
|
42
|
+
.on("end", () => {
|
|
43
|
+
pOutStream.write(lFooter);
|
|
44
|
+
pOutStream.end();
|
|
45
|
+
})
|
|
46
|
+
.on(
|
|
47
|
+
"error",
|
|
48
|
+
/* c8 ignore start */
|
|
49
|
+
(pError) => {
|
|
50
|
+
process.stderr.write(`${pError}\n`);
|
|
51
|
+
}
|
|
52
|
+
/* c8 ignore stop */
|
|
53
|
+
)
|
|
54
|
+
.on("data", (pChunk) => {
|
|
55
|
+
pOutStream.write(pChunk);
|
|
56
|
+
});
|
|
51
57
|
}
|
|
52
58
|
|
|
53
|
-
module.exports = (
|
|
54
|
-
wrap(HEADER_FILE, SCRIPT_FILE, FOOTER_FILE, pStream);
|
|
59
|
+
module.exports = (pInStream, pOutStream) => wrap(pInStream, pOutStream);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const semver = require("semver");
|
|
2
|
-
const
|
|
2
|
+
const { engines } = require("../../src/meta.js");
|
|
3
3
|
|
|
4
4
|
module.exports = function validateNodeEnvironment(pNodeVersion) {
|
|
5
5
|
// not using default parameter here because the check should run
|
|
@@ -7,12 +7,12 @@ module.exports = function validateNodeEnvironment(pNodeVersion) {
|
|
|
7
7
|
const lNodeVersion = pNodeVersion || process.versions.node;
|
|
8
8
|
const VERSION_ERR = `\nERROR: Your node version (${lNodeVersion}) is not supported. dependency-cruiser
|
|
9
9
|
follows the node.js release cycle and runs on these node versions:
|
|
10
|
-
${
|
|
10
|
+
${engines.node}
|
|
11
11
|
See https://nodejs.org/en/about/releases/ for details.
|
|
12
12
|
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
|
-
if (!semver.satisfies(lNodeVersion,
|
|
15
|
+
if (!semver.satisfies(lNodeVersion, engines.node)) {
|
|
16
16
|
throw new Error(VERSION_ERR);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
@@ -7,7 +7,7 @@ const json5 = require("json5");
|
|
|
7
7
|
const _get = require("lodash/get");
|
|
8
8
|
const _has = require("lodash/has");
|
|
9
9
|
const tryRequire = require("semver-try-require");
|
|
10
|
-
const
|
|
10
|
+
const { supportedTranspilers } = require("../../src/meta.js");
|
|
11
11
|
const makeAbsolute = require("./make-absolute");
|
|
12
12
|
|
|
13
13
|
function getCommonJSConfig(pBabelConfigFileName) {
|
|
@@ -87,9 +87,8 @@ function getConfig(pBabelConfigFileName) {
|
|
|
87
87
|
*/
|
|
88
88
|
module.exports = function extractBabelConfig(pBabelConfigFileName) {
|
|
89
89
|
let lReturnValue = {};
|
|
90
|
-
const babel = tryRequire("@babel/core",
|
|
90
|
+
const babel = tryRequire("@babel/core", supportedTranspilers.babel);
|
|
91
91
|
|
|
92
|
-
/* istanbul ignore else */
|
|
93
92
|
if (babel) {
|
|
94
93
|
const lConfig = {
|
|
95
94
|
...getConfig(pBabelConfigFileName),
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
2
|
const tryRequire = require("semver-try-require");
|
|
3
3
|
const _get = require("lodash/get");
|
|
4
|
-
const
|
|
4
|
+
const { supportedTranspilers } = require("../../src/meta.js");
|
|
5
5
|
|
|
6
|
-
const typescript = tryRequire(
|
|
7
|
-
"typescript",
|
|
8
|
-
_get($package, "supportedTranspilers.typescript", null)
|
|
9
|
-
);
|
|
6
|
+
const typescript = tryRequire("typescript", supportedTranspilers.typescript);
|
|
10
7
|
|
|
11
8
|
const FORMAT_DIAGNOSTICS_HOST = {
|
|
12
9
|
getCanonicalFileName(pFileName) {
|
|
13
10
|
let lReturnValue = pFileName.toLowerCase();
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
// depends on the platform which branch is taken, hence the c8 ignore
|
|
13
|
+
/* c8 ignore start */
|
|
16
14
|
if (_get(typescript, "sys.useCaseSensitiveFileNames", false)) {
|
|
17
15
|
lReturnValue = pFileName;
|
|
18
16
|
}
|
|
17
|
+
/* c8 ignore stop */
|
|
19
18
|
return lReturnValue;
|
|
20
19
|
},
|
|
21
20
|
getCurrentDirectory() {
|
|
@@ -40,7 +39,6 @@ const FORMAT_DIAGNOSTICS_HOST = {
|
|
|
40
39
|
module.exports = function extractTSConfig(pTSConfigFileName) {
|
|
41
40
|
let lReturnValue = {};
|
|
42
41
|
|
|
43
|
-
/* istanbul ignore else */
|
|
44
42
|
if (typescript) {
|
|
45
43
|
const lConfig = typescript.readConfigFile(
|
|
46
44
|
pTSConfigFileName,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable security/detect-object-injection */
|
|
1
|
+
/* eslint-disable security/detect-object-injection, no-inline-comments */
|
|
2
2
|
|
|
3
3
|
const _clone = require("lodash/clone");
|
|
4
4
|
const _get = require("lodash/get");
|
|
@@ -62,13 +62,7 @@ function mergeReachesProperties(pFromModule, pToModule, pRule, pPath) {
|
|
|
62
62
|
|
|
63
63
|
if (lIndexExistingReachable > -1) {
|
|
64
64
|
lReaches[lIndexExistingReachable].modules = (
|
|
65
|
-
lReaches[lIndexExistingReachable].modules ||
|
|
66
|
-
// eslint-disable-next-line no-inline-comments
|
|
67
|
-
/* istanbul ignore next: 'modules' is a mandatory attribute so shouldn't
|
|
68
|
-
* happen it doesn't exist, but defensive default here nonetheless
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
[]
|
|
65
|
+
lReaches[lIndexExistingReachable].modules /* c8 ignore next */ || []
|
|
72
66
|
).concat({
|
|
73
67
|
source: pToModule.source,
|
|
74
68
|
via: pPath,
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
/* eslint-disable valid-jsdoc */
|
|
1
|
+
/* eslint-disable valid-jsdoc, no-inline-comments */
|
|
2
2
|
const tryRequire = require("semver-try-require");
|
|
3
|
-
const
|
|
3
|
+
const { supportedTranspilers } = require("../../../src/meta.js");
|
|
4
4
|
|
|
5
|
-
const typescript = tryRequire(
|
|
6
|
-
"typescript",
|
|
7
|
-
$package.supportedTranspilers.typescript
|
|
8
|
-
);
|
|
5
|
+
const typescript = tryRequire("typescript", supportedTranspilers.typescript);
|
|
9
6
|
|
|
10
7
|
/*
|
|
11
8
|
* Both extractImport* assume the imports/ exports can only occur at
|
|
@@ -249,5 +246,5 @@ module.exports = function extractTypeScriptDependencies(
|
|
|
249
246
|
extractNestedDependencies(pTypeScriptAST, pExoticRequireStrings)
|
|
250
247
|
)
|
|
251
248
|
.map((pModule) => ({ dynamic: false, ...pModule }))
|
|
252
|
-
: [];
|
|
249
|
+
: /* c8 ignore next */ [];
|
|
253
250
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
const tryRequire = require("semver-try-require");
|
|
2
|
+
const { supportedTranspilers } = require("../../../src/meta.js");
|
|
3
|
+
|
|
2
4
|
/** @type {import('@swc/core/Visitor')} */
|
|
3
|
-
const VisitorModule = tryRequire(
|
|
4
|
-
"@swc/core/Visitor",
|
|
5
|
-
require("../../../package.json").supportedTranspilers.swc
|
|
6
|
-
);
|
|
5
|
+
const VisitorModule = tryRequire("@swc/core/Visitor", supportedTranspilers.swc);
|
|
7
6
|
|
|
8
7
|
const Visitor = VisitorModule.default;
|
|
9
8
|
|
|
@@ -12,11 +11,11 @@ function pryStringsFromArguments(pArguments) {
|
|
|
12
11
|
|
|
13
12
|
if (pArguments[0].expression.type === "StringLiteral") {
|
|
14
13
|
lReturnValue = pArguments[0].expression.value;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
else if (pArguments[0].expression.type === "TemplateLiteral") {
|
|
14
|
+
} else if (pArguments[0].expression.type === "TemplateLiteral") {
|
|
15
|
+
/* c8 ignore start */
|
|
18
16
|
lReturnValue = pArguments[0].expression.quasis[0].cooked.value;
|
|
19
17
|
}
|
|
18
|
+
/* c8 ignore stop */
|
|
20
19
|
|
|
21
20
|
return lReturnValue;
|
|
22
21
|
}
|
|
@@ -83,7 +82,6 @@ function isInterestingCallExpression(pExoticRequireStrings, pNode) {
|
|
|
83
82
|
.concat(pExoticRequireStrings.filter((pString) => !pString.includes(".")))
|
|
84
83
|
.includes(pNode.callee.value);
|
|
85
84
|
}
|
|
86
|
-
// istanbul ignore else
|
|
87
85
|
if (VisitorModule) {
|
|
88
86
|
module.exports = class SwcDependencyVisitor extends Visitor {
|
|
89
87
|
constructor(pExoticRequireStrings) {
|
|
@@ -124,20 +122,22 @@ if (VisitorModule) {
|
|
|
124
122
|
return super.visitExportAllDeclration(pNode);
|
|
125
123
|
}
|
|
126
124
|
|
|
127
|
-
/*
|
|
125
|
+
/* c8 ignore start */
|
|
128
126
|
visitExportAllDeclaration(pNode) {
|
|
129
127
|
return this.visitExportAllDeclration(pNode);
|
|
130
128
|
}
|
|
129
|
+
/* c8 ignore stop */
|
|
131
130
|
|
|
132
131
|
// same spelling error as the above - same solution
|
|
133
132
|
visitExportNamedDeclration(pNode) {
|
|
134
133
|
this.pushImportExportSource(pNode);
|
|
135
134
|
return super.visitExportNamedDeclration(pNode);
|
|
136
135
|
}
|
|
137
|
-
/*
|
|
136
|
+
/* c8 ignore start */
|
|
138
137
|
visitExportNamedDeclaration(pNode) {
|
|
139
138
|
return this.visitExportNamedDeclration(pNode);
|
|
140
139
|
}
|
|
140
|
+
/* c8 ignore stop */
|
|
141
141
|
|
|
142
142
|
visitCallExpression(pNode) {
|
|
143
143
|
if (
|
|
@@ -164,12 +164,13 @@ if (VisitorModule) {
|
|
|
164
164
|
|
|
165
165
|
return super.visitCallExpression(pNode);
|
|
166
166
|
}
|
|
167
|
-
|
|
167
|
+
/* c8 ignore start */
|
|
168
168
|
visitTsType(pNode) {
|
|
169
169
|
// override so the 'visitTsType not implemented' error message
|
|
170
170
|
// as defined in the super class doesn't appear
|
|
171
171
|
return pNode;
|
|
172
172
|
}
|
|
173
|
+
/* c8 ignore stop */
|
|
173
174
|
|
|
174
175
|
visitTsTypeAnnotation(pNode) {
|
|
175
176
|
// as visitors for some shapes of type annotations aren't completely
|
|
@@ -197,6 +198,8 @@ if (VisitorModule) {
|
|
|
197
198
|
return this.lResult;
|
|
198
199
|
}
|
|
199
200
|
};
|
|
201
|
+
/* c8 ignore start */
|
|
200
202
|
} else {
|
|
201
203
|
module.exports = {};
|
|
202
204
|
}
|
|
205
|
+
/* c8 ignore stop */
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
const tryRequire = require("semver-try-require");
|
|
2
2
|
const _memoize = require("lodash/memoize");
|
|
3
|
+
const { supportedTranspilers } = require("../../../src/meta.js");
|
|
4
|
+
|
|
3
5
|
/** @type {import('@swc/core')} */
|
|
4
|
-
const swc = tryRequire(
|
|
5
|
-
"@swc/core",
|
|
6
|
-
require("../../../package.json").supportedTranspilers.swc
|
|
7
|
-
);
|
|
6
|
+
const swc = tryRequire("@swc/core", supportedTranspilers.swc);
|
|
8
7
|
|
|
9
8
|
const SWC_PARSE_OPTIONS = {
|
|
10
9
|
dynamicImport: true,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
const fs = require("fs");
|
|
2
2
|
const tryRequire = require("semver-try-require");
|
|
3
3
|
const _memoize = require("lodash/memoize");
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
);
|
|
4
|
+
const { supportedTranspilers } = require("../../../src/meta.js");
|
|
5
|
+
|
|
6
|
+
const typescript = tryRequire("typescript", supportedTranspilers.typescript);
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Compiles pTypescriptSource into a (typescript) AST
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const tryRequire = require("semver-try-require");
|
|
2
|
-
const
|
|
2
|
+
const { supportedTranspilers } = require("../../../src/meta.js");
|
|
3
3
|
|
|
4
|
-
const babel = tryRequire("@babel/core",
|
|
4
|
+
const babel = tryRequire("@babel/core", supportedTranspilers.babel);
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
7
|
isAvailable: () => babel !== false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const tryRequire = require("semver-try-require");
|
|
2
|
-
const
|
|
2
|
+
const { supportedTranspilers } = require("../../../src/meta.js");
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
* coffeescript's npm repo was renamed from coffee-script to coffeescript
|
|
@@ -9,16 +9,17 @@ const $package = require("../../../package.json");
|
|
|
9
9
|
function getCoffeeScriptModule() {
|
|
10
10
|
let lReturnValue = tryRequire(
|
|
11
11
|
"coffeescript",
|
|
12
|
-
|
|
12
|
+
supportedTranspilers.coffeescript
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
/*
|
|
15
|
+
/* c8 ignore start */
|
|
16
16
|
if (lReturnValue === false) {
|
|
17
17
|
lReturnValue = tryRequire(
|
|
18
18
|
"coffee-script",
|
|
19
|
-
|
|
19
|
+
supportedTranspilers["coffee-script"]
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
|
+
/* c8 ignore stop */
|
|
22
23
|
return lReturnValue;
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const tryRequire = require("semver-try-require");
|
|
2
|
-
const
|
|
3
|
-
"livescript",
|
|
4
|
-
require("../../../package.json").supportedTranspilers.livescript
|
|
5
|
-
);
|
|
2
|
+
const { supportedTranspilers } = require("../../../src/meta.js");
|
|
6
3
|
|
|
7
|
-
|
|
4
|
+
const livescript = tryRequire("livescript", supportedTranspilers.livescript);
|
|
5
|
+
|
|
6
|
+
/* c8 ignore start */
|
|
8
7
|
module.exports = {
|
|
9
8
|
isAvailable: () => livescript !== false,
|
|
10
9
|
|
|
11
10
|
transpile: (pSource) => livescript.compile(pSource),
|
|
12
11
|
};
|
|
12
|
+
/* c8 ignore stop */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const _get = require("lodash/get");
|
|
2
|
-
const { supportedTranspilers } = require("../../../
|
|
2
|
+
const { supportedTranspilers } = require("../../../src/meta.js");
|
|
3
3
|
const swc = require("../parse/to-swc-ast");
|
|
4
4
|
const javaScriptWrap = require("./javascript-wrap");
|
|
5
5
|
const typeScriptWrap = require("./typescript-wrap")();
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
const tryRequire = require("semver-try-require");
|
|
2
|
+
const { supportedTranspilers } = require("../../../src/meta.js");
|
|
3
|
+
|
|
2
4
|
const svelteCompiler = tryRequire(
|
|
3
5
|
"svelte/compiler",
|
|
4
|
-
|
|
6
|
+
supportedTranspilers.svelte
|
|
5
7
|
);
|
|
6
8
|
const preProcess = require("./svelte-preprocess");
|
|
7
9
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
const tryRequire = require("semver-try-require");
|
|
2
2
|
const _get = require("lodash/get");
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
);
|
|
3
|
+
const { supportedTranspilers } = require("../../../src/meta.js");
|
|
4
|
+
|
|
5
|
+
const typescript = tryRequire("typescript", supportedTranspilers.typescript);
|
|
7
6
|
|
|
8
7
|
function getCompilerOptions(pTsx, pTSConfig) {
|
|
9
8
|
let lCompilerOptions = {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
const _get = require("lodash/get");
|
|
2
2
|
const tryRequire = require("semver-try-require");
|
|
3
|
+
const { supportedTranspilers } = require("../../../src/meta.js");
|
|
4
|
+
|
|
3
5
|
const vueTemplateCompiler = tryRequire(
|
|
4
6
|
"vue-template-compiler",
|
|
5
|
-
|
|
7
|
+
supportedTranspilers["vue-template-compiler"]
|
|
6
8
|
);
|
|
7
9
|
|
|
8
10
|
module.exports = {
|
package/src/main/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const Ajv = require("ajv").default;
|
|
4
4
|
const extract = require("../extract");
|
|
5
5
|
const enrich = require("../enrich");
|
|
6
|
-
const cruiseResultSchema = require("../schema/cruise-result.schema.
|
|
6
|
+
const cruiseResultSchema = require("../schema/cruise-result.schema.js");
|
|
7
7
|
const meta = require("../extract/transpile/meta");
|
|
8
8
|
const bus = require("../utl/bus");
|
|
9
9
|
const normalizeFilesAndDirectories = require("./files-and-dirs/normalize");
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
validate: false,
|
|
3
|
+
maxDepth: 0,
|
|
4
|
+
moduleSystems: ["amd", "cjs", "es6", "tsd"],
|
|
5
|
+
tsPreCompilationDeps: false,
|
|
6
|
+
preserveSymlinks: false,
|
|
7
|
+
combinedDependencies: false,
|
|
8
|
+
externalModuleResolutionStrategy: "node_modules",
|
|
9
|
+
exoticRequireStrings: [],
|
|
10
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const _clone = require("lodash/clone");
|
|
3
3
|
const _has = require("lodash/has");
|
|
4
4
|
const normalizeREProperties = require("../utl/normalize-re-properties");
|
|
5
|
-
const defaults = require("./defaults.
|
|
5
|
+
const defaults = require("./defaults.js");
|
|
6
6
|
|
|
7
7
|
function uniq(pArray) {
|
|
8
8
|
return [...new Set(pArray)];
|
|
@@ -2,7 +2,7 @@ const Ajv = require("ajv").default;
|
|
|
2
2
|
const safeRegex = require("safe-regex");
|
|
3
3
|
const _has = require("lodash/has");
|
|
4
4
|
const { validateCruiseOptions } = require("../options/validate");
|
|
5
|
-
const configurationSchema = require("../../schema/configuration.schema.
|
|
5
|
+
const configurationSchema = require("../../schema/configuration.schema.js");
|
|
6
6
|
|
|
7
7
|
const ajv = new Ajv();
|
|
8
8
|
|
package/src/meta.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* generated - don't edit */
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
version: "10.0.6",
|
|
5
|
+
engines: {
|
|
6
|
+
node: "^12.20||^14||>=16",
|
|
7
|
+
},
|
|
8
|
+
supportedTranspilers: {
|
|
9
|
+
babel: ">=7.0.0 <8.0.0",
|
|
10
|
+
"coffee-script": ">=1.0.0 <2.0.0",
|
|
11
|
+
coffeescript: ">=1.0.0 <3.0.0",
|
|
12
|
+
livescript: ">=1.0.0 <2.0.0",
|
|
13
|
+
svelte: ">=3.0.0 <4.0.0",
|
|
14
|
+
swc: ">=1.0.0 <2.0.0",
|
|
15
|
+
typescript: ">=2.0.0 <5.0.0",
|
|
16
|
+
"vue-template-compiler": ">=2.0.0 <3.0.0",
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
graph: {
|
|
3
|
+
ordering: "out",
|
|
4
|
+
rankdir: "LR",
|
|
5
|
+
splines: "true",
|
|
6
|
+
overlap: "false",
|
|
7
|
+
nodesep: "0.16",
|
|
8
|
+
ranksep: "0.18",
|
|
9
|
+
fontname: "Helvetica-bold",
|
|
10
|
+
fontsize: "9",
|
|
11
|
+
style: "rounded,bold,filled",
|
|
12
|
+
fillcolor: "#ffffff",
|
|
13
|
+
compound: "true",
|
|
14
|
+
},
|
|
15
|
+
node: {
|
|
16
|
+
shape: "box",
|
|
17
|
+
style: "rounded, filled",
|
|
18
|
+
height: "0.2",
|
|
19
|
+
color: "black",
|
|
20
|
+
fillcolor: "#ffffcc",
|
|
21
|
+
fontcolor: "black",
|
|
22
|
+
fontname: "Helvetica",
|
|
23
|
+
fontsize: 9,
|
|
24
|
+
},
|
|
25
|
+
edge: {
|
|
26
|
+
arrowhead: "normal",
|
|
27
|
+
arrowsize: "0.6",
|
|
28
|
+
penwidth: "2.0",
|
|
29
|
+
color: "#00000033",
|
|
30
|
+
fontname: "Helvetica",
|
|
31
|
+
fontsize: "9",
|
|
32
|
+
},
|
|
33
|
+
modules: [
|
|
34
|
+
{
|
|
35
|
+
criteria: { consolidated: true },
|
|
36
|
+
attributes: { shape: "box3d" },
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
criteria: { "rules[0].severity": "error" },
|
|
40
|
+
attributes: { fontcolor: "red", color: "red" },
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
criteria: { "rules[0].severity": "warn" },
|
|
44
|
+
attributes: { fontcolor: "orange", color: "orange" },
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
criteria: { "rules[0].severity": "info" },
|
|
48
|
+
attributes: { fontcolor: "blue", color: "blue" },
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
criteria: { valid: false },
|
|
52
|
+
attributes: { fontcolor: "red", color: "red" },
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
criteria: { couldNotResolve: true },
|
|
56
|
+
attributes: { color: "red", fontcolor: "red" },
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
criteria: { coreModule: true },
|
|
60
|
+
attributes: { color: "grey", fontcolor: "grey" },
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
criteria: { source: "node_modules" },
|
|
64
|
+
attributes: { fillcolor: "#c40b0a1a", fontcolor: "#c40b0a" },
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
criteria: { matchesDoNotFollow: true },
|
|
68
|
+
attributes: { shape: "folder" },
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
criteria: { orphan: true },
|
|
72
|
+
attributes: { fillcolor: "#ccffcc" },
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
criteria: { source: "\\.json$" },
|
|
76
|
+
attributes: { fillcolor: "#ffee44" },
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
criteria: { source: "\\.jsx$" },
|
|
80
|
+
attributes: { fillcolor: "#ffff77" },
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
criteria: { source: "\\.vue$" },
|
|
84
|
+
attributes: { fillcolor: "#41f083" },
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
criteria: { source: "\\.ts$" },
|
|
88
|
+
attributes: { fillcolor: "#ddfeff" },
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
criteria: { source: "\\.tsx$" },
|
|
92
|
+
attributes: { fillcolor: "#bbfeff" },
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
criteria: { source: "\\.svelte$" },
|
|
96
|
+
attributes: { fillcolor: "#febbff" },
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
criteria: { source: "(\\.coffee|\\.litcoffee|\\.coffee\\.md)$" },
|
|
100
|
+
attributes: { fillcolor: "#eeccaa" },
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
criteria: { source: "(\\.csx|\\.cjsx)$" },
|
|
104
|
+
attributes: { fillcolor: "#eebb77" },
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
criteria: { source: "\\.ls$/g" },
|
|
108
|
+
attributes: { fillcolor: "pink" },
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
dependencies: [
|
|
112
|
+
{
|
|
113
|
+
criteria: { "rules[0].severity": "error" },
|
|
114
|
+
attributes: { fontcolor: "red", color: "red" },
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
criteria: { "rules[0].severity": "warn" },
|
|
118
|
+
attributes: { fontcolor: "orange", color: "orange" },
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
criteria: { "rules[0].severity": "info" },
|
|
122
|
+
attributes: { fontcolor: "blue", color: "blue" },
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
criteria: { valid: false },
|
|
126
|
+
attributes: { fontcolor: "red", color: "red" },
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
criteria: { circular: true },
|
|
130
|
+
attributes: { arrowhead: "normalnoneodot" },
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
criteria: { preCompilationOnly: true },
|
|
134
|
+
attributes: { arrowhead: "onormal", penwidth: "1.0" },
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
criteria: { coreModule: true },
|
|
138
|
+
attributes: { style: "dashed", penwidth: "1.0" },
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
criteria: { "dependencyTypes[0]": "npm" },
|
|
142
|
+
attributes: { penwidth: "1.0" },
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
};
|