-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: support .npmrc for custom repo detection in bun projects #34322
base: main
Are you sure you want to change the base?
Conversation
@@ -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'; |
There was a problem hiding this comment.
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
const formatNpmrc = ( | ||
...npmrcs: (string | undefined | null)[] | ||
): string | undefined => { |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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
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])
How I've tested my work (please select one)
I have verified these changes via: