Skip to content

Latest commit

 

History

History
104 lines (81 loc) · 2.63 KB

README.md

File metadata and controls

104 lines (81 loc) · 2.63 KB

Table of Content

What is Mono Repo?

yarn workspaces

yarn scripts

Typescript configurations

Use modules from workspace

Export settings

How to write Typescript

Command line prompt arguments

How to work with Express

Test source code by Jest

Note: jest ts-jest and @types/jest ts-jest configinit

ESLint Integration

Swagger Integration

Application Deployment on Kubernetes

Troubleshooting

Module from workspace not found with import keyword

There are some situations may cause this issue:

  1. Module is not defined in compilerOptions.paths in tsconfig.json

    Solution:

    Assume the name of module is @utils and the path of workspace is at workspaces/utils

    {
      "compilerOptions": {
         ...,
         "paths": {
           "@utils/*": "workspaces/utils/src/*"
         }
      } 
    }
  2. Path of Module is not defined correspondently in compilerOptions.paths in tsconfig.json

    Solution:

    If the script would like to use complied module of @utils in the workspaces/utils/dist. The path should be:

    {
      "compilerOptions": {
         ...,
         "paths": {
           "@utils/*": "workspaces/utils/dist/*"
         }
      } 
    }

    This approach may not resolve this problem while the workspaces/utils/dist does not exist. In this case, use source directory would be the better solution as follows:

    {
      "compilerOptions": {
         ...,
         "paths": {
           "@utils/*": "workspaces/utils/src/*"
         }
      } 
    }
  3. The directory of script or the script has been excluded in tsconfig.json.

    Solution:

    Remove the directory from exclude attribute.