Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deprecated attribute in json schema #3482

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 41 additions & 37 deletions schema/mise.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$id": "https://mise.jdx.dev/schema/mise.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"$schema": "http://json-schema.org/2019-09/schema#",
"title": "mise",
"type": "object",
"$defs": {
Expand Down Expand Up @@ -148,12 +148,13 @@
},
"asdf": {
"description": "use asdf as a default plugin backend",
"deprecated": "Use disable_backends instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"asdf_compat": {
"description": "set to true to ensure .tool-versions will be compatible with asdf",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"cache_prune_age": {
"default": "30d",
Expand All @@ -172,7 +173,8 @@
},
"cargo_binstall": {
"description": "Use cargo-binstall instead of cargo install if available",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"cd": {
"description": "Path to change to after launching mise",
Expand Down Expand Up @@ -215,8 +217,8 @@
},
"disable_default_shorthands": {
"description": "Disables built-in shorthands to asdf/vfox plugins",
"deprecated": "Replaced with `disable_default_registry`",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"disable_hints": {
"default": [],
Expand All @@ -243,7 +245,7 @@
}
},
"env_file": {
"description": "Path to a file containing environment variables.",
"description": "Path to a file containing environment variables to automatically load.",
"type": "string"
},
"erlang": {
Expand Down Expand Up @@ -299,8 +301,8 @@
},
"go_set_gopath": {
"description": "[deprecated] Set to true to set GOPATH=~/.local/share/mise/installs/go/.../packages.",
"deprecated": "Use env._go.set_goroot instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"go_set_goroot": {
"default": true,
Expand Down Expand Up @@ -345,14 +347,14 @@
"legacy_version_file": {
"default": true,
"description": "Set to false to disable the idiomatic version files such as .node-version, .ruby-version, etc.",
"deprecated": "Use idiomatic_version_file instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"legacy_version_file_disable_tools": {
"default": [],
"description": "Specific tools to disable idiomatic version files for.",
"deprecated": "Use idiomatic_version_file_disable_tools instead.",
"type": "array",
"deprecated": true,
"items": {
"type": "string"
}
Expand Down Expand Up @@ -452,7 +454,8 @@
},
"profile": {
"description": "Profile to use for mise.${MISE_PROFILE}.toml files.",
"type": "string"
"type": "string",
"deprecated": true
},
"python": {
"additionalProperties": false,
Expand Down Expand Up @@ -492,8 +495,8 @@
},
"venv_auto_create": {
"description": "Automatically create virtualenvs for python tools.",
"deprecated": "Use env._python.venv instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"venv_stdlib": {
"description": "Prefer to use venv from Python's standard library.",
Expand All @@ -503,48 +506,48 @@
},
"python_compile": {
"description": "If true, compile python from source. If false, use precompiled binaries. If not set, use precompiled binaries if available.",
"deprecated": "Use python.compile instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"python_default_packages_file": {
"description": "Path to a file containing default python packages to install when installing python.",
"deprecated": "Use python.default_packages_file instead.",
"type": "string"
"type": "string",
"deprecated": true
},
"python_patch_url": {
"description": "URL to fetch python patches from.",
"deprecated": "Use python.patch_url instead.",
"type": "string"
"type": "string",
"deprecated": true
},
"python_patches_directory": {
"description": "Directory to fetch python patches from.",
"deprecated": "Use python.patch_url instead.",
"type": "string"
"type": "string",
"deprecated": true
},
"python_precompiled_arch": {
"description": "Specify the architecture to use for precompiled binaries.",
"deprecated": "Use python.precompiled_arch instead.",
"type": "string"
"type": "string",
"deprecated": true
},
"python_precompiled_os": {
"description": "Specify the OS to use for precompiled binaries.",
"deprecated": "Use python.precompiled_os instead.",
"type": "string"
"type": "string",
"deprecated": true
},
"python_pyenv_repo": {
"description": "URL to fetch pyenv from for compiling python.",
"deprecated": "Use python.pyenv_repo instead.",
"type": "string"
"type": "string",
"deprecated": true
},
"python_venv_auto_create": {
"description": "Automatically create virtualenvs for python tools.",
"deprecated": "Use env._python.venv instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"python_venv_stdlib": {
"description": "Prefer to use venv from Python's standard library.",
"deprecated": "Use python.venv_stdlib instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"quiet": {
"description": "Suppress all output except errors.",
Expand Down Expand Up @@ -665,7 +668,8 @@
"task_run_auto_install": {
"default": true,
"description": "Automatically install missing tools when executing tasks.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"task_skip": {
"default": [],
Expand Down Expand Up @@ -717,8 +721,8 @@
},
"vfox": {
"description": "Use vfox as a default plugin backend instead of asdf.",
"deprecated": "Use disable_backends instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"windows_default_file_shell_args": {
"default": "cmd /c",
Expand Down
7 changes: 5 additions & 2 deletions settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ default to using an asdf plugin for cmake.
env = "MISE_ASDF_COMPAT"
type = "Bool"
hide = true
deprecated = "no longer supported"
description = "set to true to ensure .tool-versions will be compatible with asdf"
docs = """
Only output `.tool-versions` files in `mise local|global` which will be usable by asdf.
Expand Down Expand Up @@ -139,6 +140,7 @@ mise use -g cargo-binstall
[cargo_binstall]
type = "Bool"
hide = true
deprecated = "Use cargo.binstall instead."
optional = true
description = "Use cargo-binstall instead of cargo install if available"

Expand Down Expand Up @@ -241,8 +243,7 @@ They will be read in order, with the last one taking precedence.
env = "MISE_ENV_FILE"
type = "Path"
optional = true
description = "Path to a file containing environment variables."
hide = true
description = "Path to a file containing environment variables to automatically load."

[erlang.compile]
env = "MISE_ERLANG_COMPILE"
Expand Down Expand Up @@ -576,6 +577,7 @@ env = "MISE_PROFILE"
type = "String"
description = "Profile to use for mise.${MISE_PROFILE}.toml files."
optional = true
deprecated = "Use MISE_ENV_FILE instead."
hide = true

[python.compile]
Expand Down Expand Up @@ -882,6 +884,7 @@ env = "MISE_TASK_RUN_AUTO_INSTALL"
type = "Bool"
default = true
hide = true
deprecated = "Use task_auto_install instead."
description = "Automatically install missing tools when executing tasks."

[task_skip]
Expand Down
11 changes: 8 additions & 3 deletions xtasks/render/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { match } from "ts-pattern";
type Element = {
default: string | number | boolean;
description: string;
deprecated: boolean;
deprecated?: boolean;
type: string;
enum?: string[];
items?: {
Expand All @@ -18,7 +18,7 @@ type Props = {
type: string;
default: string | number | boolean;
description: string;
deprecated: boolean;
deprecated: string;
enum?: [string][];
};

Expand Down Expand Up @@ -55,10 +55,12 @@ function buildElement(key: string, props: Props): Element {
const ele: Element = {
default: props.default,
description: props.description,
deprecated: props.deprecated,
type,
};

if (props.deprecated) {
ele.deprecated = true;
}
if (props.enum) {
ele.enum = props.enum.map((e) => e[0]);
}
Expand Down Expand Up @@ -87,6 +89,9 @@ for (const key in doc) {
description: props.description,
properties: {},
};
if (props.deprecated) {
settings[key].deprecated = true;
}
settings[key].properties[subkey] = buildElement(
`${key}.${subkey}`,
props[subkey],
Expand Down
Loading