@bigbinary/neeto-audit-frontend 2.0.2 → 2.0.4
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/common/recommendedDependencies/common.js +5 -2
- package/common/recommendedDependencies/extension.js +2 -4
- package/common/recommendedDependencies/frontend.js +11 -12
- package/common/recommendedDependencies/nano.js +11 -12
- package/dist/index.js +23664 -5493
- package/package.json +13 -12
- package/src/verifiers/recommendedPackageVersions/constants.js +4 -0
- package/src/verifiers/recommendedPackageVersions/index.js +1 -1
- package/src/verifiers/recommendedPackageVersions/utils.js +62 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-audit-frontend",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Audits neeto frontend codebase for issues and suggests a fix.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./dist/index.js",
|
|
@@ -15,26 +15,27 @@
|
|
|
15
15
|
"author": "Thejus Paul <thejuspaul@protonmail.ch>",
|
|
16
16
|
"license": "UNLICENSED",
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@rollup/plugin-commonjs": "25.0.
|
|
19
|
-
"@rollup/plugin-json": "6.0.
|
|
20
|
-
"@rollup/plugin-node-resolve": "15.
|
|
21
|
-
"rollup": "
|
|
18
|
+
"@rollup/plugin-commonjs": "25.0.7",
|
|
19
|
+
"@rollup/plugin-json": "6.0.1",
|
|
20
|
+
"@rollup/plugin-node-resolve": "15.2.3",
|
|
21
|
+
"rollup": "4.1.4",
|
|
22
22
|
"rollup-plugin-analyzer": "4.0.0",
|
|
23
23
|
"rollup-plugin-cleaner": "1.0.0",
|
|
24
24
|
"rollup-plugin-executable-script": "1.0.1",
|
|
25
25
|
"rollup-plugin-peer-deps-external": "2.2.4"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@bigbinary/neeto-commons-frontend": "2.
|
|
28
|
+
"@bigbinary/neeto-commons-frontend": "2.1.18",
|
|
29
|
+
"axios": "1.5.1",
|
|
29
30
|
"chalk": "5.3.0",
|
|
30
|
-
"commander": "11.
|
|
31
|
-
"ora": "
|
|
32
|
-
"ramda": "0.29.
|
|
33
|
-
"simple-git": "3.
|
|
31
|
+
"commander": "11.1.0",
|
|
32
|
+
"ora": "7.0.1",
|
|
33
|
+
"ramda": "0.29.1",
|
|
34
|
+
"simple-git": "3.20.0"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
36
|
-
"@bigbinary/neeto-commons-frontend": "^2.
|
|
37
|
-
"ramda": "^0.29.
|
|
37
|
+
"@bigbinary/neeto-commons-frontend": "^2.1.18",
|
|
38
|
+
"ramda": "^0.29.1"
|
|
38
39
|
},
|
|
39
40
|
"packageManager": "pnpm@8.6.9",
|
|
40
41
|
"engines": {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import chalk from "chalk";
|
|
1
3
|
import {
|
|
2
4
|
eqProps,
|
|
3
5
|
pickBy,
|
|
@@ -8,14 +10,66 @@ import {
|
|
|
8
10
|
fromPairs,
|
|
9
11
|
toPairs,
|
|
10
12
|
isEmpty,
|
|
13
|
+
startsWith,
|
|
14
|
+
includes,
|
|
15
|
+
__,
|
|
11
16
|
} from "ramda";
|
|
12
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
filterBy,
|
|
19
|
+
findBy,
|
|
20
|
+
isNotEmpty,
|
|
21
|
+
} from "@bigbinary/neeto-commons-frontend/pure";
|
|
22
|
+
|
|
23
|
+
import { DEPENDENCY_TYPES, MAX_RETRIES, REQUEST_DELAY } from "./constants";
|
|
24
|
+
|
|
25
|
+
const updateBigbinaryPackages = async (recommendedList) => {
|
|
26
|
+
const auditPackages = Object.keys(recommendedList).filter(
|
|
27
|
+
startsWith("@bigbinary")
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
if (isNotEmpty(auditPackages)) {
|
|
31
|
+
let success = false;
|
|
32
|
+
let retries = 0;
|
|
33
|
+
|
|
34
|
+
while (!success && retries < MAX_RETRIES) {
|
|
35
|
+
try {
|
|
36
|
+
const {
|
|
37
|
+
data: { repos },
|
|
38
|
+
} = await axios.get(
|
|
39
|
+
"https://nanos-release-tool-staging.neetodeployapp.com/api/v1/repos"
|
|
40
|
+
);
|
|
13
41
|
|
|
14
|
-
|
|
42
|
+
const trackedPackages = filterBy(
|
|
43
|
+
{ name: includes(__, auditPackages) },
|
|
44
|
+
repos
|
|
45
|
+
);
|
|
15
46
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
47
|
+
trackedPackages.forEach(({ name, current_version }) => {
|
|
48
|
+
recommendedList[name] = current_version;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
return recommendedList;
|
|
52
|
+
} catch (error) {
|
|
53
|
+
retries++;
|
|
54
|
+
await new Promise((resolve) => setTimeout(resolve, REQUEST_DELAY));
|
|
55
|
+
if (retries === MAX_RETRIES) {
|
|
56
|
+
console.log(
|
|
57
|
+
chalk.yellowBright(
|
|
58
|
+
"\nCouldn't connect to nanos release tool. Please retry or verify the link is working correctly."
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
process.exitCode = 1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const getOutdatedPackages = (recommendedVersions, packageJson) => {
|
|
69
|
+
const packagesToUpdate = Object.keys(DEPENDENCY_TYPES).map(async (type) => {
|
|
70
|
+
const recommendedList = await updateBigbinaryPackages(
|
|
71
|
+
recommendedVersions[type]
|
|
72
|
+
);
|
|
19
73
|
|
|
20
74
|
const dependencyTypePackages = packageJson[type] ?? {};
|
|
21
75
|
|
|
@@ -29,6 +83,9 @@ export const getOutdatedPackages = (recommendedVersions, packageJson) =>
|
|
|
29
83
|
return { type, outdatedPackages: Object.keys(outdatedPackages) };
|
|
30
84
|
});
|
|
31
85
|
|
|
86
|
+
return Promise.all(packagesToUpdate);
|
|
87
|
+
};
|
|
88
|
+
|
|
32
89
|
export const sortByKey = (object) =>
|
|
33
90
|
map(
|
|
34
91
|
(value) =>
|