Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add monorepo instructions to the README #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RhysSullivan
Copy link

@RhysSullivan RhysSullivan commented Feb 23, 2023

Just setup ts-reset for my monorepo and found this was the most painless way to do it, updated the README to reflect how I set this up for my monorepo, this allows you to only install it once into the root package json

@feedm3
Copy link

feedm3 commented Mar 10, 2023

Thanks for this solution, I just tested it and it works :)

One question though: Why is it necessary to have the reset.d.ts file inside the root? I try to avoid adding files to the package root in general to keep it more tidy. When adding a reset.d.ts file inside the package, typescript doesn't care for it. Even if I include it explicitly in the tsconfig (like with the package root file) and I have a hard time to understand it.

Edit 1
Here is a nice thread about the different ways of importing it: #30

After trying out more things I actually ended up including the reset.d.ts file in the package root tsconfig.json with "files": ["./reset.d.ts"]. With this I have the types in all our packages, cause each package has it's own tsconfig.json which extends from this package root tsconfig.json.

Edit 2

Setting it globally on the root tsconfig.json in files didn't work out, as this deactivates the automatic detection of *.d.ts files that are in the monorepo. I now switched to the solution to add a src/global.d.ts file within every package (most packages already had this even) and just added there the import '@total-typescript/ts-reset';. So in most cases, no extra file.

@the-ult
Copy link

the-ult commented May 25, 2023

Somehow can't get it to work with Nx devtools

Tried al the above (and more)
Only solution working for now is adding:
import '@total-typescript/ts-reset'; to my apps/my-app/src/main.ts file (when using Angular)

@MendyLanda
Copy link

MendyLanda commented Jul 19, 2023

Edit 1 Here is a nice thread about the different ways of importing it: #30

After trying out more things I actually ended up including the reset.d.ts file in the package root tsconfig.json with "files": ["./reset.d.ts"]. With this I have the types in all our packages, cause each package has it's own tsconfig.json which extends from this package root tsconfig.json.

This did work for me across all apps and packages.
In my root tsconfig: "files": ["./reset.d.ts"]

  • Extending the root config on each package.
  • Turborepo

@nkeil
Copy link

nkeil commented Sep 9, 2023

After playing around with some different solutions for the monorepo implementation, I also found this to be the cleanest way to make it work.

@FleetAdmiralJakob
Copy link

Needed an instruction and this one worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants