deps: bump root deps as of 2025-06-01 (#1734)

* deps: bump root deps as of 2025-06-01

* update schema generation

* update config file link too

* rerun
This commit is contained in:
Clement Tsang 2025-06-01 19:49:05 -04:00 committed by GitHub
parent 0633ed96c6
commit 3d35d08347
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 187 additions and 140 deletions

View File

@ -11,6 +11,8 @@ on:
- "schema/**"
- "scripts/schema/**"
- ".github/workflows/validate_schema.yml"
- "src/bin/schema.rs"
- "Cargo.toml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -26,7 +28,7 @@ jobs:
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
with:
skip_after_successful_duplicate: "true"
paths: '["schema/**", ".github/workflows/validate_schema.yml"]'
paths: '["schema/**", "scripts/schema/**", ".github/workflows/validate_schema.yml", "src/bin/schema.rs", "Cargo.toml"]'
do_not_skip: '["workflow_dispatch"]'
test-build-documentation:

57
Cargo.lock generated
View File

@ -253,9 +253,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "clap"
version = "4.5.38"
version = "4.5.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000"
checksum = "fd60e63e9be68e5fb56422e397cf9baddded06dae1d2e523401542383bc72a9f"
dependencies = [
"clap_builder",
"clap_derive",
@ -263,9 +263,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.38"
version = "4.5.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120"
checksum = "89cc6392a1f72bbeb820d71f32108f61fdaf18bc526e1d23954168a67759ef51"
dependencies = [
"anstream",
"anstyle",
@ -276,9 +276,9 @@ dependencies = [
[[package]]
name = "clap_complete"
version = "4.5.50"
version = "4.5.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c91d3baa3bcd889d60e6ef28874126a0b384fd225ab83aa6d8a801c519194ce1"
checksum = "1a554639e42d0c838336fc4fbedb9e2df3ad1fa4acda149f9126b4ccfcd7900f"
dependencies = [
"clap",
]
@ -295,9 +295,9 @@ dependencies = [
[[package]]
name = "clap_complete_nushell"
version = "4.5.5"
version = "4.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6a8b1593457dfc2fe539002b795710d022dc62a65bf15023f039f9760c7b18a"
checksum = "9801fe85d7986742027c6d365728a6a4ecb6d2b09866de18be836fef7ebf7df1"
dependencies = [
"clap",
"clap_complete",
@ -368,9 +368,9 @@ dependencies = [
[[package]]
name = "core-foundation"
version = "0.10.0"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63"
checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
dependencies = [
"core-foundation-sys",
"libc",
@ -971,9 +971,9 @@ dependencies = [
[[package]]
name = "nvml-wrapper"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c9bff0aa1d48904a1385ea2a8b97576fbdcbc9a3cfccd0d31fe978e1c4038c5"
checksum = "0d5c6c0ef9702176a570f06ad94f3198bc29c524c8b498f1b9346e1b1bdcbb3a"
dependencies = [
"bitflags 2.9.1",
"libloading",
@ -985,9 +985,9 @@ dependencies = [
[[package]]
name = "nvml-wrapper-sys"
version = "0.8.0"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "698d45156f28781a4e79652b6ebe2eaa0589057d588d3aec1333f6466f13fcb5"
checksum = "dd23dbe2eb8d8335d2bce0299e0a07d6a63c089243d626ca75b770a962ff49e6"
dependencies = [
"libloading",
]
@ -1212,6 +1212,26 @@ dependencies = [
"thiserror 2.0.12",
]
[[package]]
name = "ref-cast"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf"
dependencies = [
"ref-cast-impl",
]
[[package]]
name = "ref-cast-impl"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "regex"
version = "1.11.1"
@ -1302,11 +1322,12 @@ dependencies = [
[[package]]
name = "schemars"
version = "0.8.22"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615"
checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f"
dependencies = [
"dyn-clone",
"ref-cast",
"schemars_derive",
"serde",
"serde_json",
@ -1314,9 +1335,9 @@ dependencies = [
[[package]]
name = "schemars_derive"
version = "0.8.22"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d"
checksum = "5016d94c77c6d32f0b8e08b781f7dc8a90c2007d4e77472cc2807bc10a8438fe"
dependencies = [
"proc-macro2",
"quote",

View File

@ -75,7 +75,7 @@ generate_schema = ["schemars", "serde_json", "strum"]
anyhow = "1.0.98"
backtrace = "0.3.75"
cfg-if = "1.0.0"
clap = { version = "4.5.38", features = ["default", "cargo", "wrap_help", "derive"] }
clap = { version = "4.5.39", features = ["default", "cargo", "wrap_help", "derive"] }
concat-string = "1.0.1"
crossterm = "0.29.0"
ctrlc = { version = "3.4.7", features = ["termination"] }
@ -85,7 +85,7 @@ humantime = "2.2.0"
indexmap = "2.9.0"
indoc = "2.0.6"
itertools = "0.14.0"
nvml-wrapper = { version = "0.10.0", optional = true, features = ["legacy-functions"] }
nvml-wrapper = { version = "0.11.0", optional = true, features = ["legacy-functions"] }
regex = "1.11.1"
serde = { version = "1.0.219", features = ["derive"] }
starship-battery = { version = "0.10.1", optional = true }
@ -103,7 +103,7 @@ log = { version = "0.4.27", optional = true }
time = { version = "0.3.41", features = ["local-offset", "formatting", "macros"], optional = true }
# These are just used for JSON schema generation.
schemars = { version = "0.8.22", optional = true }
schemars = { version = "0.9.0", optional = true }
serde_json = { version = "1.0.140", optional = true }
strum = { version = "0.27.1", features = ["derive"], optional = true }
@ -114,7 +114,7 @@ libc = "0.2.172"
rustix = { version = "1.0.7", features = ["fs", "param"] }
[target.'cfg(target_os = "macos")'.dependencies]
core-foundation = "0.10.0"
core-foundation = "0.10.1"
mach2 = "0.4.2"
[target.'cfg(target_os = "windows")'.dependencies]
@ -143,9 +143,9 @@ tempfile = "3.20.0"
portable-pty = "0.9.0"
[build-dependencies]
clap = { version = "4.5.38", features = ["default", "cargo", "wrap_help", "derive"] }
clap_complete = "4.5.50"
clap_complete_nushell = "4.5.5"
clap = { version = "4.5.39", features = ["default", "cargo", "wrap_help", "derive"] }
clap_complete = "4.5.52"
clap_complete_nushell = "4.5.6"
clap_complete_fig = "4.5.2"
clap_mangen = "0.2.26"
indoc = "2.0.6"

View File

@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/nightly/bottom.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Schema for bottom's config file (nightly)",
"description": "https://clementtsang.github.io/bottom/nightly/configuration/config-file",
"type": "object",
@ -8,7 +8,7 @@
"cpu": {
"anyOf": [
{
"$ref": "#/definitions/CpuConfig"
"$ref": "#/$defs/CpuConfig"
},
{
"type": "null"
@ -18,7 +18,7 @@
"disk": {
"anyOf": [
{
"$ref": "#/definitions/DiskConfig"
"$ref": "#/$defs/DiskConfig"
},
{
"type": "null"
@ -28,7 +28,7 @@
"flags": {
"anyOf": [
{
"$ref": "#/definitions/FlagConfig"
"$ref": "#/$defs/FlagConfig"
},
{
"type": "null"
@ -38,7 +38,7 @@
"network": {
"anyOf": [
{
"$ref": "#/definitions/NetworkConfig"
"$ref": "#/$defs/NetworkConfig"
},
{
"type": "null"
@ -48,7 +48,7 @@
"processes": {
"anyOf": [
{
"$ref": "#/definitions/ProcessesConfig"
"$ref": "#/$defs/ProcessesConfig"
},
{
"type": "null"
@ -61,13 +61,13 @@
"null"
],
"items": {
"$ref": "#/definitions/row"
"$ref": "#/$defs/row"
}
},
"styles": {
"anyOf": [
{
"$ref": "#/definitions/StyleConfig"
"$ref": "#/$defs/StyleConfig"
},
{
"type": "null"
@ -77,7 +77,7 @@
"temperature": {
"anyOf": [
{
"$ref": "#/definitions/TempConfig"
"$ref": "#/$defs/TempConfig"
},
{
"type": "null"
@ -85,7 +85,7 @@
]
}
},
"definitions": {
"$defs": {
"BatteryStyle": {
"description": "Styling specific to the battery widget.",
"type": "object",
@ -94,7 +94,7 @@
"description": "The colour of the battery widget bar when the battery is over 50%.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -105,7 +105,7 @@
"description": "The colour of the battery widget bar when the battery is under 10%.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -116,7 +116,7 @@
"description": "The colour of the battery widget bar when the battery between 10% to 50%.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -133,12 +133,12 @@
"type": "object",
"properties": {
"default": {
"$ref": "#/definitions/CpuDefault"
"$ref": "#/$defs/CpuDefault"
}
}
},
"CpuDefault": {
"description": "The default selection of the CPU widget. If the given selection is invalid, we will fall back to all.",
"description": "The default selection of the CPU widget. If the given selection is invalid,\n we will fall back to all.",
"type": "string",
"enum": [
"all",
@ -153,7 +153,7 @@
"description": "The colour of the \"All\" CPU label.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -164,7 +164,7 @@
"description": "The colour of the average CPU label and graph line.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -178,7 +178,7 @@
"null"
],
"items": {
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
}
}
}
@ -209,14 +209,14 @@
"description": "A list of disk widget columns.",
"type": "array",
"items": {
"$ref": "#/definitions/DiskColumn"
"$ref": "#/$defs/DiskColumn"
}
},
"mount_filter": {
"description": "A filter over the mount names.",
"anyOf": [
{
"$ref": "#/definitions/IgnoreList"
"$ref": "#/$defs/IgnoreList"
},
{
"type": "null"
@ -227,7 +227,7 @@
"description": "A filter over the disk names.",
"anyOf": [
{
"$ref": "#/definitions/IgnoreList"
"$ref": "#/$defs/IgnoreList"
},
{
"type": "null"
@ -239,10 +239,10 @@
"FinalWidget": {
"description": "Represents a widget.",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string"
},
"default": {
"type": [
"boolean",
@ -255,12 +255,12 @@
"null"
],
"format": "uint32",
"minimum": 0.0
},
"type": {
"type": "string"
"minimum": 0
}
}
},
"required": [
"type"
]
},
"FlagConfig": {
"type": "object",
@ -310,7 +310,7 @@
"default_time_value": {
"anyOf": [
{
"$ref": "#/definitions/StringOrNum"
"$ref": "#/$defs/StringOrNum"
},
{
"type": "null"
@ -323,7 +323,7 @@
"null"
],
"format": "uint64",
"minimum": 0.0
"minimum": 0
},
"default_widget_type": {
"type": [
@ -442,7 +442,7 @@
"rate": {
"anyOf": [
{
"$ref": "#/definitions/StringOrNum"
"$ref": "#/$defs/StringOrNum"
},
{
"type": "null"
@ -458,7 +458,7 @@
"retention": {
"anyOf": [
{
"$ref": "#/definitions/StringOrNum"
"$ref": "#/$defs/StringOrNum"
},
{
"type": "null"
@ -480,7 +480,7 @@
"time_delta": {
"anyOf": [
{
"$ref": "#/definitions/StringOrNum"
"$ref": "#/$defs/StringOrNum"
},
{
"type": "null"
@ -521,7 +521,7 @@
"description": "The general colour of the parts of the graph.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -532,7 +532,7 @@
"description": "Text styling for graph's legend text.",
"anyOf": [
{
"$ref": "#/definitions/TextStyleConfig"
"$ref": "#/$defs/TextStyleConfig"
},
{
"type": "null"
@ -543,17 +543,14 @@
},
"IgnoreList": {
"type": "object",
"required": [
"list"
],
"properties": {
"case_sensitive": {
"default": false,
"type": "boolean"
"type": "boolean",
"default": false
},
"is_list_ignored": {
"default": true,
"type": "boolean"
"type": "boolean",
"default": true
},
"list": {
"type": "array",
@ -562,14 +559,17 @@
}
},
"regex": {
"default": false,
"type": "boolean"
"type": "boolean",
"default": false
},
"whole_word": {
"default": false,
"type": "boolean"
"type": "boolean",
"default": false
}
}
},
"required": [
"list"
]
},
"MemoryStyle": {
"description": "Styling specific to the memory widget.",
@ -579,7 +579,7 @@
"description": "The colour of the ARC label and graph line.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -590,7 +590,7 @@
"description": "The colour of the cache label and graph line. Does not do anything on Windows.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -604,14 +604,14 @@
"null"
],
"items": {
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
}
},
"ram_color": {
"description": "The colour of the RAM label and graph line.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -622,7 +622,7 @@
"description": "The colour of the swap label and graph line.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -639,7 +639,7 @@
"description": "A filter over the network interface names.",
"anyOf": [
{
"$ref": "#/definitions/IgnoreList"
"$ref": "#/$defs/IgnoreList"
},
{
"type": "null"
@ -656,7 +656,7 @@
"description": "The colour of the RX (download) label and graph line.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -667,7 +667,7 @@
"description": "he colour of the total RX (download) label in basic mode.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -678,7 +678,7 @@
"description": "The colour of the TX (upload) label and graph line.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -689,7 +689,7 @@
"description": "The colour of the total TX (upload) label in basic mode.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -735,27 +735,24 @@
"description": "A list of process widget columns.",
"type": "array",
"items": {
"$ref": "#/definitions/ProcColumn"
"$ref": "#/$defs/ProcColumn"
}
}
}
},
"RowChildren": {
"description": "Represents a child of a Row - either a Col (column) or a FinalWidget.\n\nA Col can also have an optional length and children. We only allow columns to have FinalWidgets as children, lest we get some amount of mutual recursion between Row and Col.",
"description": "Represents a child of a Row - either a Col (column) or a FinalWidget.\n\n A Col can also have an optional length and children. We only allow columns\n to have FinalWidgets as children, lest we get some amount of mutual\n recursion between Row and Col.",
"anyOf": [
{
"$ref": "#/definitions/FinalWidget"
"$ref": "#/$defs/FinalWidget"
},
{
"type": "object",
"required": [
"child"
],
"properties": {
"child": {
"type": "array",
"items": {
"$ref": "#/definitions/FinalWidget"
"$ref": "#/$defs/FinalWidget"
}
},
"ratio": {
@ -764,9 +761,12 @@
"null"
],
"format": "uint32",
"minimum": 0.0
"minimum": 0
}
}
},
"required": [
"child"
]
}
]
},
@ -778,7 +778,7 @@
{
"type": "integer",
"format": "uint64",
"minimum": 0.0
"minimum": 0
}
]
},
@ -790,7 +790,7 @@
"description": "Styling for the battery widget.",
"anyOf": [
{
"$ref": "#/definitions/BatteryStyle"
"$ref": "#/$defs/BatteryStyle"
},
{
"type": "null"
@ -801,7 +801,7 @@
"description": "Styling for the CPU widget.",
"anyOf": [
{
"$ref": "#/definitions/CpuStyle"
"$ref": "#/$defs/CpuStyle"
},
{
"type": "null"
@ -812,7 +812,7 @@
"description": "Styling for graph widgets.",
"anyOf": [
{
"$ref": "#/definitions/GraphStyle"
"$ref": "#/$defs/GraphStyle"
},
{
"type": "null"
@ -823,7 +823,7 @@
"description": "Styling for the memory widget.",
"anyOf": [
{
"$ref": "#/definitions/MemoryStyle"
"$ref": "#/$defs/MemoryStyle"
},
{
"type": "null"
@ -834,7 +834,7 @@
"description": "Styling for the network widget.",
"anyOf": [
{
"$ref": "#/definitions/NetworkStyle"
"$ref": "#/$defs/NetworkStyle"
},
{
"type": "null"
@ -845,7 +845,7 @@
"description": "Styling for table widgets.",
"anyOf": [
{
"$ref": "#/definitions/TableStyle"
"$ref": "#/$defs/TableStyle"
},
{
"type": "null"
@ -853,7 +853,7 @@
]
},
"theme": {
"description": "A built-in theme.\n\nIf this is and a custom colour are both set, in the config file, the custom colour scheme will be prioritized first. If a theme is set in the command-line args, however, it will always be prioritized first.",
"description": "A built-in theme.\n\n If this is and a custom colour are both set, in the config file,\n the custom colour scheme will be prioritized first. If a theme\n is set in the command-line args, however, it will always be\n prioritized first.",
"type": [
"string",
"null"
@ -863,7 +863,7 @@
"description": "Styling for general widgets.",
"anyOf": [
{
"$ref": "#/definitions/WidgetStyle"
"$ref": "#/$defs/WidgetStyle"
},
{
"type": "null"
@ -880,7 +880,7 @@
"description": "Text styling for table headers.",
"anyOf": [
{
"$ref": "#/definitions/TextStyleConfig"
"$ref": "#/$defs/TextStyleConfig"
},
{
"type": "null"
@ -897,7 +897,7 @@
"description": "A filter over the sensor names.",
"anyOf": [
{
"$ref": "#/definitions/IgnoreList"
"$ref": "#/$defs/IgnoreList"
},
{
"type": "null"
@ -910,7 +910,7 @@
"description": "A style for text.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "object",
@ -919,7 +919,7 @@
"description": "A built-in ANSI colour, RGB hex, or RGB colour code.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -927,7 +927,7 @@
]
},
"bold": {
"description": "Whether to make this text bolded or not. If not set, will default to built-in defaults.",
"description": "Whether to make this text bolded or not. If not set,\n will default to built-in defaults.",
"type": [
"boolean",
"null"
@ -937,7 +937,7 @@
"description": "A built-in ANSI colour, RGB hex, or RGB colour code.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -945,7 +945,7 @@
]
},
"italics": {
"description": "Whether to make this text italicized or not. If not set, will default to built-in defaults.",
"description": "Whether to make this text italicized or not. If not set,\n will default to built-in defaults.",
"type": [
"boolean",
"null"
@ -972,7 +972,7 @@
"description": "The colour of the widgets' borders.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -983,7 +983,7 @@
"description": "Text styling for text when representing something that is disabled.",
"anyOf": [
{
"$ref": "#/definitions/TextStyleConfig"
"$ref": "#/$defs/TextStyleConfig"
},
{
"type": "null"
@ -994,7 +994,7 @@
"description": "The colour of a widget's borders when the widget is selected.",
"anyOf": [
{
"$ref": "#/definitions/ColorStr"
"$ref": "#/$defs/ColorStr"
},
{
"type": "null"
@ -1005,7 +1005,7 @@
"description": "Text styling for text when representing something that is selected.",
"anyOf": [
{
"$ref": "#/definitions/TextStyleConfig"
"$ref": "#/$defs/TextStyleConfig"
},
{
"type": "null"
@ -1016,7 +1016,7 @@
"description": "Text styling for text in general.",
"anyOf": [
{
"$ref": "#/definitions/TextStyleConfig"
"$ref": "#/$defs/TextStyleConfig"
},
{
"type": "null"
@ -1027,7 +1027,7 @@
"description": "Widget borders type.",
"anyOf": [
{
"$ref": "#/definitions/WidgetBorderType"
"$ref": "#/$defs/WidgetBorderType"
},
{
"type": "null"
@ -1038,7 +1038,7 @@
"description": "Text styling for a widget's title.",
"anyOf": [
{
"$ref": "#/definitions/TextStyleConfig"
"$ref": "#/$defs/TextStyleConfig"
},
{
"type": "null"
@ -1048,7 +1048,7 @@
}
},
"row": {
"description": "Represents a row. This has a length of some sort (optional) and a vector of children.",
"description": "Represents a row. This has a length of some sort (optional) and a vector\n of children.",
"type": "object",
"properties": {
"child": {
@ -1057,7 +1057,7 @@
"null"
],
"items": {
"$ref": "#/definitions/RowChildren"
"$ref": "#/$defs/RowChildren"
}
},
"ratio": {
@ -1066,7 +1066,7 @@
"null"
],
"format": "uint32",
"minimum": 0.0
"minimum": 0
}
}
}

View File

@ -3,6 +3,7 @@
use bottom::{options::config, widgets};
use clap::Parser;
use itertools::Itertools;
use serde_json::Value;
use strum::VariantArray;
#[derive(Parser)]
@ -16,10 +17,16 @@ fn generate_schema(schema_options: SchemaOptions) -> anyhow::Result<()> {
{
// TODO: Maybe make this case insensitive? See https://stackoverflow.com/a/68639341
let proc_columns = schema.definitions.get_mut("ProcColumn").unwrap();
match proc_columns {
schemars::schema::Schema::Object(proc_columns) => {
let enums = proc_columns.enum_values.as_mut().unwrap();
match schema
.as_object_mut()
.unwrap()
.get_mut("$defs")
.unwrap()
.get_mut("ProcColumn")
.unwrap()
{
Value::Object(proc_columns) => {
let enums = proc_columns.get_mut("enum").unwrap();
*enums = widgets::ProcColumn::VARIANTS
.iter()
.flat_map(|var| var.get_schema_names())
@ -31,10 +38,16 @@ fn generate_schema(schema_options: SchemaOptions) -> anyhow::Result<()> {
_ => anyhow::bail!("missing proc columns definition"),
}
let disk_columns = schema.definitions.get_mut("DiskColumn").unwrap();
match disk_columns {
schemars::schema::Schema::Object(disk_columns) => {
let enums = disk_columns.enum_values.as_mut().unwrap();
match schema
.as_object_mut()
.unwrap()
.get_mut("$defs")
.unwrap()
.get_mut("DiskColumn")
.unwrap()
{
Value::Object(disk_columns) => {
let enums = disk_columns.get_mut("enum").unwrap();
*enums = widgets::DiskColumn::VARIANTS
.iter()
.flat_map(|var| var.get_schema_names())
@ -47,20 +60,31 @@ fn generate_schema(schema_options: SchemaOptions) -> anyhow::Result<()> {
}
}
let metadata = schema.schema.metadata.as_mut().unwrap();
let version = schema_options.version.unwrap_or("nightly".to_string());
metadata.id = Some(format!(
"https://github.com/ClementTsang/bottom/blob/main/schema/{version}/bottom.json"
));
metadata.description = Some(format!(
"https://clementtsang.github.io/bottom/{}/configuration/config-file",
if version == "nightly" {
"nightly"
} else {
"stable"
}
));
metadata.title = Some(format!("Schema for bottom's config file ({version})",));
schema.insert(
"$id".into(),
format!("https://github.com/ClementTsang/bottom/blob/main/schema/{version}/bottom.json")
.into(),
);
schema.insert(
"description".into(),
format!(
"https://bottom.pages.dev/{}/configuration/config-file/",
if version == "nightly" {
"nightly"
} else {
"stable"
}
)
.into(),
);
schema.insert(
"title".into(),
format!("Schema for bottom's config file ({version})").into(),
);
println!("{}", serde_json::to_string_pretty(&schema).unwrap());
Ok(())