AtomsPackageRepository

class AtomsPackageRepository(coordinates: GitHubRepositoryCoordinates = ATOMS_COORDINATES, fetcher: RemoteFetcher = DefaultRemoteFetcher, manifestParser: ManifestParser = TomlManifestParser) : PackageRepository

PackageRepository backed by a GitHub repository laid out as <name>/<version>/<files>, where every version directory is a package root and therefore holds its PackageManifest.FILE_NAME. Files under a name starting with PackageFile.INTERNAL_PREFIX (e.g. __tests) are repository-internal and skipped.

Each package directory is listed through the Git Trees API once per instance, on first use, so the cost grows with the packages a document uses rather than with the whole repository; files are then read from raw GitHub URLs. listPackages instead lists the whole repository in one request, since a catalog needs every package anyway, and reads one manifest per package: that of its latest version.

Parameters

coordinates

repository to read from

fetcher

strategy for network access, replaceable on platforms without synchronous networking

manifestParser

parser for atom.toml

Constructors

Link copied to clipboard
constructor(coordinates: GitHubRepositoryCoordinates = ATOMS_COORDINATES, fetcher: RemoteFetcher = DefaultRemoteFetcher, manifestParser: ManifestParser = TomlManifestParser)

Functions

Link copied to clipboard
open override fun getPackage(reference: PackageReference): RepositoryPackage?

Looks up the exact version of a package a reference points to.

Link copied to clipboard
open override fun listPackages(): Set<PackageManifest>

Lists every published package through the manifest of its latest version.

Link copied to clipboard