feat: migrate shfmt & auto-add node prereq for npm: tools#190
Merged
zeitlinger merged 2 commits intodocs/split-and-v2-installfrom Apr 18, 2026
Merged
Conversation
Bare `shfmt` resolves via aqua registry, broken in current mise
releases. Add it to OBSOLETE_KEYS so `flint update` rewrites to
`github:mvdan/sh` — the form the registry already expects (paired
with `versioned_bin("shfmt_{version}")`).
Remove once flint#175 restores bare `shfmt` via aqua:mvdan/sh.
Signed-off-by: Gregor Zeitlinger <[email protected]>
npm-backed tools (prettier, biome, markdownlint-cli2, renovate) need the `npm` command, which needs a Node.js runtime. Without an explicit `node` entry in mise.toml, mise falls back to system node — may be missing, wrong version, or drift across machines, breaking the "reproducible lint environment" promise. When `flint init` or `flint update` sees any `npm:*` key in [tools] and no `node` entry, pin `node@lts` via `mise use --pin` (which resolves to a concrete version at write time), with a direct toml_edit fallback when mise isn't available. Signed-off-by: Gregor Zeitlinger <[email protected]>
martincostello
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #187.
Two small migrations derived from the flint-v2 design todos:
1.
shfmt→github:mvdan/shBare
shfmtresolves via aqua registry, which is broken in currentmise releases.
github:mvdan/shworks (paired with the existingversioned_bin("shfmt_{version}")wiring). Adds the mapping toOBSOLETE_KEYSsoflint updaterewrites existing mise.toml filesnon-interactively. Remove once jdx/mise#9191 ships (v2026.4.17+) and #175 lands the bare
shfmtrestoration viaaqua:mvdan/sh.2. Auto-add
nodeprereq fornpm:backend toolsnpm-backed tools (prettier, biome, markdownlint-cli2, renovate) need
the
npmcommand, which needs a Node.js runtime. Without an explicitnodeentry, mise falls back to system node — may be absent, wrongversion, or drift across machines, breaking the "reproducible lint
environment" promise.
flint initandflint updatenow detect this and pinnode@ltsvia
mise use --pin(resolves to a concrete version at write time).Test plan
cargo test --bin flint)cargo test --test e2e)flint updateon a repo withnpm:prettierbut nonode→ adds nodeflint updateon a repo with bareshfmt→ rewritten togithub:mvdan/sh