Skip to content

Commit

Permalink
fix: add @types/express and fastify to dependencies
Browse files Browse the repository at this point in the history
WIthout @types/express and fastify being in dependencies, the module fails to start and the client
is forced to install the missing one on their own.
  • Loading branch information
jmcdo29 committed Jan 11, 2020
1 parent c01849f commit 9fa3436
Show file tree
Hide file tree
Showing 2 changed files with 1,816 additions and 1,299 deletions.
Loading

7 comments on commit 9fa3436

@greenreign
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmcdo29 I was wondering about this. I wanted to give this logger a try but it didn't feel right to be taking dep's on fastify and @types/express. I assume you can't make them devDependencies because they won't be packaged? But ideally I'd like them not to be shipped with my module as well. Is there another way around this?

@jmcdo29
Copy link
Owner Author

@jmcdo29 jmcdo29 commented on 9fa3436 Feb 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should probably look into how Nest takes care of the dependencies on both underlying frameworks and their types. For the moment because I need the ability to determine the type for intellisence on the methods I have them under dependencies. I do agree though that there should be a better way to manage this. If you figure something out, let me know. I'll see what I can find in the meantime.

@greenreign
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah. Good point. We are taking those dependencies anyway because NestJs is. At least fastify.
https://github.com/nestjs/nest/blob/master/package.json#L61

@types/express is a devDependency.
https://github.com/nestjs/nest/blob/master/package.json#L97

@jmcdo29
Copy link
Owner Author

@jmcdo29 jmcdo29 commented on 9fa3436 Feb 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe in Nest's case, no Express typings are explicitly used, but I'll have to double check the codebase to be sure and that could take some time

@greenreign
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you may be right. Also I looked at the nest repo but I don't actually depend on that repo. Here are my nest modules

├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
└─ @nestjs/[email protected]

And none seem to rely on Fastify. I'm gonna give your logger a shot. If I have some time I'll try to set some aside to look into what nest does with fastify types. If anything.

@jmcdo29
Copy link
Owner Author

@jmcdo29 jmcdo29 commented on 9fa3436 Feb 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for giving it a shot! If you find anything else, let me know and I'll see if I can address it

@jmcdo29
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @greenreign, just got around to releasing v2.0.5 that has no dependencies on fastify or @types/express. Feel free to give it a shot and log an issue if there is a problem 😄

Please sign in to comment.