renderer crate, few more renames i forgot from the template

+193 -56
+1 -1
.config/hakari.toml
··· 1 1 # This file contains settings for `cargo hakari`. 2 2 # See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a full list of options. 3 3 4 - hakari-package = "my-workspace-hack" 4 + hakari-package = "atpblog-workspace-hack" 5 5 6 6 # Format version for hakari's output. Version 4 requires cargo-hakari 0.9.22 or above. 7 7 dep-format-version = "4"
+1
.envrc
··· 1 + use flake
+5
.zed/settings.json
··· 1 + // Folder-specific settings 2 + // 3 + // For a full list of overridable settings, and general information on folder-specific settings, 4 + // see the documentation: https://zed.dev/docs/configuring-zed#settings-files 5 + {}
+42 -38
Cargo.lock
··· 29 29 ] 30 30 31 31 [[package]] 32 + name = "atpblog-cli" 33 + version = "0.1.0" 34 + dependencies = [ 35 + "atpblog-common", 36 + "atpblog-workspace-hack", 37 + "tokio", 38 + ] 39 + 40 + [[package]] 41 + name = "atpblog-common" 42 + version = "0.1.0" 43 + dependencies = [ 44 + "atpblog-workspace-hack", 45 + "tokio", 46 + ] 47 + 48 + [[package]] 49 + name = "atpblog-renderer" 50 + version = "0.1.0" 51 + 52 + [[package]] 53 + name = "atpblog-server" 54 + version = "0.1.0" 55 + dependencies = [ 56 + "atpblog-common", 57 + "atpblog-workspace-hack", 58 + "axum", 59 + "tokio", 60 + ] 61 + 62 + [[package]] 63 + name = "atpblog-workspace-hack" 64 + version = "0.1.0" 65 + dependencies = [ 66 + "proc-macro2", 67 + "quote", 68 + "smallvec", 69 + "syn", 70 + "tokio", 71 + ] 72 + 73 + [[package]] 32 74 name = "autocfg" 33 75 version = "1.4.0" 34 76 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 321 363 "libc", 322 364 "wasi", 323 365 "windows-sys", 324 - ] 325 - 326 - [[package]] 327 - name = "my-cli" 328 - version = "0.1.0" 329 - dependencies = [ 330 - "my-common", 331 - "my-workspace-hack", 332 - "tokio", 333 - ] 334 - 335 - [[package]] 336 - name = "my-common" 337 - version = "0.1.0" 338 - dependencies = [ 339 - "my-workspace-hack", 340 - "tokio", 341 - ] 342 - 343 - [[package]] 344 - name = "my-server" 345 - version = "0.1.0" 346 - dependencies = [ 347 - "axum", 348 - "my-common", 349 - "my-workspace-hack", 350 - "tokio", 351 - ] 352 - 353 - [[package]] 354 - name = "my-workspace-hack" 355 - version = "0.1.0" 356 - dependencies = [ 357 - "proc-macro2", 358 - "quote", 359 - "smallvec", 360 - "syn", 361 - "tokio", 362 366 ] 363 367 364 368 [[package]]
+1
Cargo.toml
··· 9 9 [workspace.package] 10 10 version = "0.1.0" 11 11 edition = "2021" 12 + license = "MPL-2.0" 12 13 13 14 [workspace.metadata.crane] 14 15 name = "atpblog-workspace"
+1
crates/atpblog-cli/Cargo.toml
··· 2 2 name = "atpblog-cli" 3 3 version.workspace = true 4 4 edition.workspace = true 5 + license.workspace = true 5 6 publish = false 6 7 7 8 [dependencies]
+1 -1
crates/atpblog-cli/src/main.rs
··· 2 2 3 3 #[tokio::main] 4 4 async fn main() { 5 - let (tx, mut rx, fut) = my_common::echo_task(10, "echo".into()); 5 + let (tx, mut rx, fut) = atpblog_common::echo_task(10, "echo".into()); 6 6 let args = std::env::args().skip(1).collect::<Vec<_>>(); 7 7 8 8 tokio::spawn(fut);
+1
crates/atpblog-common/Cargo.toml
··· 2 2 name = "atpblog-common" 3 3 version.workspace = true 4 4 edition.workspace = true 5 + license.workspace = true 5 6 publish = false 6 7 7 8 [dependencies]
+2
crates/atpblog-renderer/Cargo.toml
··· 2 2 name = "atpblog-renderer" 3 3 version.workspace = true 4 4 edition.workspace = true 5 + license.workspace = true 6 + publish = false 5 7 6 8 [dependencies]
+1
crates/atpblog-renderer/src/lib.rs
··· 1 +
-3
crates/atpblog-renderer/src/main.rs
··· 1 - fn main() { 2 - println!("Hello, world!"); 3 - }
+1
crates/atpblog-server/Cargo.toml
··· 2 2 name = "atpblog-server" 3 3 version.workspace = true 4 4 edition.workspace = true 5 + license.workspace = true 5 6 publish = false 6 7 7 8 [dependencies]
+1 -1
crates/atpblog-server/src/main.rs
··· 21 21 } 22 22 23 23 async fn ping(Query(params): Query<HashMap<String, String>>) -> Html<String> { 24 - let (tx, mut rx, fut) = my_common::echo_task(10, "ping".into()); 24 + let (tx, mut rx, fut) = atpblog_common::echo_task(10, "ping".into()); 25 25 tokio::spawn(fut); 26 26 tokio::spawn(async move { 27 27 for (k, v) in params {
+1
crates/atpblog-workspace-hack/Cargo.toml
··· 6 6 name = "atpblog-workspace-hack" 7 7 version = "0.1.0" 8 8 description = "workspace-hack package, managed by hakari" 9 + license.workspace = true 9 10 # You can choose to publish this crate: see https://docs.rs/cargo-hakari/latest/cargo_hakari/publishing. 10 11 publish = false 11 12
+1 -1
deny.toml
··· 2 2 multiple-versions = 'allow' 3 3 4 4 [licenses] 5 + allow = ["Apache-2.0", "BSD-3-Clause", "MIT", "Unicode-3.0", "MPL-2.0"] 5 6 private = { ignore = true } 6 - allow = ["Apache-2.0", "BSD-3-Clause", "MIT", "Unicode-3.0"]
+116
flake.lock
··· 1 + { 2 + "nodes": { 3 + "advisory-db": { 4 + "flake": false, 5 + "locked": { 6 + "lastModified": 1744288177, 7 + "narHash": "sha256-HxYhdWc6YJ8Q8gOZtv7+teCucmDf6+Ntickvb62Au58=", 8 + "owner": "rustsec", 9 + "repo": "advisory-db", 10 + "rev": "1273f0099ce6882659ff64b852c8fdb5f8cdd5b9", 11 + "type": "github" 12 + }, 13 + "original": { 14 + "owner": "rustsec", 15 + "repo": "advisory-db", 16 + "type": "github" 17 + } 18 + }, 19 + "crane": { 20 + "locked": { 21 + "lastModified": 1745022865, 22 + "narHash": "sha256-tXL4qUlyYZEGOHUKUWjmmcvJjjLQ+4U38lPWSc8Cgdo=", 23 + "owner": "ipetkov", 24 + "repo": "crane", 25 + "rev": "25ca4c50039d91ad88cc0b8feacb9ad7f748dedf", 26 + "type": "github" 27 + }, 28 + "original": { 29 + "owner": "ipetkov", 30 + "repo": "crane", 31 + "type": "github" 32 + } 33 + }, 34 + "fenix": { 35 + "inputs": { 36 + "nixpkgs": [ 37 + "nixpkgs" 38 + ], 39 + "rust-analyzer-src": [] 40 + }, 41 + "locked": { 42 + "lastModified": 1745303921, 43 + "narHash": "sha256-zYucemS2QvJUR5GKJ/u3eZAoe82AKhcxMtNVZDERXsw=", 44 + "owner": "nix-community", 45 + "repo": "fenix", 46 + "rev": "14850d5984f3696a2972f85f19085e5fb46daa95", 47 + "type": "github" 48 + }, 49 + "original": { 50 + "owner": "nix-community", 51 + "repo": "fenix", 52 + "type": "github" 53 + } 54 + }, 55 + "flake-utils": { 56 + "inputs": { 57 + "systems": "systems" 58 + }, 59 + "locked": { 60 + "lastModified": 1731533236, 61 + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 62 + "owner": "numtide", 63 + "repo": "flake-utils", 64 + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 65 + "type": "github" 66 + }, 67 + "original": { 68 + "owner": "numtide", 69 + "repo": "flake-utils", 70 + "type": "github" 71 + } 72 + }, 73 + "nixpkgs": { 74 + "locked": { 75 + "lastModified": 1744868846, 76 + "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=", 77 + "owner": "NixOS", 78 + "repo": "nixpkgs", 79 + "rev": "ebe4301cbd8f81c4f8d3244b3632338bbeb6d49c", 80 + "type": "github" 81 + }, 82 + "original": { 83 + "owner": "NixOS", 84 + "ref": "nixpkgs-unstable", 85 + "repo": "nixpkgs", 86 + "type": "github" 87 + } 88 + }, 89 + "root": { 90 + "inputs": { 91 + "advisory-db": "advisory-db", 92 + "crane": "crane", 93 + "fenix": "fenix", 94 + "flake-utils": "flake-utils", 95 + "nixpkgs": "nixpkgs" 96 + } 97 + }, 98 + "systems": { 99 + "locked": { 100 + "lastModified": 1681028828, 101 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 102 + "owner": "nix-systems", 103 + "repo": "default", 104 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 105 + "type": "github" 106 + }, 107 + "original": { 108 + "owner": "nix-systems", 109 + "repo": "default", 110 + "type": "github" 111 + } 112 + } 113 + }, 114 + "root": "root", 115 + "version": 7 116 + }
+17 -11
flake.nix
··· 71 71 fileset = lib.fileset.unions [ 72 72 ./Cargo.toml 73 73 ./Cargo.lock 74 - (craneLib.fileset.commonCargoSources ./crates/my-common) 75 - (craneLib.fileset.commonCargoSources ./crates/my-workspace-hack) 74 + (craneLib.fileset.commonCargoSources ./crates/atpblog-common) 75 + (craneLib.fileset.commonCargoSources ./crates/atpblog-workspace-hack) 76 76 (craneLib.fileset.commonCargoSources crate) 77 77 ]; 78 78 }; ··· 86 86 # otherwise, omitting a crate (like we do below) will result in errors since 87 87 # cargo won't be able to find the sources for all members. 88 88 atpblog-cli = craneLib.buildPackage (individualCrateArgs // { 89 - pname = "my-cli"; 90 - cargoExtraArgs = "-p my-cli"; 91 - src = fileSetForCrate ./crates/my-cli; 89 + pname = "atpblog-cli"; 90 + cargoExtraArgs = "-p atpblog-cli"; 91 + src = fileSetForCrate ./crates/atpblog-cli; 92 92 }); 93 93 atpblog-server = craneLib.buildPackage (individualCrateArgs // { 94 - pname = "my-server"; 95 - cargoExtraArgs = "-p my-server"; 96 - src = fileSetForCrate ./crates/my-server; 94 + pname = "atpblog-server"; 95 + cargoExtraArgs = "-p atpblog-server"; 96 + src = fileSetForCrate ./crates/atpblog-server; 97 + }); 98 + atpblog-renderer = craneLib.buildPackage (individualCrateArgs // { 99 + pname = "atpblog-renderer"; 100 + cargoExtraArgs = "-p atpblog-renderer"; 101 + src = fileSetForCrate ./crates/atpblog-renderer; 97 102 }); 98 103 in 99 104 { 100 105 checks = { 101 106 # Build the crates as part of `nix flake check` for convenience 102 - inherit atpblog-cli atpblog-server; 107 + inherit atpblog-cli atpblog-server atpblog-renderer; 103 108 104 109 # Run clippy (and deny all warnings) on the workspace source, 105 110 # again, reusing the dependency artifacts from above. ··· 191 196 # MY_CUSTOM_DEVELOPMENT_VAR = "something else"; 192 197 193 198 # Extra inputs can be added here; cargo and rustc are provided by default. 194 - packages = [ 195 - pkgs.cargo-hakari 199 + packages = with pkgs; [ 200 + cargo-hakari 201 + nixd 196 202 ]; 197 203 }; 198 204 });