feat: Reinitialize frontend with SvelteKit and TypeScript

- 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
This commit is contained in:
2026-02-17 16:19:59 -05:00
parent 54df6018f5
commit de2d83092e
28274 changed files with 3816354 additions and 90 deletions

View File

@@ -0,0 +1,35 @@
import { asyncToStringMethod, hasAsyncToStringMethod, hasToStringMethod, toStringMethod, } from '../../../utils/stringify.js';
import { cloneMethod, hasCloneMethod } from '../../symbols.js';
export class CommandWrapper {
constructor(cmd) {
this.cmd = cmd;
this.hasRan = false;
if (hasToStringMethod(cmd)) {
const method = cmd[toStringMethod];
this[toStringMethod] = function toStringMethod() {
return method.call(cmd);
};
}
if (hasAsyncToStringMethod(cmd)) {
const method = cmd[asyncToStringMethod];
this[asyncToStringMethod] = function asyncToStringMethod() {
return method.call(cmd);
};
}
}
check(m) {
return this.cmd.check(m);
}
run(m, r) {
this.hasRan = true;
return this.cmd.run(m, r);
}
clone() {
if (hasCloneMethod(this.cmd))
return new CommandWrapper(this.cmd[cloneMethod]());
return new CommandWrapper(this.cmd);
}
toString() {
return this.cmd.toString();
}
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,21 @@
import { cloneMethod } from '../../symbols.js';
export class CommandsIterable {
constructor(commands, metadataForReplay) {
this.commands = commands;
this.metadataForReplay = metadataForReplay;
}
[Symbol.iterator]() {
return this.commands[Symbol.iterator]();
}
[cloneMethod]() {
return new CommandsIterable(this.commands.map((c) => c.clone()), this.metadataForReplay);
}
toString() {
const serializedCommands = this.commands
.filter((c) => c.hasRan)
.map((c) => c.toString())
.join(',');
const metadata = this.metadataForReplay();
return metadata.length !== 0 ? `${serializedCommands} /*${metadata}*/` : serializedCommands;
}
}

View File

@@ -0,0 +1,53 @@
export class ScheduledCommand {
constructor(s, cmd) {
this.s = s;
this.cmd = cmd;
}
async check(m) {
let error = null;
let checkPassed = false;
const status = await this.s.scheduleSequence([
{
label: `check@${this.cmd.toString()}`,
builder: async () => {
try {
checkPassed = await Promise.resolve(this.cmd.check(m));
}
catch (err) {
error = err;
throw err;
}
},
},
]).task;
if (status.faulty) {
throw error;
}
return checkPassed;
}
async run(m, r) {
let error = null;
const status = await this.s.scheduleSequence([
{
label: `run@${this.cmd.toString()}`,
builder: async () => {
try {
await this.cmd.run(m, r);
}
catch (err) {
error = err;
throw err;
}
},
},
]).task;
if (status.faulty) {
throw error;
}
}
}
export const scheduleCommands = function* (s, cmds) {
for (const cmd of cmds) {
yield new ScheduledCommand(s, cmd);
}
};