express-fix-any-js 1.26.2 → 1.28.5

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.
Files changed (33) hide show
  1. package/bin/{v25 → v28}/alterFile/start.js +5 -1
  2. package/bin/{v26 → v28}/hookFolder/forImportLine/index.js +7 -3
  3. package/bin/{v26 → v28}/hookFolder/insertLine/index.js +4 -6
  4. package/bin/{v25 → v28}/hookFolder/start.js +7 -4
  5. package/package.json +3 -2
  6. package/bin/v26/fileNames.json +0 -35
  7. /package/bin/{v25 → v27}/alterFile/forImportLine/index.js +0 -0
  8. /package/bin/{v25 → v27}/alterFile/forInsertIndex.js +0 -0
  9. /package/bin/{v25 → v27}/alterFile/insertLine/addLines.js +0 -0
  10. /package/bin/{v25 → v27}/alterFile/insertLine/findInsertIndex.js +0 -0
  11. /package/bin/{v25 → v27}/alterFile/insertLine/index.js +0 -0
  12. /package/bin/{v25 → v27}/alterFile/insertLine/writeToFile.js +0 -0
  13. /package/bin/{v26 → v27}/alterFile/start.js +0 -0
  14. /package/bin/{v25 → v27}/fileNames.json +0 -0
  15. /package/bin/{v25 → v27}/hookFolder/forImportLine/index.js +0 -0
  16. /package/bin/{v25 → v27}/hookFolder/forInsertIndex.js +0 -0
  17. /package/bin/{v25 → v27}/hookFolder/insertLine/addLines.js +0 -0
  18. /package/bin/{v25 → v27}/hookFolder/insertLine/findInsertIndex.js +0 -0
  19. /package/bin/{v25 → v27}/hookFolder/insertLine/index.js +0 -0
  20. /package/bin/{v25 → v27}/hookFolder/insertLine/writeToFile.js +0 -0
  21. /package/bin/{v26 → v27}/hookFolder/start.js +0 -0
  22. /package/bin/{v25 → v27}/start.js +0 -0
  23. /package/bin/{v26 → v28}/alterFile/forImportLine/index.js +0 -0
  24. /package/bin/{v26 → v28}/alterFile/forInsertIndex.js +0 -0
  25. /package/bin/{v26 → v28}/alterFile/insertLine/addLines.js +0 -0
  26. /package/bin/{v26 → v28}/alterFile/insertLine/findInsertIndex.js +0 -0
  27. /package/bin/{v26 → v28}/alterFile/insertLine/index.js +0 -0
  28. /package/bin/{v26 → v28}/alterFile/insertLine/writeToFile.js +0 -0
  29. /package/bin/{v26 → v28}/hookFolder/forInsertIndex.js +0 -0
  30. /package/bin/{v26 → v28}/hookFolder/insertLine/addLines.js +0 -0
  31. /package/bin/{v26 → v28}/hookFolder/insertLine/findInsertIndex.js +0 -0
  32. /package/bin/{v26 → v28}/hookFolder/insertLine/writeToFile.js +0 -0
  33. /package/bin/{v26 → v28}/start.js +0 -0
@@ -1,11 +1,15 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
+ import { fileNamesJson as fromNpm } from "pattern-collector-base-files";
3
4
 
4
- import fileNamesJson from '../fileNames.json' with {type: 'json'};
5
+ // import fileNamesJson from '../fileNames.json' with {type: 'json'};
5
6
 
6
7
  const startFunc = ({ alterArray, inFileType, inTargetPath, inValue }) => {
7
8
 
8
9
  try {
10
+
11
+ const fileNamesJson = fromNpm();
12
+
9
13
  if (!inFileType in fileNamesJson) {
10
14
  return false;
11
15
  };
@@ -2,15 +2,19 @@ import fs from "fs";
2
2
  import path from "path";
3
3
 
4
4
  import defaultFunc from 'pattern-collector-anyjs-story';
5
+ import { fileNamesJson as fromNpm } from "pattern-collector-base-files";
6
+
5
7
  import insertLine from "../insertLine/index.js";
6
8
 
7
- import fileNamesJson from '../../fileNames.json' with {type: 'json'};
9
+ // import fileNamesJson from '../../fileNames.json' with {type: 'json'};
8
10
 
9
11
  const startFunc = ({ inParts, inFileType, inTargetPath,
10
- presentKey, regexKey, templateKey
12
+ presentKey, regexKey, templateKey, inConsiderKey
11
13
  }) => {
12
14
 
13
15
  try {
16
+ const fileNamesJson = fromNpm();
17
+
14
18
  const localJsPath = path.join(inTargetPath, fileNamesJson[inFileType]?.fileName);
15
19
 
16
20
  const fileContent = fs.readFileSync(localJsPath, 'utf8');
@@ -25,7 +29,7 @@ const startFunc = ({ inParts, inFileType, inTargetPath,
25
29
  importRegex: story?.extractRegex?.toInsertIndex?.[inFileType]?.[regexKey],
26
30
  filePath: localJsPath,
27
31
  inTemplate: story?.reverseTemplates?.[templateKey],
28
- inParts
32
+ inParts, inConsiderKey
29
33
  });
30
34
 
31
35
  return fromInsertLine;
@@ -7,10 +7,12 @@ function build(template, parts) {
7
7
  };
8
8
 
9
9
  const startFunc = ({ linesStory, fileContent, filePath, importRegex, onlyIndexesValues,
10
- presentKey, inTemplate, inParts }) => {
10
+ presentKey, inTemplate, inParts, inConsiderKey }) => {
11
11
 
12
12
  const foundUseLinesStory = linesStory[presentKey].find(element => {
13
- return element.part2 === inParts[1];
13
+ if (inConsiderKey in element) {
14
+ return element[inConsiderKey] === inParts[1];
15
+ };
14
16
  });
15
17
 
16
18
  if (foundUseLinesStory) {
@@ -36,15 +38,11 @@ const startFunc = ({ linesStory, fileContent, filePath, importRegex, onlyIndexes
36
38
  inGapAfter: insertStory?.gapAfter
37
39
  });
38
40
 
39
- // lines.splice(insertAtIndex, 0, newLine);
40
-
41
41
  writeToFile({ fileContent, filePath, lines });
42
42
 
43
43
  return {
44
44
  newLine, inParts
45
45
  };
46
- // fs.writeFileSync(filePath, lines.join(fileContent.includes("\r\n") ? "\r\n" : "\n"));
47
-
48
46
  };
49
47
 
50
48
  export default startFunc;
@@ -1,22 +1,25 @@
1
+ import { fileNamesJson as fromNpm } from "pattern-collector-base-files";
1
2
  import forImportLine from "./forImportLine/index.js";
2
3
 
3
- import fileNamesJson from '../fileNames.json' with {type: 'json'};
4
-
5
4
  const startFunc = ({ inValue, OutValue,
6
5
  inFileType, inTargetPath }) => {
7
6
 
7
+ const fileNamesJson = fromNpm();
8
+
8
9
  const fromImportLine = forImportLine({
9
10
  inFileType, regexKey: "import",
10
11
  templateKey: "importRegex",
11
12
  inTargetPath, presentKey: "importLines",
12
- inParts: [`${fileNamesJson[inFileType]?.temporaryValue}${inValue}`, inValue]
13
+ inParts: [`${fileNamesJson[inFileType]?.temporaryValue}${inValue}`, inValue],
14
+ inConsiderKey: "part2"
13
15
  });
14
16
 
15
17
  const fromUseLine = forImportLine({
16
18
  inParts: [`${fileNamesJson[inFileType]?.temporaryValue}${inValue}`, OutValue],
17
19
  inFileType, regexKey: "consumption",
18
20
  templateKey: "consumptionRegex",
19
- inTargetPath, presentKey: "useLines"
21
+ inTargetPath, presentKey: "useLines",
22
+ inConsiderKey: "part1"
20
23
  });
21
24
 
22
25
  return { fromImportLine, fromUseLine }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-fix-any-js",
3
- "version": "1.26.2",
3
+ "version": "1.28.5",
4
4
  "description": "CLI to build for appjs, the endpoints",
5
5
  "keywords": [
6
6
  "cli",
@@ -10,7 +10,8 @@
10
10
  "project-generator"
11
11
  ],
12
12
  "dependencies": {
13
- "pattern-collector-anyjs-story": "^1.23.2",
13
+ "express-check-any-for-import": "^1.4.7",
14
+ "pattern-collector-anyjs-story": "^1.24.2",
14
15
  "pattern-collector-base-files": "^1.3.1"
15
16
  },
16
17
  "type": "module",
@@ -1,35 +0,0 @@
1
- {
2
- "version": "25.2",
3
- "fromAppJs": {
4
- "fileName": "app.js",
5
- "temporaryValue": "routerFrom"
6
- },
7
- "fromRoutesJs": {
8
- "fileName": "routes.js",
9
- "temporaryValue": "routerFrom"
10
- },
11
- "fromRoutesJsEnd": {
12
- "fileName": "routes.js",
13
- "temporaryValue": "routerFrom",
14
- "hookTo": "fromEndPointsJs"
15
- },
16
- "fromEndPointsJs": {
17
- "fileName": "end-points.js",
18
- "temporaryValue": "funcFrom",
19
- "hookTo": "fromControllerJs"
20
- },
21
- "tableGetShowAll": {
22
- "fileName": "end-points.js",
23
- "temporaryValue": "funcFrom",
24
- "hookTo": "fromControllerJs"
25
- },
26
- "tableGetFind": {
27
- "fileName": "end-points.js",
28
- "temporaryValue": "funcFrom",
29
- "hookTo": "fromControllerJs"
30
- },
31
- "fromControllerJs": {
32
- "fileName": "controller.js",
33
- "temporaryValue": "controllerFrom"
34
- }
35
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes