yeoman / update-notifier

Update notifications for your CLI app
BSD 2-Clause "Simplified" License
1.76k stars 132 forks source link

Private Git Repo instead of npm / private npm #186

Closed JoernBerkefeld closed 2 years ago

JoernBerkefeld commented 4 years ago

Hi team, is there a hidden option to do the version check based on a git repo url (and optionally branch/tag via hashtag) instead of in npm? If you have a private project depending on your environment you might not be able to use npm to distribute the package, especially in the enterprise world. I would be willing to adapt update-notifier myself but wanted to reach out first to check if I missed an already existing option ;-)

Thank you

UlisesGascon commented 4 years ago

Hi @JoernBerkefeld!

Not sure I understand the case, but if you need to run the dependencies in a different Package manager, like a private one you can always use .npmrc. see Documentation

Or use npm install --save [REPO_URL] for install a private fork using official npm client. thread about it

JoernBerkefeld commented 4 years ago

Hi @UlisesGascon ! Picture a situation in which you can only use your npm install [repo_url]. No private registry service, no enterprise npm account and no public listing possible either.

In that scenario, you can still use your git server, even a password protected one, to run npm install [repo_url] and afterwards npm update [package_name] to keep it updated. I still have to tell my users to get their tool updated and posting that on internal forums alone sometimes doesnt cut it. Hence what update-notifier does is actually quite perfect.

Problem: The version would need to be retrieved from the package.json in the repo rather than from the registry.

Since I havent yet understood how update-notifier grabs the current version for comparison yet, I can't foresee how much effort it might be to enable it to do this but I would still love to take up the challenge if needed.

JennieJi commented 4 years ago

Hi I have a similar issue. So my global env is using npm org, but my package is published in a private registry. So if I installed this private package in my global, then the notifier will not work at all since .npmrc will not be packed by npm(even if I add it to files), and notifier does not provide options of registry to check.

sindresorhus commented 2 years ago

https://github.com/yeoman/update-notifier/pull/190#issuecomment-1164348066