@bigbinary/neeto-audit-frontend 2.1.3 → 2.1.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/eslint/common/eslint.config.mjs +3 -0
- package/common/eslint/extension/eslint.config.mjs +16 -0
- package/common/eslint/nano/eslint.config.mjs +3 -0
- package/common/eslint/widget/eslint.config.mjs +9 -0
- package/common/recommendedDependencies/common.js +20 -16
- package/common/recommendedDependencies/extension.js +4 -4
- package/common/recommendedDependencies/frontend.js +12 -12
- package/common/recommendedDependencies/nano.js +7 -7
- package/dist/index.js +256 -223
- package/package.json +2 -2
- package/src/constants/index.js +7 -0
- package/src/utils/index.js +20 -18
- package/.github/CODEOWNERS +0 -2
- package/common/eslint/common/.eslintrc.js +0 -1
- package/common/eslint/extension/.eslintrc.js +0 -10
- package/common/eslint/nano/.eslintrc.js +0 -1
- package/common/eslint/widget/.eslintrc.js +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-audit-frontend",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"description": "Audits neeto frontend codebase for issues and suggests a fix.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@bigbinary/neeto-cist": "1.0.8",
|
|
26
26
|
"@bigbinary/neeto-commons-frontend": "3.1.10",
|
|
27
|
-
"axios": "1.
|
|
27
|
+
"axios": "1.8.2",
|
|
28
28
|
"chalk": "5.3.0",
|
|
29
29
|
"commander": "11.1.0",
|
|
30
30
|
"ora": "8.0.1",
|
package/src/constants/index.js
CHANGED
package/src/utils/index.js
CHANGED
|
@@ -10,7 +10,11 @@ import { identity, last, split } from "ramda";
|
|
|
10
10
|
import { simpleGit } from "simple-git";
|
|
11
11
|
import util from "util";
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
NANO_TYPE_MAP,
|
|
15
|
+
PACKAGE_JSON_PATH,
|
|
16
|
+
REMOTE_URL_PREFIXES,
|
|
17
|
+
} from "../constants";
|
|
14
18
|
|
|
15
19
|
const run = util.promisify(exec);
|
|
16
20
|
|
|
@@ -81,7 +85,7 @@ export const getCliOptions = () => {
|
|
|
81
85
|
|
|
82
86
|
export const getFileContent = async ({
|
|
83
87
|
relativeFilePath = "",
|
|
84
|
-
debug = false
|
|
88
|
+
debug = false,
|
|
85
89
|
}) => {
|
|
86
90
|
const resolvedFilePath = path.resolve(relativeFilePath);
|
|
87
91
|
|
|
@@ -97,7 +101,7 @@ export const createOrReplaceFile = async ({
|
|
|
97
101
|
relativeFilePath = "",
|
|
98
102
|
content = "",
|
|
99
103
|
debug = false,
|
|
100
|
-
options = {}
|
|
104
|
+
options = {},
|
|
101
105
|
}) => {
|
|
102
106
|
const resolvedFilePath = path.resolve(relativeFilePath);
|
|
103
107
|
|
|
@@ -105,7 +109,7 @@ export const createOrReplaceFile = async ({
|
|
|
105
109
|
return await writeFile(resolvedFilePath, content, {
|
|
106
110
|
encoding: "utf8",
|
|
107
111
|
flag: "w",
|
|
108
|
-
...options
|
|
112
|
+
...options,
|
|
109
113
|
});
|
|
110
114
|
} catch (error) {
|
|
111
115
|
debug && console.error(error);
|
|
@@ -116,7 +120,7 @@ export const createOrReplaceFile = async ({
|
|
|
116
120
|
export const identicalFiles = async ({
|
|
117
121
|
sourceFile = "",
|
|
118
122
|
destinationFile = "",
|
|
119
|
-
debug = false
|
|
123
|
+
debug = false,
|
|
120
124
|
}) => {
|
|
121
125
|
try {
|
|
122
126
|
const sourceFileContent = await readFile(sourceFile);
|
|
@@ -134,7 +138,7 @@ export const identicalFiles = async ({
|
|
|
134
138
|
export const identicalDirectoryFiles = async ({
|
|
135
139
|
sourceDirectory,
|
|
136
140
|
destinationDirectory,
|
|
137
|
-
debug
|
|
141
|
+
debug,
|
|
138
142
|
}) => {
|
|
139
143
|
try {
|
|
140
144
|
const files = await promises.readdir(sourceDirectory);
|
|
@@ -149,14 +153,14 @@ export const identicalDirectoryFiles = async ({
|
|
|
149
153
|
return await identicalFiles({
|
|
150
154
|
sourceFile,
|
|
151
155
|
destinationFile,
|
|
152
|
-
debug
|
|
156
|
+
debug,
|
|
153
157
|
});
|
|
154
158
|
} else {
|
|
155
159
|
await mkdir(destinationFile, { recursive: true });
|
|
156
160
|
const identicalFiles = await identicalDirectoryFiles({
|
|
157
161
|
sourceDirectory: sourceFile,
|
|
158
162
|
destinationDirectory: destinationFile,
|
|
159
|
-
debug
|
|
163
|
+
debug,
|
|
160
164
|
});
|
|
161
165
|
|
|
162
166
|
const results = await Promise.all(identicalFiles);
|
|
@@ -176,7 +180,7 @@ export const createOrReplaceDirectoryFiles = async ({
|
|
|
176
180
|
sourceDirectory,
|
|
177
181
|
destinationDirectory,
|
|
178
182
|
debug,
|
|
179
|
-
options
|
|
183
|
+
options,
|
|
180
184
|
}) => {
|
|
181
185
|
try {
|
|
182
186
|
const files = await promises.readdir(sourceDirectory);
|
|
@@ -190,14 +194,14 @@ export const createOrReplaceDirectoryFiles = async ({
|
|
|
190
194
|
if (isFile) {
|
|
191
195
|
const content = await getFileContent({
|
|
192
196
|
relativeFilePath: sourcePath,
|
|
193
|
-
debug
|
|
197
|
+
debug,
|
|
194
198
|
});
|
|
195
199
|
|
|
196
200
|
await createOrReplaceFile({
|
|
197
201
|
relativeFilePath: destinationPath,
|
|
198
202
|
content,
|
|
199
203
|
debug,
|
|
200
|
-
options
|
|
204
|
+
options,
|
|
201
205
|
});
|
|
202
206
|
} else {
|
|
203
207
|
await mkdir(destinationPath, { recursive: true });
|
|
@@ -205,7 +209,7 @@ export const createOrReplaceDirectoryFiles = async ({
|
|
|
205
209
|
sourceDirectory: sourcePath,
|
|
206
210
|
destinationDirectory: destinationPath,
|
|
207
211
|
debug,
|
|
208
|
-
options
|
|
212
|
+
options,
|
|
209
213
|
});
|
|
210
214
|
}
|
|
211
215
|
});
|
|
@@ -250,22 +254,20 @@ export const getNanoType = async () => {
|
|
|
250
254
|
const git = simpleGit();
|
|
251
255
|
const { value: remoteOriginUrl } = await git.getConfig("remote.origin.url");
|
|
252
256
|
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
remoteOriginUrl.split("github.com/bigbinary/").at(1);
|
|
256
|
-
|
|
257
|
+
const prefix = REMOTE_URL_PREFIXES.find((p) => remoteOriginUrl.includes(p));
|
|
258
|
+
const projectGitName = remoteOriginUrl.split(prefix).at(1);
|
|
257
259
|
const projectName = projectGitName.split(".git").at(0);
|
|
258
260
|
|
|
259
261
|
return {
|
|
260
262
|
type: NANO_TYPE_MAP[last(split("-", projectName))],
|
|
261
|
-
repoName: projectName
|
|
263
|
+
repoName: projectName,
|
|
262
264
|
};
|
|
263
265
|
};
|
|
264
266
|
|
|
265
267
|
export const getPackageJson = async (debug) => {
|
|
266
268
|
const packageJsonContent = await getFileContent({
|
|
267
269
|
relativeFilePath: PACKAGE_JSON_PATH,
|
|
268
|
-
debug
|
|
270
|
+
debug,
|
|
269
271
|
});
|
|
270
272
|
|
|
271
273
|
return JSON.parse(packageJsonContent);
|
package/.github/CODEOWNERS
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require("@bigbinary/neeto-commons-frontend/configs/nanos/eslint/index.js");
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const { mergeDeepLeft } = require("ramda");
|
|
2
|
-
const defaultConfiguration = require("@bigbinary/neeto-commons-frontend/configs/nanos/eslint/index.js");
|
|
3
|
-
|
|
4
|
-
module.exports = mergeDeepLeft(
|
|
5
|
-
{
|
|
6
|
-
globals: { chrome: "readonly" },
|
|
7
|
-
rules: { "@bigbinary/neeto/use-webpack-alias": "off" },
|
|
8
|
-
},
|
|
9
|
-
defaultConfiguration
|
|
10
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require("@bigbinary/neeto-commons-frontend/configs/nanos/eslint/index.js");
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const defaultConfigurations = require("@bigbinary/neeto-commons-frontend/configs/nanos/eslint/index.js");
|
|
2
|
-
const { mergeDeepLeft } = require("ramda");
|
|
3
|
-
|
|
4
|
-
module.exports = mergeDeepLeft(
|
|
5
|
-
{
|
|
6
|
-
rules: { "@bigbinary/neeto/file-name-and-export-name-standards": "off" },
|
|
7
|
-
},
|
|
8
|
-
defaultConfigurations
|
|
9
|
-
);
|