Skip to content

feat: support .npmrc for custom repo detection in bun projects #34322

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

Closed
wants to merge 6 commits into from

Conversation

stephen-dahl
Copy link
Contributor

Changes

this moves the npm logic to read .npmrc into a helper function then calls that helper function in both npm and bun managers. it also exports npm's detectGlobalConfig function from bun.

Context

there is no issue for this PR

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@stephen-dahl stephen-dahl changed the title Bun/read npmrc feat: support .npmrc for custom repo detection in bun projects Feb 19, 2025
@stephen-dahl stephen-dahl marked this pull request as draft February 19, 2025 18:17
@stephen-dahl stephen-dahl marked this pull request as ready for review February 19, 2025 19:17
@@ -4,7 +4,7 @@ import { NpmDatasource } from '../../datasource/npm';

export { updateArtifacts } from './artifacts';
export { extractAllPackageFiles } from './extract';
export { getRangeStrategy, updateDependency } from '../npm';
export { getRangeStrategy, updateDependency, detectGlobalConfig } from '../npm';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this isn't essential for this PR, please move it to a separate discussion. I'm not sure this export even achieves anything

Comment on lines +18 to +20
const formatNpmrc = (
...npmrcs: (string | undefined | null)[]
): string | undefined => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid nesting of functions

import { newlineRegex } from '../../../../../util/regex';
import type { ExtractConfig } from '../../../types';

export async function readNpmrc(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do this refactor in a separate PR

@rarkins rarkins added the auto:close-inactive-pr Inactive PR should be closed label May 21, 2025
Copy link
Contributor

Hi there,

We're closing this PR due to inactivity, but we are happy for you, or others, to finish the PR if time allows.

Thanks, the Renovate team

@github-actions github-actions bot closed this May 21, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto:close-inactive-pr Inactive PR should be closed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants