Skip to content

Commit

Permalink
Update pkg meta (#463)
Browse files Browse the repository at this point in the history
# Objective

- Set up Valence so it's ready to publish on crates.io (an alpha version
for all crates has already been published)

# Solution

- Changed some package names.
- Added more info for crates.io
- Added symlink spaghetti for `extracted/` because data outside the
package root can't be included directly.
  • Loading branch information
rj00a authored Aug 12, 2023
1 parent 34946f2 commit 7186073
Show file tree
Hide file tree
Showing 63 changed files with 197 additions and 95 deletions.
61 changes: 33 additions & 28 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ readme = "README.md"
license.workspace = true
keywords = ["minecraft", "gamedev", "server", "ecs"]
categories = ["game-engines"]
include = ["/src", "/benches", "/examples", "/README.md", "/LICENSE.txt"]

[features]
default = [
Expand Down Expand Up @@ -88,7 +89,7 @@ exclude = []
resolver = "2"

[workspace.package]
version = "0.2.0-dev+mc.1.20.1"
version = "0.2.0-alpha.1+mc.1.20.1"
edition = "2021"
repository = "https://github.com/valence-rs/valence"
documentation = "https://docs.rs/valence/"
Expand All @@ -103,7 +104,9 @@ async-trait = "0.1.60"
atty = "0.2.14"
base64 = "0.21.0"
bevy_app = { version = "0.11", default-features = false }
bevy_ecs = { version = "0.11", default-features = false, features = ["multi-threaded"] }
bevy_ecs = { version = "0.11", default-features = false, features = [
"multi-threaded",
] }
bevy_hierarchy = { version = "0.11", default-features = false }
bevy_log = { version = "0.11" }
bevy_mod_debugdump = { version = "0.8.0", default-features = false }
Expand All @@ -126,8 +129,8 @@ fs_extra = "1.2.0"
glam = "0.23.0"
heck = "0.4.0"
hmac = "0.12.1"
indexmap = "1.9.3"
image = "0.24.6"
indexmap = "1.9.3"
itertools = "0.10.5"
lru = "0.10.0"
noise = "0.8.2"
Expand Down Expand Up @@ -163,29 +166,31 @@ tracing = "0.1.37"
tracing-subscriber = "0.3.16"
url = { version = "2.2.2", features = ["serde"] }
uuid = "1.3.1"
valence_advancement.path = "crates/valence_advancement"
valence_anvil.path = "crates/valence_anvil"
valence_build_utils.path = "crates/valence_build_utils"
valence_server.path = "crates/valence_server"
valence_packet_macros.path = "crates/valence_packet_macros"
valence_server_core.path = "crates/valence_server_core"
valence_entity.path = "crates/valence_entity"
valence_inventory.path = "crates/valence_inventory"
valence_nbt = { path = "crates/valence_nbt", features = ["uuid"] }
valence_network.path = "crates/valence_network"
valence_player_list.path = "crates/valence_player_list"
valence_registry.path = "crates/valence_registry"
valence_scoreboard.path = "crates/valence_scoreboard"
valence_world_border.path = "crates/valence_world_border"
valence_boss_bar.path = "crates/valence_boss_bar"
valence_weather.path = "crates/valence_weather"
valence_math.path = "crates/valence_math"
valence_ident.path = "crates/valence_ident"
valence_ident_macros.path = "crates/valence_ident_macros"
valence_generated.path = "crates/valence_generated"
valence_text.path = "crates/valence_text"
valence_protocol.path = "crates/valence_protocol"
valence_protocol_macros.path = "crates/valence_protocol_macros"
valence_lang.path = "crates/valence_lang"
valence.path = "."
valence = { path = ".", version = "0.2.0-alpha.1" }
valence_advancement = { path = "crates/valence_advancement", version = "0.2.0-alpha.1" }
valence_anvil = { path = "crates/valence_anvil", version = "0.2.0-alpha.1" }
valence_boss_bar = { path = "crates/valence_boss_bar", version = "0.2.0-alpha.1" }
valence_build_utils = { path = "crates/valence_build_utils", version = "0.2.0-alpha.1" }
valence_entity = { path = "crates/valence_entity", version = "0.2.0-alpha.1" }
valence_generated = { path = "crates/valence_generated", version = "0.2.0-alpha.1" }
valence_ident = { path = "crates/valence_ident", version = "0.2.0-alpha.1" }
valence_ident_macros = { path = "crates/valence_ident_macros", version = "0.2.0-alpha.1" }
valence_inventory = { path = "crates/valence_inventory", version = "0.2.0-alpha.1" }
valence_lang = { path = "crates/valence_lang", version = "0.2.0-alpha.1" }
valence_math = { path = "crates/valence_math", version = "0.2.0-alpha.1" }
valence_nbt = { path = "crates/valence_nbt", features = [
"uuid",
], version = "0.6.1" }
valence_network = { path = "crates/valence_network", version = "0.2.0-alpha.1" }
valence_packet_macros = { path = "crates/valence_packet_macros", version = "0.2.0-alpha.1" }
valence_player_list = { path = "crates/valence_player_list", version = "0.2.0-alpha.1" }
valence_protocol = { path = "crates/valence_protocol", version = "0.2.0-alpha.1" }
valence_protocol_macros = { path = "crates/valence_protocol_macros", version = "0.2.0-alpha.1" }
valence_registry = { path = "crates/valence_registry", version = "0.2.0-alpha.1" }
valence_scoreboard = { path = "crates/valence_scoreboard", version = "0.2.0-alpha.1" }
valence_server = { path = "crates/valence_server", version = "0.2.0-alpha.1" }
valence_server_common = { path = "crates/valence_server_common", version = "0.2.0-alpha.1" }
valence_text = { path = "crates/valence_text", version = "0.2.0-alpha.1" }
valence_weather = { path = "crates/valence_weather", version = "0.2.0-alpha.1" }
valence_world_border = { path = "crates/valence_world_border", version = "0.2.0-alpha.1" }
zip = "0.6.3"
4 changes: 2 additions & 2 deletions assets/depgraph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions crates/valence_advancement/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[package]
name = "valence_advancement"
description = "Advancement support for Valence"
readme = "README.md"
version.workspace = true
edition.workspace = true
repository.workspace = true
documentation.workspace = true
license.workspace = true

[dependencies]
valence_server.workspace = true
Expand Down
7 changes: 4 additions & 3 deletions crates/valence_anvil/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[package]
name = "valence_anvil"
description = "Anvil world format support for Valence"
documentation.workspace = true
description = "Anvil file format support for Valence"
readme = "README.md"
license.workspace = true
keywords = ["anvil", "minecraft", "deserialization"]
version.workspace = true
edition.workspace = true
repository.workspace = true
documentation.workspace = true
license.workspace = true

[dependencies]
bevy_app.workspace = true
Expand Down
4 changes: 3 additions & 1 deletion crates/valence_boss_bar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ name = "valence_boss_bar"
description = "Boss bar API for Valence"
readme = "README.md"
keywords = ["minecraft", "bossbar", "api"]
documentation.workspace = true
version.workspace = true
edition.workspace = true
repository.workspace = true
documentation.workspace = true
license.workspace = true

[dependencies]
valence_entity.workspace = true
Expand Down
5 changes: 5 additions & 0 deletions crates/valence_build_utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[package]
name = "valence_build_utils"
description = "Common build script utilities for Valence"
readme = "README.md"
version.workspace = true
edition.workspace = true
repository.workspace = true
documentation.workspace = true
license.workspace = true

[dependencies]
anyhow.workspace = true
Expand Down
7 changes: 6 additions & 1 deletion crates/valence_entity/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[package]
name = "valence_entity"
description = "Minecraft entities for Valence"
readme = "README.md"
version.workspace = true
edition.workspace = true
repository.workspace = true
documentation.workspace = true
license.workspace = true

[dependencies]
anyhow.workspace = true
Expand All @@ -13,7 +18,7 @@ paste.workspace = true
rustc-hash.workspace = true
tracing.workspace = true
uuid.workspace = true
valence_server_core.workspace = true
valence_server_common.workspace = true
valence_nbt.workspace = true
valence_protocol.workspace = true

Expand Down
13 changes: 6 additions & 7 deletions crates/valence_entity/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,19 +271,18 @@ impl Value {
type Entities = BTreeMap<String, Entity>;

pub fn main() -> anyhow::Result<()> {
rerun_if_changed(["../../extracted/misc.json", "../../extracted/entities.json"]);
rerun_if_changed(["extracted/misc.json", "extracted/entities.json"]);

write_generated_file(build()?, "entity.rs")
}

fn build() -> anyhow::Result<TokenStream> {
let entity_types =
serde_json::from_str::<EntityTypes>(include_str!("../../extracted/misc.json"))
.context("failed to deserialize misc.json")?
.entity_type;
let entity_types = serde_json::from_str::<EntityTypes>(include_str!("extracted/misc.json"))
.context("failed to deserialize misc.json")?
.entity_type;

let entities: Entities =
serde_json::from_str::<Entities>(include_str!("../../extracted/entities.json"))
serde_json::from_str::<Entities>(include_str!("extracted/entities.json"))
.context("failed to deserialize entities.json")?
.into_iter()
.collect();
Expand Down Expand Up @@ -518,7 +517,7 @@ fn build() -> anyhow::Result<TokenStream> {
}

let misc_entity_data: MiscEntityData =
serde_json::from_str(include_str!("../../extracted/misc.json"))?;
serde_json::from_str(include_str!("extracted/misc.json"))?;

let entity_status_variants = misc_entity_data
.entity_status
Expand Down
1 change: 1 addition & 0 deletions crates/valence_entity/extracted/entities.json
1 change: 1 addition & 0 deletions crates/valence_entity/extracted/misc.json
2 changes: 1 addition & 1 deletion crates/valence_entity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use tracing::warn;
use tracked_data::TrackedData;
use valence_math::{DVec3, Vec3};
use valence_protocol::{BlockPos, ChunkPos, Decode, Encode, VarInt};
use valence_server_core::{Despawned, UniqueId, DEFAULT_TPS};
use valence_server_common::{Despawned, UniqueId, DEFAULT_TPS};

include!(concat!(env!("OUT_DIR"), "/entity.rs"));
pub struct EntityPlugin;
Expand Down
2 changes: 1 addition & 1 deletion crates/valence_entity/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use valence_protocol::packets::play::{
};
use valence_protocol::var_int::VarInt;
use valence_protocol::ByteAngle;
use valence_server_core::UniqueId;
use valence_server_common::UniqueId;

use crate::tracked_data::TrackedData;
use crate::{
Expand Down
2 changes: 2 additions & 0 deletions crates/valence_generated/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[package]
name = "valence_generated"
description = "Generated code for valence and valence_protocol"
readme = "README.md"
version.workspace = true
edition.workspace = true
repository.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions crates/valence_generated/build/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ struct Shape {
}

pub fn build() -> anyhow::Result<TokenStream> {
rerun_if_changed(["../../extracted/blocks.json"]);
rerun_if_changed(["extracted/blocks.json"]);

let TopLevel {
blocks,
shapes,
block_entity_types,
} = serde_json::from_str(include_str!("../../../extracted/blocks.json"))?;
} = serde_json::from_str(include_str!("../extracted/blocks.json"))?;

let max_state_id = blocks.iter().map(|b| b.max_state_id()).max().unwrap();

Expand Down
4 changes: 2 additions & 2 deletions crates/valence_generated/build/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ struct FoodComponent {
}

pub fn build() -> anyhow::Result<TokenStream> {
rerun_if_changed(["../../extracted/items.json"]);
rerun_if_changed(["extracted/items.json"]);

let items = serde_json::from_str::<Vec<Item>>(include_str!("../../../extracted/items.json"))?;
let items = serde_json::from_str::<Vec<Item>>(include_str!("../extracted/items.json"))?;

let item_kind_count = items.len();

Expand Down
5 changes: 2 additions & 3 deletions crates/valence_generated/build/packet_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ struct Packet {
}

pub fn build() -> anyhow::Result<TokenStream> {
rerun_if_changed(["../../extracted/packets.json"]);
rerun_if_changed(["extracted/packets.json"]);

let packets: Vec<Packet> =
serde_json::from_str(include_str!("../../../extracted/packets.json"))?;
let packets: Vec<Packet> = serde_json::from_str(include_str!("../extracted/packets.json"))?;

let mut consts = TokenStream::new();

Expand Down
5 changes: 2 additions & 3 deletions crates/valence_generated/build/sound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ pub struct Sound {
}

pub fn build() -> anyhow::Result<TokenStream> {
rerun_if_changed(["../../extracted/sounds.json"]);
rerun_if_changed(["extracted/sounds.json"]);

let sounds =
serde_json::from_str::<Vec<Sound>>(include_str!("../../../extracted/sounds.json"))?;
let sounds = serde_json::from_str::<Vec<Sound>>(include_str!("../extracted/sounds.json"))?;

let sound_count = sounds.len();

Expand Down
1 change: 1 addition & 0 deletions crates/valence_generated/extracted/blocks.json
1 change: 1 addition & 0 deletions crates/valence_generated/extracted/items.json
1 change: 1 addition & 0 deletions crates/valence_generated/extracted/packets.json
1 change: 1 addition & 0 deletions crates/valence_generated/extracted/sounds.json
2 changes: 2 additions & 0 deletions crates/valence_ident/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[package]
name = "valence_ident"
description = "Parse and create Minecraft's resource identifiers"
readme = "README.md"
version.workspace = true
edition.workspace = true
repository.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/valence_ident/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![doc = include_str!("../README.md")]

//! Resource identifiers.
use std::borrow::{Borrow, Cow};
use std::cmp::Ordering;
use std::fmt;
Expand Down
4 changes: 3 additions & 1 deletion crates/valence_ident_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[package]
name = "valence_ident_macros"
description = "Procedural macros for valence_ident"
readme = "README.md"
version.workspace = true
edition.workspace = true
repository.workspace = true
Expand All @@ -12,4 +14,4 @@ proc-macro = true
[dependencies]
proc-macro2.workspace = true
quote.workspace = true
syn = { workspace = true, features = ["full"] }
syn = { workspace = true, features = ["full"] }
5 changes: 5 additions & 0 deletions crates/valence_inventory/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[package]
name = "valence_inventory"
description = "Inventory support for Valence"
readme = "README.md"
version.workspace = true
edition.workspace = true
repository.workspace = true
documentation.workspace = true
license.workspace = true

[dependencies]
bevy_app.workspace = true
Expand Down
4 changes: 3 additions & 1 deletion crates/valence_lang/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[package]
name = "valence_lang"
description = "Minecraft's languages and translation keys."
readme = "README.md"
version.workspace = true
edition.workspace = true
repository.workspace = true
Expand All @@ -13,4 +15,4 @@ proc-macro2.workspace = true
quote.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
valence_build_utils.workspace = true
valence_build_utils.workspace = true
7 changes: 3 additions & 4 deletions crates/valence_lang/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ pub fn main() -> anyhow::Result<()> {
}

fn build() -> anyhow::Result<TokenStream> {
rerun_if_changed(["../../extracted/translation_keys.json"]);
rerun_if_changed(["extracted/translation_keys.json"]);

let translations = serde_json::from_str::<Vec<Translation>>(include_str!(
"../../extracted/translation_keys.json"
))?;
let translations =
serde_json::from_str::<Vec<Translation>>(include_str!("extracted/translation_keys.json"))?;

let translation_key_consts = translations
.iter()
Expand Down
1 change: 1 addition & 0 deletions crates/valence_lang/extracted/translation_keys.json
Loading

0 comments on commit 7186073

Please sign in to comment.