Skip to content

Commit

Permalink
restructure templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jondot committed Dec 6, 2024
1 parent e50eecf commit 40fca68
Show file tree
Hide file tree
Showing 21 changed files with 17 additions and 94 deletions.
33 changes: 15 additions & 18 deletions loco-gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,27 @@ mod scaffold;
mod testutil;
use std::{str::FromStr, sync::OnceLock};

const CONTROLLER_T: &str = include_str!("templates/controller.t");
const CONTROLLER_TEST_T: &str = include_str!("templates/request_test.t");
const MAILER_T: &str = include_str!("templates/mailer/mailer.t");
const MAILER_SUB_T: &str = include_str!("templates/mailer/subject.t");
const MAILER_TEXT_T: &str = include_str!("templates/mailer/text.t");
const MAILER_HTML_T: &str = include_str!("templates/mailer/html.t");

const MAILER_T: &str = include_str!("templates/mailer.t");
const MAILER_SUB_T: &str = include_str!("templates/mailer_sub.t");
const MAILER_TEXT_T: &str = include_str!("templates/mailer_text.t");
const MAILER_HTML_T: &str = include_str!("templates/mailer_html.t");
const MIGRATION_T: &str = include_str!("templates/migration/migration.t");

const MIGRATION_T: &str = include_str!("templates/migration.t");
const TASK_T: &str = include_str!("templates/task/task.t");
const TASK_TEST_T: &str = include_str!("templates/task/test.t");

const TASK_T: &str = include_str!("templates/task.t");
const TASK_TEST_T: &str = include_str!("templates/task_test.t");
const SCHEDULER_T: &str = include_str!("templates/scheduler/scheduler.t");

const SCHEDULER_T: &str = include_str!("templates/scheduler.t");

const WORKER_T: &str = include_str!("templates/worker.t");
const WORKER_TEST_T: &str = include_str!("templates/worker_test.t");
const WORKER_T: &str = include_str!("templates/worker/worker.t");
const WORKER_TEST_T: &str = include_str!("templates/worker/test.t");

// Deployment templates
const DEPLOYMENT_DOCKER_T: &str = include_str!("templates/deployment_docker.t");
const DEPLOYMENT_DOCKER_IGNORE_T: &str = include_str!("templates/deployment_docker_ignore.t");
const DEPLOYMENT_SHUTTLE_T: &str = include_str!("templates/deployment_shuttle.t");
const DEPLOYMENT_SHUTTLE_CONFIG_T: &str = include_str!("templates/deployment_shuttle_config.t");
const DEPLOYMENT_NGINX_T: &str = include_str!("templates/deployment_nginx.t");
const DEPLOYMENT_DOCKER_T: &str = include_str!("templates/deployment/docker/docker.t");
const DEPLOYMENT_DOCKER_IGNORE_T: &str = include_str!("templates/deployment/docker/ignore.t");
const DEPLOYMENT_SHUTTLE_T: &str = include_str!("templates/deployment/shuttle/shuttle.t");
const DEPLOYMENT_SHUTTLE_CONFIG_T: &str = include_str!("templates/deployment/shuttle/config.t");
const DEPLOYMENT_NGINX_T: &str = include_str!("templates/deployment/nginx/nginx.t");

const DEPLOYMENT_SHUTTLE_RUNTIME_VERSION: &str = "0.46.0";

Expand Down
4 changes: 2 additions & 2 deletions loco-gen/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use serde_json::json;
use super::{Error, Result};
use crate::get_mappings;

const MODEL_T: &str = include_str!("templates/model.t");
const MODEL_TEST_T: &str = include_str!("templates/model_test.t");
const MODEL_T: &str = include_str!("templates/model/model.t");
const MODEL_TEST_T: &str = include_str!("templates/model/test.t");

use super::{collect_messages, AppInfo};

Expand Down
35 changes: 0 additions & 35 deletions loco-gen/src/templates/controller.t

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 0 additions & 39 deletions loco-gen/src/templates/request_test.t

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 40fca68

Please sign in to comment.