trilium/vitest.config.ts
Elian Doran 12475a811b
ci(nix): sync the flake's Electron pin automatically
nixpkgs lags behind the Electron releases we track, so flake.nix builds the
exact pinned version from Electron's official binary release. Renovate bumps
the devDependency but knows nothing about that pin, so every Electron update
left the flake refusing to evaluate until someone refreshed six hashes by
hand.

scripts/update-flake-electron.ts does it instead: the per-platform checksums
come from the release's own SHASUMS256.txt and the headers hash from
nix-prefetch-url --unpack. It is a no-op when the pin already matches.

The workflow runs it on pushes to main that touch apps/desktop/package.json
(and on demand), verifies the written hashes by actually building .#electron
and .#electron.headers, and only then opens a PR.

Two supporting flake changes:

  - packages.electron is exposed, so the pinned binary can be built — and its
    hashes verified — without a full desktop build.
  - electron_<major> is looked up with `or null`. A major bump lands in
    package.json long before nixpkgs has the attribute, and without the
    fallback the flake died with an attribute error rather than reaching the
    throw that explains the mismatch.

scripts/ is not a workspace package, so its tests get their own vitest
project, a `pnpm scripts:test` entry point, and a step in dev.yml.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-08 15:55:22 +03:00

15 lines
331 B
TypeScript

import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
projects: [
"packages/*/vitest.config.ts",
"packages/*/vite.config.ts",
"apps/*/vitest.config.ts",
"apps/*/vite.config.ts",
"apps/*/vite.config.mts",
"scripts/vitest.config.ts",
],
},
})