From 0dc10ffe76277e9cea3131b505ee4e87f65cc7aa Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Mon, 7 Sep 2026 09:54:51 +0100 Subject: [PATCH] fix(web): repair nix frontend build Two things broke `nix build .#webFrontend`, and with it `nh home apply` on any host that installs maestro. `marked` was added to web/package.json without repinning pnpmDeps.hash, so pnpm install failed offline with ERR_PNPM_NO_OFFLINE_TARBALL. `tsc -b` also type-checks web/src/toolIcon.test.ts, which imports the shared ../../fixtures/command-resolution.json. The derivation's src is ./web, so that path does not exist in the sandbox. The production build now uses tsconfig.build.json, which excludes tests; `pnpm typecheck` still covers them from a full checkout. --- flake.nix | 2 +- web/package.json | 2 +- web/tsconfig.build.json | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 web/tsconfig.build.json diff --git a/flake.nix b/flake.nix index 0ecbc89..58e5046 100644 --- a/flake.nix +++ b/flake.nix @@ -148,7 +148,7 @@ pnpmDeps = (pkgs.fetchPnpmDeps.override { pnpm = pkgs.pnpm_10; }) { inherit (finalAttrs) pname version src; fetcherVersion = 3; - hash = "sha256-hOqiAbnjKsoQnV8lgto5HspDsLIb+48sNLkShIjCZPQ="; + hash = "sha256-AzF/rrhqbvl613hNsC18YSylBSVxtatg7fEiUEF1u2o="; }; buildPhase = '' diff --git a/web/package.json b/web/package.json index f496bbf..97d0369 100644 --- a/web/package.json +++ b/web/package.json @@ -6,7 +6,7 @@ "packageManager": "pnpm@9.15.4", "scripts": { "dev": "vite", - "build": "tsc -b && vite build", + "build": "tsc -b tsconfig.build.json && vite build", "preview": "vite preview", "typecheck": "tsc -b --noEmit", "test": "vitest run", diff --git a/web/tsconfig.build.json b/web/tsconfig.build.json new file mode 100644 index 0000000..88cd2cf --- /dev/null +++ b/web/tsconfig.build.json @@ -0,0 +1,8 @@ +{ + // The nix derivation's src is `./web`, so the shared fixtures/ directory at + // the repo root does not exist there and `*.test.ts` cannot resolve its + // imports. Tests are not part of the shipped bundle; `pnpm typecheck` still + // checks them from a full checkout. + "extends": "./tsconfig.json", + "exclude": ["src/**/*.test.ts", "src/**/*.test.tsx"] +}