Skip to main content

Module package

Module package 

Source
Expand description

The packaging layer: the data a backend needs to assemble a distributable package, and the driver that materializes one to disk.

weaveffi generate emits binding source that a consumer must compile or point at a native library themselves. weaveffi package produces the next artifact up: a ready-to-publish package for an ecosystem (an npm tarball tree, a NuGet-ready project, a Python wheel tree, …) with a prebuilt native library bundled for each Platform so npm install / pip install / dotnet add package “just works” with no local toolchain.

A backend opts in by overriding LanguageBackend::package, returning the full set of PackagedFiles that make up the package. The write_package driver then writes the rendered text and copies the bundled binaries into place. Rendering stays pure (it returns values, it does no I/O), so package layouts are snapshot-testable exactly like generated source.

Structs§

PackageContext
Everything a backend’s package hook needs beyond the Api and BindingModel it already receives.
PackagedFile
One file in a packaged artifact: where to write it and what it contains.

Enums§

FileContent
The contents of one PackagedFile: either rendered text or a native binary to copy in from elsewhere on disk.

Functions§

summarize
Count the text files and bundled binaries in a rendered package, for the CLI’s end-of-run summary.
write_package
Write a rendered package to disk: create parent directories, write every FileContent::Text verbatim, and copy every FileContent::Copy native binary into place.