Skip to content

Commit

Permalink
Add public field to ambient.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
FredrikNoren committed Aug 28, 2023
1 parent 46f6ce3 commit e75f6b1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docs/src/reference/package.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
9 changes: 9 additions & 0 deletions shared_crates/package/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ pub struct Package {
#[serde(default)]
pub authors: Vec<String>,
pub content: PackageContent,
#[serde(default = "return_true")]
pub public: bool,
#[serde(default)]
pub includes: Vec<PathBuf>,
}
Expand Down Expand Up @@ -198,6 +200,7 @@ mod tests {
name = "Test"
version = "0.0.1"
content = { type = "Playable" }
public = false
"#;

assert_eq!(
Expand Down Expand Up @@ -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"] }
Expand Down Expand Up @@ -296,6 +300,7 @@ mod tests {
name = "Tic Tac Toe"
version = "0.0.1"
content = { type = "Playable" }
public = false
[build.rust]
feature-multibuild = ["client"]
Expand Down Expand Up @@ -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 = "" }
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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" }
Expand Down Expand Up @@ -591,6 +599,7 @@ mod tests {
name = "dependencies"
version = "0.0.1"
content = { type = "Playable" }
public = false
[dependencies]
deps_assets = { path = "deps/assets" }
Expand Down

0 comments on commit e75f6b1

Please sign in to comment.