yarnpkg / yarnpkg/berry

[Feature] Provide a way to manually invoke plugin-typescript

Open
#2,807 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
8.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

Our repo uses dependabot which updates dependencies by changing the package.json file and running the install tool (yarn). Unfortunately, this also results in out-of-sync @types definitions because the typescript yarn plugin is only run on package addition or removal with yarn add or yarn remove. We can update our dependabot run to invoke a script after it modifies package.json if there was a way to invoke the typescript plugin in a "fixup" or "re-run" mode.

Describe the solution you'd like

A way to invoke the typescript plugin manually to "fixup" any out-of-sync @types packages.

Describe the drawbacks of your solution

Depending on when or how the "fixup" is triggered (or how) it might overwrite manual @types changes introduced by the user. Tho it seems the spirit of the plugin is to handle @types for you automatically. This would be problematic if the user is explicitly pinning an @types package to a specific version due to type errors or other incompatibilities. One possible solution would be to look for an ^ in the @type version and leave any @types which do not have ^ untouched (i.e. respecting absolute pinning by the user).

Describe alternatives you've considered

We've so far not found a way to make dependabot update package.json files by going through yarn rather than modifying package.json directly.

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 tracing the plugin-typescript behavior triggered by yarn add and yarn remove, using the package.json updates described in the issue. Define how a manual fixup or re-run should be invoked and how pinned @types versions are handled; done means Dependabot can trigger it after editing package.json without unexpectedly changing explicitly pinned versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
developer-experience, tooling
Issue type
Feature
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.