From a7907c8a3721483d31f4fce2f754ed0a68bc74cf Mon Sep 17 00:00:00 2001 From: insects Date: Wed, 14 May 2025 18:28:41 +0200 Subject: [PATCH] fix: properly include `public/` in published crate --- Cargo.lock | 2 +- Cargo.toml | 4 +++- frontend/package.json | 2 +- src/server.rs | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 89b413c..13d5cea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -156,7 +156,7 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cargo-spiel" -version = "0.1.0" +version = "0.1.1" dependencies = [ "axum", "clap", diff --git a/Cargo.toml b/Cargo.toml index be0f29f..908af68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "cargo-spiel" description = "Run a playground connected to a Cargo project locally" -version = "0.1.0" +version = "0.1.1" license = "MIT" edition = "2024" +exclude = ["/frontend"] +include = ["/public", "/src"] [dependencies] axum = { version = "0.8.4", features = ["macros"] } diff --git a/frontend/package.json b/frontend/package.json index e187adc..3cf08c6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,7 +5,7 @@ "type": "module", "scripts": { "watch": "vite build --watch", - "build": "vite build", + "build": "vite build --emptyOutDir", "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json" }, "devDependencies": { diff --git a/src/server.rs b/src/server.rs index 13c412e..db857bf 100644 --- a/src/server.rs +++ b/src/server.rs @@ -17,7 +17,7 @@ use axum::{ use include_dir::{Dir, include_dir}; use serde::Serialize; -static PUBLIC_DIR: Dir<'_> = include_dir!("$PWD/public"); +static PUBLIC_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/public"); #[derive(Serialize)] struct OutputResponse {