diff --git a/Cargo.toml b/Cargo.toml index 7085de87..b728fb22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,27 +1,9 @@ -[dependencies] -anyhow = {version = "1.0.66", features = ["backtrace"]} -camino = "1.1.4" -chrono = {version = "0.4.19", features = ["serde"]} -clap = {version = "4.1.4", features = ["derive"]} -console-subscriber = {version = "0.1.8", optional = true} -futures = "0.3.28" -indexmap = "1.9.2" -once_cell = "1.16.0" -serde = {version = "1.0.138", features = ["derive"]} -serde_json = "1.0.82" -ssg-parent = {version = "0.0.0", path = "ssg-parent"} -thiserror = "1.0.40" -# TODO less features -tokio = {version = "1.21.0", features = ["full"]} -url = "2.3.1" - -[features] -tokio_console = ["dep:console-subscriber"] - -[package] -name = "cli" -version = "0.0.0" -edition = "2021" - [workspace] -members = ["builder"] +resolver = "2" +members = ["crates/*"] +default-members = ["crates/cli"] + +[workspace.dependencies] +reactive.path = "crates/reactive" +ssg-child.path = "crates/ssg-child" +ssg-parent.path = "crates/ssg-parent" diff --git a/builder/Cargo.toml b/crates/builder/Cargo.toml similarity index 95% rename from builder/Cargo.toml rename to crates/builder/Cargo.toml index 33a0f23f..71fb2e75 100644 --- a/builder/Cargo.toml +++ b/crates/builder/Cargo.toml @@ -23,13 +23,13 @@ schema = "0.1.0" serde = {version = "1.0.138", features = ["derive"]} serde_json = "1.0.82" serde_yaml = "0.9.11" -ssg-child = {version = "0.0.0", path = "../ssg-child"} strum = {version = "0.24.1", features = ["derive"]} syn = {version = "2.0.5", features = ["full"]} thiserror = "1.0.40" # TODO less features tokio = {version = "1.21.0", features = ["full"]} url = "2.3.1" +ssg-child.workspace = true [features] tokio_console = ["dep:console-subscriber"] diff --git a/builder/src/components.rs b/crates/builder/src/components.rs similarity index 100% rename from builder/src/components.rs rename to crates/builder/src/components.rs diff --git a/builder/src/components/add_page.rs b/crates/builder/src/components/add_page.rs similarity index 100% rename from builder/src/components/add_page.rs rename to crates/builder/src/components/add_page.rs diff --git a/builder/src/components/calendar.rs b/crates/builder/src/components/calendar.rs similarity index 100% rename from builder/src/components/calendar.rs rename to crates/builder/src/components/calendar.rs diff --git a/builder/src/components/calendar/snippet.js b/crates/builder/src/components/calendar/snippet.js similarity index 100% rename from builder/src/components/calendar/snippet.js rename to crates/builder/src/components/calendar/snippet.js diff --git a/builder/src/components/home_page.rs b/crates/builder/src/components/home_page.rs similarity index 100% rename from builder/src/components/home_page.rs rename to crates/builder/src/components/home_page.rs diff --git a/builder/src/components/mob_page.rs b/crates/builder/src/components/mob_page.rs similarity index 100% rename from builder/src/components/mob_page.rs rename to crates/builder/src/components/mob_page.rs diff --git a/builder/src/components/mob_page/status.rs b/crates/builder/src/components/mob_page/status.rs similarity index 100% rename from builder/src/components/mob_page/status.rs rename to crates/builder/src/components/mob_page/status.rs diff --git a/builder/src/components/page_base.rs b/crates/builder/src/components/page_base.rs similarity index 100% rename from builder/src/components/page_base.rs rename to crates/builder/src/components/page_base.rs diff --git a/builder/src/components/redirect_page.rs b/crates/builder/src/components/redirect_page.rs similarity index 100% rename from builder/src/components/redirect_page.rs rename to crates/builder/src/components/redirect_page.rs diff --git a/builder/src/components/schema.rs b/crates/builder/src/components/schema.rs similarity index 100% rename from builder/src/components/schema.rs rename to crates/builder/src/components/schema.rs diff --git a/builder/src/components/schema/ident.rs b/crates/builder/src/components/schema/ident.rs similarity index 100% rename from builder/src/components/schema/ident.rs rename to crates/builder/src/components/schema/ident.rs diff --git a/builder/src/components/schema/node.rs b/crates/builder/src/components/schema/node.rs similarity index 100% rename from builder/src/components/schema/node.rs rename to crates/builder/src/components/schema/node.rs diff --git a/builder/src/components/schema/type_.rs b/crates/builder/src/components/schema/type_.rs similarity index 100% rename from builder/src/components/schema/type_.rs rename to crates/builder/src/components/schema/type_.rs diff --git a/builder/src/components/schema/type_/documentation.rs b/crates/builder/src/components/schema/type_/documentation.rs similarity index 100% rename from builder/src/components/schema/type_/documentation.rs rename to crates/builder/src/components/schema/type_/documentation.rs diff --git a/builder/src/components/schema/type_/enum_.rs b/crates/builder/src/components/schema/type_/enum_.rs similarity index 100% rename from builder/src/components/schema/type_/enum_.rs rename to crates/builder/src/components/schema/type_/enum_.rs diff --git a/builder/src/components/schema/type_/enum_/variant.rs b/crates/builder/src/components/schema/type_/enum_/variant.rs similarity index 100% rename from builder/src/components/schema/type_/enum_/variant.rs rename to crates/builder/src/components/schema/type_/enum_/variant.rs diff --git a/builder/src/components/schema/type_/enum_/variant/ident.rs b/crates/builder/src/components/schema/type_/enum_/variant/ident.rs similarity index 100% rename from builder/src/components/schema/type_/enum_/variant/ident.rs rename to crates/builder/src/components/schema/type_/enum_/variant/ident.rs diff --git a/builder/src/components/schema/type_/field.rs b/crates/builder/src/components/schema/type_/field.rs similarity index 100% rename from builder/src/components/schema/type_/field.rs rename to crates/builder/src/components/schema/type_/field.rs diff --git a/builder/src/components/schema/type_/field/ident.rs b/crates/builder/src/components/schema/type_/field/ident.rs similarity index 100% rename from builder/src/components/schema/type_/field/ident.rs rename to crates/builder/src/components/schema/type_/field/ident.rs diff --git a/builder/src/components/schema/type_/ident.rs b/crates/builder/src/components/schema/type_/ident.rs similarity index 100% rename from builder/src/components/schema/type_/ident.rs rename to crates/builder/src/components/schema/type_/ident.rs diff --git a/builder/src/components/schema/type_/link.rs b/crates/builder/src/components/schema/type_/link.rs similarity index 100% rename from builder/src/components/schema/type_/link.rs rename to crates/builder/src/components/schema/type_/link.rs diff --git a/builder/src/components/schema/type_/mapping.rs b/crates/builder/src/components/schema/type_/mapping.rs similarity index 100% rename from builder/src/components/schema/type_/mapping.rs rename to crates/builder/src/components/schema/type_/mapping.rs diff --git a/builder/src/components/schema/type_/mapping/key.rs b/crates/builder/src/components/schema/type_/mapping/key.rs similarity index 100% rename from builder/src/components/schema/type_/mapping/key.rs rename to crates/builder/src/components/schema/type_/mapping/key.rs diff --git a/builder/src/constants.rs b/crates/builder/src/constants.rs similarity index 96% rename from builder/src/constants.rs rename to crates/builder/src/constants.rs index f1ed2f6f..a44ddffb 100644 --- a/builder/src/constants.rs +++ b/crates/builder/src/constants.rs @@ -9,7 +9,7 @@ pub(crate) const DESCRIPTION: &str = "A mob programming community"; pub(crate) const MOBS_DIR: &str = "mobs"; pub(crate) static MOBS_PATH: Lazy = Lazy::new(|| { - [env!("CARGO_MANIFEST_DIR"), "..", MOBS_DIR] + [env!("CARGO_MANIFEST_DIR"), "..", "..", MOBS_DIR] .iter() .collect() }); diff --git a/builder/src/expected_files.rs b/crates/builder/src/expected_files.rs similarity index 100% rename from builder/src/expected_files.rs rename to crates/builder/src/expected_files.rs diff --git a/builder/src/file_specs.rs b/crates/builder/src/file_specs.rs similarity index 100% rename from builder/src/file_specs.rs rename to crates/builder/src/file_specs.rs diff --git a/builder/src/fonts.rs b/crates/builder/src/fonts.rs similarity index 100% rename from builder/src/fonts.rs rename to crates/builder/src/fonts.rs diff --git a/builder/src/google_font.rs b/crates/builder/src/google_font.rs similarity index 100% rename from builder/src/google_font.rs rename to crates/builder/src/google_font.rs diff --git a/builder/src/graphic_file_specs.rs b/crates/builder/src/graphic_file_specs.rs similarity index 100% rename from builder/src/graphic_file_specs.rs rename to crates/builder/src/graphic_file_specs.rs diff --git a/builder/src/html.rs b/crates/builder/src/html.rs similarity index 100% rename from builder/src/html.rs rename to crates/builder/src/html.rs diff --git a/builder/src/main.rs b/crates/builder/src/main.rs similarity index 100% rename from builder/src/main.rs rename to crates/builder/src/main.rs diff --git a/builder/src/markdown.rs b/crates/builder/src/markdown.rs similarity index 100% rename from builder/src/markdown.rs rename to crates/builder/src/markdown.rs diff --git a/builder/src/mob.rs b/crates/builder/src/mob.rs similarity index 100% rename from builder/src/mob.rs rename to crates/builder/src/mob.rs diff --git a/builder/src/mob/file.rs b/crates/builder/src/mob/file.rs similarity index 100% rename from builder/src/mob/file.rs rename to crates/builder/src/mob/file.rs diff --git a/builder/src/mob/file/yaml_recurring_session.rs b/crates/builder/src/mob/file/yaml_recurring_session.rs similarity index 100% rename from builder/src/mob/file/yaml_recurring_session.rs rename to crates/builder/src/mob/file/yaml_recurring_session.rs diff --git a/builder/src/mob/id.rs b/crates/builder/src/mob/id.rs similarity index 100% rename from builder/src/mob/id.rs rename to crates/builder/src/mob/id.rs diff --git a/builder/src/mob/link.rs b/crates/builder/src/mob/link.rs similarity index 100% rename from builder/src/mob/link.rs rename to crates/builder/src/mob/link.rs diff --git a/builder/src/mob/participant.rs b/crates/builder/src/mob/participant.rs similarity index 100% rename from builder/src/mob/participant.rs rename to crates/builder/src/mob/participant.rs diff --git a/builder/src/mob/participant/person.rs b/crates/builder/src/mob/participant/person.rs similarity index 100% rename from builder/src/mob/participant/person.rs rename to crates/builder/src/mob/participant/person.rs diff --git a/builder/src/mob/recurring_session.rs b/crates/builder/src/mob/recurring_session.rs similarity index 100% rename from builder/src/mob/recurring_session.rs rename to crates/builder/src/mob/recurring_session.rs diff --git a/builder/src/mob/status.rs b/crates/builder/src/mob/status.rs similarity index 100% rename from builder/src/mob/status.rs rename to crates/builder/src/mob/status.rs diff --git a/builder/src/mob/status/legend.rs b/crates/builder/src/mob/status/legend.rs similarity index 100% rename from builder/src/mob/status/legend.rs rename to crates/builder/src/mob/status/legend.rs diff --git a/builder/src/mob/subtitle.rs b/crates/builder/src/mob/subtitle.rs similarity index 100% rename from builder/src/mob/subtitle.rs rename to crates/builder/src/mob/subtitle.rs diff --git a/builder/src/mob/title.rs b/crates/builder/src/mob/title.rs similarity index 100% rename from builder/src/mob/title.rs rename to crates/builder/src/mob/title.rs diff --git a/builder/src/pages.rs b/crates/builder/src/pages.rs similarity index 100% rename from builder/src/pages.rs rename to crates/builder/src/pages.rs diff --git a/builder/src/pages/add.rs b/crates/builder/src/pages/add.rs similarity index 100% rename from builder/src/pages/add.rs rename to crates/builder/src/pages/add.rs diff --git a/builder/src/pages/index.rs b/crates/builder/src/pages/index.rs similarity index 100% rename from builder/src/pages/index.rs rename to crates/builder/src/pages/index.rs diff --git a/builder/src/relative_path.rs b/crates/builder/src/relative_path.rs similarity index 100% rename from builder/src/relative_path.rs rename to crates/builder/src/relative_path.rs diff --git a/builder/src/style.rs b/crates/builder/src/style.rs similarity index 100% rename from builder/src/style.rs rename to crates/builder/src/style.rs diff --git a/builder/src/syn_helpers.rs b/crates/builder/src/syn_helpers.rs similarity index 100% rename from builder/src/syn_helpers.rs rename to crates/builder/src/syn_helpers.rs diff --git a/builder/src/tailwind.rs b/crates/builder/src/tailwind.rs similarity index 100% rename from builder/src/tailwind.rs rename to crates/builder/src/tailwind.rs diff --git a/builder/src/url.rs b/crates/builder/src/url.rs similarity index 100% rename from builder/src/url.rs rename to crates/builder/src/url.rs diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml new file mode 100644 index 00000000..2f22899b --- /dev/null +++ b/crates/cli/Cargo.toml @@ -0,0 +1,24 @@ +[dependencies] +anyhow = {version = "1.0.66", features = ["backtrace"]} +camino = "1.1.4" +chrono = {version = "0.4.19", features = ["serde"]} +clap = {version = "4.1.4", features = ["derive"]} +console-subscriber = {version = "0.1.8", optional = true} +futures = "0.3.28" +indexmap = "1.9.2" +once_cell = "1.16.0" +serde = {version = "1.0.138", features = ["derive"]} +serde_json = "1.0.82" +thiserror = "1.0.40" +# TODO less features +tokio = {version = "1.21.0", features = ["full"]} +url = "2.3.1" +ssg-parent.workspace = true + +[features] +tokio_console = ["dep:console-subscriber"] + +[package] +name = "cli" +version = "0.0.0" +edition = "2021" diff --git a/src/input.css b/crates/cli/src/input.css similarity index 100% rename from src/input.css rename to crates/cli/src/input.css diff --git a/src/main.rs b/crates/cli/src/main.rs similarity index 97% rename from src/main.rs rename to crates/cli/src/main.rs index 702f7bc0..bab5f90f 100644 --- a/src/main.rs +++ b/crates/cli/src/main.rs @@ -8,7 +8,7 @@ use once_cell::sync::Lazy; use ssg_parent::Parent; pub static OUTPUT_DIR: Lazy = - Lazy::new(|| Utf8PathBuf::from(env!("CARGO_MANIFEST_DIR")).join(".vercel/output/static")); + Lazy::new(|| Utf8PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../.vercel/output/static")); #[derive(Debug, Parser)] struct Cli { diff --git a/src/tailwind.rs b/crates/cli/src/tailwind.rs similarity index 100% rename from src/tailwind.rs rename to crates/cli/src/tailwind.rs diff --git a/reactive/Cargo.toml b/crates/reactive/Cargo.toml similarity index 100% rename from reactive/Cargo.toml rename to crates/reactive/Cargo.toml diff --git a/reactive/src/driver.rs b/crates/reactive/src/driver.rs similarity index 100% rename from reactive/src/driver.rs rename to crates/reactive/src/driver.rs diff --git a/reactive/src/driver/child_process_killer.rs b/crates/reactive/src/driver/child_process_killer.rs similarity index 100% rename from reactive/src/driver/child_process_killer.rs rename to crates/reactive/src/driver/child_process_killer.rs diff --git a/reactive/src/driver/command.rs b/crates/reactive/src/driver/command.rs similarity index 100% rename from reactive/src/driver/command.rs rename to crates/reactive/src/driver/command.rs diff --git a/reactive/src/driver/notify.rs b/crates/reactive/src/driver/notify.rs similarity index 100% rename from reactive/src/driver/notify.rs rename to crates/reactive/src/driver/notify.rs diff --git a/reactive/src/driver/open_that.rs b/crates/reactive/src/driver/open_that.rs similarity index 100% rename from reactive/src/driver/open_that.rs rename to crates/reactive/src/driver/open_that.rs diff --git a/reactive/src/driver/println.rs b/crates/reactive/src/driver/println.rs similarity index 100% rename from reactive/src/driver/println.rs rename to crates/reactive/src/driver/println.rs diff --git a/reactive/src/lib.rs b/crates/reactive/src/lib.rs similarity index 100% rename from reactive/src/lib.rs rename to crates/reactive/src/lib.rs diff --git a/ssg-child/Cargo.toml b/crates/ssg-child/Cargo.toml similarity index 100% rename from ssg-child/Cargo.toml rename to crates/ssg-child/Cargo.toml diff --git a/ssg-child/src/disk_caching_http_client.rs b/crates/ssg-child/src/disk_caching_http_client.rs similarity index 100% rename from ssg-child/src/disk_caching_http_client.rs rename to crates/ssg-child/src/disk_caching_http_client.rs diff --git a/ssg-child/src/file_error.rs b/crates/ssg-child/src/file_error.rs similarity index 100% rename from ssg-child/src/file_error.rs rename to crates/ssg-child/src/file_error.rs diff --git a/ssg-child/src/file_spec.rs b/crates/ssg-child/src/file_spec.rs similarity index 100% rename from ssg-child/src/file_spec.rs rename to crates/ssg-child/src/file_spec.rs diff --git a/ssg-child/src/file_success.rs b/crates/ssg-child/src/file_success.rs similarity index 100% rename from ssg-child/src/file_success.rs rename to crates/ssg-child/src/file_success.rs diff --git a/ssg-child/src/final_error.rs b/crates/ssg-child/src/final_error.rs similarity index 100% rename from ssg-child/src/final_error.rs rename to crates/ssg-child/src/final_error.rs diff --git a/ssg-child/src/final_error/duplicates.rs b/crates/ssg-child/src/final_error/duplicates.rs similarity index 100% rename from ssg-child/src/final_error/duplicates.rs rename to crates/ssg-child/src/final_error/duplicates.rs diff --git a/ssg-child/src/final_error/failed_files.rs b/crates/ssg-child/src/final_error/failed_files.rs similarity index 100% rename from ssg-child/src/final_error/failed_files.rs rename to crates/ssg-child/src/final_error/failed_files.rs diff --git a/ssg-child/src/final_error/missing_files.rs b/crates/ssg-child/src/final_error/missing_files.rs similarity index 100% rename from ssg-child/src/final_error/missing_files.rs rename to crates/ssg-child/src/final_error/missing_files.rs diff --git a/ssg-child/src/final_error/processed_files_count.rs b/crates/ssg-child/src/final_error/processed_files_count.rs similarity index 100% rename from ssg-child/src/final_error/processed_files_count.rs rename to crates/ssg-child/src/final_error/processed_files_count.rs diff --git a/ssg-child/src/generation_task.rs b/crates/ssg-child/src/generation_task.rs similarity index 100% rename from ssg-child/src/generation_task.rs rename to crates/ssg-child/src/generation_task.rs diff --git a/ssg-child/src/lib.rs b/crates/ssg-child/src/lib.rs similarity index 100% rename from ssg-child/src/lib.rs rename to crates/ssg-child/src/lib.rs diff --git a/ssg-child/src/sources.rs b/crates/ssg-child/src/sources.rs similarity index 100% rename from ssg-child/src/sources.rs rename to crates/ssg-child/src/sources.rs diff --git a/ssg-child/src/sources/bytes.rs b/crates/ssg-child/src/sources/bytes.rs similarity index 100% rename from ssg-child/src/sources/bytes.rs rename to crates/ssg-child/src/sources/bytes.rs diff --git a/ssg-child/src/sources/google_font.rs b/crates/ssg-child/src/sources/google_font.rs similarity index 100% rename from ssg-child/src/sources/google_font.rs rename to crates/ssg-child/src/sources/google_font.rs diff --git a/ssg-child/src/sources/http.rs b/crates/ssg-child/src/sources/http.rs similarity index 100% rename from ssg-child/src/sources/http.rs rename to crates/ssg-child/src/sources/http.rs diff --git a/ssg-child/src/sources/static_byte_slice.rs b/crates/ssg-child/src/sources/static_byte_slice.rs similarity index 100% rename from ssg-child/src/sources/static_byte_slice.rs rename to crates/ssg-child/src/sources/static_byte_slice.rs diff --git a/ssg-parent/Cargo.toml b/crates/ssg-parent/Cargo.toml similarity index 90% rename from ssg-parent/Cargo.toml rename to crates/ssg-parent/Cargo.toml index d3cf9a8b..e43bc32e 100644 --- a/ssg-parent/Cargo.toml +++ b/crates/ssg-parent/Cargo.toml @@ -8,12 +8,12 @@ live-server = "0.6.0" once_cell = "1.17.1" open = "4.1.0" portpicker = "0.1.1" -reactive = {version = "0.1.0", path = "../reactive"} reqwest = {version = "0.11.11", default-features = false, features = ["rustls-tls"]} thiserror = "1.0.38" # TODO less features tokio = {version = "1.21.0", features = ["fs", "tokio-macros", "full"]} url = "2.3.1" +reactive.workspace = true [package] name = "ssg-parent" diff --git a/ssg-parent/src/lib.rs b/crates/ssg-parent/src/lib.rs similarity index 98% rename from ssg-parent/src/lib.rs rename to crates/ssg-parent/src/lib.rs index e5c28673..1decf2c3 100644 --- a/ssg-parent/src/lib.rs +++ b/crates/ssg-parent/src/lib.rs @@ -1,5 +1,6 @@ #![warn(clippy::all, clippy::pedantic)] +use camino::Utf8PathBuf; use colored::Colorize; use futures::{ channel::mpsc, @@ -129,7 +130,11 @@ impl Parent { reactive::driver::open_that::StaticOpenThatDriver::new(url.to_string()); let (eprintln_driver, ()) = reactive::driver::println::EprintlnDriver::new(); let (notify_driver, notify) = - match reactive::driver::notify::FsChangeDriver::new(BUILDER_CRATE_NAME) { + match reactive::driver::notify::FsChangeDriver::new(Utf8PathBuf::from_iter([ + env!("CARGO_MANIFEST_DIR"), + "..", + BUILDER_CRATE_NAME, + ])) { Ok(val) => val, Err(e) => return e.into(), };