microsoft / microsoft/fluentui-contrib

feat: normalize and enforce`@type` package dependencies

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

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
56
Forks
62
Avg merge
3d 2h
Merged PRs (30d)
1

Description

Follows https://github.com/microsoft/fluentui-contrib/pull/316

ATM we specify @types/* as peerDependencies. With the new behaviour added to package managers for auto installing peerDependencies, this approach adds unwanted behaviour for users not using TypeScript as part of their CI toolchain.

For that reason we should enforce following patterns when specifying dependencies:

If package has production dependency ( peer or prod ) which doesn't ship types as part of the package (eg react, react-dom ) a @types/* package needs to exists as peerDependency with additional peerDependenciesMeta definition that marks this type package as optional.

Implementation:

  • add this functionality to @nx/dependency-check rule or
  • handle on our own via either
    • custom lint rule
    • nx sync generator
Related issues:

https://github.com/microsoft/fluentui/issues/32292

Contributor guide

Open the contributing guide

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 by reviewing the proposed behavior in PR 316 and the @nx/dependency-check rule named in the implementation options; the issue does not identify repository files or tests. Done means enforcing the stated @types dependency and optional peerDependenciesMeta pattern for packages whose production dependencies do not ship types, while choosing and implementing one of the listed approaches.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.