Skip to main content

Crate gen_adapter_forge

Crate gen_adapter_forge 

Source
Expand description

gen-adapter-forge — typed declarative spec for gen adapters.

Every existing adapter (gen-cargo / gen-npm / gen-bundler) has the same shape:

  • one or more manifest markers (Cargo.toml, package.json, …)
  • zero or more lockfile markers (Cargo.lock, pnpm-lock.yaml, …)
  • a registry (CratesIo / Npm / RubyGems / …)
  • a constraint syntax family (semver-caret-default / semver-exact-default / bundler-pessimistic / …)
  • dependency table names (dependencies / devDependencies / …)
  • target-predicate shape (cargo cfg / npm engines+os / bundler platforms / pep-508 markers / none)
  • workspace shape (members / workspaces array / single-package)

A typed AdapterSpec captures all of this. The forge component generates the boilerplate scaffold (lib.rs + error.rs + raw.rs + tests) from one spec; the adapter author only writes the format- specific parsing logic — typically <100 LOC.

Structs§

AdapterSpec
Typed declarative adapter spec. One value of this struct generates a complete adapter scaffold. Authoring-side equivalent of the (defadapter …) Lisp form (M5+).
ScaffoldOutput
Forge output — the rendered scaffold ready to drop in a new crates/gen-<name>/ directory.

Enums§

ConstraintFamily
LockfileFormat
ManifestFormat
TargetPredicateShape
WorkspaceShape

Functions§

bundler_spec
cargo_spec
The cargo adapter as a typed spec — what gen-cargo would have been authored as if AdapterSpec existed before it.
forge
Forge a fresh adapter scaffold from a typed spec. Produces a directory’s worth of starter files:
npm_spec