diff --git a/rojo-test/src/internable.rs b/rojo-test/src/internable.rs index 40abbdda..70b93481 100644 --- a/rojo-test/src/internable.rs +++ b/rojo-test/src/internable.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use rbx_dom_weak::RbxId; use serde::Serialize; -use librojo::web_interface::{Instance, InstanceUpdate, ReadResponse, SubscribeResponse}; +use librojo::web_api::{Instance, InstanceUpdate, ReadResponse, SubscribeResponse}; use rojo_insta_ext::RedactionMap; /// A convenience method to store all of the redactable data from a piece of diff --git a/rojo-test/src/serve_util.rs b/rojo-test/src/serve_util.rs index 8ea23800..d31a032d 100644 --- a/rojo-test/src/serve_util.rs +++ b/rojo-test/src/serve_util.rs @@ -11,7 +11,7 @@ use rbx_dom_weak::RbxId; use tempfile::{tempdir, TempDir}; -use librojo::web_interface::{ReadResponse, ServerInfoResponse, SubscribeResponse}; +use librojo::web_api::{ReadResponse, ServerInfoResponse, SubscribeResponse}; use rojo_insta_ext::RedactionMap; use crate::util::{ diff --git a/src/bin.rs b/src/bin.rs index 0616517c..aba23d30 100644 --- a/src/bin.rs +++ b/src/bin.rs @@ -4,10 +4,7 @@ use failure::Error; use log::error; use structopt::StructOpt; -use librojo::{ - cli::{Options, Subcommand}, - commands, -}; +use librojo::cli::{self, Options, Subcommand}; fn main() { let options = Options::from_args(); @@ -50,10 +47,10 @@ fn main() { fn run(subcommand: Subcommand) -> Result<(), Error> { match subcommand { - Subcommand::Init(init_options) => commands::init(init_options)?, - Subcommand::Serve(serve_options) => commands::serve(serve_options)?, - Subcommand::Build(build_options) => commands::build(build_options)?, - Subcommand::Upload(upload_options) => commands::upload(upload_options)?, + Subcommand::Init(init_options) => cli::init(init_options)?, + Subcommand::Serve(serve_options) => cli::serve(serve_options)?, + Subcommand::Build(build_options) => cli::build(build_options)?, + Subcommand::Upload(upload_options) => cli::upload(upload_options)?, } Ok(()) diff --git a/src/commands/build.rs b/src/cli/build.rs similarity index 100% rename from src/commands/build.rs rename to src/cli/build.rs diff --git a/src/commands/init.rs b/src/cli/init.rs similarity index 100% rename from src/commands/init.rs rename to src/cli/init.rs diff --git a/src/cli.rs b/src/cli/mod.rs similarity index 97% rename from src/cli.rs rename to src/cli/mod.rs index 4f721b49..a2cd56e3 100644 --- a/src/cli.rs +++ b/src/cli/mod.rs @@ -1,11 +1,19 @@ //! Defines Rojo's CLI through structopt types. -#![deny(missing_docs)] +mod build; +mod init; +mod serve; +mod upload; use std::{env, error::Error, fmt, path::PathBuf, str::FromStr}; use structopt::StructOpt; +pub use self::build::*; +pub use self::init::*; +pub use self::serve::*; +pub use self::upload::*; + /// Trick used with structopt to get the initial working directory of the /// process and store it for use in default values. fn working_dir() -> &'static str { diff --git a/src/commands/serve.rs b/src/cli/serve.rs similarity index 100% rename from src/commands/serve.rs rename to src/cli/serve.rs diff --git a/src/commands/upload.rs b/src/cli/upload.rs similarity index 100% rename from src/commands/upload.rs rename to src/cli/upload.rs diff --git a/src/commands/mod.rs b/src/commands/mod.rs deleted file mode 100644 index b4b53557..00000000 --- a/src/commands/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -mod build; -mod init; -mod serve; -mod upload; - -pub use self::build::*; -pub use self::init::*; -pub use self::serve::*; -pub use self::upload::*; diff --git a/src/lib.rs b/src/lib.rs index 6e4f8e42..4f74156d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,12 +6,6 @@ mod impl_from; pub mod cli; -pub mod commands; - -// This module is only public for testing right now, and won't be -// part of the first version of the Rojo API. -#[doc(hidden)] -pub mod project; #[cfg(test)] mod tree_view; @@ -23,6 +17,7 @@ mod message_queue; mod multimap; mod path_map; mod path_serializer; +mod project; mod serve_session; mod session_id; mod snapshot; @@ -30,5 +25,6 @@ mod snapshot_middleware; mod vfs; mod web; -pub use crate::session_id::SessionId; -pub use crate::web::interface as web_interface; +pub use project::*; +pub use session_id::SessionId; +pub use web::interface as web_api; diff --git a/src/project.rs b/src/project.rs index 3ba7ed7e..9bac403f 100644 --- a/src/project.rs +++ b/src/project.rs @@ -8,7 +8,7 @@ use rbx_dom_weak::UnresolvedRbxValue; use serde::{Deserialize, Serialize}; use snafu::{ResultExt, Snafu}; -pub static PROJECT_FILENAME: &str = "default.project.json"; +static PROJECT_FILENAME: &str = "default.project.json"; /// Error type returned by any function that handles projects. #[derive(Debug, Snafu)] @@ -26,6 +26,9 @@ enum Error { }, } +/// Contains all of the configuration for a Rojo-managed project. +/// +/// Project files are stored in `.project.json` files. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct Project {