rnx-kit icon indicating copy to clipboard operation
rnx-kit copied to clipboard

[SUGGESTION] Can we also include @types/xyz dependencies in align-deps

Open SparshaSaha opened this issue 1 year ago • 5 comments

What happened?

I have seen quite often that people who use rnx-kit/align-deps, update their dependencies properly as align-deps does it for them. But they often forget to update the type dependencies. For example, with React: 18.x.x we should use @types/React: 18.x.x. with ReactNative: 0.71.x, we do not need types/react-native as types are already included. There could be merit in configuring align-deps to factor in these dependencies as well.

Affected Package

@rnx-kit/align-deps

Version

2.2.0

Which platforms are you seeing this issue on?

  • [ ] Android
  • [ ] iOS
  • [ ] macOS
  • [ ] Windows

System Information

NA

Steps to Reproduce

NA

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

SparshaSaha avatar May 03 '23 11:05 SparshaSaha

submit a PR?

kelset avatar May 03 '23 13:05 kelset

@kelset sure I can submit a PR but before I did that i wanted to confirm if you folks also think that this will be a meaningful addition.

SparshaSaha avatar May 05 '23 06:05 SparshaSaha

I think it makes sense to add it. My only concern is that we should not make the react capability take a dependency on it. It's not a given that people use TypeScript.

tido64 avatar May 05 '23 07:05 tido64

Yeah. Makes sense. We can maybe add "types" as a capability. If "types" is listed as a capability, the tool will check/include typings for required packages. What do you think?

SparshaSaha avatar May 05 '23 09:05 SparshaSaha

Yeah. Makes sense. We can maybe add "types" as a capability. If "types" is listed as a capability, the tool will check/include typings for required packages. What do you think?

I think that will require a lot more work and no longer makes the core engine generic. If we just add a types/react capability, the types package will be checked when you run in "vigilant" mode. I find that most people do this anyway to catch packages that they forgot to add.

tido64 avatar May 08 '23 07:05 tido64