syncpack icon indicating copy to clipboard operation
syncpack copied to clipboard

feat(update): support custom npm registries

Open maksnester opened this issue 1 year ago • 2 comments

Description

In my .npmrc file I have custom npm registries for some scoped packages like

@foo:registry=https://gitlab.com/api/v4/projects/000000/packages/npm/
//gitlab.com/api/v4/projects/000000/packages/npm/:_authToken=000000

@bar:registry=https://gitlab.com/api/v4/projects/111111112/packages/npm/
//gitlab.com/api/v4/projects/111111112/packages/npm/:_authToken=111111112

Suggested Solution

It would be nice if the update command

syncpack update --filter '@foo' 

Could respect the custom registries as currently it doesn't show any available updates.

As a reference, the NCU tool currently supports it, but would be nice to do this with Syncpack to avoid using one more tool. It looks like this there:

ncu -ws -f "@foo/*"

maksnester avatar May 29 '24 14:05 maksnester

I came across this too, my package uses a private registry at the moment and I was hoping the general registry setting in .npmrc would let me use the private one.

rockshandy avatar Sep 22 '24 19:09 rockshandy

In corporate environments, it highly likely that you cannot reach registry.npmjs.org directly and will be required to use an internal mirror. Sadly, syncpack doesn't seem to honor the npm config registry value and always requests packages from registry.npmjs.org.

Just looking at the code, it seems this the only place where the registry URL is hard-coded: https://github.com/JamieMason/syncpack/blob/8ddc2986841c6626a6320ffc501b93e0d57cbf84/src/bin-update/effects.ts#L143

damnhandy avatar Nov 11 '24 15:11 damnhandy