mirror of
https://github.com/hanzoai/desktop.git
synced 2026-10-30 14:58:42 +00:00
@noble/ed25519 is 3.2.0 here and the setup was still v2's: assign the SHA-512 onto `etc`. v3 freezes `etc`, so the assignment threw at module load and took the surface importing it down with it — "Cannot add property sha512Sync, object is not extensible", before a frame was drawn. v3 reads the hash from `hashes`, and mints a secret key with `randomSecretKey`. The library's own tests could not run to catch it: its vite config loads unplugin-dts, which cannot start under TypeScript 7. A vitest config beside it runs them. Key generation, both kinds, now passes. Co-authored-by: Hanzo Dev <[email protected]>
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
/// <reference types="vitest" />
|
|
// @ts-expect-error path
|
|
import path from 'path';
|
|
import topLevelAwait from 'vite-plugin-top-level-await';
|
|
import wasm from 'vite-plugin-wasm';
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
cacheDir: '../../node_modules/.vite/hanzo-message-ts',
|
|
resolve: {
|
|
alias: {
|
|
'./libsodium-sumo.mjs': path.resolve(
|
|
__dirname,
|
|
'../../node_modules/libsodium-sumo/dist/modules-sumo-esm/libsodium-sumo.mjs',
|
|
),
|
|
},
|
|
},
|
|
plugins: [
|
|
tsconfigPaths({ root: '../..' }),
|
|
wasm(),
|
|
topLevelAwait(),
|
|
],
|
|
test: {
|
|
watch: false,
|
|
setupFiles: './scripts/setupTests.ts',
|
|
globals: true,
|
|
cache: { dir: '../../node_modules/.vitest/libs/hanzo-message-ts' },
|
|
environment: 'jsdom',
|
|
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
reporters: ['default'],
|
|
coverage: {
|
|
reportsDirectory: '../../coverage/libs/hanzo-message-ts',
|
|
provider: 'v8',
|
|
},
|
|
},
|
|
root: __dirname,
|
|
});
|