From 5fe662919c3e0bcafe899deb7c4eda17b5aa6715 Mon Sep 17 00:00:00 2001 From: "dobby-yivi-agent[bot]" <275734547+dobby-yivi-agent[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2026 07:47:35 +0000 Subject: [PATCH 1/2] 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 --- package.json | 3 +++ src/lib/components/filesharing/SendButton.svelte | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/package.json b/package.json index c5628b8..e6ff0ef 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,9 @@ "name": "postguard-website", "version": "1.7.0", "private": true, + "engines": { + "node": ">=20" + }, "scripts": { "dev": "vite dev", "build": "vite build", diff --git a/src/lib/components/filesharing/SendButton.svelte b/src/lib/components/filesharing/SendButton.svelte index 4e3db81..e9498e8 100644 --- a/src/lib/components/filesharing/SendButton.svelte +++ b/src/lib/components/filesharing/SendButton.svelte @@ -304,6 +304,11 @@ let buttonRef: HTMLButtonElement | null = $state(null) let dialogRef: HTMLDialogElement | null = $state(null) + // Computed here as a script-level $derived rather than inline in the template + // via {@const} to dodge an upstream prettier-plugin-svelte crash on ternaries + // with a BinaryExpression test inside {@const} + // (https://github.com/sveltejs/prettier-plugin-svelte/issues/528). Once that + // fix is confirmed in the pinned plugin version, this can move back inline. let totalProgress = $derived( encryptState.percentages.length > 0 ? Math.round( From 5c76a160fdd94ab511ab059ecafa97b406387c66 Mon Sep 17 00:00:00 2001 From: "dobby-yivi-agent[bot]" <275734547+dobby-yivi-agent[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2026 07:55:43 +0000 Subject: [PATCH 2/2] chore: clarify prettier-plugin-svelte workaround comment The pinned prettier-plugin-svelte@^4.0.1 already contains the #528 fix, so reword the comment to state that explicitly rather than implying the fix is not yet in the pinned version. Co-Authored-By: Claude Opus 4.8 --- src/lib/components/filesharing/SendButton.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/components/filesharing/SendButton.svelte b/src/lib/components/filesharing/SendButton.svelte index e9498e8..ad31a42 100644 --- a/src/lib/components/filesharing/SendButton.svelte +++ b/src/lib/components/filesharing/SendButton.svelte @@ -307,8 +307,9 @@ // Computed here as a script-level $derived rather than inline in the template // via {@const} to dodge an upstream prettier-plugin-svelte crash on ternaries // with a BinaryExpression test inside {@const} - // (https://github.com/sveltejs/prettier-plugin-svelte/issues/528). Once that - // fix is confirmed in the pinned plugin version, this can move back inline. + // (https://github.com/sveltejs/prettier-plugin-svelte/issues/528). The pinned + // ^4.0.1 already includes the #528 fix, so this can move back inline as a + // {@const} ternary once verified with `prettier --check` on 4.0.1. let totalProgress = $derived( encryptState.percentages.length > 0 ? Math.round(