From 64f4698d5d3f7fbd0df94856035ad1f0d5e1c4f0 Mon Sep 17 00:00:00 2001 From: Hugues Verlin Date: Wed, 29 Jan 2025 13:04:05 +0100 Subject: [PATCH] docs: Update sections about idiomatic version files (#4252) --- .gitignore | 1 + docs/components/settings.vue | 4 +++- docs/configuration.md | 6 +++--- docs/lang/go.md | 4 +++- docs/lang/java.md | 4 ++-- docs/lang/node.md | 6 +++++- docs/lang/python.md | 4 ++++ docs/lang/ruby.md | 4 +++- mise.lock | 1 + 9 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 987fe261eb..47a255800b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /node_modules/ package-lock.json .mise.lock +/mise.local.toml *.log *.profraw diff --git a/docs/components/settings.vue b/docs/components/settings.vue index ca06240d0a..2bb536e01e 100644 --- a/docs/components/settings.vue +++ b/docs/components/settings.vue @@ -3,7 +3,9 @@ import { data } from "/settings.data.ts"; import Setting from "/components/setting.vue"; const { child } = defineProps(["child", "level"]); -const settings = child ? data.find((f) => f.key === child).settings : data; +const settings = child + ? (data.find((f) => f.key === child)?.settings ?? []) + : data; diff --git a/docs/configuration.md b/docs/configuration.md index 24cc9d09fe..14da1a7655 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -257,7 +257,7 @@ Both `mise.toml` and `.tool-versions` support "scopes" which modify the behavior mise supports "idiomatic version files" just like asdf. They're language-specific files like `.node-version` and `.python-version`. These are ideal for setting the runtime version of a project without forcing -other developers to use a specific tool like mise/asdf. +other developers to use a specific tool like mise or asdf. They support aliases, which means you can have an `.nvmrc` file with `lts/hydrogen` and it will work in mise and nvm. Here are some of the supported idiomatic version files: @@ -274,8 +274,8 @@ in mise and nvm. Here are some of the supported idiomatic version files: | terraform | `.terraform-version`, `.packer-version`, `main.tf` | | yarn | `.yarnrc` | -In mise these are enabled by default. You can disable them -with `mise settings idiomatic_version_file=false`. +In mise these are enabled by default. You can disable them with [`mise settings idiomatic_version_file=false`](/configuration/settings.html#idiomatic_version_file) or for specific tools with [`mise settings idiomatic_version_file_disable_tools=['python']`](/configuration/settings.html#idiomatic_version_file_disable_tools). + There is a performance cost to having these when they're parsed as it's performed by the plugin in `bin/parse-version-file`. However, these are [cached](/cache-behavior) so it's not a huge deal. You may not even notice. diff --git a/docs/lang/go.md b/docs/lang/go.md index dd6fe8deb1..d78b9ed3c0 100644 --- a/docs/lang/go.md +++ b/docs/lang/go.md @@ -46,4 +46,6 @@ github.com/jesseduffield/lazygit ## `.go-version` file support mise uses a `mise.toml` or `.tool-versions` file for auto-switching between software versions. -However it can also read go-specific version files named `.go-version`. +However, it can also read go-specific version files named `.go-version`. + +See [idiomatic version files](/configuration.html#idiomatic-version-files) diff --git a/docs/lang/java.md b/docs/lang/java.md index 8f61884feb..93404f45ef 100644 --- a/docs/lang/java.md +++ b/docs/lang/java.md @@ -58,9 +58,9 @@ sudo ln -s ~/.local/share/mise/installs/java/openjdk-21/Contents /Library/Java/J > Note: Not all distributions of the Java SDK support this integration (e.g liberica). -## Idiomatic version files +## `.java-version` and `.sdkmanrc` files support -The Java core plugin supports the idiomatic version files `.java-version` and `.sdkmanrc`. +The Java core plugin supports the idiomatic version files `.java-version` and `.sdkmanrc`. See [idiomatic version files](/configuration.html#idiomatic-version-files). For `.sdkmanrc` files, mise will try to map the vendor and version to the appropriate version string. For example, the version `20.0.2-tem` will be mapped to `temurin-20.0.2`. Due to Azul's Zulu diff --git a/docs/lang/node.md b/docs/lang/node.md index ed050b8177..201c08f757 100644 --- a/docs/lang/node.md +++ b/docs/lang/node.md @@ -59,7 +59,11 @@ You can specify a non-default location of this file by setting a `MISE_NODE_DEFA ## `.nvmrc` and `.node-version` support -mise uses a `mise.toml` or `.tool-versions` file for auto-switching between software versions. To ease migration, you can have also have it read an existing `.nvmrc` or `.node-version` file to find out what version of Node.js should be used. This will be used if `node` isn't defined in `mise.toml`/`.tool-versions`. +mise uses a `mise.toml` or `.tool-versions` file for auto-switching between software versions. + +To ease migration, you can have also it read an existing `.nvmrc` or `.node-version` file to find out what version of Node.js should be used. This will be used if `node` isn't defined in `mise.toml`/`.tool-versions`. + +See [idiomatic version files](/configuration.html#idiomatic-version-files) ## "nodejs" -> "node" Alias diff --git a/docs/lang/python.md b/docs/lang/python.md index e701751453..0676e32ca4 100644 --- a/docs/lang/python.md +++ b/docs/lang/python.md @@ -156,3 +156,7 @@ Or to compile with python-build: ```bash MISE_PYTHON_COMPILE=1 PYTHON_BUILD_FREE_THREADING=1 mise install python ``` + +## `.python-version` support + +`.python-version`/`.python-versions` files are supported by mise. See [idiomatic version files](/configuration.html#idiomatic-version-files). diff --git a/docs/lang/ruby.md b/docs/lang/ruby.md index e76711b5e5..0b88b1c9fe 100644 --- a/docs/lang/ruby.md +++ b/docs/lang/ruby.md @@ -51,7 +51,7 @@ rubocop --pre # install prerelease version ## `.ruby-version` and `Gemfile` support mise uses a `mise.toml` or `.tool-versions` file for auto-switching between software versions. -However it can also read ruby-specific version files `.ruby-version` or `Gemfile` +However, it can also read ruby-specific version files `.ruby-version` or `Gemfile` (if it specifies a ruby version). Create a `.ruby-version` file for the current version of ruby: @@ -60,6 +60,8 @@ Create a `.ruby-version` file for the current version of ruby: ruby -v > .ruby-version ``` +See [idiomatic version files](/configuration.html#idiomatic-version-files) for more information. + ### Manually updating ruby-build ruby-build should update daily, however if you find versions do not yet exist you can force an diff --git a/mise.lock b/mise.lock index 03e4c80b70..c45d303c80 100644 --- a/mise.lock +++ b/mise.lock @@ -4,6 +4,7 @@ backend = "aqua:rhysd/actionlint" [tools.actionlint.checksums] "actionlint_1.7.7_darwin_arm64.tar.gz" = "sha256:2693315b9093aeacb4ebd91a993fea54fc215057bf0da2659056b4bc033873db" +"actionlint_1.7.7_linux_amd64.tar.gz" = "sha256:023070a287cd8cccd71515fedc843f1985bf96c436b7effaecce67290e7e0757" [tools.bun] version = "1.1.44"