express-fix-any-js 1.2.3 → 1.3.2
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/{v1/EndPointsJs/UpdateAppJs → v3/UpdateJs}/common/AlterFile/index.js +0 -1
- package/bin/{v1/EndPointsJs/UpdateAppJs → v3/UpdateJs}/index.js +3 -6
- package/bin/{v1 → v3}/core/parseInput.js +2 -3
- package/bin/{v1 → v3}/start.js +4 -4
- package/package.json +1 -1
- package/bin/v1/EndPointsJs/UpdateAppJs/validations/validateAppJsPath.js +0 -11
- package/bin/v1/EndPointsJs/UpdateAppJs/validations/validateEndpoint.js +0 -9
- package/bin/v1/EndPointsJs/index.js +0 -14
- /package/bin/{v1/EndPointsJs/UpdateAppJs → v3/UpdateJs}/checkLines.json +0 -0
- /package/bin/{v1/EndPointsJs/UpdateAppJs → v3/UpdateJs}/common/AlterFile/buildUpdatedContent.js +0 -0
- /package/bin/{v1/EndPointsJs/UpdateAppJs → v3/UpdateJs}/common/AlterFile/checkDuplicate.js +0 -0
- /package/bin/{v1/EndPointsJs/UpdateAppJs → v3/UpdateJs}/common/AlterFile/findInsertIndex.js +0 -0
- /package/bin/{v1/EndPointsJs/UpdateAppJs → v3/UpdateJs}/common/readFile.js +0 -0
- /package/bin/{v1/EndPointsJs/UpdateAppJs → v3/UpdateJs}/common/writeFile.js +0 -0
- /package/bin/{v1 → v3}/core/createFolder.js +0 -0
- /package/bin/{v1 → v3}/core/showUsage.js +0 -0
|
@@ -2,7 +2,6 @@ import readFile from "../readFile.js";
|
|
|
2
2
|
import checkDuplicate from "./checkDuplicate.js";
|
|
3
3
|
import findInsertIndex from "./findInsertIndex.js";
|
|
4
4
|
import writeFile from "../writeFile.js";
|
|
5
|
-
import validateAppJsPath from "../../validations/validateAppJsPath.js";
|
|
6
5
|
|
|
7
6
|
import buildUpdatedContent from "./buildUpdatedContent.js";
|
|
8
7
|
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
// v2/AppJs/index.js
|
|
2
2
|
|
|
3
3
|
import checkLines from "./checkLines.json" with {type: "json"};
|
|
4
|
-
import validateEndpoint from "./validations/validateEndpoint.js";
|
|
5
4
|
import alterFile from "./common/AlterFile/index.js";
|
|
6
5
|
|
|
7
|
-
const updateAppJs = ({
|
|
6
|
+
const updateAppJs = ({ inJsFilePath, inCheckLines,
|
|
8
7
|
showLog = false }) => {
|
|
9
8
|
|
|
10
|
-
validateEndpoint({ endpoint: actionName });
|
|
11
|
-
|
|
12
9
|
const localCheckLines = inCheckLines || checkLines;
|
|
13
10
|
// console.log("bbbbbbbbbbbb : ", localCheckLines);
|
|
14
11
|
|
|
15
12
|
alterFile({
|
|
16
|
-
jsFilePath:
|
|
13
|
+
jsFilePath: inJsFilePath,
|
|
17
14
|
toInsertLine: localCheckLines.importLines.toInsertLine,
|
|
18
15
|
duplicationCheck: localCheckLines.importLines.duplicationCheck,
|
|
19
16
|
insertAfter: localCheckLines.importLines.insertAfter,
|
|
@@ -21,7 +18,7 @@ const updateAppJs = ({ inEndPointsJsPath, actionName, inCheckLines,
|
|
|
21
18
|
});
|
|
22
19
|
|
|
23
20
|
alterFile({
|
|
24
|
-
jsFilePath:
|
|
21
|
+
jsFilePath: inJsFilePath,
|
|
25
22
|
toInsertLine: localCheckLines.useLines.toInsertLine,
|
|
26
23
|
duplicationCheck: localCheckLines.useLines.duplicationCheck,
|
|
27
24
|
insertAfter: localCheckLines.useLines.insertAfter,
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
export default function parseInput({
|
|
1
|
+
export default function parseInput({ jsFilePath,
|
|
2
2
|
inCheckLines = {}, showLog }) {
|
|
3
3
|
|
|
4
4
|
const [...args] = process.argv.slice(2);
|
|
5
5
|
|
|
6
6
|
return {
|
|
7
|
-
actionName: args[0] || actionName,
|
|
8
7
|
showLog: args[1] === undefined
|
|
9
8
|
? showLog
|
|
10
9
|
: args[1] === "true",
|
|
11
|
-
|
|
10
|
+
inJsFilePath: jsFilePath || process.cwd(),
|
|
12
11
|
inCheckLines
|
|
13
12
|
};
|
|
14
13
|
};
|
package/bin/{v1 → v3}/start.js
RENAMED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import parseInput from "./core/parseInput.js";
|
|
2
2
|
import showUsage from './core/showUsage.js';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import updateJs from "./UpdateJs/index.js";
|
|
5
5
|
|
|
6
6
|
import pkg from '../../package.json' with { type: 'json' };
|
|
7
7
|
|
|
8
8
|
const version = pkg.version;
|
|
9
9
|
|
|
10
|
-
const run = ({
|
|
11
|
-
const input = parseInput({
|
|
10
|
+
const run = ({ jsFilePath, inCheckLines, showLog }) => {
|
|
11
|
+
const input = parseInput({ jsFilePath, inCheckLines, showLog });
|
|
12
12
|
|
|
13
13
|
if (input.cmd === "--help" || input.cmd === "-h" || input.cmd === "help") return showUsage(version);
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
updateJs(input);
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export default run;
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import updateAppJs from "./UpdateAppJs/index.js";
|
|
2
|
-
|
|
3
|
-
export default ({ actionName, endPointsJsPath, inCheckLines, showLog }) => {
|
|
4
|
-
const localToPath = endPointsJsPath;
|
|
5
|
-
|
|
6
|
-
const fromUpdate = updateAppJs({
|
|
7
|
-
inEndPointsJsPath: `${localToPath}/end-points.js`,
|
|
8
|
-
actionName,
|
|
9
|
-
inCheckLines,
|
|
10
|
-
showLog
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
return true;
|
|
14
|
-
};
|
|
File without changes
|
/package/bin/{v1/EndPointsJs/UpdateAppJs → v3/UpdateJs}/common/AlterFile/buildUpdatedContent.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|