diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..2e2e1ccd42 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,42 @@ +name: mise-docs + +on: + push: + paths: + - "docs/**" + branches: + - main + pull_request: + paths: + - "docs/**" + branches: + - main + +concurrency: + group: mise-docs-release-${{ github.head_ref }} + cancel-in-progress: true + +env: + MISE_EXPERIMENTAL: 1 + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # for lastUpdated + - uses: jdx/mise-action@v2 + with: + install_args: bun + working_directory: docs + - run: bun install + working-directory: docs + - run: bun run docs:build + working-directory: docs + - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: mise run release-docs + working-directory: docs + env: + AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dad6c35ab4..b8178cfe42 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: release on: push: tags: ["v*"] - branches: ["release", "win"] + branches: ["release", "win", "docs"] workflow_dispatch: concurrency: @@ -250,20 +250,13 @@ jobs: - build-tarball-win steps: - uses: actions/checkout@v4 - with: - path: mise - - uses: actions/checkout@v4 - with: - repository: jdx/mise-docs - path: mise-docs - token: ${{ secrets.RTX_GITHUB_BOT_TOKEN }} - name: cache zipsign id: cache-zipsign uses: actions/cache@v4 with: path: ~/.cargo/bin/zipsign key: cargo-zipsign - - run: ./mise/scripts/setup-zipsign.sh + - run: ./scripts/setup-zipsign.sh env: ZIPSIGN: ${{ secrets.ZIPSIGN }} - name: Install fd-find @@ -281,12 +274,6 @@ jobs: with: key: ${{ secrets.RTX_SSH_KEY }} known_hosts: ${{ secrets.RTX_KNOWN_HOSTS_AUR }} - - uses: crazy-max/ghaction-import-gpg@v6 - with: - gpg_private_key: ${{ secrets.MISE_GPG_KEY }} - git_user_signingkey: true - git_commit_gpgsign: true - workdir: mise-docs - uses: actions/download-artifact@v4 with: { path: artifacts } - run: ls -R artifacts @@ -299,16 +286,12 @@ jobs: mise-v*.zip merge-multiple: true - run: ls -R artifacts - - run: mise/scripts/release.sh + - run: scripts/release.sh env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} CLOUDFLARE_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }} CLOUDFLARE_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }} - - name: mise-docs push - if: startsWith(github.event.ref, 'refs/tags/v') - run: git push - working-directory: mise-docs - name: GitHub Release Assets uses: softprops/action-gh-release@v2 if: startsWith(github.event.ref, 'refs/tags/v') diff --git a/.idea/mise.iml b/.idea/mise.iml index 26265d4cb4..ff4628d837 100644 --- a/.idea/mise.iml +++ b/.idea/mise.iml @@ -26,17 +26,17 @@ - - + + - + - \ No newline at end of file + diff --git a/.markdownlint.json b/.markdownlint.json index a36edfc88f..a69775f0a1 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -1,6 +1,7 @@ { "MD004": false, "MD013": false, + "MD029": false, "MD033": false, "MD040": false, "MD041": false diff --git a/docs/.mise/tasks/release b/.mise/tasks/release-docs similarity index 100% rename from docs/.mise/tasks/release rename to .mise/tasks/release-docs diff --git a/docs/.github/renovate.json b/docs/.github/renovate.json deleted file mode 100644 index dc8886a165..0000000000 --- a/docs/.github/renovate.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ "github>jdx/renovate-config" ] -} diff --git a/docs/.github/workflows/build.yml b/docs/.github/workflows/build.yml deleted file mode 100644 index 648764c282..0000000000 --- a/docs/.github/workflows/build.yml +++ /dev/null @@ -1,23 +0,0 @@ -on: - pull_request: - branches: - - main - -concurrency: - group: mise-docs-build-${{ github.head_ref }} - cancel-in-progress: true - -env: - MISE_EXPERIMENTAL: 1 - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # for lastUpdated - - uses: jdx/mise-action@v2 - - run: bun install - - run: bun run docs:build diff --git a/docs/.github/workflows/release.yml b/docs/.github/workflows/release.yml deleted file mode 100644 index af9f72d18b..0000000000 --- a/docs/.github/workflows/release.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: mise-docs - -on: - push: - branches: - - main - -concurrency: - group: mise-docs-release-${{ github.head_ref }} - cancel-in-progress: true - -env: - MISE_EXPERIMENTAL: 1 - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # for lastUpdated - - uses: jdx/mise-action@v2 - - run: bun install - - run: bun run docs:build - - run: mise run release - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 2eb8ba0b6a..aa3b251df1 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -109,7 +109,7 @@ export default defineConfig({ ], editLink: { - pattern: 'https://github.com/jdx/mise-docs/edit/main/:path', + pattern: 'https://github.com/jdx/mise/edit/main/docs/:path', }, search: { provider: 'algolia', diff --git a/docs/configuration.md b/docs/configuration.md index 16560b0628..1bdd724fc1 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -3,10 +3,12 @@ ## `.mise.toml` `.mise.toml` is a new config file that replaces asdf-style `.tool-versions` files with a file -that has lot more flexibility. It supports functionality that is not possible with `.tool-versions`, such as: +that has lot more flexibility. It supports functionality that is not possible with `.tool-versions`, +such as: - setting arbitrary env vars while inside the directory -- passing options to plugins like `virtualenv=".venv"` for [python](https://github.com/jdx/mise/blob/main/docs/python.md#experimental-automatic-virtualenv-creationactivation). +- passing options to plugins like `virtualenv=".venv"` + for [python](https://github.com/jdx/mise/blob/main/docs/python.md#experimental-automatic-virtualenv-creationactivation). - specifying custom plugin URLs They can use any of the following file locations (in order of precedence, top is highest): @@ -23,7 +25,8 @@ They can use any of the following file locations (in order of precedence, top is - `.config/mise/config.toml` See [Profiles](/profiles) for more information about `.mise.$MISE_ENV.toml` files. -These files recurse upwards, so if you have a `~/src/work/myproj/.mise.toml` file, what is defined there will override anything set in +These files recurse upwards, so if you have a `~/src/work/myproj/.mise.toml` file, what is defined +there will override anything set in `~/src/work/.mise.toml` or `~/.config/mise.toml`. The config contents are merged together. :::tip @@ -47,7 +50,7 @@ node = ['16', 'prefix:20', 'ref:master', 'path:~/.nodes/14'] # send arbitrary options to the plugin, passed as: # MISE_TOOL_OPTS__VENV=.venv -python = {version='3.10', virtualenv='.venv'} +python = { version = '3.10', virtualenv = '.venv' } [plugins] # specify a custom repo url @@ -101,7 +104,8 @@ If you simply want to install a plugin from a specific URL once, it's better to `mise plugin install plugin `. Add this section to `.mise.toml` if you want to share the plugin location/revision with other developers in your project. -This is similar to [`MISE_SHORTHANDS`](https://github.com/jdx/mise#mise_shorthands_fileconfigmiseshorthandstoml) +This is similar +to [`MISE_SHORTHANDS`](https://github.com/jdx/mise#mise_shorthands_fileconfigmiseshorthandstoml) but doesn't require a separate file. ### `[aliases]` - Tool version aliases @@ -110,7 +114,9 @@ The following makes `mise install node@my_custom_node` install node-20.x this can also be specified in a [plugin](/dev-tools/aliases.md). note adding an alias will also add a symlink, in this case: - ~/.local/share/mise/installs/node/20 -> ./20.x.x +```sh +~/.local/share/mise/installs/node/20 -> ./20.x.x +``` ```toml my_custom_node = '20' @@ -118,7 +124,8 @@ my_custom_node = '20' ## Global config: `~/.config/mise/config.toml` -mise can be configured in `~/.config/mise/config.toml`. It's like local `.mise.toml` files except that +mise can be configured in `~/.config/mise/config.toml`. It's like local `.mise.toml` files except +that it is used for all directories. ```toml @@ -168,7 +175,7 @@ env_file = '.env' # load env vars from a dotenv file, see `MISE_ENV_FILE` experimental = true # enable experimental features # configure messages displayed when entering directories with config files -status = {missing_tools = "if_other_versions_installed", show_env = false, show_tools = false} +status = { missing_tools = "if_other_versions_installed", show_env = false, show_tools = false } ``` ## System config: `/etc/mise/config.toml` @@ -198,7 +205,8 @@ node sub-2:lts # install 2 versions behind the latest lts (e.g.: 18 python sub-0.1:latest # install python-3.10 if the latest is 3.11 ``` -See [the asdf docs](https://asdf-vm.com/manage/configuration.html#tool-versions) for more info on this file format. +See [the asdf docs](https://asdf-vm.com/manage/configuration.html#tool-versions) for more info on +this file format. ## Scopes @@ -215,7 +223,8 @@ Both `.mise.toml` and `.tool-versions` support "scopes" which modify the behavio ## Legacy version files -mise supports "legacy version files" just like asdf. They're language-specific files like `.node-version` +mise supports "legacy 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. @@ -234,7 +243,8 @@ in mise and nvm. Here are some of the supported legacy 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 set legacy_version_file false`. +In mise these are enabled by default. You can disable them +with `mise settings set legacy_version_file false`. 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. @@ -259,7 +269,8 @@ Some of them also can be set via global CLI flags. * Env: `MISE_ACTIVATE_AGGRESSIVE` * Default: `false` -Pushes tools' bin-paths to the front of PATH instead of allowing modifications of PATH after activation to take precedence. +Pushes tools' bin-paths to the front of PATH instead of allowing modifications of PATH after +activation to take precedence. For example, if you have the following in your `.mise.toml`: @@ -276,10 +287,12 @@ eval "$(mise activate zsh)" PATH="/some/other/python:$PATH" ``` -What will happen is `/some/other/python` will be used instead of the python installed by mise. This means +What will happen is `/some/other/python` will be used instead of the python installed by mise. This +means you typically want to put `mise activate` at the end of your shell config so nothing overrides it. -If you want to always use the mise versions of tools despite what is in your shell config, set this to `true`. +If you want to always use the mise versions of tools despite what is in your shell config, set this +to `true`. In that case, using this example again, `/some/other/python` will be after mise's python in PATH. ### `asdf_compat` @@ -289,9 +302,11 @@ In that case, using this example again, `/some/other/python` will be after mise' * Default: `false` Only output `.tool-versions` files in `mise local|global` which will be usable by asdf. -This disables mise functionality that would otherwise make these files incompatible with asdf such as non-pinned versions. +This disables mise functionality that would otherwise make these files incompatible with asdf such +as non-pinned versions. -This will also change the default global tool config to be `~/.tool-versions` instead of `~/.config/mise/config.toml`. +This will also change the default global tool config to be `~/.tool-versions` instead +of `~/.config/mise/config.toml`. ### `disable_tools` @@ -299,7 +314,8 @@ This will also change the default global tool config to be `~/.tool-versions` in * Env: `MISE_DISABLE_TOOLS` * Default: `[]` -Disables the specified tools. Separate with `,`. Generally used for core plugins but works with any tool. +Disables the specified tools. Separate with `,`. Generally used for core plugins but works with any +tool. ### `status.missing_tools` @@ -343,7 +359,8 @@ mise can also be configured via environment variables. The following options are Default: `~/.local/share/mise` or `$XDG_DATA_HOME/mise` -This is the directory where mise stores plugins and tool installs. These are not supposed to be shared +This is the directory where mise stores plugins and tool installs. These are not supposed to be +shared across machines. ### `MISE_CACHE_DIR` @@ -356,7 +373,8 @@ across machines. It may be deleted at any time mise is not running. ### `MISE_TMP_DIR` -Default: [`std::env::temp_dir()`](https://doc.rust-lang.org/std/env/fn.temp_dir.html) implementation in rust +Default: [`std::env::temp_dir()`](https://doc.rust-lang.org/std/env/fn.temp_dir.html) implementation +in rust This is used for temporary storage such as when installing tools. @@ -379,7 +397,8 @@ a different name. ### `MISE_DEFAULT_CONFIG_FILENAME` -Set to something other than `.mise.toml` to have mise look for `.mise.toml` config files with a different name. +Set to something other than `.mise.toml` to have mise look for `.mise.toml` config files with a +different name. ### `MISE_ENV` @@ -413,7 +432,8 @@ of what is set in `.tool-versions`/`.mise.toml`. ### `MISE_LEGACY_VERSION_FILE=1` Plugins can read the versions files used by other version managers (if enabled by the plugin) -for example, `.nvmrc` in the case of node's nvm. See [legacy version files](#legacy-version-files) for more +for example, `.nvmrc` in the case of node's nvm. See [legacy version files](#legacy-version-files) +for more information. Set to "0" to disable legacy version file parsing. @@ -427,7 +447,8 @@ Disable legacy version file parsing for specific tools. Separate with `,`. Set to `1` to default to using `.mise.toml` in `mise local` instead of `.tool-versions` for configuration. -For now this is not used by `mise use` which will only use `.mise.toml` unless `--path` is specified. +For now this is not used by `mise use` which will only use `.mise.toml` unless `--path` is +specified. ### `MISE_TRUSTED_CONFIG_PATHS` @@ -518,8 +539,10 @@ This will automatically answer yes or no to prompts. This is useful for scriptin ### `MISE_NOT_FOUND_AUTO_INSTALL=true` -Set to false to disable the "command not found" handler to autoinstall missing tool versions. Disable this -if experiencing strange behavior in your shell when a command is not found—but please submit a ticket to +Set to false to disable the "command not found" handler to autoinstall missing tool versions. +Disable this +if experiencing strange behavior in your shell when a command is not found—but please submit a +ticket to help diagnose problems. ### `MISE_TASK_OUTPUT=prefix` @@ -555,7 +578,8 @@ Default: false unless running NixOS or Alpine (let me know if others should be a Do not use precompiled binaries for all languages. Useful if running on a Linux distribution like Alpine that does not use glibc and therefore likely won't be able to run precompiled binaries. -Note that this needs to be setup for each language. File a ticket if you notice a language that is not +Note that this needs to be setup for each language. File a ticket if you notice a language that is +not working with this config. ### `MISE_FISH_AUTO_ACTIVATE=1` diff --git a/docs/contact.md b/docs/contact.md index f026efccc3..e7b1815e7e 100644 --- a/docs/contact.md +++ b/docs/contact.md @@ -15,5 +15,3 @@ driver for me. If you have anything positive or negative to say-even if it's jus to say hi-please reach out to me either on [Twitter](https://twitter.com/jdxcode), [Mastodon](https://fosstodon.org/@jdx), [Discord](https://discord.gg/UBa7pJUN7Z), or `jdx at this domain`. - - diff --git a/docs/contributing.md b/docs/contributing.md index f214553fc6..2ca3da2b28 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -9,11 +9,11 @@ There is a docker setup that makes development with mise easier. It is especiall Here's some example ways to use it: ```sh -$ mise run docker:cargo build -$ mise run docker:cargo test -$ mise run docker:mise --help # run `mise --help` in the dev container -$ mise run docker:mise run test:e2e # run the e2e tests inside of the docker container -$ mise run docker:e2e # shortcut for `mise run docker:mise run test:e2e` +mise run docker:cargo build +mise run docker:cargo test +mise run docker:mise --help # run `mise --help` in the dev container +mise run docker:mise run test:e2e # run the e2e tests inside of the docker container +mise run docker:e2e # shortcut for `mise run docker:mise run test:e2e` ``` ## Testing @@ -26,12 +26,15 @@ for executing since it does not require having a proper local setup. To run locally you will need to first disable mise if you are using it. :::code-group + ```sh [dev container] -$ mise run docker:cargo test +mise run docker:cargo test ``` + ```sh [local] -$ cargo test +cargo test ``` + ::: ### E2E Tests @@ -39,12 +42,15 @@ $ cargo test Like unit tests, the e2e tests should be run either in the dev container (recommended) or with mise disabled locally. :::code-group + ```sh [dev container] -$ mise run docker:e2e +mise run docker:e2e ``` + ```sh [local] -$ mise run test:e2e +mise run test:e2e ``` + ::: Slow tests do not run by default or on PRs. They can be manually enabled with `TEST_ALL=1`. @@ -106,10 +112,10 @@ Don't forget to change the manifest path to the correct path for your setup. Then if that is in PATH just use `@mise` to run mise by compiling it on the fly. ```sh -$ @mise --help -$ @mise run docker:e2e -$ eval "$(@mise activate zsh)" -$ @mise activate fish | source +@mise --help +@mise run docker:e2e +eval "$(@mise activate zsh)" +@mise activate fish | source ``` ## Releasing diff --git a/docs/demo.gif b/docs/demo.gif new file mode 100644 index 0000000000..7e11432bed Binary files /dev/null and b/docs/demo.gif differ diff --git a/docs/demo.sh b/docs/demo.sh new file mode 100755 index 0000000000..f60cbf288d --- /dev/null +++ b/docs/demo.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e + +cd +mkdir -p ~/myproj +rm -rf ~/myproj/.* ~/.mise/installs ~/.config/mise +PATH="$HOME/.cargo/bin:$PATH" vhs <~/src/mise/docs/demo.tape +rm -rf ~/myproj diff --git a/docs/demo.tape b/docs/demo.tape new file mode 100644 index 0000000000..521b76f58c --- /dev/null +++ b/docs/demo.tape @@ -0,0 +1,87 @@ +# VHS documentation +# +# Output: +# Output .gif Create a GIF output at the given +# Output .mp4 Create an MP4 output at the given +# Output .webm Create a WebM output at the given +# +# Require: +# Require Ensure a program is on the $PATH to proceed +# +# Settings: +# Set FontSize Set the font size of the terminal +# Set FontFamily Set the font family of the terminal +# Set Height Set the height of the terminal +# Set Width Set the width of the terminal +# Set LetterSpacing Set the font letter spacing (tracking) +# Set LineHeight Set the font line height +# Set LoopOffset % Set the starting frame offset for the GIF loop +# Set Theme Set the theme of the terminal +# Set Padding Set the padding of the terminal +# Set Framerate Set the framerate of the recording +# Set PlaybackSpeed Set the playback speed of the recording +# +# Sleep: +# Sleep