- 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
42 lines
1.4 KiB
JavaScript
42 lines
1.4 KiB
JavaScript
import { describeCollapsibleDate } from "@ark/util";
|
|
import { Disjoint } from "../shared/disjoint.js";
|
|
import { implementNode } from "../shared/implement.js";
|
|
import { $ark } from "../shared/registry.js";
|
|
import { BaseRange, createDateSchemaNormalizer, parseDateLimit } from "./range.js";
|
|
const implementation = implementNode({
|
|
kind: "before",
|
|
collapsibleKey: "rule",
|
|
hasAssociatedError: true,
|
|
keys: {
|
|
rule: {
|
|
parse: parseDateLimit,
|
|
serialize: schema => schema.toISOString()
|
|
}
|
|
},
|
|
normalize: createDateSchemaNormalizer("before"),
|
|
defaults: {
|
|
description: node => `${node.collapsibleLimitString} or earlier`,
|
|
actual: describeCollapsibleDate
|
|
},
|
|
intersections: {
|
|
before: (l, r) => (l.isStricterThan(r) ? l : r),
|
|
after: (before, after, ctx) => before.overlapsRange(after) ?
|
|
before.overlapIsUnit(after) ?
|
|
ctx.$.node("unit", { unit: before.rule })
|
|
: null
|
|
: Disjoint.init("range", before, after)
|
|
}
|
|
});
|
|
export class BeforeNode extends BaseRange {
|
|
collapsibleLimitString = describeCollapsibleDate(this.rule);
|
|
traverseAllows = data => data <= this.rule;
|
|
impliedBasis = $ark.intrinsic.Date.internal;
|
|
reduceJsonSchema(base, ctx) {
|
|
return ctx.fallback.date({ code: "date", base, before: this.rule });
|
|
}
|
|
}
|
|
export const Before = {
|
|
implementation,
|
|
Node: BeforeNode
|
|
};
|