From c3839ed1721c3c55e3d1988297c557fcdd46972c Mon Sep 17 00:00:00 2001 From: Shane Osbourne Date: Sun, 2 Jun 2024 21:29:38 +0100 Subject: [PATCH] input file name --- input.yml => bslive.yml | 2 +- crates/bsnext_client/ui/{input.yml => bslive.yml} | 0 crates/bsnext_input/src/input_test/mod.rs | 2 +- crates/bsnext_input/src/lib.rs | 6 +++--- crates/bsnext_system/src/start_kind/start_from_inputs.rs | 2 +- examples/basic/bslive.yml | 5 +++++ examples/kitchen-sink/{input.yml => bslive.yml} | 0 examples/lit/{input.yml => bslive.yml} | 0 examples/openai/{input.yml => bslive.yml} | 0 examples/proxy-simple/{input.yml => bslive.yml} | 0 examples/single/{input.yaml => bslive.yaml} | 0 11 files changed, 11 insertions(+), 6 deletions(-) rename input.yml => bslive.yml (77%) rename crates/bsnext_client/ui/{input.yml => bslive.yml} (100%) create mode 100644 examples/basic/bslive.yml rename examples/kitchen-sink/{input.yml => bslive.yml} (100%) rename examples/lit/{input.yml => bslive.yml} (100%) rename examples/openai/{input.yml => bslive.yml} (100%) rename examples/proxy-simple/{input.yml => bslive.yml} (100%) rename examples/single/{input.yaml => bslive.yaml} (100%) diff --git a/input.yml b/bslive.yml similarity index 77% rename from input.yml rename to bslive.yml index abbe2b9..1b2513e 100644 --- a/input.yml +++ b/bslive.yml @@ -3,6 +3,6 @@ servers: routes: - path: / watch: true - dir: . + dir: examples/basic/public headers: null watchers: [] diff --git a/crates/bsnext_client/ui/input.yml b/crates/bsnext_client/ui/bslive.yml similarity index 100% rename from crates/bsnext_client/ui/input.yml rename to crates/bsnext_client/ui/bslive.yml diff --git a/crates/bsnext_input/src/input_test/mod.rs b/crates/bsnext_input/src/input_test/mod.rs index 058d7fe..2d2e970 100644 --- a/crates/bsnext_input/src/input_test/mod.rs +++ b/crates/bsnext_input/src/input_test/mod.rs @@ -6,7 +6,7 @@ use crate::Input; #[test] fn test_deserialize() { - let input = include_str!("../../../../examples/kitchen-sink/input.yml"); + let input = include_str!("../../../../examples/kitchen-sink/bslive.yml"); let _: Input = serde_yaml::from_str(input).unwrap(); } diff --git a/crates/bsnext_input/src/lib.rs b/crates/bsnext_input/src/lib.rs index a0ea4bf..1bae1cf 100644 --- a/crates/bsnext_input/src/lib.rs +++ b/crates/bsnext_input/src/lib.rs @@ -169,9 +169,9 @@ pub fn fs_write_input( TargetKind::Md => md::input_to_str(input), }; let name = match target_kind { - TargetKind::Yaml => "input.yml", - TargetKind::Toml => "input.toml", - TargetKind::Md => "input.md", + TargetKind::Yaml => "bslive.yml", + TargetKind::Toml => "bslive.toml", + TargetKind::Md => "bslive.md", }; let next_path = cwd.join(name); fs::write(&next_path, string) diff --git a/crates/bsnext_system/src/start_kind/start_from_inputs.rs b/crates/bsnext_system/src/start_kind/start_from_inputs.rs index 40ad0e4..c5fade5 100644 --- a/crates/bsnext_system/src/start_kind/start_from_inputs.rs +++ b/crates/bsnext_system/src/start_kind/start_from_inputs.rs @@ -20,7 +20,7 @@ fn from_yml_paths>(cwd: &Path, inputs: &[T]) -> Result>(); - let lookups = ["input.yml", "input.yaml"] + let lookups = ["bslive.yml", "bslive.yaml"] .iter() .map(|path| cwd.join(path)) .collect::>(); diff --git a/examples/basic/bslive.yml b/examples/basic/bslive.yml new file mode 100644 index 0000000..1113940 --- /dev/null +++ b/examples/basic/bslive.yml @@ -0,0 +1,5 @@ +servers: + - bind_address: 0.0.0.0:3000 + routes: + - path: / + html: "oops" \ No newline at end of file diff --git a/examples/kitchen-sink/input.yml b/examples/kitchen-sink/bslive.yml similarity index 100% rename from examples/kitchen-sink/input.yml rename to examples/kitchen-sink/bslive.yml diff --git a/examples/lit/input.yml b/examples/lit/bslive.yml similarity index 100% rename from examples/lit/input.yml rename to examples/lit/bslive.yml diff --git a/examples/openai/input.yml b/examples/openai/bslive.yml similarity index 100% rename from examples/openai/input.yml rename to examples/openai/bslive.yml diff --git a/examples/proxy-simple/input.yml b/examples/proxy-simple/bslive.yml similarity index 100% rename from examples/proxy-simple/input.yml rename to examples/proxy-simple/bslive.yml diff --git a/examples/single/input.yaml b/examples/single/bslive.yaml similarity index 100% rename from examples/single/input.yaml rename to examples/single/bslive.yaml