Skip to content

feat: migrate shfmt & auto-add node prereq for npm: tools#190

Merged
zeitlinger merged 2 commits intodocs/split-and-v2-installfrom
feat/shfmt-obsolete-and-node-prereq
Apr 18, 2026
Merged

feat: migrate shfmt & auto-add node prereq for npm: tools#190
zeitlinger merged 2 commits intodocs/split-and-v2-installfrom
feat/shfmt-obsolete-and-node-prereq

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

@zeitlinger zeitlinger commented Apr 17, 2026

Stacked on #187.

Two small migrations derived from the flint-v2 design todos:

1. shfmtgithub:mvdan/sh

Bare shfmt resolves via aqua registry, which is broken in current
mise releases. github:mvdan/sh works (paired with the existing
versioned_bin("shfmt_{version}") wiring). Adds the mapping to
OBSOLETE_KEYS so flint update rewrites existing mise.toml files
non-interactively. Remove once jdx/mise#9191 ships (v2026.4.17+) and #175 lands the bare shfmt restoration via aqua:mvdan/sh.

2. Auto-add node prereq for npm: backend tools

npm-backed tools (prettier, biome, markdownlint-cli2, renovate) need
the npm command, which needs a Node.js runtime. Without an explicit
node entry, mise falls back to system node — may be absent, wrong
version, or drift across machines, breaking the "reproducible lint
environment" promise.

flint init and flint update now detect this and pin node@lts
via mise use --pin (resolves to a concrete version at write time).

Test plan

  • Unit tests pass (cargo test --bin flint)
  • E2E tests pass (cargo test --test e2e)
  • Run flint update on a repo with npm:prettier but no node → adds node
  • Run flint update on a repo with bare shfmt → rewritten to github:mvdan/sh

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]>
@zeitlinger zeitlinger marked this pull request as ready for review April 17, 2026 12:30
@zeitlinger zeitlinger requested a review from a team as a code owner April 17, 2026 12:30
@zeitlinger zeitlinger merged commit 05c4451 into docs/split-and-v2-install Apr 18, 2026
13 checks passed
@zeitlinger zeitlinger deleted the feat/shfmt-obsolete-and-node-prereq branch April 18, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants