@bigbinary/neeto-audit-frontend 2.0.5 → 2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-audit-frontend",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "Audits neeto frontend codebase for issues and suggests a fix.",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.js",
@@ -25,6 +25,7 @@
25
25
  "rollup-plugin-peer-deps-external": "2.2.4"
26
26
  },
27
27
  "dependencies": {
28
+ "@bigbinary/neeto-cist": "^1.0.4",
28
29
  "@bigbinary/neeto-commons-frontend": "2.1.24",
29
30
  "axios": "1.6.0",
30
31
  "chalk": "5.3.0",
@@ -34,6 +35,7 @@
34
35
  "simple-git": "3.20.0"
35
36
  },
36
37
  "peerDependencies": {
38
+ "@bigbinary/neeto-cist": "^1.0.4",
37
39
  "@bigbinary/neeto-commons-frontend": "^2.1.24",
38
40
  "ramda": "^0.29.1"
39
41
  },
@@ -1,4 +1,4 @@
1
- import { isNotEmpty } from "@bigbinary/neeto-commons-frontend/pure";
1
+ import { isNotEmpty } from "@bigbinary/neeto-cist";
2
2
  import chalk from "chalk";
3
3
  import { exec } from "child_process";
4
4
  import { program } from "commander";
@@ -81,7 +81,7 @@ export const getCliOptions = () => {
81
81
 
82
82
  export const getFileContent = async ({
83
83
  relativeFilePath = "",
84
- debug = false,
84
+ debug = false
85
85
  }) => {
86
86
  const resolvedFilePath = path.resolve(relativeFilePath);
87
87
 
@@ -97,7 +97,7 @@ export const createOrReplaceFile = async ({
97
97
  relativeFilePath = "",
98
98
  content = "",
99
99
  debug = false,
100
- options = {},
100
+ options = {}
101
101
  }) => {
102
102
  const resolvedFilePath = path.resolve(relativeFilePath);
103
103
 
@@ -105,7 +105,7 @@ export const createOrReplaceFile = async ({
105
105
  return await writeFile(resolvedFilePath, content, {
106
106
  encoding: "utf8",
107
107
  flag: "w",
108
- ...options,
108
+ ...options
109
109
  });
110
110
  } catch (error) {
111
111
  debug && console.error(error);
@@ -116,7 +116,7 @@ export const createOrReplaceFile = async ({
116
116
  export const identicalFiles = async ({
117
117
  sourceFile = "",
118
118
  destinationFile = "",
119
- debug = false,
119
+ debug = false
120
120
  }) => {
121
121
  try {
122
122
  const sourceFileContent = await readFile(sourceFile);
@@ -134,7 +134,7 @@ export const identicalFiles = async ({
134
134
  export const identicalDirectoryFiles = async ({
135
135
  sourceDirectory,
136
136
  destinationDirectory,
137
- debug,
137
+ debug
138
138
  }) => {
139
139
  try {
140
140
  const files = await promises.readdir(sourceDirectory);
@@ -149,14 +149,14 @@ export const identicalDirectoryFiles = async ({
149
149
  return await identicalFiles({
150
150
  sourceFile,
151
151
  destinationFile,
152
- debug,
152
+ debug
153
153
  });
154
154
  } else {
155
155
  await mkdir(destinationFile, { recursive: true });
156
156
  const identicalFiles = await identicalDirectoryFiles({
157
157
  sourceDirectory: sourceFile,
158
158
  destinationDirectory: destinationFile,
159
- debug,
159
+ debug
160
160
  });
161
161
 
162
162
  const results = await Promise.all(identicalFiles);
@@ -176,7 +176,7 @@ export const createOrReplaceDirectoryFiles = async ({
176
176
  sourceDirectory,
177
177
  destinationDirectory,
178
178
  debug,
179
- options,
179
+ options
180
180
  }) => {
181
181
  try {
182
182
  const files = await promises.readdir(sourceDirectory);
@@ -190,14 +190,14 @@ export const createOrReplaceDirectoryFiles = async ({
190
190
  if (isFile) {
191
191
  const content = await getFileContent({
192
192
  relativeFilePath: sourcePath,
193
- debug,
193
+ debug
194
194
  });
195
195
 
196
196
  await createOrReplaceFile({
197
197
  relativeFilePath: destinationPath,
198
198
  content,
199
199
  debug,
200
- options,
200
+ options
201
201
  });
202
202
  } else {
203
203
  await mkdir(destinationPath, { recursive: true });
@@ -205,7 +205,7 @@ export const createOrReplaceDirectoryFiles = async ({
205
205
  sourceDirectory: sourcePath,
206
206
  destinationDirectory: destinationPath,
207
207
  debug,
208
- options,
208
+ options
209
209
  });
210
210
  }
211
211
  });
@@ -258,14 +258,14 @@ export const getNanoType = async () => {
258
258
 
259
259
  return {
260
260
  type: NANO_TYPE_MAP[last(split("-", projectName))],
261
- repoName: projectName,
261
+ repoName: projectName
262
262
  };
263
263
  };
264
264
 
265
265
  export const getPackageJson = async (debug) => {
266
266
  const packageJsonContent = await getFileContent({
267
267
  relativeFilePath: PACKAGE_JSON_PATH,
268
- debug,
268
+ debug
269
269
  });
270
270
 
271
271
  return JSON.parse(packageJsonContent);
@@ -1,4 +1,4 @@
1
- import { existsBy, isNotEmpty } from "@bigbinary/neeto-commons-frontend/pure";
1
+ import { existsBy, isNotEmpty } from "@bigbinary/neeto-cist";
2
2
  import { mergeDeepRight, objOf } from "ramda";
3
3
 
4
4
  import recommendedDependencies from "../../../common/recommendedDependencies";
@@ -7,12 +7,12 @@ import {
7
7
  createOrReplaceFile,
8
8
  execute,
9
9
  getNanoType,
10
- getPackageJson,
10
+ getPackageJson
11
11
  } from "../../utils";
12
12
  import {
13
13
  getInstallationCommands,
14
14
  getOutdatedPackages,
15
- sortByKey,
15
+ sortByKey
16
16
  } from "./utils";
17
17
 
18
18
  const recommendedPackageVersions = async (debug) => {
@@ -45,7 +45,7 @@ const recommendedPackageVersions = async (debug) => {
45
45
  (await createOrReplaceFile({
46
46
  relativeFilePath: PACKAGE_JSON_PATH,
47
47
  content: JSON.stringify(newPackageJson, null, 2),
48
- debug,
48
+ debug
49
49
  }));
50
50
 
51
51
  const commands = getInstallationCommands(
@@ -67,7 +67,7 @@ const recommendedPackageVersions = async (debug) => {
67
67
  return {
68
68
  error: "The dependency packages are not using the recommended versions.",
69
69
  status: STATUSES.FAIL,
70
- fix,
70
+ fix
71
71
  };
72
72
  }
73
73
 
@@ -12,13 +12,9 @@ import {
12
12
  isEmpty,
13
13
  startsWith,
14
14
  includes,
15
- __,
15
+ __
16
16
  } from "ramda";
17
- import {
18
- filterBy,
19
- findBy,
20
- isNotEmpty,
21
- } from "@bigbinary/neeto-commons-frontend/pure";
17
+ import { filterBy, findBy, isNotEmpty } from "@bigbinary/neeto-cist";
22
18
 
23
19
  import { DEPENDENCY_TYPES, MAX_RETRIES, REQUEST_DELAY } from "./constants";
24
20
 
@@ -34,7 +30,7 @@ const updateBigbinaryPackages = async (recommendedList) => {
34
30
  while (!success && retries < MAX_RETRIES) {
35
31
  try {
36
32
  const {
37
- data: { repos },
33
+ data: { repos }
38
34
  } = await axios.get(
39
35
  "https://nanos-release-tool-staging.neetodeployapp.com/api/v1/repos"
40
36
  );