@hyperfrontend/versioning/registry/modelsmodels
Registry data models: registries themselves, package metadata, version metadata, and maintainer records.
Registry and RegistryConfig describe a configured registry endpoint (URL, scope, auth headers) used by the registry clients. PackageInfo (built via createPackageInfo) carries package-level metadata: name, dist-tags, versions list. VersionInfo (built via createVersionInfo) carries per-version metadata: version string, dependency declarations, dist (tarball + integrity), and Maintainer[]. The factories produce normalized objects regardless of the registry's exact payload shape so downstream code can rely on a single model.
API Reference§
ƒ Functions
Creates a new PackageInfo object.
Parameters
| Name | Type | Description |
|---|---|---|
§options | CreatePackageInfoOptions | Configuration for the package info |
Returns
PackageInfoA new PackageInfo object
Example
Creating package info from registry data
const info = createPackageInfo({
name: '@scope/my-package',
latestVersion: '2.0.0',
versions: ['1.0.0', '1.1.0', '2.0.0'],
license: 'MIT'
})Creates a new VersionInfo object.
Parameters
| Name | Type | Description |
|---|---|---|
§options | CreateVersionInfoOptions | Configuration for the release info |
Returns
VersionInfoA new VersionInfo object
Example
Creating version info from registry data
const release = createVersionInfo({
version: '1.2.3',
publishedAt: '2024-01-15T10:30:00Z',
tarball: 'https://registry.npmjs.org/pkg/-/pkg-1.2.3.tgz'
})◈ Interfaces
Maintainer information.
Package information from a registry.
Properties
Abstract interface for package registries.
Registry configuration options.
Properties
Version-specific information from a registry.
Properties
§
readonly gitHead?:stringGit commit hash at publish time. Used to determine commit range for changelog generation.
NOTE: This value comes from npm registry, making it immutable and independent of local git state.
NOTE: This value comes from npm registry, making it immutable and independent of local git state.
◆ Types
Why a registry could not answer a lookup.
Every value here means the answer is unknown, never that the package or version is absent. An absent package is a successful lookup with a negative answer, and is reported through the normal return value instead.
Every value here means the answer is unknown, never that the package or version is absent. An absent package is a successful lookup with a negative answer, and is reported through the normal return value instead.
type RegistryFailureReason = "network" | "authentication" | "rate-limit" | "server" | "timeout" | "unknown"● Variables
Name carried by every error this module raises, used to identify it across module boundaries.