Skip to content

Commit

Permalink
docs: Update sections about idiomatic version files (#4252)
Browse files Browse the repository at this point in the history
  • Loading branch information
hverlin authored Jan 29, 2025
1 parent d2fd341 commit 64f4698
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/node_modules/
package-lock.json
.mise.lock
/mise.local.toml

*.log
*.profraw
Expand Down
4 changes: 3 additions & 1 deletion docs/components/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
</script>
<!-- <ul>-->
Expand Down
6 changes: 3 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion docs/lang/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions docs/lang/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion docs/lang/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions docs/lang/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
4 changes: 3 additions & 1 deletion docs/lang/ruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions mise.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 64f4698

Please sign in to comment.