Skip to main content

crossplane_forge/
lib.rs

1//! Crossplane CRD generator from `IaC` forge IR.
2//!
3//! Implements [`iac_forge::Backend`] to produce Kubernetes
4//! `CustomResourceDefinition` YAML from the `iac-forge` intermediate
5//! representation. Each [`IacResource`](iac_forge::ir::IacResource) becomes a
6//! namespaced CRD with `forProvider` (input) and `atProvider` (output) specs,
7//! plus standard Crossplane conditions and printer columns.
8
9/// Backend trait implementation and naming convention.
10pub mod backend;
11/// Schema-driven body-field signatures pulled from the OpenAPI spec.
12/// Drives M6.4 — `build_request_body` consults this to skip pushes
13/// where the IacAttribute disagrees with the SDK body's field shape.
14pub mod body_signatures;
15/// Crossplane controller Go-code emitter (per-resource ExternalClient impl).
16pub mod controller_gen;
17/// CRD YAML generation helpers.
18pub mod crd;
19/// Per-package deepcopy emitter (`zz_generated_deepcopy.go`).
20pub mod deepcopy_gen;
21/// Per-Kind `managed.Resource` interface methods emitter
22/// (`zz_generated_managed.go`).
23pub mod managed_methods_gen;
24/// Typed errors for CRD generation.
25pub mod error;
26/// The Go **macro-farm** surface — typed, serde-serializable Go-codegen
27/// specs ([`go_spec::GoSpec`]) that lower to [`go_synthesizer::GoFile`]
28/// and render through [`go_synthesizer::print_file`]. The Go analog of
29/// `tatara-rust-ast`'s `*DeriveSpec` family.
30pub mod go_spec;
31/// Provider-runtime scaffold emitter (ProviderConfig types, main.go,
32/// setup.go, go.mod, Helm chart files).
33pub mod provider_gen;
34/// Crossplane managed-resource Go-types emitter.
35pub mod types_gen;
36
37pub use backend::CrossplaneBackend;
38pub use controller_gen::{ControllerConfig, render_controller};
39pub use error::CrdError;
40pub use go_spec::{
41    GoFieldSpec, GoFuncBodySpec, GoFuncSpec, GoImportSpec, GoItemSpec, GoMarkerSpec, GoParamSpec,
42    GoSpec, GoStructSpec, GoTagSpec, GoTypeSpec,
43};
44pub use provider_gen::{
45    render_go_mod, render_helm_chart_yaml, render_helm_deployment_template, render_helm_rbac_template,
46    render_helm_values_yaml, render_main_go, render_provider_config_types,
47    render_provider_groupversion_info, render_setup_go,
48};
49pub use types_gen::{render_groupversion_info, render_resource_types};