diff --git a/apps/pnpm-lock.yaml b/apps/pnpm-lock.yaml index 8d9345895f..9e9c0978c5 100644 --- a/apps/pnpm-lock.yaml +++ b/apps/pnpm-lock.yaml @@ -550,11 +550,11 @@ importers: specifier: ^8.53.0 version: 8.53.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) vite: - specifier: ^8.0.16 + specifier: 8.0.16 version: 8.0.16(@types/node@20.19.28)(esbuild@0.27.2)(jiti@2.6.1)(tsx@4.21.0) vitest: - specifier: ^1.6.0 - version: 1.6.1(@types/node@20.19.28)(happy-dom@20.8.9)(lightningcss@1.32.0) + specifier: ^4.1.10 + version: 4.1.10(@types/node@20.19.28)(happy-dom@20.8.9)(msw@2.12.7(@types/node@20.19.28)(typescript@5.9.3))(vite@8.0.16(@types/node@20.19.28)(esbuild@0.27.2)(jiti@2.6.1)(tsx@4.21.0)) packages: @@ -1763,8 +1763,8 @@ packages: resolution: {integrity: sha512-EFd6cVbHsgLa6wa4RljGj6Wk75qoHxUSyc5asLyyPSyuhIcdS2Q3Phw6ImS1q+CkALthJRShiYfKANcQMuMqsQ==} engines: {node: '>=18'} - '@napi-rs/wasm-runtime@1.1.5': - resolution: {integrity: sha512-AWPoBRJ9tsnVhor4sjO7rkni+7p+2IAEFj6cx06UgP10jkQHqay/36uRV/bFkgrh18D9vb4cr8Q0Pthskgzy+Q==} + '@napi-rs/wasm-runtime@1.1.6': + resolution: {integrity: sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==} peerDependencies: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 @@ -2842,6 +2842,9 @@ packages: resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} engines: {node: '>=18'} + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + '@tabler/icons-react@3.36.1': resolution: {integrity: sha512-/8nOXeNeMoze9xY/QyEKG65wuvRhkT3q9aytaur6Gj8bYU2A98YVJyLc9MRmc5nVvpy+bRlrrwK/Ykr8WGyUWg==} peerDependencies: @@ -3306,12 +3309,15 @@ packages: '@ts-morph/common@0.27.0': resolution: {integrity: sha512-Wf29UqxWDpc+i61k3oIOzcUfQt79PIT9y/MWfAGlrkjg6lBC1hwDECLXPVJAhWjiGbfBCxZd65F/LIZF3+jeJQ==} - '@tybys/wasm-util@0.10.2': - resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==} + '@tybys/wasm-util@0.10.3': + resolution: {integrity: sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==} '@types/aria-query@5.0.4': resolution: {integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==} + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + '@types/d3-array@3.2.2': resolution: {integrity: sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==} @@ -3408,6 +3414,9 @@ packages: '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + '@types/diff@8.0.0': resolution: {integrity: sha512-o7jqJM04gfaYrdCecCVMbZhNdG6T1MHg/oQoRFdERLV+4d+V7FijhiEAbFu0Usww84Yijk9yH58U4Jk4HbtzZw==} deprecated: This is a stub types definition. diff provides its own type definitions, so you do not need this installed. @@ -3600,18 +3609,47 @@ packages: '@vitest/expect@1.6.1': resolution: {integrity: sha512-jXL+9+ZNIJKruofqXuuTClf44eSpcHlgj3CiuNihUF3Ioujtmc0zIa3UJOW5RjDK1YLBJZnWBlPuqhYycLioog==} + '@vitest/expect@4.1.10': + resolution: {integrity: sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==} + + '@vitest/mocker@4.1.10': + resolution: {integrity: sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==} + peerDependencies: + msw: ^2.4.9 + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@4.1.10': + resolution: {integrity: sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==} + '@vitest/runner@1.6.1': resolution: {integrity: sha512-3nSnYXkVkf3mXFfE7vVyPmi3Sazhb/2cfZGGs0JRzFsPFvAMBEcrweV1V1GsrstdXeKCTXlJbvnQwGWgEIHmOA==} + '@vitest/runner@4.1.10': + resolution: {integrity: sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==} + '@vitest/snapshot@1.6.1': resolution: {integrity: sha512-WvidQuWAzU2p95u8GAKlRMqMyN1yOJkGHnx3M1PL9Raf7AQ1kwLKg04ADlCa3+OXUZE7BceOhVZiuWAbzCKcUQ==} + '@vitest/snapshot@4.1.10': + resolution: {integrity: sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==} + '@vitest/spy@1.6.1': resolution: {integrity: sha512-MGcMmpGkZebsMZhbQKkAf9CX5zGvjkBTqf8Zx3ApYWXr3wG+QvEu2eXWfnIIWYSJExIp4V9FCKDEeygzkYrXMw==} + '@vitest/spy@4.1.10': + resolution: {integrity: sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==} + '@vitest/utils@1.6.1': resolution: {integrity: sha512-jOrrUvXM4Av9ZWiG1EajNto0u96kWAhJ1LmPmJhXXQx/32MecEKd10pOLYgS2BQx1TgkGhloPU1ArDW2vvaY6g==} + '@vitest/utils@4.1.10': + resolution: {integrity: sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==} + '@xterm/addon-attach@0.12.0': resolution: {integrity: sha512-1lxvXM4JYSm60lbFmE8WMOy2oF2ip3Ye8jWorSAmwy7x8FiC53netEJ5RguL8+FSRj79MUQsNCb2hprY2QA2ig==} @@ -3711,6 +3749,10 @@ packages: assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + ast-types@0.16.1: resolution: {integrity: sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==} engines: {node: '>=4'} @@ -3786,6 +3828,10 @@ packages: resolution: {integrity: sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==} engines: {node: '>=4'} + chai@6.2.2: + resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} + engines: {node: '>=18'} + chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -4332,6 +4378,9 @@ packages: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} + es-module-lexer@2.3.1: + resolution: {integrity: sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA==} + es-object-atoms@1.1.1: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} @@ -4469,6 +4518,10 @@ packages: resolution: {integrity: sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==} engines: {node: ^18.19.0 || >=20.5.0} + expect-type@1.4.0: + resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==} + engines: {node: '>=12.0.0'} + express-rate-limit@7.5.1: resolution: {integrity: sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw==} engines: {node: '>= 16'} @@ -5564,6 +5617,10 @@ packages: resolution: {integrity: sha512-EFVjAYfzWqWsBMRHPMAXLCDIJnpMhdWAqR7xG6M6a2cs6PMFpl/+Z20w9zDW4vkxOFfddegBKq9Rehd0bxWE7A==} engines: {node: '>= 10'} + obug@2.1.3: + resolution: {integrity: sha512-9miFgM2OFba7hB+pRgvtV84pYTBaoTHohvmIgiRt6dRIzbwEOIaNaP+dIlGs2fNFoB0SeISs0Jz5WFVRid6Xyg==} + engines: {node: '>=12.20.0'} + on-finished@2.4.1: resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} engines: {node: '>= 0.8'} @@ -5697,14 +5754,14 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - picomatch@4.0.3: - resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} - engines: {node: '>=12'} - picomatch@4.0.4: resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} engines: {node: '>=12'} + picomatch@4.0.5: + resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==} + engines: {node: '>=12'} + pkce-challenge@5.0.1: resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==} engines: {node: '>=16.20.0'} @@ -5739,6 +5796,10 @@ packages: resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==} engines: {node: ^10 || ^12 || >=14} + postcss@8.5.19: + resolution: {integrity: sha512-Mz8SaolMd8nB+G13WkORcxQKHZ/NE4xXevtkJHVuG+guo9/wYKlIMTKAqGdEmYOXR2ijPjTYNHssizdaVSUNdQ==} + engines: {node: ^10 || ^12 || >=14} + postcss@8.5.6: resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} @@ -6212,6 +6273,9 @@ packages: std-env@3.10.0: resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} + std-env@4.2.0: + resolution: {integrity: sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==} + stdin-discarder@0.2.2: resolution: {integrity: sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==} engines: {node: '>=18'} @@ -6323,6 +6387,10 @@ packages: resolution: {integrity: sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==} engines: {node: '>=14.0.0'} + tinyrainbow@3.1.0: + resolution: {integrity: sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==} + engines: {node: '>=14.0.0'} + tinyspy@2.2.1: resolution: {integrity: sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==} engines: {node: '>=14.0.0'} @@ -6634,6 +6702,47 @@ packages: jsdom: optional: true + vitest@4.1.10: + resolution: {integrity: sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==} + engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@opentelemetry/api': ^1.9.0 + '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 + '@vitest/browser-playwright': 4.1.10 + '@vitest/browser-preview': 4.1.10 + '@vitest/browser-webdriverio': 4.1.10 + '@vitest/coverage-istanbul': 4.1.10 + '@vitest/coverage-v8': 4.1.10 + '@vitest/ui': 4.1.10 + happy-dom: '*' + jsdom: '*' + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@opentelemetry/api': + optional: true + '@types/node': + optional: true + '@vitest/browser-playwright': + optional: true + '@vitest/browser-preview': + optional: true + '@vitest/browser-webdriverio': + optional: true + '@vitest/coverage-istanbul': + optional: true + '@vitest/coverage-v8': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + vscode-jsonrpc@8.2.0: resolution: {integrity: sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==} engines: {node: '>=14.0.0'} @@ -7337,10 +7446,10 @@ snapshots: dotenv: 17.2.3 eciesjs: 0.4.16 execa: 5.1.1 - fdir: 6.5.0(picomatch@4.0.3) + fdir: 6.5.0(picomatch@4.0.4) ignore: 5.3.2 object-treeify: 1.1.33 - picomatch: 4.0.3 + picomatch: 4.0.4 which: 4.0.0 '@ecies/ciphers@0.2.5(@noble/ciphers@1.3.0)': @@ -7989,11 +8098,11 @@ snapshots: outvariant: 1.4.3 strict-event-emitter: 0.5.1 - '@napi-rs/wasm-runtime@1.1.5(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': + '@napi-rs/wasm-runtime@1.1.6(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': dependencies: '@emnapi/core': 1.10.0 '@emnapi/runtime': 1.10.0 - '@tybys/wasm-util': 0.10.2 + '@tybys/wasm-util': 0.10.3 optional: true '@noble/ciphers@1.3.0': {} @@ -8889,7 +8998,7 @@ snapshots: dependencies: '@emnapi/core': 1.10.0 '@emnapi/runtime': 1.10.0 - '@napi-rs/wasm-runtime': 1.1.5(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) optional: true '@rolldown/binding-win32-arm64-msvc@1.0.3': @@ -9019,6 +9128,8 @@ snapshots: '@sindresorhus/merge-streams@4.0.0': {} + '@standard-schema/spec@1.1.0': {} + '@tabler/icons-react@3.36.1(react@19.2.3)': dependencies: '@tabler/icons': 3.36.1 @@ -9451,13 +9562,18 @@ snapshots: minimatch: 10.1.1 path-browserify: 1.0.1 - '@tybys/wasm-util@0.10.2': + '@tybys/wasm-util@0.10.3': dependencies: tslib: 2.8.1 optional: true '@types/aria-query@5.0.4': {} + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + '@types/d3-array@3.2.2': {} '@types/d3-axis@3.0.6': @@ -9579,6 +9695,8 @@ snapshots: dependencies: '@types/ms': 2.1.0 + '@types/deep-eql@4.0.2': {} + '@types/diff@8.0.0': dependencies: diff: 8.0.3 @@ -9805,22 +9923,58 @@ snapshots: '@vitest/utils': 1.6.1 chai: 4.5.0 + '@vitest/expect@4.1.10': + dependencies: + '@standard-schema/spec': 1.1.0 + '@types/chai': 5.2.3 + '@vitest/spy': 4.1.10 + '@vitest/utils': 4.1.10 + chai: 6.2.2 + tinyrainbow: 3.1.0 + + '@vitest/mocker@4.1.10(msw@2.12.7(@types/node@20.19.28)(typescript@5.9.3))(vite@8.0.16(@types/node@20.19.28)(esbuild@0.27.2)(jiti@2.6.1)(tsx@4.21.0))': + dependencies: + '@vitest/spy': 4.1.10 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + msw: 2.12.7(@types/node@20.19.28)(typescript@5.9.3) + vite: 8.0.16(@types/node@20.19.28)(esbuild@0.27.2)(jiti@2.6.1)(tsx@4.21.0) + + '@vitest/pretty-format@4.1.10': + dependencies: + tinyrainbow: 3.1.0 + '@vitest/runner@1.6.1': dependencies: '@vitest/utils': 1.6.1 p-limit: 5.0.0 pathe: 1.1.2 + '@vitest/runner@4.1.10': + dependencies: + '@vitest/utils': 4.1.10 + pathe: 2.0.3 + '@vitest/snapshot@1.6.1': dependencies: magic-string: 0.30.21 pathe: 1.1.2 pretty-format: 29.7.0 + '@vitest/snapshot@4.1.10': + dependencies: + '@vitest/pretty-format': 4.1.10 + '@vitest/utils': 4.1.10 + magic-string: 0.30.21 + pathe: 2.0.3 + '@vitest/spy@1.6.1': dependencies: tinyspy: 2.2.1 + '@vitest/spy@4.1.10': {} + '@vitest/utils@1.6.1': dependencies: diff-sequences: 29.6.3 @@ -9828,6 +9982,12 @@ snapshots: loupe: 2.3.7 pretty-format: 29.7.0 + '@vitest/utils@4.1.10': + dependencies: + '@vitest/pretty-format': 4.1.10 + convert-source-map: 2.0.0 + tinyrainbow: 3.1.0 + '@xterm/addon-attach@0.12.0': {} '@xterm/addon-fit@0.11.0': {} @@ -9907,6 +10067,8 @@ snapshots: assertion-error@1.1.0: {} + assertion-error@2.0.1: {} + ast-types@0.16.1: dependencies: tslib: 2.8.1 @@ -9990,6 +10152,8 @@ snapshots: pathval: 1.1.1 type-detect: 4.1.0 + chai@6.2.2: {} + chalk@4.1.2: dependencies: ansi-styles: 4.3.0 @@ -10510,6 +10674,8 @@ snapshots: es-errors@1.3.0: {} + es-module-lexer@2.3.1: {} + es-object-atoms@1.1.1: dependencies: es-errors: 1.3.0 @@ -10763,6 +10929,8 @@ snapshots: strip-final-newline: 4.0.0 yoctocolors: 2.1.2 + expect-type@1.4.0: {} + express-rate-limit@7.5.1(express@5.2.1): dependencies: express: 5.2.1 @@ -10824,14 +10992,14 @@ snapshots: dependencies: reusify: 1.1.0 - fdir@6.5.0(picomatch@4.0.3): - optionalDependencies: - picomatch: 4.0.3 - fdir@6.5.0(picomatch@4.0.4): optionalDependencies: picomatch: 4.0.4 + fdir@6.5.0(picomatch@4.0.5): + optionalDependencies: + picomatch: 4.0.5 + fetch-blob@3.2.0: dependencies: node-domexception: 1.0.0 @@ -12023,6 +12191,8 @@ snapshots: object-treeify@1.1.33: {} + obug@2.1.3: {} + on-finished@2.4.1: dependencies: ee-first: 1.1.1 @@ -12171,10 +12341,10 @@ snapshots: picomatch@2.3.1: {} - picomatch@4.0.3: {} - picomatch@4.0.4: {} + picomatch@4.0.5: {} + pkce-challenge@5.0.1: {} pkg-types@1.3.1: @@ -12211,6 +12381,12 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + postcss@8.5.19: + dependencies: + nanoid: 3.3.12 + picocolors: 1.1.1 + source-map-js: 1.2.1 + postcss@8.5.6: dependencies: nanoid: 3.3.11 @@ -12959,6 +13135,8 @@ snapshots: std-env@3.10.0: {} + std-env@4.2.0: {} + stdin-discarder@0.2.2: {} strict-event-emitter@0.5.1: {} @@ -13052,11 +13230,13 @@ snapshots: tinyglobby@0.2.17: dependencies: - fdir: 6.5.0(picomatch@4.0.4) - picomatch: 4.0.4 + fdir: 6.5.0(picomatch@4.0.5) + picomatch: 4.0.5 tinypool@0.8.4: {} + tinyrainbow@3.1.0: {} + tinyspy@2.2.1: {} tiptap-markdown@0.9.0(@tiptap/core@3.19.0(@tiptap/pm@3.19.0)): @@ -13294,7 +13474,7 @@ snapshots: vite@5.4.21(@types/node@20.19.28)(lightningcss@1.32.0): dependencies: esbuild: 0.21.5 - postcss: 8.5.6 + postcss: 8.5.15 rollup: 4.55.1 optionalDependencies: '@types/node': 20.19.28 @@ -13304,8 +13484,8 @@ snapshots: vite@8.0.16(@types/node@20.19.28)(esbuild@0.27.2)(jiti@2.6.1)(tsx@4.21.0): dependencies: lightningcss: 1.32.0 - picomatch: 4.0.4 - postcss: 8.5.15 + picomatch: 4.0.5 + postcss: 8.5.19 rolldown: 1.0.3 tinyglobby: 0.2.17 optionalDependencies: @@ -13350,6 +13530,34 @@ snapshots: - supports-color - terser + vitest@4.1.10(@types/node@20.19.28)(happy-dom@20.8.9)(msw@2.12.7(@types/node@20.19.28)(typescript@5.9.3))(vite@8.0.16(@types/node@20.19.28)(esbuild@0.27.2)(jiti@2.6.1)(tsx@4.21.0)): + dependencies: + '@vitest/expect': 4.1.10 + '@vitest/mocker': 4.1.10(msw@2.12.7(@types/node@20.19.28)(typescript@5.9.3))(vite@8.0.16(@types/node@20.19.28)(esbuild@0.27.2)(jiti@2.6.1)(tsx@4.21.0)) + '@vitest/pretty-format': 4.1.10 + '@vitest/runner': 4.1.10 + '@vitest/snapshot': 4.1.10 + '@vitest/spy': 4.1.10 + '@vitest/utils': 4.1.10 + es-module-lexer: 2.3.1 + expect-type: 1.4.0 + magic-string: 0.30.21 + obug: 2.1.3 + pathe: 2.0.3 + picomatch: 4.0.4 + std-env: 4.2.0 + tinybench: 2.9.0 + tinyexec: 1.0.2 + tinyglobby: 0.2.17 + tinyrainbow: 3.1.0 + vite: 8.0.16(@types/node@20.19.28)(esbuild@0.27.2)(jiti@2.6.1)(tsx@4.21.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 20.19.28 + happy-dom: 20.8.9 + transitivePeerDependencies: + - msw + vscode-jsonrpc@8.2.0: {} vscode-languageserver-protocol@3.17.5: diff --git a/apps/web/app/actions/features.test.ts b/apps/web/app/actions/features.test.ts index e4818b0385..9b4e353b22 100644 --- a/apps/web/app/actions/features.test.ts +++ b/apps/web/app/actions/features.test.ts @@ -9,7 +9,7 @@ import { getRuntimeDebugModeAction } from "./features"; type FetchInput = Parameters[0]; type FetchInit = Parameters[1]; -const fetchSpy = vi.fn<[FetchInput, FetchInit?], Promise>(); +const fetchSpy = vi.fn<(...args: [FetchInput, FetchInit?]) => Promise>(); beforeEach(() => { fetchSpy.mockReset(); diff --git a/apps/web/components/gitlab/my-gitlab/use-gitlab-search.test.ts b/apps/web/components/gitlab/my-gitlab/use-gitlab-search.test.ts index c0d80e88f5..9bd68d6d10 100644 --- a/apps/web/components/gitlab/my-gitlab/use-gitlab-search.test.ts +++ b/apps/web/components/gitlab/my-gitlab/use-gitlab-search.test.ts @@ -4,8 +4,8 @@ import { IconInbox } from "@tabler/icons-react"; import type { Issue, MR, MRSearchPage, IssueSearchPage } from "@/lib/types/gitlab"; import type { PresetOption } from "./presets"; -const searchUserMRsMock = vi.fn<[unknown], Promise>(); -const searchUserIssuesMock = vi.fn<[unknown], Promise>(); +const searchUserMRsMock = vi.fn<(input: unknown) => Promise>(); +const searchUserIssuesMock = vi.fn<(input: unknown) => Promise>(); vi.mock("@/lib/api/domains/gitlab-api", () => ({ searchUserMRs: (args: unknown) => searchUserMRsMock(args), diff --git a/apps/web/components/jira/my-jira/use-project-statuses.test.ts b/apps/web/components/jira/my-jira/use-project-statuses.test.ts index 25e6e4c94f..ee688b56f9 100644 --- a/apps/web/components/jira/my-jira/use-project-statuses.test.ts +++ b/apps/web/components/jira/my-jira/use-project-statuses.test.ts @@ -2,10 +2,8 @@ import { afterEach, describe, expect, it, vi } from "vitest"; import { cleanup, renderHook, waitFor } from "@testing-library/react"; import type { JiraStatus } from "@/lib/types/jira"; -const listJiraProjectStatusesMock = vi.fn< - [string, { workspaceId?: string }?], - Promise<{ statuses: JiraStatus[] }> ->(); +const listJiraProjectStatusesMock = + vi.fn<(key: string, options?: { workspaceId?: string }) => Promise<{ statuses: JiraStatus[] }>>(); vi.mock("@/lib/api/domains/jira-api", () => ({ listJiraProjectStatuses: (key: string, options?: { workspaceId?: string }) => diff --git a/apps/web/components/task/chat/use-chat-input-state.test.ts b/apps/web/components/task/chat/use-chat-input-state.test.ts index 6f0448e36d..57847cc0a6 100644 --- a/apps/web/components/task/chat/use-chat-input-state.test.ts +++ b/apps/web/components/task/chat/use-chat-input-state.test.ts @@ -18,10 +18,7 @@ function renderInputState(onSubmit: SubmitHandler) { ); } -function attachInputHandle( - inputRef: React.RefObject, - clear: ReturnType, -) { +function attachInputHandle(inputRef: React.RefObject, clear: () => void) { (inputRef as React.MutableRefObject | null>).current = { clear, getMentions: () => [], @@ -44,7 +41,7 @@ describe("useChatInputState", () => { it("keeps the draft when async submit reports failure", async () => { const onSubmit = vi - .fn, ReturnType>() + .fn<(...args: Parameters) => ReturnType>() .mockResolvedValue(false); const clear = vi.fn(); const { result } = renderInputState(onSubmit); @@ -68,7 +65,7 @@ describe("useChatInputState", () => { it("clears the draft when async submit succeeds", async () => { const onSubmit = vi - .fn, ReturnType>() + .fn<(...args: Parameters) => ReturnType>() .mockResolvedValue(true); const clear = vi.fn(); const resetHeight = vi.fn(); @@ -92,7 +89,7 @@ describe("useChatInputState", () => { it("keeps newer attachments when async submit succeeds after attachments change", async () => { const submit = deferred(); const onSubmit = vi - .fn, ReturnType>() + .fn<(...args: Parameters) => ReturnType>() .mockReturnValue(submit.promise); const clear = vi.fn(); const resetHeight = vi.fn(); diff --git a/apps/web/components/task/chat/use-drain-older-messages.test.ts b/apps/web/components/task/chat/use-drain-older-messages.test.ts index c26ec99839..3e4da082f7 100644 --- a/apps/web/components/task/chat/use-drain-older-messages.test.ts +++ b/apps/web/components/task/chat/use-drain-older-messages.test.ts @@ -1,7 +1,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; import { renderHook, cleanup, waitFor } from "@testing-library/react"; -const loadMoreMock = vi.fn<[], Promise>(); +const loadMoreMock = vi.fn<() => Promise>(); vi.mock("@/hooks/use-lazy-load-messages", () => ({ useLazyLoadMessages: () => ({ loadMore: loadMoreMock, hasMore: true, isLoading: false }), diff --git a/apps/web/components/task/dockview-session-tab-sync.test.ts b/apps/web/components/task/dockview-session-tab-sync.test.ts index 7f8044ba10..59afd45b01 100644 --- a/apps/web/components/task/dockview-session-tab-sync.test.ts +++ b/apps/web/components/task/dockview-session-tab-sync.test.ts @@ -16,14 +16,14 @@ const OTHER_SESSION_PANEL_ID = `session:${OTHER_SESSION_ID}`; type SessionTabSyncPanel = { id: string; - api: { setActive: ReturnType> }; + api: { setActive: ReturnType void>> }; }; type SessionTabSyncApi = { panels: SessionTabSyncPanel[]; getPanel: (id: string) => SessionTabSyncPanel | null; onDidActivePanelChange: (callback: (panel: { id: string } | null) => void) => { - dispose: ReturnType>; + dispose: ReturnType void>>; }; }; @@ -34,7 +34,7 @@ type SessionTabSyncStore = { items: Record; }; environmentIdBySessionId: Record; - setActiveSession: ReturnType>; + setActiveSession: ReturnType void>>; }; }; diff --git a/apps/web/components/task/dockview-session-tabs.test.ts b/apps/web/components/task/dockview-session-tabs.test.ts index f85f574b1f..6f5bdd02e1 100644 --- a/apps/web/components/task/dockview-session-tabs.test.ts +++ b/apps/web/components/task/dockview-session-tabs.test.ts @@ -16,7 +16,7 @@ import { useDockviewStore } from "@/lib/state/dockview-store"; type FakePanel = { id: string; - api: { close: ReturnType> }; + api: { close: ReturnType void>> }; }; type MoveToOptions = { diff --git a/apps/web/components/task/file-browser-actions.test.ts b/apps/web/components/task/file-browser-actions.test.ts index a5c1a2be9b..d161a552d0 100644 --- a/apps/web/components/task/file-browser-actions.test.ts +++ b/apps/web/components/task/file-browser-actions.test.ts @@ -47,7 +47,7 @@ function response(content = "export const value = 1;"): FileContentResponse { describe("fetchAndOpenFile", () => { it("opens the requested repo-scoped file when the request is current", async () => { requestFileContentMock.mockResolvedValueOnce(response()); - const onOpenFile = vi.fn<[OpenFileTab], void>(); + const onOpenFile = vi.fn<(tab: OpenFileTab) => void>(); const toast = vi.fn(); await fetchAndOpenFile(SESSION_ID, FILE_PATH, onOpenFile, toast, { repo: REPO }); diff --git a/apps/web/hooks/domains/gitlab/use-task-mr.test.ts b/apps/web/hooks/domains/gitlab/use-task-mr.test.ts index d7c5dee348..d177a12dc5 100644 --- a/apps/web/hooks/domains/gitlab/use-task-mr.test.ts +++ b/apps/web/hooks/domains/gitlab/use-task-mr.test.ts @@ -4,11 +4,9 @@ import { act, cleanup, renderHook, waitFor } from "@testing-library/react"; import { StateProvider, useAppStore } from "@/components/state-provider"; import type { GitLabStatus, TaskMR } from "@/lib/types/gitlab"; -const fetchGitLabStatusMock = vi.fn<[], Promise>(); -const listWorkspaceTaskMRsMock = vi.fn< - [string], - Promise<{ task_mrs: Record } | null> ->(); +const fetchGitLabStatusMock = vi.fn<() => Promise>(); +const listWorkspaceTaskMRsMock = + vi.fn<(workspaceId: string) => Promise<{ task_mrs: Record } | null>>(); vi.mock("@/lib/api/domains/gitlab-api", () => ({ fetchGitLabStatus: () => fetchGitLabStatusMock(), diff --git a/apps/web/hooks/domains/jira/use-jira-availability.test.ts b/apps/web/hooks/domains/jira/use-jira-availability.test.ts index 72520461be..0e7886437f 100644 --- a/apps/web/hooks/domains/jira/use-jira-availability.test.ts +++ b/apps/web/hooks/domains/jira/use-jira-availability.test.ts @@ -2,7 +2,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; import { renderHook, waitFor } from "@testing-library/react"; import type { JiraConfig } from "@/lib/types/jira"; -const getJiraConfigMock = vi.fn<[], Promise>(); +const getJiraConfigMock = vi.fn<() => Promise>(); vi.mock("@/lib/api/domains/jira-api", () => ({ getJiraConfig: () => getJiraConfigMock(), diff --git a/apps/web/hooks/domains/system/use-system-badge-count.test.ts b/apps/web/hooks/domains/system/use-system-badge-count.test.ts index 14f85bc268..5c07d7c57f 100644 --- a/apps/web/hooks/domains/system/use-system-badge-count.test.ts +++ b/apps/web/hooks/domains/system/use-system-badge-count.test.ts @@ -14,8 +14,8 @@ type UpdatesMockReturn = { updates: UpdatesResponse | null; }; -const healthMock = vi.fn<[], HealthMockReturn>(); -const updatesMock = vi.fn<[], UpdatesMockReturn>(); +const healthMock = vi.fn<() => HealthMockReturn>(); +const updatesMock = vi.fn<() => UpdatesMockReturn>(); vi.mock("@/hooks/domains/settings/use-system-health", () => ({ useSystemHealth: () => healthMock(), diff --git a/apps/web/hooks/file-editors-sync.test.ts b/apps/web/hooks/file-editors-sync.test.ts index 1857b54683..534a908727 100644 --- a/apps/web/hooks/file-editors-sync.test.ts +++ b/apps/web/hooks/file-editors-sync.test.ts @@ -92,7 +92,9 @@ describe("buildGitFileSignature", () => { }); describe("syncOpenFileFromWorkspace", () => { - let updateFileState: ReturnType; + let updateFileState: ReturnType< + typeof vi.fn<(path: string, updates: Partial) => void> + >; beforeEach(() => { vi.clearAllMocks(); @@ -186,7 +188,9 @@ describe("syncOpenFileFromWorkspace", () => { }); describe("syncOpenFileFromWorkspace repo scoping", () => { - let updateFileState: ReturnType; + let updateFileState: ReturnType< + typeof vi.fn<(path: string, updates: Partial) => void> + >; beforeEach(() => { vi.clearAllMocks(); diff --git a/apps/web/hooks/use-ensure-user-settings.test.ts b/apps/web/hooks/use-ensure-user-settings.test.ts index e2ea77b14d..55f227228b 100644 --- a/apps/web/hooks/use-ensure-user-settings.test.ts +++ b/apps/web/hooks/use-ensure-user-settings.test.ts @@ -13,7 +13,7 @@ const mockFetchUserSettings = vi.fn(); const mockSetUserSettings = vi.fn((settings: UserSettingsState) => { mockState.userSettings = settings; }); -const mockReadQueuedTaskCreateLastUsedState = vi.fn<[], PendingTaskCreateLastUsed>(() => ({ +const mockReadQueuedTaskCreateLastUsedState = vi.fn<() => PendingTaskCreateLastUsed>(() => ({ repositoryId: undefined, branch: undefined, agentProfileId: undefined, diff --git a/apps/web/lib/api/domains/github-api.test.ts b/apps/web/lib/api/domains/github-api.test.ts index 4394d3a5ed..f099f44f61 100644 --- a/apps/web/lib/api/domains/github-api.test.ts +++ b/apps/web/lib/api/domains/github-api.test.ts @@ -21,7 +21,7 @@ import { type FetchInput = Parameters[0]; type FetchInit = Parameters[1]; -const fetchSpy = vi.fn<[FetchInput, FetchInit?], Promise>(); +const fetchSpy = vi.fn<(...args: [FetchInput, FetchInit?]) => Promise>(); beforeEach(() => { fetchSpy.mockReset(); diff --git a/apps/web/lib/api/domains/linear-api.test.ts b/apps/web/lib/api/domains/linear-api.test.ts index 142686b16e..e1b7d4673b 100644 --- a/apps/web/lib/api/domains/linear-api.test.ts +++ b/apps/web/lib/api/domains/linear-api.test.ts @@ -31,7 +31,7 @@ const AUTH = "api_key" as const; type FetchInput = Parameters[0]; type FetchInit = Parameters[1]; -const fetchSpy = vi.fn<[FetchInput, FetchInit?], Promise>(); +const fetchSpy = vi.fn<(...args: [FetchInput, FetchInit?]) => Promise>(); beforeEach(() => { fetchSpy.mockReset(); diff --git a/apps/web/lib/api/domains/office-tasks-api.test.ts b/apps/web/lib/api/domains/office-tasks-api.test.ts index 813b786c55..7f8584d176 100644 --- a/apps/web/lib/api/domains/office-tasks-api.test.ts +++ b/apps/web/lib/api/domains/office-tasks-api.test.ts @@ -10,7 +10,7 @@ import { listTasks, type ListTasksParams } from "./office-tasks-api"; type FetchInput = Parameters[0]; type FetchInit = Parameters[1]; -const fetchSpy = vi.fn<[FetchInput, FetchInit?], Promise>(); +const fetchSpy = vi.fn<(...args: [FetchInput, FetchInit?]) => Promise>(); beforeEach(() => { fetchSpy.mockReset(); diff --git a/apps/web/lib/api/domains/runtime-flags-api.test.ts b/apps/web/lib/api/domains/runtime-flags-api.test.ts index 501596d600..640532df6c 100644 --- a/apps/web/lib/api/domains/runtime-flags-api.test.ts +++ b/apps/web/lib/api/domains/runtime-flags-api.test.ts @@ -11,7 +11,7 @@ const BASE = "http://api.test/api/v1/runtime-flags"; type FetchInput = Parameters[0]; type FetchInit = Parameters[1]; -const fetchSpy = vi.fn<[FetchInput, FetchInit?], Promise>(); +const fetchSpy = vi.fn<(...args: [FetchInput, FetchInit?]) => Promise>(); beforeEach(() => { fetchSpy.mockReset(); diff --git a/apps/web/lib/api/domains/sentry-api.test.ts b/apps/web/lib/api/domains/sentry-api.test.ts index 21c9c6825c..c8ae32a52f 100644 --- a/apps/web/lib/api/domains/sentry-api.test.ts +++ b/apps/web/lib/api/domains/sentry-api.test.ts @@ -9,7 +9,7 @@ import { copySentryInstances } from "./sentry-api"; type FetchInput = Parameters[0]; type FetchInit = Parameters[1]; -const fetchSpy = vi.fn<[FetchInput, FetchInit?], Promise>(); +const fetchSpy = vi.fn<(...args: [FetchInput, FetchInit?]) => Promise>(); beforeEach(() => { fetchSpy.mockReset(); diff --git a/apps/web/lib/api/domains/share-api.test.ts b/apps/web/lib/api/domains/share-api.test.ts index b80b14aee7..f080e0e87e 100644 --- a/apps/web/lib/api/domains/share-api.test.ts +++ b/apps/web/lib/api/domains/share-api.test.ts @@ -16,7 +16,7 @@ import { type FetchInput = Parameters[0]; type FetchInit = Parameters[1]; -const fetchSpy = vi.fn<[FetchInput, FetchInit?], Promise>(); +const fetchSpy = vi.fn<(...args: [FetchInput, FetchInit?]) => Promise>(); beforeEach(() => { fetchSpy.mockReset(); diff --git a/apps/web/lib/api/domains/system-api.test.ts b/apps/web/lib/api/domains/system-api.test.ts index 1a1b971ba4..51f1096165 100644 --- a/apps/web/lib/api/domains/system-api.test.ts +++ b/apps/web/lib/api/domains/system-api.test.ts @@ -34,7 +34,7 @@ const BASE = "http://api.test/api/v1/system"; type FetchInput = Parameters[0]; type FetchInit = Parameters[1]; -const fetchSpy = vi.fn<[FetchInput, FetchInit?], Promise>(); +const fetchSpy = vi.fn<(...args: [FetchInput, FetchInit?]) => Promise>(); beforeEach(() => { fetchSpy.mockReset(); diff --git a/apps/web/lib/logger/intercept.test.ts b/apps/web/lib/logger/intercept.test.ts index e2c6e6884a..b42e557663 100644 --- a/apps/web/lib/logger/intercept.test.ts +++ b/apps/web/lib/logger/intercept.test.ts @@ -12,9 +12,9 @@ describe("console interceptor", () => { error: console.error, }; - let infoSpy: ReturnType; - let warnSpy: ReturnType; - let errorSpy: ReturnType; + let infoSpy: ReturnType void>>; + let warnSpy: ReturnType void>>; + let errorSpy: ReturnType void>>; beforeEach(() => { _resetForTesting(); diff --git a/apps/web/lib/terminal/touch-scroll.test.ts b/apps/web/lib/terminal/touch-scroll.test.ts index 42f4a9a201..2d417ababa 100644 --- a/apps/web/lib/terminal/touch-scroll.test.ts +++ b/apps/web/lib/terminal/touch-scroll.test.ts @@ -31,7 +31,10 @@ describe("computeScrollLines", () => { }); }); -type TerminalStub = { scrollLines: ReturnType; rows: number }; +type TerminalStub = { + scrollLines: ReturnType void>>; + rows: number; +}; function makeContainer(): HTMLElement { const el = document.createElement("div"); diff --git a/apps/web/lib/ws/handlers/tasks.test.ts b/apps/web/lib/ws/handlers/tasks.test.ts index 545a078285..947835f564 100644 --- a/apps/web/lib/ws/handlers/tasks.test.ts +++ b/apps/web/lib/ws/handlers/tasks.test.ts @@ -138,7 +138,7 @@ function makeInactiveStore() { describe("task.updated primary-session focus follow", () => { let store: ReturnType; - let setActiveSessionAuto: ReturnType; + let setActiveSessionAuto: ReturnType void>>; beforeEach(() => { setActiveSessionAuto = vi.fn(); @@ -242,7 +242,7 @@ describe("task.updated primary-session focus follow", () => { // they deliberately clicked into. describe("task.updated primary-session focus follow (pinning)", () => { let store: ReturnType; - let setActiveSessionAuto: ReturnType; + let setActiveSessionAuto: ReturnType void>>; beforeEach(() => { setActiveSessionAuto = vi.fn(); @@ -302,7 +302,7 @@ describe("task.updated primary-session focus follow (pinning)", () => { describe("task.updated primary-session focus follow (stale pin cleanup)", () => { let store: ReturnType; - let setActiveSessionAuto: ReturnType; + let setActiveSessionAuto: ReturnType void>>; beforeEach(() => { setActiveSessionAuto = vi.fn(); diff --git a/apps/web/package.json b/apps/web/package.json index 9160649cf7..b85babbc46 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -143,7 +143,7 @@ "tsx": "^4.21.0", "typescript": "^5", "typescript-eslint": "^8.53.0", - "vite": "^8.0.16", - "vitest": "^1.6.0" + "vite": "8.0.16", + "vitest": "^4.1.10" } } diff --git a/apps/web/vitest.config.ts b/apps/web/vitest.config.ts index 1fc683dcc5..7e8aa23c32 100644 --- a/apps/web/vitest.config.ts +++ b/apps/web/vitest.config.ts @@ -1,17 +1,28 @@ -import path from "path"; -import { defineConfig } from "vitest/config"; +import { defineConfig, mergeConfig } from "vitest/config"; -export default defineConfig({ - resolve: { - alias: { - "@": path.resolve(__dirname, "."), - "@kandev/ui": path.resolve(__dirname, "../packages/ui/src"), - "@kandev/theme": path.resolve(__dirname, "../packages/theme/src"), +import viteConfig from "./vite.config"; + +const configuredMaxWorkers = process.env.VITEST_MAX_WORKERS?.trim(); +const maxWorkers = resolveMaxWorkers(configuredMaxWorkers, Boolean(process.env.CI)); + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + environment: "happy-dom", + setupFiles: ["./vitest.setup.ts"], + exclude: ["e2e/**", "node_modules/**"], + pool: "threads", + maxWorkers, }, - }, - test: { - environment: "happy-dom", - setupFiles: ["./vitest.setup.ts"], - exclude: ["e2e/**", "node_modules/**"], - }, -}); + }), +); + +function resolveMaxWorkers(value: string | undefined, isCI: boolean) { + if (/^[1-9]\d*%$/.test(value ?? "")) return value; + + const workers = Number(value); + if (Number.isInteger(workers) && workers > 0) return workers; + + return isCI ? undefined : "20%"; +} diff --git a/docs/decisions/0037-resource-aware-frontend-unit-tests.md b/docs/decisions/0037-resource-aware-frontend-unit-tests.md new file mode 100644 index 0000000000..7e2827356f --- /dev/null +++ b/docs/decisions/0037-resource-aware-frontend-unit-tests.md @@ -0,0 +1,40 @@ +# 0037: Resource-Aware Frontend Unit Tests + +**Status:** accepted +**Date:** 2026-07-14 +**Area:** frontend, infra + +## Context + +The web unit suite contains hundreds of Vitest files and is commonly run by several concurrent Kandev tasks on the same developer host. Vitest's uncapped run mode uses all available parallelism, so overlapping full-suite runs saturate CPU, consume multiple gigabytes of memory, and can thermally throttle smaller hosts. The test stack also remained on Vitest 1 with its private Vite 5 and Tinypool dependencies while the application had moved to Vite 8. + +On a 10-logical-CPU development host, the old uncapped suite averaged roughly 7.5–8 logical CPUs and peaked near 2.25 GB RSS. After the upgrade, a 20-percent cap completed all 4,661 tests using an average of 2.64 logical CPUs and a 1.72 GB peak RSS. These measurements are workload-specific, but they establish the intended order of magnitude for the local default. Vite 8.1.4's Rolldown update also misbundles `rehype-sanitize`'s re-exported `defaultSchema`, crashing the production app at startup, so its known-good 8.0.16 lock is retained pending an upstream fix. + +## Decision + +Kandev keeps Vitest as the frontend unit-test runner and aligns it with the application's current Vite major. Local full-suite runs use the worker-thread pool and at most 20 percent of the host's available parallelism. `pool: "threads"` is explicit because Vitest 2+ defaults to `forks`; the suite's isolation trial showed that `forks` produces widespread cross-file mock and DOM failures. CI remains uncapped so dedicated runners can use their assigned capacity, and `VITEST_MAX_WORKERS` can override either default for an explicit execution environment when it is a positive integer or percentage. Vitest is upgraded to 4.1.10; Vite remains locked at 8.0.16 rather than the incompatible 8.1.4. + +Targeted test-file runs remain the normal development loop. Full frontend suites run during final verification and CI rather than after every edit. Per-file isolation remains enabled because the suite relies on module and DOM isolation. + +## Consequences + +- Concurrent Kandev tasks leave CPU capacity for the backend, agents, editor, and other test suites. +- A local full-suite run takes longer when it is the only workload, but overlapping runs cause less contention and thermal pressure. +- CI performance is unchanged unless the CI environment explicitly sets `VITEST_MAX_WORKERS`. +- Vitest and Vite share a supported dependency generation instead of loading a second legacy Vite toolchain. +- The percentage limit scales across developer machines without hard-coding a workstation-specific core count. +- Vite updates require a production-build smoke check until the Rolldown re-export regression is fixed upstream. + +## Alternatives Considered + +### Keep uncapped Vitest locally + +Rejected because the fastest isolated run becomes slower and less predictable when several Kandev tasks independently consume the whole host. + +### Disable test-file isolation + +Rejected because a trial produced widespread cross-file mock and DOM failures. The suite depends on isolation for correctness. + +### Migrate to Rstest + +Deferred because its Rust-powered transform pipeline does not remove the need for a worker budget, while migration would require broad changes to Vitest imports and mocking APIs. It can be benchmarked separately after the lower-risk runner upgrade and resource policy land. diff --git a/docs/decisions/INDEX.md b/docs/decisions/INDEX.md index 5be9dd2894..a268a89a04 100644 --- a/docs/decisions/INDEX.md +++ b/docs/decisions/INDEX.md @@ -42,3 +42,4 @@ Read individual ADRs for full context. Create new ones via `/record decision` or | 0034 | [Agent Client Protocol Codex ACP Bridge](0034-agentclientprotocol-codex-acp.md) | accepted | backend, protocol | 2026-07-10 | | 0035 | [Version AgentReady events by prompt generation](0035-version-agent-ready-events-by-prompt-generation.md) | accepted | backend | 2026-07-14 | | 0036 | [Normalize ACP shell output at the adapter boundary](0036-normalize-acp-shell-output-at-adapter-boundary.md) | accepted | backend, frontend, protocol | 2026-07-14 | +| 0037 | [Resource-aware frontend unit tests](0037-resource-aware-frontend-unit-tests.md) | accepted | frontend, infra | 2026-07-14 |