ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.Npm.Metadata

Description

npm's part of a metadata read, which Ecluse.Core.Registry.Metadata.Fetch drives. Both reads fetch the full packument because publish-age rules need its time map. Selective reads materialise only the requested version and timestamp. A version read pairs the typed projection with the selected version object, which the mirror write republishes.

Synopsis

What the read driver runs

npmReadWith :: (Int -> IO ()) -> EcosystemRead Source #

What the read driver needs to read a packument, with the full read's absolute workspace payer.

prepareNpmRead :: PrepareRead Source #

Bind the selected origin's full-read workspace, which pays the per-entry floor.

The memory budget

npmChargeFactors :: ChargeFactors Source #

Per-byte charges from the corpus read, retained-entry and output measurements in docs/testing.md.

Walking a packument

npmPackumentWalk :: Limits -> PackageName -> PackumentRead -> InternTable -> Cursor -> Step (Walked TreeRead) Source #

The production packument walk into aeson's tree over a caller's intern table.

type NpmFullRead = Walked PackedRead Source #

What a full read finishes with: the read's table, and its typed facts and packed releases.

npmFullWalk :: PrimVar st Int -> VersionWriter st -> Limits -> PackageName -> InternTable -> Cursor -> ST st (Steps (ST st) NpmFullRead) Source #

Pack retained releases and collect direct typed facts over the caller's table, publishing the floors its retained entries owe.

npmFullTable :: Text -> PackageName -> InternTable -> ST st (InternTable, VersionWriter st) Source #

Seed the source author pointer and observe policy facts beside the packed writer.

Pure projection

projectNpmStream :: Limits -> PackageName -> Text -> StreamResult (Walked TreeRead) -> Either MetadataError (PackageInfo, Value) Source #

Finish a streamed source, keeping its typed error classification.

projectNpmPacked :: Limits -> PackageName -> Text -> StreamResult NpmFullRead -> Either MetadataError (PackageInfo, PackedPackument) Source #

Finish a full read over its sealed table, keeping its typed error classification.

selectNpmRead :: Version -> Int -> (PackageInfo, Value) -> VersionRead Source #

Pair one release with its compact source object and the same document's latest tag.

selectNpmVersionDoc :: Version -> CachedDoc -> Maybe CachedDoc Source #

Select the object paired with a warm full projection under the same rendered version key.