packages

package
v0.3.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package packages generates target package-manager manifests from trbconfig.jsonc. The config is the source of truth.

Index

Constants

View Source
const (
	TypeRBLockName = "trb.lock"
)
View Source
const TypeRBManifestName = "trbpackage.json"

Variables

This section is empty.

Functions

func EqualManifest

func EqualManifest(path string, expected []byte) (bool, error)

EqualManifest is used by checks without modifying a project.

func Install

func Install(config *project.Config, stdin io.Reader, stdout, stderr io.Writer) error

func InstallWithDependencies added in v0.2.0

func InstallWithDependencies(config *project.Config, packageDependencies map[string]string, stdin io.Reader, stdout, stderr io.Writer) error

func Sync

func Sync(config *project.Config) (string, error)

func SyncWithDependencies added in v0.2.0

func SyncWithDependencies(config *project.Config, packageDependencies map[string]string) (string, error)

SyncWithDependencies adds target dependencies required by imported TypeRB packages without copying those implementation details into trbconfig.jsonc.

func TypeRBLockPath added in v0.2.3

func TypeRBLockPath(config *project.Config) string

func WriteTypeRBLock added in v0.2.3

func WriteTypeRBLock(path string, lock *TypeRBLock) error

Types

type NativeTypeProvider added in v0.2.3

type NativeTypeProvider struct {
	Package      string
	Path         string
	Dependencies map[string]string
}

type TypeRBLock added in v0.2.3

type TypeRBLock struct {
	FormatVersion  int                            `json:"formatVersion"`
	ConfigChecksum string                         `json:"configChecksum"`
	Imports        map[string]string              `json:"imports"`
	Packages       map[string]TypeRBLockedPackage `json:"packages"`
}

func ReadTypeRBLock added in v0.2.3

func ReadTypeRBLock(path string) (*TypeRBLock, error)

func (*TypeRBLock) Validate added in v0.2.3

func (l *TypeRBLock) Validate() error

type TypeRBLockedPackage added in v0.2.3

type TypeRBLockedPackage struct {
	Version          string            `json:"version"`
	Source           string            `json:"source,omitempty"`
	Revision         string            `json:"revision,omitempty"`
	Checksum         string            `json:"checksum,omitempty"`
	Path             string            `json:"path,omitempty"`
	ManifestChecksum string            `json:"manifestChecksum,omitempty"`
	Dependencies     map[string]string `json:"dependencies,omitempty"`
}

type TypeRBManifest added in v0.2.3

type TypeRBManifest struct {
	FormatVersion       int                                   `json:"formatVersion"`
	Name                string                                `json:"name"`
	Version             string                                `json:"version"`
	SourceDir           string                                `json:"sourceDir,omitempty"`
	Modes               []string                              `json:"modes,omitempty"`
	Packages            map[string]project.PackageRequirement `json:"packages,omitempty"`
	NativeDependencies  map[string]map[string]string          `json:"nativeDependencies,omitempty"`
	NativeTypeProviders map[string]string                     `json:"nativeTypeProviders,omitempty"`
	CompilerExtension   json.RawMessage                       `json:"compilerExtension,omitempty"`
}

TypeRBManifest is the portable, repository-owned description of an external TypeRB package. Compiler extensions are recorded at this boundary but are deliberately rejected until the sandboxed extension protocol is available.

func ReadTypeRBManifest added in v0.2.3

func ReadTypeRBManifest(root string) (*TypeRBManifest, error)

func (*TypeRBManifest) NativeDependenciesFor added in v0.2.3

func (m *TypeRBManifest) NativeDependenciesFor(mode string) map[string]string

func (*TypeRBManifest) NativeTypeProviderFor added in v0.2.3

func (m *TypeRBManifest) NativeTypeProviderFor(mode string) string

func (*TypeRBManifest) Supports added in v0.2.3

func (m *TypeRBManifest) Supports(mode string) bool

func (*TypeRBManifest) Validate added in v0.2.3

func (m *TypeRBManifest) Validate(root string) error

type TypeRBPackages added in v0.2.3

type TypeRBPackages struct {
	Lock                *TypeRBLock
	Aliases             map[string]string
	Packages            []TypeRBResolvedPackage
	NativeDependencies  map[string]string
	NativeTypeProviders []NativeTypeProvider
}

func LoadTypeRBPackages added in v0.2.3

func LoadTypeRBPackages(config *project.Config) (*TypeRBPackages, error)

LoadTypeRBPackages reads installed packages without changing the lock or contacting a package source. Build, check, run, and REPL use this boundary.

func ResolveTypeRBPackages added in v0.2.3

func ResolveTypeRBPackages(config *project.Config, options TypeRBResolveOptions) (*TypeRBPackages, error)

ResolveTypeRBPackages creates or reuses the deterministic project lock and ensures every remote package is present in the content-addressed cache.

type TypeRBResolveOptions added in v0.2.3

type TypeRBResolveOptions struct {
	Frozen  bool
	Offline bool
	Update  bool
}

type TypeRBResolvedPackage added in v0.2.3

type TypeRBResolvedPackage struct {
	Name     string
	Root     string
	Manifest *TypeRBManifest
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL