build

package
v0.1.5-0...-b5400da Latest Latest
Warning

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

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

Documentation

Overview

Package build provides the SDK bundle used by the server's hermetic in-process build backend.

Package build owns author-side local application builds. The server receives the resulting typed artifact through the clean /api/v1 deployment surface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackSource

func PackSource(projectRoot string) ([]byte, error)

PackSource returns a deterministic archive of the files that identify an app. It is used by the author CLI to record the deploy source digest.

func SourceDigest

func SourceDigest(source []byte) string

SourceDigest returns the SHA-256 content address of a packed source archive.

Types

type Artifact

type Artifact struct {
	WASM []byte
}

Artifact is the locally built WebAssembly module.

type Builder

type Builder interface {
	Build(context.Context, Project) (Artifact, error)
}

Builder compiles a project to wasip1/wasm.

type Bundle

type Bundle struct {
	WorkspaceModules []string
	GoProxy          string
	// contains filtered or unexported fields
}

Bundle is a materialized copy of the embedded build dependencies. Call Cleanup after the build backend has stopped using WorkspaceModules.

func Extract

func Extract() (*Bundle, error)

Extract materializes the embedded modules and offline module proxy into a private temporary directory. Go requires workspace modules to exist on disk, so the archive cannot be consumed directly from embed.FS.

func (*Bundle) Cleanup

func (b *Bundle) Cleanup() error

Cleanup removes the materialized build dependencies.

type LocalBuilder

type LocalBuilder struct {
	GoBin         string
	WorkspaceRoot string
}

LocalBuilder invokes the local Go toolchain. WorkspaceRoot may point at a Plumtree checkout so development builds resolve the checkout SDK.

func (LocalBuilder) Build

func (b LocalBuilder) Build(ctx context.Context, project Project) (Artifact, error)

Build compiles project.Root/app and returns the resulting WASM bytes.

type Project

type Project struct {
	Root string
}

Project identifies an app source tree.

Directories

Path Synopsis
cmd
generate command

Jump to

Keyboard shortcuts

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