Documentation
¶
Overview ¶
Package packages generates target package-manager manifests from trbconfig.jsonc. The config is the source of truth.
Index ¶
- Constants
- func EqualManifest(path string, expected []byte) (bool, error)
- func Install(config *project.Config, stdin io.Reader, stdout, stderr io.Writer) error
- func InstallWithDependencies(config *project.Config, packageDependencies map[string]string, stdin io.Reader, ...) error
- func Sync(config *project.Config) (string, error)
- func SyncWithDependencies(config *project.Config, packageDependencies map[string]string) (string, error)
- func TypeRBLockPath(config *project.Config) string
- func WriteTypeRBLock(path string, lock *TypeRBLock) error
- type AdapterTest
- type DeclarationAdapter
- type TypeRBLock
- type TypeRBLockedPackage
- type TypeRBManifest
- type TypeRBPackages
- type TypeRBResolveOptions
- type TypeRBResolvedPackage
Constants ¶
const (
TypeRBLockName = "trb.lock"
)
const TypeRBManifestName = "trbpackage.json"
Variables ¶
This section is empty.
Functions ¶
func EqualManifest ¶
EqualManifest is used by checks without modifying a project.
func InstallWithDependencies ¶ added in v0.2.0
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 WriteTypeRBLock ¶ added in v0.2.3
func WriteTypeRBLock(path string, lock *TypeRBLock) error
Types ¶
type AdapterTest ¶ added in v0.3.16
AdapterTest declares one explicitly invoked conformance project for a package-owned declaration adapter. Command is an argv vector and is never interpreted by a shell.
type DeclarationAdapter ¶ added in v0.3.16
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"`
DeclarationAdapters map[string]string `json:"declarationAdapters,omitempty"`
AdapterTests map[string]AdapterTest `json:"adapterTests,omitempty"`
LegacyNativeTypeProviders 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) DeclarationAdapterFor ¶ added in v0.3.16
func (m *TypeRBManifest) DeclarationAdapterFor(mode string) string
func (*TypeRBManifest) NativeDependenciesFor ¶ added in v0.2.3
func (m *TypeRBManifest) NativeDependenciesFor(mode string) map[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
DeclarationAdapters []DeclarationAdapter
}
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 TypeRBResolvedPackage ¶ added in v0.2.3
type TypeRBResolvedPackage struct {
Name string
Root string
Manifest *TypeRBManifest
}