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

Lerna bootstrap peerDep warnings #60

Closed
wants to merge 1 commit into from

Conversation

cassler
Copy link
Contributor

@cassler cassler commented Apr 25, 2021

Since this repository is intended for reliable autocompletion between packages, it would seem reasonable to include certain peer dependencies needed to ensure compatibility. You'll notice that we don't indicate a version number - as this is ostensibly to suppress warnings from yarn.

The notion here is that we'll prefer flexibility when dropping in additional packages over succinctness. Likewise, we prefer a warning-free experience out of the box. Ultimately this is only useful because of a shortcoming in yarn for peerDependencies which was solved in npm7

Changes:

  • Include certain package peerDependencies as root devDependencies because yarn/lerna cant... kinda.
  • Running lerna bootstrap no longer produces any peer dependency warnings.
  • Update jest-example to support TypeScript 4.x (and thus compat with the rest of the repo).

…cause yarn/lerna cant... kinda.

- Running `lerna bootstrap` no longer produces any peer dependency warnings.
- Update jest-example to support TypeScript 4.x
@NiGhTTraX NiGhTTraX closed this in 6ca0a49 Apr 28, 2021
NiGhTTraX added a commit that referenced this pull request Apr 28, 2021
This silences the yarn warning for missing peer dependency for
`@nighttrax/components`. This is actually a bug in yarn:
yarnpkg/yarn#5810. I don't particularly like
the workaround, but better than a noisy warning, I guess?

Fixes #60.
@NiGhTTraX
Copy link
Owner

Hey @cassler, thanks for sending this. I agree with the idea of removing the warnings, but we can actually declare the dependencies in the packages that need them. This also bodes well for projects using eslint import/no-extraneous-dependencies. See 6ca0a49.

Unfortunately, due to a yarn bug, I had to declare React in the root because it's a peer dependency of the components package. See 2dab7a9.

yarn install now doesn't print any warnings, so I hope this achieves what you were looking for.

NiGhTTraX added a commit that referenced this pull request Jan 24, 2022
This reverts the workarounds for #159, #74 and #60, as they are no
longer needed.

There are a few peer dependency warnings, though the examples work just
fine:

- The one for NextJS is tracked in
vercel/next.js#31887.
- CRACO support for CRA@5 is tracked in
dilanx/craco#378.
- The warnings for CRA are tracked in
facebook/create-react-app#11982, except for
the `ts-jest` one which is expected, since we're using CRA's `jest`.
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.

2 participants