Skip to content

feat(bundlechecker): Add custom npm registry support - #482

Merged
aversini merged 3 commits into
mainfrom
feat(bundlechecker)-Add-custom-npm-registry-support
Jan 31, 2026
Merged

aversini merged 3 commits into
mainfrom
feat(bundlechecker)-Add-custom-npm-registry-support

Conversation

@aversini

Copy link
Copy Markdown
Collaborator

Add support for specifying a custom npm registry via a --registry/-r flag and plumbing it through the bundle check flow. Key changes:

  • CLI: add registry flag (short -r) with default and docs/examples in README.
  • Versions: fetchPackageVersions now accepts an options object (or legacy string), uses DEFAULT_REGISTRY, strips trailing slashes, and builds the registry URL when fetching package metadata. Tests added to verify registry usage and trailing-slash handling.
  • Bundler: expose registry in BundleOptions, pass registry to install command, and append a --registry argument to pnpm/npm install commands.
  • Bundlecheck/trend: propagate flags.registry into calls that fetch versions or check bundles.
  • Defaults: introduce DEFAULT_REGISTRY constant and registry default flag.

This enables checking packages from private or alternative registries (e.g., Verdaccio or corporate registries) and ensures consistent behavior when registry URLs include a trailing slash.

Add support for specifying a custom npm registry via a --registry/-r flag and plumbing it through the bundle check flow. Key changes:

- CLI: add registry flag (short -r) with default and docs/examples in README.
- Versions: fetchPackageVersions now accepts an options object (or legacy string), uses DEFAULT_REGISTRY, strips trailing slashes, and builds the registry URL when fetching package metadata. Tests added to verify registry usage and trailing-slash handling.
- Bundler: expose registry in BundleOptions, pass registry to install command, and append a --registry argument to pnpm/npm install commands.
- Bundlecheck/trend: propagate flags.registry into calls that fetch versions or check bundles.
- Defaults: introduce DEFAULT_REGISTRY constant and registry default flag.

This enables checking packages from private or alternative registries (e.g., Verdaccio or corporate registries) and ensures consistent behavior when registry URLs include a trailing slash.
Comment thread packages/bundlecheck/src/bundler.ts Fixed
Comment thread packages/bundlecheck/src/bundler.ts Fixed
Comment thread packages/bundlecheck/src/bundler.ts Fixed
@aversini
aversini merged commit d2cdd21 into main Jan 31, 2026
6 checks passed
@aversini
aversini deleted the feat(bundlechecker)-Add-custom-npm-registry-support branch January 31, 2026 16:08
@aversini aversini mentioned this pull request Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants