# Packages

> What branchd stores beside a repository's code, on one host. Container images, generic packages (any file, by package and version) and npm packages.
Every repository on branchd can hold packages beside its code. They are all
served from one host, `registry.branchd.run`, and a repository's packages
follow one set of access rules.

| Kind                                          | What it holds                                                             | Where                                                                          |
| --------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| Container images                              | Images and Helm charts, pushed and pulled with Docker                     | `registry.branchd.run/<repository>`                                            |
| [Generic packages](https://docs.branchd.run/branchd/packages/generic) | Any files, grouped by package and version, each with its size and SHA-256 | `https://registry.branchd.run/generic/<repository>/<package>/<version>/<file>` |
| [npm packages](https://docs.branchd.run/branchd/packages/npm)         | Scoped npm packages (`@scope/name`), for npm and pnpm                     | `https://registry.branchd.run/npm/`                                            |

A package always **belongs to one repository**. There are no packages owned
by a group or by branchd as a whole. Who may read, publish and delete a
package is decided by its repository: see [Access](https://docs.branchd.run/branchd/packages/access).

- [Generic packages](https://docs.branchd.run/branchd/packages/generic): Publish and download files with curl, the CLI or a pipeline step. Aliases such as latest, and retention.
- [npm packages](https://docs.branchd.run/branchd/packages/npm): Claim a scope, grant who may install and publish under it, and publish with npm or pnpm from your machine or a pipeline.
- [Access](https://docs.branchd.run/branchd/packages/access): Scopes, tokens, public packages and anonymous reads, and CI grants for another repository's jobs.

## In the console

A repository's packages are under **Releases**: the Releases page has an
**Images** button and a **Packages** button, and the two pages link to each
other. The Packages page lists the repository's generic packages, and the
npm packages its pipelines have published. Open a generic package to see its
versions, files and checksums, copy the commands to download it, and (with
the access to do so) move an alias or delete a version.

An npm package belongs to its scope, so its page is on the group that holds
the scope: versions, dist-tags, where each version was published from, and
who may install and publish it.

- **Retention** for generic packages is on the repository's
  **Settings › Releases and registry** tab.
- **npm scopes** are on a group's **Settings › General** tab. Each opens
  its own page: its packages, and the pipelines and people who may install
  and publish under it.

## Limits

| Limit                                          | Value                                                                                |
| ---------------------------------------------- | ------------------------------------------------------------------------------------ |
| One generic package file                       | 5 GiB                                                                                |
| A generic package, version, alias or file name | 200 characters: letters, digits and `.` `_` `+` `-`, starting with a letter or digit |
| One npm tarball                                | 32 MiB                                                                               |
| An npm package name, with its scope            | 214 characters                                                                       |
| An npm scope                                   | 100 characters                                                                       |

Reads with no credential, where a repository's packages are public, are rate
limited by client address.

## What is not supported

- **Overwriting.** A published generic file and a published npm version are
  never replaced. Publish a new version.
- **Unscoped npm names.** Every npm package is `@scope/name`.
- **npm search, `npm audit`, provenance and web login** (`npm login`). Use a
  token in `.npmrc`.
- **Packages owned by a group**, or a registry URL per group. A scope
  belongs to a group; each package under it belongs to a repository.
- **Other package formats** (PyPI, Maven, NuGet and so on). Use a generic
  package for their files. Go modules are served from the repository itself
  and need no package.

Source: https://docs.branchd.run/branchd/packages
