From e75f6b1a0432b6a3e3049366988b7a5bef0b7d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Nore=CC=81n?= Date: Mon, 28 Aug 2023 14:54:31 +0200 Subject: [PATCH] Add public field to ambient.toml --- docs/src/reference/package.md | 15 ++++++++------- shared_crates/package/src/manifest.rs | 9 +++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/src/reference/package.md b/docs/src/reference/package.md index d9ce76f950..ffc4ae723d 100644 --- a/docs/src/reference/package.md +++ b/docs/src/reference/package.md @@ -84,13 +84,14 @@ Note that `ValueType`s are not themselves values, but rather types of values. Fo The `package` section contains metadata about the package itself, such as its name and version. -| Property | Type | Description | -| ------------- | --------------------- | --------------------------------------------------------------------------------------------- | -| `id` | `SnakeCaseIdentifier` | _Required_. The package's snake-cased ID. | -| `name` | `String` | _Optional_. A human-readable name for the package. | -| `description` | `String` | _Optional_. A human-readable description of the package. | -| `version` | `String` | _Optional_. The package's version, in `(major, minor, patch)` format. Semantically versioned. | -| `content` | `PackageContent` | A description of the content of this Package. See below. | +| Property | Type | Description | +| ------------- | --------------------- | ------------------------------------------------------------------------------------------------- | +| `id` | `SnakeCaseIdentifier` | _Required_. The package's snake-cased ID. | +| `name` | `String` | _Optional_. A human-readable name for the package. | +| `description` | `String` | _Optional_. A human-readable description of the package. | +| `version` | `String` | _Optional_. The package's version, in `(major, minor, patch)` format. Semantically versioned. | +| `content` | `PackageContent` | _Required_. A description of the content of this Package. See below. | +| `public` | `Bool` | _Optional_. Indicates if this package will be publicly available when deployed. Defaults to true. | #### `PackageContent` diff --git a/shared_crates/package/src/manifest.rs b/shared_crates/package/src/manifest.rs index a46433f6d6..173164c482 100644 --- a/shared_crates/package/src/manifest.rs +++ b/shared_crates/package/src/manifest.rs @@ -64,6 +64,8 @@ pub struct Package { #[serde(default)] pub authors: Vec, pub content: PackageContent, + #[serde(default = "return_true")] + pub public: bool, #[serde(default)] pub includes: Vec, } @@ -198,6 +200,7 @@ mod tests { name = "Test" version = "0.0.1" content = { type = "Playable" } + public = false "#; assert_eq!( @@ -237,6 +240,7 @@ mod tests { name = "Tic Tac Toe" version = "0.0.1" content = { type = "Playable" } + public = false [components] cell = { type = "i32", name = "Cell", description = "The ID of the cell this player is in", attributes = ["store"] } @@ -296,6 +300,7 @@ mod tests { name = "Tic Tac Toe" version = "0.0.1" content = { type = "Playable" } + public = false [build.rust] feature-multibuild = ["client"] @@ -330,6 +335,7 @@ mod tests { name = "My Package" version = "0.0.1" content = { type = "Playable" } + public = false [components] "core::transform::rotation" = { type = "quat", name = "Rotation", description = "" } @@ -471,6 +477,7 @@ mod tests { name = "Tic Tac Toe" version = "0.0.1" content = { type = "Playable" } + public = false [enums.CellState] description = "The current cell state" @@ -515,6 +522,7 @@ mod tests { name = "Test" version = "0.0.1" content = { type = "Playable" } + public = false [components] test = { type = "I32", name = "Test", description = "Test" } @@ -591,6 +599,7 @@ mod tests { name = "dependencies" version = "0.0.1" content = { type = "Playable" } + public = false [dependencies] deps_assets = { path = "deps/assets" }