Skip to content

Conversation

Beachman4
Copy link

Right now, the example in the documentation does not work because the types export was removed from the package.json and even if that is added back, the generation of the helper file is being done in the generators folder because of __dirname

fixes #54, fixes #21

A change resulted in the context being generated in the generators folder, so this moves it up 1 directory
Copy link

vercel bot commented Dec 28, 2024

@Beachman4 is attempting to deploy a commit to the Kevin's Projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Dec 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nestjs-trpc-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 29, 2024 10:55pm

@KevinEdry
Copy link
Owner

Oh this is awesome! does it really fix the types generation?

@Beachman4
Copy link
Author

Oh this is awesome! does it really fix the types generation?

Yes it should make it work according to the docs, but I think the context generation should be expanded to allow you to specify the placement so you can check it into version control. Right now, since it's in node_modules, when you use this type in your repo and you have a fresh node_modules, then typecheck will break, thus not allowing the context to be generated.

Alternatively, perhaps adding a bin to this package & adding a generate command, similar to prisma, as prisma follows a similar pattern with generated files being placed in node_modules.

@ctrhub
Copy link

ctrhub commented Feb 2, 2025

Hey, thinks for this PR.

In addition to this:

but I think the context generation should be expanded to allow you to specify the placement so you can check it into version control.

I am also wondering how this will work with a monorepo(turborepo) where 2 or more apps are using the nestjs-trpc package. In a monorepo you only have one node_modules in the root folder. This means there will only be one nestjs-trpc package that will be used by multiple apps. Will this cause conflicts in type generation?

@guotingchao
Copy link

Can this commit be released? The latest version still cannot import Context.

@emptyengineering
Copy link

Hey, thinks for this PR.

In addition to this:

but I think the context generation should be expanded to allow you to specify the placement so you can check it into version control.

I am also wondering how this will work with a monorepo(turborepo) where 2 or more apps are using the nestjs-trpc package. In a monorepo you only have one node_modules in the root folder. This means there will only be one nestjs-trpc package that will be used by multiple apps. Will this cause conflicts in type generation?

This is also how I am using it, curious as well.

@arturbacilla
Copy link

@KevinEdry Can you please release this PR? 7 months since its creation...

@Vitals9367
Copy link

Hey, please merge this. I really want to use context in my setup!

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.

Bug: Cannot find module 'nestjs-trpc/types' or its corresponding type declarations. Context Helper Type not Generating
7 participants