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§
- Package
Context - Everything a backend’s
packagehook needs beyond theApiandBindingModelit already receives. - Packaged
File - One file in a packaged artifact: where to write it and what it contains.
Enums§
- File
Content - 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::Textverbatim, and copy everyFileContent::Copynative binary into place.