Skip to content

Commit 5fe6629

Browse files
chore: declare node>=20 engines floor and document prettier-plugin-svelte workaround
prettier-plugin-svelte@4.0.0 raised its own engines.node to >=20, giving the repo an undocumented Node 20 floor. Add a top-level engines field so a contributor on Node 18 gets a clear EBADENGINE signal. Also document why totalProgress in SendButton.svelte is a script-level $derived rather than an inline {@const} ternary, linking the upstream bug (sveltejs/prettier-plugin-svelte#528) so the workaround can be retired. Closes #235 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent bc1a1b5 commit 5fe6629

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"name": "postguard-website",
33
"version": "1.7.0",
44
"private": true,
5+
"engines": {
6+
"node": ">=20"
7+
},
58
"scripts": {
69
"dev": "vite dev",
710
"build": "vite build",

src/lib/components/filesharing/SendButton.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@
304304
let buttonRef: HTMLButtonElement | null = $state(null)
305305
let dialogRef: HTMLDialogElement | null = $state(null)
306306
307+
// Computed here as a script-level $derived rather than inline in the template
308+
// via {@const} to dodge an upstream prettier-plugin-svelte crash on ternaries
309+
// with a BinaryExpression test inside {@const}
310+
// (https://github.com/sveltejs/prettier-plugin-svelte/issues/528). Once that
311+
// fix is confirmed in the pinned plugin version, this can move back inline.
307312
let totalProgress = $derived(
308313
encryptState.percentages.length > 0
309314
? Math.round(

0 commit comments

Comments
 (0)