From a1f23fff32a15261679ad318fa4a1717bf6e2d0c Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Sun, 22 Nov 2026 20:24:04 -0600 Subject: [PATCH] =?UTF-8?q?refactor(start-axum):=20facade=20slimming=20?= =?UTF-8?q?=E2=80=94=20crate=20split=20step=203=20(#8969)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove src/shell.nix from the facade crate: a byte-identical duplicate of the project-root shell.nix sitting in src/ since 2024, referenced by nothing. Facade src/ now holds exactly lib.rs (hydrate()), fileserv.rs, main.rs and the three facade re-export shims (app, dark_mode, error_template). - Add tests/facade_paths.rs: a facade-contract test (ssr-gated) that references the pre-split public paths through the facade (start_axum::app::App / SimpleCounter, start_axum::dark_mode::DarkModeToggle, start_axum::error_template::{AppError, ErrorTemplate}, start_axum::fileserv::file_and_error_handler) so a dropped re-export fails the suite. The project baseline is 0 tests; this is the first. No code moves and no behavior change: the extracted code already lives solely in start-axum-ui / start-axum-error, and fileserv's use crate::app::App already resolves through the facade re-export of start-axum-ui. Closes #8969 --- pkgs/web-gen-api-axum/src/shell.nix | 19 --------------- pkgs/web-gen-api-axum/tests/facade_paths.rs | 27 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 19 deletions(-) delete mode 100644 pkgs/web-gen-api-axum/src/shell.nix create mode 100644 pkgs/web-gen-api-axum/tests/facade_paths.rs diff --git a/pkgs/web-gen-api-axum/src/shell.nix b/pkgs/web-gen-api-axum/src/shell.nix deleted file mode 100644 index a996f7ca8e..0000000000 --- a/pkgs/web-gen-api-axum/src/shell.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - pkgs ? import { }, -}: -pkgs.mkShell { - NIX_CONFIG = "extra-experimental-features = nix-command flakes ca-derivations"; - nativeBuildInputs = with pkgs; [ - nix - home-manager - git - sops - ssh-to-age - gnupg - age - ]; - shellHook = '' - # Add any shell initialization commands here, for instance: - echo "Welcome to the development shell!" - ''; -} diff --git a/pkgs/web-gen-api-axum/tests/facade_paths.rs b/pkgs/web-gen-api-axum/tests/facade_paths.rs new file mode 100644 index 0000000000..785f71d462 --- /dev/null +++ b/pkgs/web-gen-api-axum/tests/facade_paths.rs @@ -0,0 +1,27 @@ +//! Facade contract test — crate split step 3 (#8969). +//! +//! The `start-axum` facade keeps the pre-split public paths working while the +//! implementation lives in `start-axum-ui` / `start-axum-error`. This test +//! references each pre-split path through the facade, so a dropped or renamed +//! re-export fails the suite at compile time. +//! +//! Gated on `ssr`, matching the step gates: the `fileserv` handler only exists +//! under `ssr`, and the hydrate build is covered separately by +//! `cargo check --locked --features hydrate`. +#![cfg(feature = "ssr")] + +use start_axum::error_template::AppError; + +#[test] +fn facade_paths_resolve() { + // Value-position references to the component/handler items re-exported + // through the facade. + let _app = start_axum::app::App; + let _counter = start_axum::app::SimpleCounter; + let _toggle = start_axum::dark_mode::DarkModeToggle; + let _template = start_axum::error_template::ErrorTemplate; + let _handler = start_axum::fileserv::file_and_error_handler; + + // Type-position reference to the error type re-exported through the facade. + let _err: Option = None; +}