3

I want to develop a typescript nodejs solution split into 3 sub project like a csharp solution split into multiple libraries.

I want that each of them has its own pacakge.json

  • UI project
    package.json

  • Infrastructure
    package.json

  • Domain
    package.json

Obviously, I want from one project to reference another, for example, ui can reference the infrastructure project

In the package.json I found to reference another package using the syntax file::

"dependencies": {
    "infrastrucure": "file:../infrastructure"
  },

The main drawbacks I found:

  • Compile the dependant projects before running the ui
  • The eslint show a warning

Cannot read file on <solution root>\tsconfig.json

What I want to know is:

  1. This is the correct approach to split into multiple projects a solution or there are more not considered drawbacks?
  2. Why eslint looking for tsconfig.json into the root folder?

2 Answers 2

1

lerna or yarn workspaces can help you manage a multi-project repository in the way you have described. I'm not sure how to fix your errors without seeing how eslint is setup, but it might be worth looking into these solutions instead of trying to set everything up yourself.

Sign up to request clarification or add additional context in comments.

3 Comments

Have you experienced one (or both) of them? Lerna seems to be more complex rather than yarn. What is your honest opinion?
I've only used lerna personally and haven't used it in great depth, but I found it a bit clunky although it does the job. Yarn workspaces is newer and I've heard good things from others about it but have never tried it myself.
Thanks, Christos
1

After a bit of research, I found Rush a monorepos tool by Microsoft.
This tool (for me) is the most similar to a .sln like visual studio and uses the pnpm, the package manager that I already use.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.