forked from webiny/webiny-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.adiorc.js
52 lines (50 loc) · 1.88 KB
/
.adiorc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const get = require("lodash.get");
const LOAD_COMPONENTS_PREFIX = ["@webiny/", "@serverless/"];
module.exports = {
parser: {
plugins: ["jsx", "classProperties", "dynamicImport", "throwExpressions", "typescript"]
},
traverse: ({ path, push }) => {
// We try to detect "this.load("...")" calls inside of Serverless components.
const { node } = path;
if (node.type === "CallExpression") {
if (get(node, "callee.property.name") === "load") {
const possiblePackage = get(node, "arguments.0.value");
if (typeof possiblePackage === "string") {
LOAD_COMPONENTS_PREFIX.forEach(prefix => {
if (possiblePackage.startsWith(prefix)) {
return push(possiblePackage);
}
});
}
}
if (
get(node, "callee.property.name") === "resolve" &&
get(node, "callee.object.name") === "require"
) {
const possiblePackage = get(node, "arguments.0.value");
if (typeof possiblePackage === "string") {
return push(possiblePackage);
}
}
}
},
ignore: {
src: ["path", "os", "fs", "util", "events", "crypto", "aws-sdk"],
dependencies: ["@babel/runtime"],
devDependencies: true
},
ignoreDirs: ["node_modules/", "dist/", "build/"],
packages: [
"packages/*",
"sample-project/api/apolloGateway",
"sample-project/api/settingsManager",
"sample-project/api/databaseProxy",
"sample-project/api/files/*",
"sample-project/api/formBuilder",
"sample-project/api/cms/*",
"sample-project/api/i18n/*",
"sample-project/api/pageBuilder",
"sample-project/api/security/*"
]
};