Skip to content

Commit

Permalink
Namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejressel committed Dec 21, 2024
1 parent 1db4ccf commit f0dacb0
Showing 1 changed file with 0 additions and 65 deletions.
65 changes: 0 additions & 65 deletions pulumi_wasm_generator_lib/src/output/rust/source_code_types_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,71 +3,6 @@ use convert_case::{Case, Casing};
use rinja::Template;
use std::collections::BTreeMap;

// static TEMPLATE: &str = include_str!("types_mod.rs.handlebars");

// #[derive(Template)] // this will generate the code...
// #[template(path = "hello.html")] // using the template in this path, relative
// // to the `templates` dir in the crate root
// struct HelloTemplate<'a> { // the name of the struct can be anything
// name: &'a str, // the field name should match the variable name
// // in your template
// }
//
// #[derive(Serialize)]
// struct RefType {
// file_name: String,
// }
//
// #[derive(Serialize)]
// struct AliasType {
// name: String,
// type_: String,
// }
//
// #[derive(Serialize)]
// struct Package {
// types: Vec<RefType>,
// }
//
// fn convert_model(package: &crate::model::Package) -> Package {
// let mut real_types = Vec::new();
//
// package
// .types
// .iter()
// .for_each(|(element_id, resource)| match resource {
// GlobalType::Object(_, _) => {
// let ref_type = RefType {
// file_name: element_id.get_rust_struct_name().to_case(Case::Snake),
// };
// real_types.push(ref_type);
// }
// GlobalType::StringEnum(_, _)
// | GlobalType::IntegerEnum(_, _)
// | GlobalType::NumberEnum(_, _) => {
// let ref_type = RefType {
// file_name: element_id.get_rust_struct_name().to_case(Case::Snake),
// };
// real_types.push(ref_type);
// }
// });
//
// Package { types: real_types }
// }
//
// pub(crate) fn generate_source_code(package: &crate::model::Package) -> String {
// let package = convert_model(package);
//
// let content = {
// let handlebars = Handlebars::new();
// handlebars
// .render_template(TEMPLATE, &json!({"package": &package}))
// .unwrap()
// };
//
// content
// }

#[derive(Template)]
#[template(path = "types_mod.rs.jinja")]
struct TemplateModel {
Expand Down

0 comments on commit f0dacb0

Please sign in to comment.