microsoft / microsoft/DefinitelyTyped-tools

definitions-parser does not support subset peer dependencies

Open
#423 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
423
Forks
237
Avg merge
18h 18m
Merged PRs (30d)
11

Description

Mapping react to react/v16 in react-virtualized-select and mapping react to react/v17 (new in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210) currently throws the following when running npm run test-all:
"react-virtualized-select depends on react-virtualized, which has a path mapping for react/v17. react-virtualized-select must have the same path mappings as its dependencies."

This constraint isn't really reflective of how peer dependencies work.
react-virtualized-select has a peer on React 16. react-virtualized has a peer on React 16 or 17. react-virtualized-select depends on react-virtualized.
This is perfectly fine at runtime by installing React 16.

But for some reason the definitions-parser thinks that's not ok. What's the reasoning behind that?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the definitions-parser implementation and reproduce the failure with npm run test-all using the react-virtualized-select and react-virtualized mappings described here. Trace why a dependency's react/v17 mapping must exactly match the dependent package's react/v16 mapping, then verify that compatible peer-dependency subsets pass while genuinely incompatible mappings remain rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.