Providers
A provider is a registry adapter that tells upgrade() (and the
UpgradeCommand) which
versions exist and where to download them. upgrade() takes a single provider.
The UpgradeCommand also accepts an array: the first one is the default, the
others are selectable with --registry.
Available providers
| Provider | Source | Script | Binary |
|---|---|---|---|
JsrProvider | jsr package | yes | no |
NpmProvider | npm package | yes | no |
DenoLandProvider | deno.land/x | yes | no |
NestLandProvider | nest.land | yes | no |
GithubProvider | github repository | yes | yes |
GitlabProvider | gitlab repository | yes | yes |
UrlProvider | any url | Deno only | yes |
Providers group by where the cli is distributed:
- Package registries: jsr and npm.
- CDNs: deno.land and nest.land.
- Git repositories: github and gitlab.
- Custom url: url.
The GithubProvider, GitlabProvider and UrlProvider can upgrade standalone
executables by downloading a release asset. The shared configuration for that is
described under binary upgrade.
Package name
The package name defaults to the cli name for the jsr,
npm, deno.land and nest.land
providers. Override it with the name option, or set the full package name on
the jsr and npm providers.
The github and gitlab providers locate the source
with the repository option instead, and url builds the url itself.
The cli name is still what the upgraded cli is installed as, and what the binary
inside a release archive is expected to be called. See
binary upgrade to override the latter.
iNOTE
@cliffy/command/upgradere-exports the jsr, npm, deno.land, nest.land and github providers, but those re-exports are deprecated and will be removed in 2.0. Import providers from@cliffy/upgrade/provider/*instead. The gitlab and url providers are only available there.