Bundle versioned stdlib components with Forest CLI #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Forest already has stdlib-like components in
apps/forest/components, but installed releases do not ship them. Users must bootstrap/publish/update registry packages before local projects can use standard components like:forest/sdk— currently0.7.0forest/deployment— currently0.3.0forest-contrib/build-rust|build-go|build-docker— currently0.1.0Current release tarballs contain only the
forestbinary.scripts/install.shinstalls only that binary. Runtime resolution then depends on registry/CUE module availability.Grounded findings
forest.cueintoDependencyType::{Versioned, Local}inapps/forest/crates/forest/src/services/project.rs.ComponentsService::sync_componentsand fetched from registry into~/.cache/forest/components/<org>/<name>/<version>/.cue exportis delegated to the externalcuebinary and relies onCUE_REGISTRYor vendored files undercue.mod/pkg.components(name, organisation, version)plus per-version files/manifests/artifacts.apps/forest/components.forest updatecan resolvelatest/partial versions viaListComponentVersions, but normalforest runcurrently matches the version string declared inforest.cuedirectly.Recommended design
Add an embedded/packaged Stdlib Component Provider that is checked before registry.
Resolution order:
Introduce a versioned stdlib catalog, e.g.
The catalog should expose the same concepts as registry:
files,binary,deno,externalImplementation plan
Create stdlib catalog format
apps/forest/components/<org>/<name>”.Add
StdlibProviderlist_versions(org, name)get_component_version(org, name, version)get_manifest(org, name, version)materialize_files(org, name, version)materialize_binary(org, name, version, os, arch)ComponentsService::sync_components,ensure_versioned_dep_cached,forest add, andforest update.Materialize bundled components into existing cache
~/.cache/forest/components/<org>/<name>/<version>/..forest/component/meta.jsonforest.component.cuemarkerrelease prepare,forest run, Deno, templates, and command discovery mostly unchanged.Handle CUE stdlib imports offline
cue, ensure bundled stdlib CUE modules are vendored into:cue.mod/pkg/forest.sh/forest/sdk@v0/cue.mod/pkg/forest.sh/forest/deployment@v0/CUE_REGISTRYfallback for non-stdlib imports.Update packaging
.woodpecker/release-build.yamlbuilds onlyforestand tars only the binary.components/stdlibbeside the binary and install to a known data dir, orscripts/install.shandforest self updateto install/copy stdlib assets.Lockfile/source tracking
forest.lockwith a stdlib source, e.g.Acceptance criteria
forest.sh/forest/sdk@v0without a Forest registry.forest add forest-contrib/build-rustresolves bundled latest without registry.forest run buildworks from a clean machine after install, using bundledbuild-rust.forest updateresolves stdlib versions from local catalog before registry.Main risks
forest rundoes not appear to useforest.lockfor partial/latest resolution; this should be fixed or avoided for stdlib specs.