mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-25 12:52:47 -07:00
refactor: support crates sub-modules (#636)
This commit is contained in:
@@ -10,7 +10,7 @@ repository = "https://github.com/tuono-labs/tuono"
|
||||
readme = "../../README.md"
|
||||
license-file = "../../LICENSE.md"
|
||||
categories = ["web-programming"]
|
||||
include = ["src/*.rs", "Cargo.toml"]
|
||||
include = ["src/**/*.rs", "Cargo.toml"]
|
||||
|
||||
[lib]
|
||||
name = "tuono"
|
||||
|
||||
@@ -5,13 +5,11 @@ use tracing::{span, Level};
|
||||
use tracing_subscriber::EnvFilter;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::build;
|
||||
use crate::commands::{build, dev, new};
|
||||
use crate::mode::Mode;
|
||||
use crate::scaffold_project;
|
||||
use crate::source_builder::{
|
||||
bundle_axum_source, check_tuono_folder, create_client_entry_files, generate_fallback_html,
|
||||
};
|
||||
use crate::watch;
|
||||
|
||||
#[derive(Subcommand, Debug)]
|
||||
enum Actions {
|
||||
@@ -87,7 +85,7 @@ pub fn app() -> std::io::Result<()> {
|
||||
generate_fallback_html(&app)?;
|
||||
app.check_server_availability(Mode::Dev);
|
||||
|
||||
watch::watch().unwrap();
|
||||
dev::watch().unwrap();
|
||||
}
|
||||
Actions::Build { ssg, no_js_emit } => {
|
||||
let span = span!(Level::TRACE, "BUILD");
|
||||
@@ -107,7 +105,7 @@ pub fn app() -> std::io::Result<()> {
|
||||
|
||||
let _guard = span.enter();
|
||||
|
||||
scaffold_project::create_new_project(folder_name, template, head);
|
||||
new::create_new_project(folder_name, template, head);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
pub mod build;
|
||||
pub mod dev;
|
||||
pub mod new;
|
||||
@@ -4,10 +4,8 @@
|
||||
//! You can find the full documentation at [tuono.dev](https://tuono.dev/)
|
||||
|
||||
mod app;
|
||||
mod build;
|
||||
pub mod cli;
|
||||
mod commands;
|
||||
mod mode;
|
||||
mod route;
|
||||
mod scaffold_project;
|
||||
mod source_builder;
|
||||
mod watch;
|
||||
|
||||
@@ -11,7 +11,7 @@ readme = "../../README.md"
|
||||
license-file = "../../LICENSE.md"
|
||||
categories = ["web-programming"]
|
||||
include = [
|
||||
"src/*.rs",
|
||||
"src/**/*.rs",
|
||||
"Cargo.toml"
|
||||
]
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ readme = "../../README.md"
|
||||
license-file = "../../LICENSE.md"
|
||||
categories = ["web-programming"]
|
||||
include = [
|
||||
"src/*.rs",
|
||||
"src/**/*.rs",
|
||||
"Cargo.toml"
|
||||
]
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
mod catch_all;
|
||||
mod config;
|
||||
mod env;
|
||||
mod logger;
|
||||
mod manifest;
|
||||
mod mode;
|
||||
mod payload;
|
||||
mod request;
|
||||
mod response;
|
||||
mod server;
|
||||
mod services;
|
||||
mod ssr;
|
||||
mod vite_reverse_proxy;
|
||||
mod vite_websocket_proxy;
|
||||
|
||||
@@ -9,7 +9,7 @@ use tuono_internal::config::Config;
|
||||
|
||||
use crate::env::load_env_vars;
|
||||
use crate::{
|
||||
catch_all::catch_all, logger::LoggerLayer, vite_reverse_proxy::vite_reverse_proxy,
|
||||
catch_all::catch_all, services::logger::LoggerLayer, vite_reverse_proxy::vite_reverse_proxy,
|
||||
vite_websocket_proxy::vite_websocket_proxy,
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
pub mod logger;
|
||||
@@ -10,7 +10,7 @@ readme = "../../README.md"
|
||||
license-file = "../../LICENSE.md"
|
||||
categories = ["web-programming"]
|
||||
include = [
|
||||
"src/*.rs",
|
||||
"src/**/*.rs",
|
||||
"Cargo.toml"
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user