mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 08:01:26 +00:00
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:
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user