Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-pkg

Source of release 0.6.2

0.6.2 / src / pkg.lucb

## Package definitions and versions for Luce: the `pkg` export.
import semver
import package
from luce_crypto import native as crypto_native

pub let invalid = semver.invalid
pub type Version = semver.Version
pub type Definition = package.Definition
pub type Requirement = package.Requirement
pub type Task = package.Task
pub type Application = package.Application
pub type Native = package.Native

## Decode an authored package.prisma; see docs/PACKAGE_PRISMA.md.
pub func decode_package(text: const u8[]) -> Definition!:
    return try package.decode(text)

## Numeric major.minor.patch.
pub func parse_version(text: str) -> Version!:
    return try semver.parse(text)

## SHA-256 of release bytes, the digest luc.lock records and the registry lists.
pub func source_digest(input: const u8[], output: u8[]) -> usize!:
    return try crypto_native.digest(input, output, "sha256")