diff --git a/lib/crates/fabro-dev/src/commands/docs.rs b/lib/crates/fabro-dev/src/commands/docs.rs index e5aa1af4b..b0f9eeb37 100644 --- a/lib/crates/fabro-dev/src/commands/docs.rs +++ b/lib/crates/fabro-dev/src/commands/docs.rs @@ -3,8 +3,8 @@ use std::path::{Path, PathBuf}; use anyhow::Result; use clap::{Args, Subcommand}; -use super::generate_cli_reference::generate_cli_reference_root; -use super::generate_options_reference::generate_options_reference_root; +use super::docs_cli_reference::docs_cli_reference_root; +use super::docs_options_reference::docs_options_reference_root; use super::workspace_root; #[derive(Debug, Args)] @@ -37,13 +37,13 @@ pub(crate) fn docs(args: DocsArgs) -> Result<()> { } fn refresh_docs(root: &Path) -> Result<()> { - generate_cli_reference_root(root, false)?; - generate_options_reference_root(root, false) + docs_cli_reference_root(root, false)?; + docs_options_reference_root(root, false) } fn check_docs(root: &Path) -> Result<()> { - generate_cli_reference_root(root, true)?; - generate_options_reference_root(root, true) + docs_cli_reference_root(root, true)?; + docs_options_reference_root(root, true) } #[expect( diff --git a/lib/crates/fabro-dev/src/commands/generate_cli_reference.rs b/lib/crates/fabro-dev/src/commands/docs_cli_reference.rs similarity index 98% rename from lib/crates/fabro-dev/src/commands/generate_cli_reference.rs rename to lib/crates/fabro-dev/src/commands/docs_cli_reference.rs index dbf694c9b..0d8715443 100644 --- a/lib/crates/fabro-dev/src/commands/generate_cli_reference.rs +++ b/lib/crates/fabro-dev/src/commands/docs_cli_reference.rs @@ -15,7 +15,7 @@ const FENCE_END: &str = ""; clippy::disallowed_methods, reason = "dev generator reports the generated docs path directly and intentionally uses sync filesystem I/O" )] -pub(crate) fn generate_cli_reference_root(root: &Path, check: bool) -> Result<()> { +pub(crate) fn docs_cli_reference_root(root: &Path, check: bool) -> Result<()> { let path = root.join(CLI_REFERENCE_PATH); let current = std::fs::read_to_string(&path).with_context(|| format!("reading {}", path.display()))?; diff --git a/lib/crates/fabro-dev/src/commands/generate_options_reference.rs b/lib/crates/fabro-dev/src/commands/docs_options_reference.rs similarity index 98% rename from lib/crates/fabro-dev/src/commands/generate_options_reference.rs rename to lib/crates/fabro-dev/src/commands/docs_options_reference.rs index f0ab12a62..46aa0e9f2 100644 --- a/lib/crates/fabro-dev/src/commands/generate_options_reference.rs +++ b/lib/crates/fabro-dev/src/commands/docs_options_reference.rs @@ -15,7 +15,7 @@ const FENCE_END: &str = ""; clippy::disallowed_methods, reason = "dev generator reports the generated docs path directly and intentionally uses sync filesystem I/O" )] -pub(crate) fn generate_options_reference_root(root: &Path, check: bool) -> Result<()> { +pub(crate) fn docs_options_reference_root(root: &Path, check: bool) -> Result<()> { let path = root.join(OPTIONS_REFERENCE_PATH); let current = std::fs::read_to_string(&path).with_context(|| format!("reading {}", path.display()))?; diff --git a/lib/crates/fabro-dev/src/commands/mod.rs b/lib/crates/fabro-dev/src/commands/mod.rs index 9a44b07ac..82999cd3c 100644 --- a/lib/crates/fabro-dev/src/commands/mod.rs +++ b/lib/crates/fabro-dev/src/commands/mod.rs @@ -1,11 +1,11 @@ -mod check_spa_budgets; mod docker_build; mod docs; -mod generate_cli_reference; -mod generate_options_reference; -mod refresh_spa; +mod docs_cli_reference; +mod docs_options_reference; mod release; mod spa; +mod spa_check; +mod spa_refresh; use std::path::{Path, PathBuf}; use std::process::{Command, Output}; diff --git a/lib/crates/fabro-dev/src/commands/spa.rs b/lib/crates/fabro-dev/src/commands/spa.rs index 7be521b09..46a86fd7c 100644 --- a/lib/crates/fabro-dev/src/commands/spa.rs +++ b/lib/crates/fabro-dev/src/commands/spa.rs @@ -1,8 +1,8 @@ use anyhow::Result; use clap::{Args, Subcommand}; -use super::check_spa_budgets::{CheckSpaBudgetsArgs, check_spa_budgets}; -use super::refresh_spa::{RefreshSpaArgs, refresh_spa}; +use super::spa_check::{SpaCheckArgs, spa_check}; +use super::spa_refresh::{SpaRefreshArgs, spa_refresh}; #[derive(Debug, Args)] pub(crate) struct SpaArgs { @@ -13,15 +13,15 @@ pub(crate) struct SpaArgs { #[derive(Debug, Subcommand)] enum SpaCommand { /// Rebuild and refresh the embedded Fabro web SPA bundle. - Refresh(RefreshSpaArgs), + Refresh(SpaRefreshArgs), /// Verify embedded Fabro web SPA assets are current and within budget. - Check(CheckSpaBudgetsArgs), + Check(SpaCheckArgs), } pub(crate) fn spa(args: SpaArgs) -> Result<()> { match args.command { - Some(SpaCommand::Refresh(args)) => refresh_spa(args), - Some(SpaCommand::Check(args)) => check_spa_budgets(args), + Some(SpaCommand::Refresh(args)) => spa_refresh(args), + Some(SpaCommand::Check(args)) => spa_check(args), None => print_spa_help(), } } diff --git a/lib/crates/fabro-dev/src/commands/check_spa_budgets.rs b/lib/crates/fabro-dev/src/commands/spa_check.rs similarity index 97% rename from lib/crates/fabro-dev/src/commands/check_spa_budgets.rs rename to lib/crates/fabro-dev/src/commands/spa_check.rs index 9184e863f..e9ee1f190 100644 --- a/lib/crates/fabro-dev/src/commands/check_spa_budgets.rs +++ b/lib/crates/fabro-dev/src/commands/spa_check.rs @@ -6,14 +6,14 @@ use anyhow::{Context, Result, bail}; use clap::Args; use walkdir::WalkDir; -use super::refresh_spa::{TempDir, mirror_dist, run_bun_build}; +use super::spa_refresh::{TempDir, mirror_dist, run_bun_build}; use super::workspace_root; const DEFAULT_ASSET_BUDGET_BYTES: u64 = 15 * 1024 * 1024; const DEFAULT_PAYLOAD_BUDGET_BYTES: u64 = 5 * 1024 * 1024; #[derive(Debug, Args)] -pub(crate) struct CheckSpaBudgetsArgs { +pub(crate) struct SpaCheckArgs { /// Repository root containing lib/crates/fabro-spa/assets. #[arg(long, hide = true)] root: Option, @@ -32,7 +32,7 @@ pub(crate) struct CheckSpaBudgetsArgs { clippy::print_stdout, reason = "dev spa check command reports measured budgets directly" )] -pub(crate) fn check_spa_budgets(args: CheckSpaBudgetsArgs) -> Result<()> { +pub(crate) fn spa_check(args: SpaCheckArgs) -> Result<()> { let root = args.root.unwrap_or_else(workspace_root); let web_dir = root.join("apps/fabro-web"); let dist_dir = web_dir.join("dist"); diff --git a/lib/crates/fabro-dev/src/commands/refresh_spa.rs b/lib/crates/fabro-dev/src/commands/spa_refresh.rs similarity index 96% rename from lib/crates/fabro-dev/src/commands/refresh_spa.rs rename to lib/crates/fabro-dev/src/commands/spa_refresh.rs index 899fe4b36..6a7758f42 100644 --- a/lib/crates/fabro-dev/src/commands/refresh_spa.rs +++ b/lib/crates/fabro-dev/src/commands/spa_refresh.rs @@ -5,14 +5,14 @@ use anyhow::{Context, Result, bail}; use clap::Args; use walkdir::WalkDir; -use super::check_spa_budgets::check_spa_asset_budgets; +use super::spa_check::check_spa_asset_budgets; use super::workspace_root; const DEFAULT_ASSET_BUDGET_BYTES: u64 = 15 * 1024 * 1024; const DEFAULT_PAYLOAD_BUDGET_BYTES: u64 = 5 * 1024 * 1024; #[derive(Debug, Args)] -pub(crate) struct RefreshSpaArgs { +pub(crate) struct SpaRefreshArgs { /// Repository root containing apps/fabro-web and lib/crates/fabro-spa. #[arg(long, hide = true)] root: Option, @@ -27,9 +27,9 @@ pub(crate) struct RefreshSpaArgs { pub(super) payload_budget_bytes: u64, } -pub(crate) fn refresh_spa(args: RefreshSpaArgs) -> Result<()> { +pub(crate) fn spa_refresh(args: SpaRefreshArgs) -> Result<()> { let root = args.root.unwrap_or_else(workspace_root); - refresh_spa_root( + spa_refresh_root( &root, args.skip_build, args.asset_budget_bytes, @@ -41,7 +41,7 @@ pub(crate) fn refresh_spa(args: RefreshSpaArgs) -> Result<()> { clippy::print_stdout, reason = "dev spa refresh command reports progress directly" )] -pub(super) fn refresh_spa_root( +pub(super) fn spa_refresh_root( root: &Path, skip_build: bool, asset_budget_bytes: u64,