Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 24, 2026

The JSDoc for INpmRegistryPackageResponse incorrectly stated it "extends INpmCheckRegistryData" when the interface doesn't use the extends keyword.

Change:

  • Reworded JSDoc to say "structurally compatible with" instead of "extends"

The interface has the same dist-tags and versions fields as INpmCheckRegistryData, making it structurally compatible in TypeScript's type system without formal inheritance.

/**
 * @remarks
 * This interface represents the full response from the npm registry when
 * fetching package metadata. It is structurally compatible with INpmCheckRegistryData
 * to maintain compatibility with existing code like bestGuessHomepage.
 */
export interface INpmRegistryPackageResponse {
  name: string;
  'dist-tags': Record<string, string>;
  versions: Record<string, INpmRegistryVersionMetadata>;
  time?: Record<string, string>;
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix comments on package-json and throat dependency replacements docs(npm-check-fork): fix JSDoc claiming interface extends when it doesn't Jan 24, 2026
Copilot AI requested a review from TheLarkInn January 24, 2026 23:56
@TheLarkInn TheLarkInn marked this pull request as ready for review January 25, 2026 00:18
@TheLarkInn TheLarkInn merged commit 8a4b3a3 into atomic-style-claude Jan 25, 2026
1 check passed
@TheLarkInn TheLarkInn deleted the copilot/sub-pr-5565-again branch January 25, 2026 00:18
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bug Triage Jan 25, 2026
TheLarkInn added a commit that referenced this pull request Jan 27, 2026
…esn't (#5567)

* Initial plan

* docs: reword JSDoc for structural compatibility instead of extends

Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
TheLarkInn added a commit that referenced this pull request Jan 27, 2026
* feat(npm-check-fork): add npm registry type definitions

Add INpmRegistryPackageResponse and INpmRegistryVersionMetadata interfaces
to support the upcoming replacement of the package-json dependency with a
local implementation using WebClient.

- INpmRegistryVersionMetadata extends INpmCheckPackageVersion for backward
  compatibility
- INpmRegistryPackageResponse models the full npm registry API response
- Added JSDoc with links to npm registry API documentation

* feat(npm-check-fork): add NpmRegistryClient for fetching package metadata

Implement NpmRegistryClient class to replace external package-json dependency
with a self-contained HTTP client using Node.js built-in modules.

Features:
- INpmRegistryClientOptions for configuring registry URL, user agent, timeout
- INpmRegistryClientResult for consistent error handling
- Automatic scoped package URL encoding (@scope/name -> @scope%2Fname)
- Support for gzip/deflate response decompression
- Proper error handling for 404, HTTP errors, network errors, and timeouts

* refactor(npm-check-fork): use NpmRegistryClient in GetLatestFromRegistry

Replace package-json and throat dependencies with NpmRegistryClient for
fetching npm registry metadata. Preserves existing version sorting and
homepage extraction logic.

Changes:
- Remove package-json and throat imports
- Add lazy-initialized module-level NpmRegistryClient instance
- Update getNpmInfo to use fetchPackageMetadataAsync
- Preserve lodash/semver version sorting
- Preserve bestGuessHomepage extraction

* feat(npm-check-fork): add getNpmInfoBatch for concurrent package fetching

Add batch fetching function to retrieve metadata for multiple packages
concurrently with configurable concurrency limit.

Features:
- getNpmInfoBatch(packageNames, concurrency) returns Map<string, INpmRegistryInfo>
- Default concurrency matches CPU count (like original throat behavior)
- Processes packages in batches using Promise.all

* refactor(npm-check-fork): remove package-json and throat dependencies

Remove external dependencies that have been replaced by NpmRegistryClient:
- package-json: replaced by NpmRegistryClient
- throat: replaced by Promise.all batch processing

Update tests to mock NpmRegistryClient instead of package-json.

* test(npm-check-fork): add unit tests for NpmRegistryClient

Add basic unit tests for NpmRegistryClient constructor options.
Update GetLatestFromRegistry tests with improved module mocking.

* docs(npm-check-fork): update CHANGELOG for dependency replacement

Document the removal of package-json and throat dependencies in favor of
internal NpmRegistryClient implementation.

* cleanup from code review

* remove ai outputs

* rush change

* restore CHANGELOG.md

* docs(npm-check-fork): fix JSDoc claiming interface extends when it doesn't (#5567)

* Initial plan

* docs: reword JSDoc for structural compatibility instead of extends

Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>

* Add comprehensive unit tests for NpmRegistryClient with http mocking (#5568)

* Initial plan

* test(npm-check-fork): add comprehensive unit tests for NpmRegistryClient with http mocking

Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>

* DROP: rush update

---------

Co-authored-by: Sean Larkin <thelarkinn@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

2 participants