SIGN IN SIGN UP

Target ES2024 and require Node 22 for the build toolchain

The TypeScript lib was nominally ES5/ES6/ES7, but @types/node 18 pulls in
ES2020 via a reference directive, so the effective ceiling was ES2020 and the
declared one was misleading. The esbuild target was ES2020 as well. Both now
say ES2024.

That is safe for every installer the current app can run on: Obsidian 1.13
notes that the app crashes on any installer older than 1.6, and the 1.6
installers ship Electron 28-30 (Chromium 120-124), which fully support ES2024.
ES2025 is deliberately not used, since Set methods and iterator helpers need
Chromium 122 and RegExp.escape needs 136, so early-1.6 installers would fail
at runtime. The runtime Node at that floor is 18.18-20.11, so @types/node
moves to ^20 rather than tracking the build toolchain's Node.

Raising the tsconfig target past ES2022 switches class fields to define
semantics. The only field affected is LocalRestApi.settings, which the 1.13
obsidian typings now declare on Plugin as `settings?: unknown` with the
instruction to redeclare it concretely on the subclass, so it becomes a
`declare` field.

The build toolchain minimum is now Node 22 (package.json engines, matching
.tool-versions and the CI and docs workflows); the release workflow moves from
20.x to 22 to match, and the test workflow's checkout/setup-node actions are
bumped from v2 to v4.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A
Adam Coddington committed
fc0a370af0abb9778fe8eff349ad2ec76cc62e2b
Parent: ce07d55