whefter / nestjs-joi

Easy to use JoiPipe as an interface between joi and NestJS with optional decorator-based schema construction.
MIT License
25 stars 12 forks source link

Support nest 7 & 8, update dependencies #10

Closed ephys closed 2 years ago

ephys commented 2 years ago

This PR updates the dependencies used by this project and marks nest 8 as a supported peer dependency.

No actual changes to the source code were required so nest 7 is still marked as supported.

Other notes:

whefter commented 2 years ago

Hi and thanks. I took a look and there's a test issue as well as a couple of things I'd like to understand:

Can you explain the need for the other changes? I'll happily accept a PR containing the Nest 8 dependency support alone for now.

ephys commented 2 years ago

Hi

eslint-patch

eslint does not technically support loading plugins that are not direct children of node_modules, and npm does not guarantee a fully flattened node_modules: a plugin installed by a preset might be in /node_modules/the_preset/node_modules/the_plugin instead of /node_modules/the_plugin.

eslint-patch makes eslint search for plugins in the node_modules of presets too.

TypeScript & Assert

Assert check is indeed due to a typescript change: https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/#use-unknown-catch-variables.

I can remove esModuleInterop, but I then need to replace import assert from 'assert'; with either:

Which one do you prefer?

note: same with import * as Joi from 'joi';


There is no need for the other changes, they're there as a "while I'm updating that dep, might as well update all of them". If you don't want them feel free to close the PR. Supporting nest 8 is as simple as setting the peerDeps to

"@nestjs/common": "^8.0.0 | ^7.0.0", "@nestjs/core": "^8.0.0 | ^7.0.0",

As it's already compatible with nest 8

whefter commented 2 years ago

Hi, thanks for your reply. I've pushed a new version for NestJS ^8.0.0 compatibility - thanks for testing it our beforehand. I'm still interested in the other changes.

whefter commented 2 years ago

Have not heard back, closing as stale.