Replies: 15 comments 1 reply
-
There is already an example for a Node.js project here (https://mise.jdx.dev/templates.html#a-node-js-project). Here is what I usually do with [tools]
node = '22'
[tasks.pnpmInstall]
alias = 'pi'
description = 'Installs dependencies with pnpm'
run = 'corepack enable && pnpm install'
sources = ['package.json', 'pnpm-lock.yaml', 'mise.toml']
outputs = ['node_modules/.pnpm/lock.yaml']
[tasks.dev]
description = 'Calls your dev script in `package.json`'
run = 'node --run dev'
depends = ['pnpmInstall']
[tasks.nodeRun]
alias = 'nr'
description = 'Call any script in your package.json file. Example: mise nr lint'
run = 'node --run {{arg(name="script")}}'
depends = ['pnpmInstall'] Note that |
Beta Was this translation helpful? Give feedback.
-
presets: #3320 (comment) |
Beta Was this translation helpful? Give feedback.
-
For additional context on the "template documentation". I wrote a few to demonstrate templates without readers needed to try in mise.toml. I would merge them into cookbooks to demonstrate the real world setup. I would also reduce the template documentation examples when cookbooks have good examples. |
Beta Was this translation helpful? Give feedback.
-
Agree that the existing examples could be moved to cookbooks now. We can do a page for each language (example: one page for Node.JS, one for terraform, one for python, etc.) Also, when seeing |
Beta Was this translation helpful? Give feedback.
-
Mise search [tasks.search]
run = "mise use --pin $(mise registry -b aqua | fzf --multi | awk '{print $2}')" Might want to adapt it to not be aqua specific |
Beta Was this translation helpful? Give feedback.
-
I think it could be implemented internally, like for |
Beta Was this translation helpful? Give feedback.
-
I know skim can be imported as a library and has a very similar feature set to fzf. |
Beta Was this translation helpful? Give feedback.
-
we don't need no skim, we have demand |
Beta Was this translation helpful? Give feedback.
-
Not sure I trust the author of that library. I hear bad things 👀 |
Beta Was this translation helpful? Give feedback.
-
this is a way to convert from
though I'd like this to be a part of |
Beta Was this translation helpful? Give feedback.
-
I've been using docker to debug issues in a clean environment over the weekend: [tasks.docker]
run = "docker run --pull=always -it --rm --entrypoint bash jdxcode/mise:latest" Puts me in a fresh debian shell with mise installed. I then normally run the following manually: ❯ mise docker
[docker] $ docker run --pull=always -it --rm --entrypoint bash jdxcode/mise:latest
latest: Pulling from jdxcode/mise
Digest: sha256:eecc479b6259479ffca5a4f9c68dbfe8631ca62dc59aa60c9ab5e4f6e9982701
Status: Image is up to date for jdxcode/mise:latest
root@75f179a190a1:/mise# eval "$(mise activate bash)"
root@75f179a190a1:/mise# echo "" >/mise/config.toml
root@75f179a190a1:/mise# mise prune --yes
mise pruned configuration links
mise python@3.13.1 ✓ remove /mise/cache/python/3.13.1 But it might be nice to automate that bit too. |
Beta Was this translation helpful? Give feedback.
-
Using # ~/.config/mise/config.toml
[tools]
"cargo:record-query" = "latest" function mise_parse_env {
rq -m < <(
zcat -q < <(
printf $'\x1f\x8b\x08\x00\x00\x00\x00\x00'
base64 -d <<< "$1"
)
)
} $ mise_parse_env "${__MISE_DIFF}"
{
"new": {
...
},
"old": {
...
},
"path": [
...
]
} |
Beta Was this translation helpful? Give feedback.
-
Nice one @joshbode! It could also be a great showcase of the new task tools feature that was recently merged, because cargo:record-query can be defined as a task tool. |
Beta Was this translation helpful? Give feedback.
-
Another trick that works with the latest version (required #3640 to make In ZSH to set the prompt colour whenever # activate mise like normal
source <(command mise activate zsh)
typeset -i _mise_updated
# replace default mise hook
function _mise_hook {
local diff=${__MISE_DIFF}
source <(command mise hook-env -s zsh)
[[ ${diff} == ${__MISE_DIFF} ]]
_mise_updated=$?
}
_PROMPT="❱ " # or _PROMPT=${PROMPT} to keep the default
function _prompt {
if (( ${_mise_updated} )); then
PROMPT='%F{blue}${_PROMPT}%f'
else
PROMPT='%(?.%F{green}${_PROMPT}%f.%F{red}${_PROMPT}%f)'
fi
}
add-zsh-hook precmd _prompt Now, when |
Beta Was this translation helpful? Give feedback.
-
I've seen a few similar requests around this behaviour: #3808 (comment) |
Beta Was this translation helpful? Give feedback.
-
I'd like to create a cookbook section for the docs. Show me parts of your mise.toml you think are interesting.
In particular I think tasks, hooks, and env would be really helpful for people to see examples of.
Beta Was this translation helpful? Give feedback.
All reactions