@bigbinary/neeto-commons-frontend 4.12.4 → 4.12.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.
@@ -28,6 +28,7 @@ export const INLINE_CODE_PATTERN = { type: REMARK_NODE_TYPES.INLINE_CODE };
28
28
  export const TEXT_PATTERN = { type: REMARK_NODE_TYPES.TEXT };
29
29
  export const DOCS_FOLDER_NAME = "docs";
30
30
  export const TYPES_FOLDER_NAME = "typeTemplates";
31
+ export const EXPORTED_TYPES_FOLDER_NAME = "dist";
31
32
 
32
33
  export const JSDOC_IMG_HEIGHT = "200";
33
34
  export const JSDOC_IMG_WIDTH = "300";
@@ -5,7 +5,11 @@ import _generate from "@babel/generator";
5
5
  import _traverse from "@babel/traverse";
6
6
  import * as babelTypes from "@babel/types";
7
7
 
8
- import { DOCS_FOLDER_NAME, TYPES_FOLDER_NAME } from "./constants.mjs";
8
+ import {
9
+ DOCS_FOLDER_NAME,
10
+ EXPORTED_TYPES_FOLDER_NAME,
11
+ TYPES_FOLDER_NAME,
12
+ } from "./constants.mjs";
9
13
  import {
10
14
  buildEntityTitleToEntityDescMap,
11
15
  getFileContent,
@@ -21,11 +25,12 @@ const generate = _generate.default;
21
25
 
22
26
  const buildJsdoc = ({
23
27
  customTypeFileTraverser = defaultTypeFileTraverser,
28
+ exportedTypesFolderName = EXPORTED_TYPES_FOLDER_NAME,
24
29
  } = {}) => {
25
30
  const fileNamesInsideDocs = getFileNameList(path.resolve(DOCS_FOLDER_NAME));
26
31
  const typeFileNames = fs.readdirSync(path.resolve(TYPES_FOLDER_NAME));
27
32
 
28
- syncTypeFiles();
33
+ syncTypeFiles(exportedTypesFolderName);
29
34
 
30
35
  const entityTitleToDescMapOfAllFiles = {};
31
36
 
@@ -41,11 +46,13 @@ const buildJsdoc = ({
41
46
 
42
47
  // eslint-disable-next-line consistent-return
43
48
  typeFileNames.forEach(typeFileName => {
44
- const typeFileContent = getFileContent(typeFileName);
49
+ const typeFileContent = getFileContent(
50
+ path.join(exportedTypesFolderName, typeFileName)
51
+ );
45
52
  const typeFileAST = parseTypeFile(typeFileContent);
46
53
 
47
54
  customTypeFileTraverser({
48
- typeFileName,
55
+ typeFileName: `${exportedTypesFolderName}/${typeFileName}`,
49
56
  typeFileAST,
50
57
  entityTitleToDescMapOfAllFiles,
51
58
  babelTraverse: traverse,
@@ -184,10 +184,11 @@ export const defaultTypeFileTraverser = ({
184
184
  },
185
185
  });
186
186
 
187
- export const syncTypeFiles = () => {
187
+ export const syncTypeFiles = exportedTypesFolderName => {
188
188
  const sourceDir = path.resolve(TYPES_FOLDER_NAME);
189
+ const destDir = path.resolve(exportedTypesFolderName);
189
190
 
190
- fs.cpSync(sourceDir, path.resolve(), { recursive: true });
191
+ fs.cpSync(sourceDir, destDir, { recursive: true });
191
192
  };
192
193
 
193
194
  export const getFileNameList = dirPath => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-commons-frontend",
3
- "version": "4.12.4",
3
+ "version": "4.12.5",
4
4
  "description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
5
5
  "repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",