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

Add Sorbet type annotations to UpdateChecker, LatestVersionFinder, and VersionResolver for npm_and_yarn #11903

Merged
merged 9 commits into from
Mar 27, 2025

Conversation

kbukum1
Copy link
Contributor

@kbukum1 kbukum1 commented Mar 26, 2025

What are you trying to accomplish?

This PR introduces Sorbet type annotations to three core classes in the npm_and_yarn ecosystem:

  • UpdateChecker
  • LatestVersionFinder
  • RegistryFinder
  • VersionResolver

What:
The goal is to improve static type safety and developer tooling support for these critical components of the npm/yarn update logic. Types have been added to method signatures, internal state, and helper methods where appropriate.

Why:
Adding Sorbet types to these classes increases confidence when making future changes, helps catch bugs earlier, and makes the code easier to navigate for contributors unfamiliar with the implicit contracts in these classes.

Anything you want to highlight for special attention from reviewers?

How will you know you've accomplished your goal?

  • The code now passes srb tc with no type errors on the updated files.
  • The classes still pass all tests, ensuring functional equivalence.
  • Contributors working on these classes will now benefit from typed method signatures and IDE/autocomplete support.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@kbukum1 kbukum1 force-pushed the kamil/fix-sorbet-typings-for-npm_and_yarn branch 2 times, most recently from 460a22d to 5aa2be9 Compare March 26, 2025 05:29
@kbukum1 kbukum1 force-pushed the kamil/fix-sorbet-typings-for-npm_and_yarn branch from 10b54fe to 9012e75 Compare March 26, 2025 20:55
@kbukum1 kbukum1 added the sorbet 🍦 Relates to Sorbet types label Mar 26, 2025
@kbukum1 kbukum1 marked this pull request as ready for review March 27, 2025 07:44
@kbukum1 kbukum1 requested a review from a team as a code owner March 27, 2025 07:44
@kbukum1 kbukum1 assigned markhallen and unassigned markhallen Mar 27, 2025
@kbukum1 kbukum1 requested a review from markhallen March 27, 2025 08:05
@kbukum1 kbukum1 merged commit b9f16fa into main Mar 27, 2025
74 checks passed
@kbukum1 kbukum1 deleted the kamil/fix-sorbet-typings-for-npm_and_yarn branch March 27, 2025 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: javascript sorbet 🍦 Relates to Sorbet types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants