How paketo-buildpacks/libpak works
Project type and purpose
• Type: Go library (module) intended to be imported by Paketo buildpacks.
• Purpose: Provide reusable functionality—detect/build/generate phases, dependency resolution, layer management, file operations, SBOM generation, logging—for Paketo-style buildpacks.
File structure
• Top-level API files:
– main.go (entry)
– detect.go (detect phase)
– build.go, generate.go (build + generate phases)
– resolve.go, buildmodule.go, buildpack_plan.go (supporting build-time logic)
• Core packages:
– bindings/ : bind environment/platform info
– dependency* : resolve and cache external dependencies
– crush/ : extract/compress archives
– effect/ : wrap OS process execution
– sbom/ : generate Software Bill of Materials
– sherpa/ : filesystem ops (copy, exists, env var)
– log/ : structured logging
– utils/ : TOML writers, exit handlers, entry & environment writers
• Tests and mocks confirm module responsibilities.
README for additional insights
• README confirms: “Go library with useful functionality for building Paketo-style buildpacks.”