express-fix-any-js 1.25.2 → 1.26.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.
@@ -1,12 +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
- const startFunc = ({ alterArray, inFileType, inTargetPath
7
- }) => {
7
+ const startFunc = ({ alterArray, inFileType, inTargetPath, inValue }) => {
8
8
 
9
9
  try {
10
+
11
+ const fileNamesJson = fromNpm();
12
+
10
13
  if (!inFileType in fileNamesJson) {
11
14
  return false;
12
15
  };
@@ -15,13 +18,13 @@ const startFunc = ({ alterArray, inFileType, inTargetPath
15
18
  return false;
16
19
  };
17
20
 
18
- if (!"fileName" in fileNamesJson[fileNamesJson[hookTo]]) {
21
+ if (!"fileName" in fileNamesJson[fileNamesJson[inFileType]?.hookTo]) {
19
22
  return false;
20
23
  };
21
24
 
22
- const jsFileName = fileNamesJson[fileNamesJson[hookTo]]?.fileName;
25
+ const jsFileName = fileNamesJson[fileNamesJson[inFileType]?.hookTo]?.fileName;
23
26
 
24
- const localJsPath = path.join(inTargetPath, jsFileName);
27
+ const localJsPath = path.join(inTargetPath, inValue, jsFileName);
25
28
 
26
29
  let fileContent = fs.readFileSync(localJsPath, 'utf8');
27
30
 
@@ -0,0 +1,35 @@
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
+ }
@@ -1,10 +1,13 @@
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
+ // import fileNamesJson from '../fileNames.json' with {type: 'json'};
4
5
 
5
6
  const startFunc = ({ inValue, OutValue,
6
7
  inFileType, inTargetPath }) => {
7
8
 
9
+ const fileNamesJson = fromNpm();
10
+
8
11
  const fromImportLine = forImportLine({
9
12
  inFileType, regexKey: "import",
10
13
  templateKey: "importRegex",
@@ -14,7 +14,10 @@ const startFunc = ({ inValue, OutValue,
14
14
  });
15
15
  };
16
16
 
17
- fromAlterFile = alterFile({ alterArray, inFileType, inTargetPath });
17
+ fromAlterFile = alterFile({
18
+ alterArray, inFileType, inValue,
19
+ inTargetPath
20
+ });
18
21
 
19
22
  return { fromInternal, fromAlterFile };
20
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-fix-any-js",
3
- "version": "1.25.2",
3
+ "version": "1.26.2",
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.21.4"
13
+ "pattern-collector-anyjs-story": "^1.23.2",
14
+ "pattern-collector-base-files": "^1.3.1"
14
15
  },
15
16
  "type": "module",
16
17
  "exports": {
@@ -33,4 +34,4 @@
33
34
  "bugs": {
34
35
  "url": "https://github.com/keshavsoft/express-fix-any-js/issues"
35
36
  }
36
- }
37
+ }
@@ -1,19 +0,0 @@
1
- {
2
- "fromAppJs": {
3
- "fileName": "app.js",
4
- "temporaryValue": "routerFrom"
5
- },
6
- "fromRoutesJs": {
7
- "fileName": "routes.js",
8
- "temporaryValue": "routerFrom"
9
- },
10
- "fromRoutesJsEnd": {
11
- "fileName": "routes.js",
12
- "temporaryValue": "routerFrom",
13
- "hookTo": "fromEndPointsJs"
14
- },
15
- "fromEndPointsJs": {
16
- "fileName": "end-points.js",
17
- "temporaryValue": "funcFrom"
18
- }
19
- }
File without changes
File without changes
File without changes
File without changes