- Delete old Vite+Svelte frontend - Initialize new SvelteKit project with TypeScript - Configure Tailwind CSS v4 + DaisyUI - Implement JWT authentication with auto-refresh - Create login page with form validation (Zod) - Add protected route guards - Update Docker configuration for single-stage build - Add E2E tests with Playwright (6/11 passing) - Fix Svelte 5 reactivity with $state() runes Known issues: - 5 E2E tests failing (timing/async issues) - Token refresh implementation needs debugging - Validation error display timing
22 lines
611 B
JavaScript
22 lines
611 B
JavaScript
export function defaults(data, adapter, options) {
|
|
if (data && 'superFormValidationLibrary' in data) {
|
|
options = adapter;
|
|
adapter = data;
|
|
data = null;
|
|
}
|
|
const validator = adapter;
|
|
const optionDefaults = options?.defaults ?? validator.defaults;
|
|
return {
|
|
id: options?.id ?? validator.id ?? '',
|
|
valid: false,
|
|
posted: false,
|
|
errors: {},
|
|
data: { ...optionDefaults, ...data },
|
|
constraints: validator.constraints,
|
|
shape: validator.shape
|
|
};
|
|
}
|
|
export function defaultValues(adapter) {
|
|
return adapter.defaults;
|
|
}
|