chore(frontend): unbreak the shared-utils library build (#10734)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-08-18 00:20:55 +02:00
committed by GitHub
parent b17fdab8ff
commit f4f2dd5ece
2 changed files with 9 additions and 3 deletions
@@ -1,11 +1,12 @@
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import { resolve } from 'path'
import { writeFileSync } from 'fs'
import { exec } from 'child_process'
import { promisify } from 'util'
const execAsync = promisify(exec)
const VERSION = '1.0.12'
const VERSION = '1.0.13'
export default defineConfig({
build: {
@@ -24,6 +25,7 @@ export default defineConfig({
}
},
plugins: [
svelte(),
{
name: 'bundle-types',
async closeBundle() {
+6 -2
View File
@@ -18,8 +18,12 @@ export function createState<T>(initialValue: T): T {
return s
}
export function stateSnapshot<T>(state: T) {
return $state.snapshot(state)
// Annotated: the inferred `Snapshot<T>` is a deep conditional type TS refuses to
// serialize into a declaration file (TS7056), which breaks the shared-utils build.
// `Snapshot<T>` is not exported from the `$state` namespace, and it only differs
// from `T` for Date/Map/Set, which no caller snapshots.
export function stateSnapshot<T>(state: T): T {
return $state.snapshot(state) as T
}
export function refreshStateStore<T>(store: StateStore<T>): void {
store.val = $state.snapshot(store.val) as any