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,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=IVirtualConsoleLogEntry.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IVirtualConsoleLogEntry.cjs","sourceRoot":"","sources":["../../src/console/IVirtualConsoleLogEntry.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,10 @@
import IVirtualConsoleLogGroup from './IVirtualConsoleLogGroup.cjs';
import VirtualConsoleLogLevelEnum from './enums/VirtualConsoleLogLevelEnum.cjs';
import VirtualConsoleLogTypeEnum from './enums/VirtualConsoleLogTypeEnum.cjs';
export default interface IVirtualConsoleLogEntry {
type: VirtualConsoleLogTypeEnum;
level: VirtualConsoleLogLevelEnum;
message: Array<string | object>;
group: IVirtualConsoleLogGroup | null;
}
//# sourceMappingURL=IVirtualConsoleLogEntry.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IVirtualConsoleLogEntry.d.ts","sourceRoot":"","sources":["../../src/console/IVirtualConsoleLogEntry.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,0BAA0B,MAAM,uCAAuC,CAAC;AAC/E,OAAO,yBAAyB,MAAM,sCAAsC,CAAC;AAE7E,MAAM,CAAC,OAAO,WAAW,uBAAuB;IAC/C,IAAI,EAAE,yBAAyB,CAAC;IAChC,KAAK,EAAE,0BAA0B,CAAC;IAClC,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACtC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=IVirtualConsoleLogGroup.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IVirtualConsoleLogGroup.cjs","sourceRoot":"","sources":["../../src/console/IVirtualConsoleLogGroup.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,7 @@
export default interface IVirtualConsoleLogGroup {
id: number;
label: string;
collapsed: boolean;
parent: IVirtualConsoleLogGroup;
}
//# sourceMappingURL=IVirtualConsoleLogGroup.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IVirtualConsoleLogGroup.d.ts","sourceRoot":"","sources":["../../src/console/IVirtualConsoleLogGroup.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,uBAAuB;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,uBAAuB,CAAC;CAChC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=IVirtualConsolePrinter.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IVirtualConsolePrinter.cjs","sourceRoot":"","sources":["../../src/console/IVirtualConsolePrinter.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,52 @@
import IVirtualConsoleLogEntry from './IVirtualConsoleLogEntry.cjs';
import VirtualConsoleLogLevelEnum from './enums/VirtualConsoleLogLevelEnum.cjs';
import Event from '../event/Event.cjs';
/**
* Virtual console printer.
*/
export default interface IVirtualConsolePrinter {
/**
* Writes to the output.
*
* @param logEntry Log entry.
*/
print(logEntry: IVirtualConsoleLogEntry): void;
/**
* Clears the output.
*/
clear(): void;
/**
* Adds an event listener.
*
* @param eventType Event type ("print" or "clear").
* @param listener Listener.
*/
addEventListener(eventType: 'print' | 'clear', listener: (event: Event) => void): void;
/**
* Removes an event listener.
*
* @param eventType Event type ("print" or "clear").
* @param listener Listener.
*/
removeEventListener(eventType: 'print' | 'clear', listener: (event: Event) => void): void;
/**
* Dispatches an event.
*
* @param event Event.
*/
dispatchEvent(event: Event): void;
/**
* Reads the buffer.
*
* @returns Console log entries.
*/
read(): IVirtualConsoleLogEntry[];
/**
* Returns the buffer as a string.
*
* @param [logLevel] Log level.
* @returns Buffer as a string of concatenated log entries.
*/
readAsString(logLevel?: VirtualConsoleLogLevelEnum): string;
}
//# sourceMappingURL=IVirtualConsolePrinter.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IVirtualConsolePrinter.d.ts","sourceRoot":"","sources":["../../src/console/IVirtualConsolePrinter.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,0BAA0B,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,OAAO,WAAW,sBAAsB;IAC9C;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAE/C;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;;;;OAKG;IACH,gBAAgB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAAC;IAEvF;;;;;OAKG;IACH,mBAAmB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAAC;IAE1F;;;;OAIG;IACH,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAElC;;;;OAIG;IACH,IAAI,IAAI,uBAAuB,EAAE,CAAC;IAElC;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,CAAC,EAAE,0BAA0B,GAAG,MAAM,CAAC;CAC5D"}

View File

@@ -0,0 +1,342 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const VirtualConsoleLogLevelEnum_js_1 = __importDefault(require("./enums/VirtualConsoleLogLevelEnum.cjs"));
const VirtualConsoleLogTypeEnum_js_1 = __importDefault(require("./enums/VirtualConsoleLogTypeEnum.cjs"));
/**
* Virtual Console.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/Console
*/
class VirtualConsole {
// This is needed as the interface for the NodeJS Console also have a reference to the ConsoleConstructor class as a property for some reason.
// This is not part of the browser specs.
Console;
#printer;
#count = {};
#time = {};
#groupID = 0;
#groups = [];
/**
* Constructor.
*
* @param printer Console printer.
*/
constructor(printer) {
this.#printer = printer;
}
/**
* Writes an error message to the console if the assertion is false. If the assertion is true, nothing happens.
*
* @param assertion Assertion.
* @param message Message.
* @param args Arguments.
*/
assert(assertion, message, ...args) {
if (!assertion) {
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.assert,
level: VirtualConsoleLogLevelEnum_js_1.default.error,
message: ['Assertion failed:', ...(message ? [message, ...args] : args)],
group: this.#groups[this.#groups.length - 1] || null
});
}
}
/**
* Clears the console.
*/
clear() {
this.#printer.clear();
}
/**
* Logs the number of times that this particular call to count() has been called.
*
* @param [label='default'] Label.
*/
count(label = 'default') {
if (!this.#count[label]) {
this.#count[label] = 0;
}
this.#count[label]++;
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.count,
level: VirtualConsoleLogLevelEnum_js_1.default.info,
message: [`${label}: ${this.#count[label]}`],
group: this.#groups[this.#groups.length - 1] || null
});
}
/**
* Resets the counter.
*
* @param [label='default'] Label.
*/
countReset(label = 'default') {
delete this.#count[label];
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.countReset,
level: VirtualConsoleLogLevelEnum_js_1.default.warn,
message: [`${label}: 0`],
group: this.#groups[this.#groups.length - 1] || null
});
}
/**
* Outputs a message to the web console at the "debug" log level.
*
* @param message Message.
* @param args Arguments.
*/
debug(message, ...args) {
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.debug,
level: VirtualConsoleLogLevelEnum_js_1.default.log,
message: message ? [message, ...args] : args,
group: this.#groups[this.#groups.length - 1] || null
});
}
/**
* Displays an interactive list of the properties of the specified JavaScript object.
*
* @param data Data.
*/
dir(data) {
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.dir,
level: VirtualConsoleLogLevelEnum_js_1.default.log,
message: [data],
group: this.#groups[this.#groups.length - 1] || null
});
}
/**
* Displays an interactive tree of the descendant elements of the specified XML/HTML element.
*
* @param data Data.
*/
dirxml(data) {
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.dirxml,
level: VirtualConsoleLogLevelEnum_js_1.default.log,
message: [data],
group: this.#groups[this.#groups.length - 1] || null
});
}
/**
* Outputs an error message to the console.
*
* @param message Message.
* @param args Arguments.
*/
error(message, ...args) {
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.error,
level: VirtualConsoleLogLevelEnum_js_1.default.error,
message: message ? [message, ...args] : args,
group: this.#groups[this.#groups.length - 1] || null
});
}
/**
* Alias for error().
*
* @deprecated
* @alias error()
* @param args Arguments.
*/
exception(...args) {
this.error(...args);
}
/**
* Creates a new inline group in the console, causing any subsequent console messages to be indented by an additional level, until console.groupEnd() is called.
*
* @param [label] Label.
*/
group(label) {
this.#groupID++;
const group = {
id: this.#groupID,
label: label || 'default',
collapsed: false,
parent: this.#groups[this.#groups.length - 1] || null
};
this.#groups.push(group);
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.group,
level: VirtualConsoleLogLevelEnum_js_1.default.log,
message: [label || 'default'],
group
});
}
/**
* Creates a new inline group in the console, but prints it as collapsed, requiring the use of a disclosure button to expand it.
*
* @param [label] Label.
*/
groupCollapsed(label) {
this.#groupID++;
const group = {
id: this.#groupID,
label: label || 'default',
collapsed: true,
parent: this.#groups[this.#groups.length - 1] || null
};
this.#groups.push(group);
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.groupCollapsed,
level: VirtualConsoleLogLevelEnum_js_1.default.log,
message: [label || 'default'],
group
});
}
/**
* Exits the current inline group in the console.
*/
groupEnd() {
if (this.#groups.length === 0) {
return;
}
this.#groups.pop();
}
/**
* Outputs an informational message to the console.
*
* @param message Message.
* @param args Arguments.
*/
info(message, ...args) {
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.info,
level: VirtualConsoleLogLevelEnum_js_1.default.info,
message: message ? [message, ...args] : args,
group: this.#groups[this.#groups.length - 1] || null
});
}
/**
* Outputs a message to the console.
*
* @param message Message.
* @param args Arguments.
*/
log(message, ...args) {
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.log,
level: VirtualConsoleLogLevelEnum_js_1.default.log,
message: message ? [message, ...args] : args,
group: this.#groups[this.#groups.length - 1] || null
});
}
/**
* Starts recording a performance profile.
*
* TODO: Implement this.
*/
profile() {
throw new Error('Method not implemented.');
}
/**
* Stops recording a performance profile.
*
* TODO: Implement this.
*/
profileEnd() {
throw new Error('Method not implemented.');
}
/**
* Displays tabular data as a table.
*
* @param data Data.
*/
table(data) {
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.table,
level: VirtualConsoleLogLevelEnum_js_1.default.log,
message: [data],
group: this.#groups[this.#groups.length - 1] || null
});
}
/**
* Starts a timer you can use to track how long an operation takes.
*
* @param [label=default] Label.
*/
time(label = 'default') {
this.#time[label] = performance.now();
}
/**
* Stops a timer that was previously started by calling console.time().
* The method logs the elapsed time in milliseconds.
*
* @param [label=default] Label.
*/
timeEnd(label = 'default') {
const time = this.#time[label];
if (time) {
const duration = performance.now() - time;
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.timeEnd,
level: VirtualConsoleLogLevelEnum_js_1.default.info,
message: [`${label}: ${duration}ms - timer ended`],
group: this.#groups[this.#groups.length - 1] || null
});
}
}
/**
* Logs the current value of a timer that was previously started by calling console.time().
* The method logs the elapsed time in milliseconds.
*
* @param [label=default] Label.
* @param [args] Arguments.
*/
timeLog(label = 'default', ...args) {
const time = this.#time[label];
if (time) {
const duration = performance.now() - time;
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.timeLog,
level: VirtualConsoleLogLevelEnum_js_1.default.info,
message: [`${label}: ${duration}ms`, ...args],
group: this.#groups[this.#groups.length - 1] || null
});
}
}
/**
* Adds a single marker to the browser's Performance tool.
*
* TODO: Implement this.
*/
timeStamp() {
throw new Error('Method not implemented.');
}
/**
* Outputs a stack trace to the console.
*
* @param message Message.
* @param args Arguments.
*/
trace(message, ...args) {
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.trace,
level: VirtualConsoleLogLevelEnum_js_1.default.log,
message: [
...(message ? [message, ...args] : args),
new Error('stack').stack.replace('Error: stack', '')
],
group: this.#groups[this.#groups.length - 1] || null
});
}
/**
* Outputs a warning message to the console.
*
* @param message Message.
* @param args Arguments.
*/
warn(message, ...args) {
this.#printer.print({
type: VirtualConsoleLogTypeEnum_js_1.default.warn,
level: VirtualConsoleLogLevelEnum_js_1.default.warn,
message: message ? [message, ...args] : args,
group: this.#groups[this.#groups.length - 1] || null
});
}
}
exports.default = VirtualConsole;
//# sourceMappingURL=VirtualConsole.cjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,167 @@
import IVirtualConsolePrinter from './IVirtualConsolePrinter.cjs';
import { ConsoleConstructor } from 'console';
/**
* Virtual Console.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/Console
*/
export default class VirtualConsole implements Console {
#private;
Console: ConsoleConstructor;
/**
* Constructor.
*
* @param printer Console printer.
*/
constructor(printer: IVirtualConsolePrinter);
/**
* Writes an error message to the console if the assertion is false. If the assertion is true, nothing happens.
*
* @param assertion Assertion.
* @param message Message.
* @param args Arguments.
*/
assert(assertion: boolean, message?: any, ...args: Array<object | string>): void;
/**
* Clears the console.
*/
clear(): void;
/**
* Logs the number of times that this particular call to count() has been called.
*
* @param [label='default'] Label.
*/
count(label?: string): void;
/**
* Resets the counter.
*
* @param [label='default'] Label.
*/
countReset(label?: string): void;
/**
* Outputs a message to the web console at the "debug" log level.
*
* @param message Message.
* @param args Arguments.
*/
debug(message?: any, ...args: Array<object | string>): void;
/**
* Displays an interactive list of the properties of the specified JavaScript object.
*
* @param data Data.
*/
dir(data: any): void;
/**
* Displays an interactive tree of the descendant elements of the specified XML/HTML element.
*
* @param data Data.
*/
dirxml(data: any[]): void;
/**
* Outputs an error message to the console.
*
* @param message Message.
* @param args Arguments.
*/
error(message?: any, ...args: Array<object | string>): void;
/**
* Alias for error().
*
* @deprecated
* @alias error()
* @param args Arguments.
*/
exception(...args: Array<object | string>): void;
/**
* Creates a new inline group in the console, causing any subsequent console messages to be indented by an additional level, until console.groupEnd() is called.
*
* @param [label] Label.
*/
group(label?: string): void;
/**
* Creates a new inline group in the console, but prints it as collapsed, requiring the use of a disclosure button to expand it.
*
* @param [label] Label.
*/
groupCollapsed(label?: string): void;
/**
* Exits the current inline group in the console.
*/
groupEnd(): void;
/**
* Outputs an informational message to the console.
*
* @param message Message.
* @param args Arguments.
*/
info(message?: any, ...args: Array<object | string>): void;
/**
* Outputs a message to the console.
*
* @param message Message.
* @param args Arguments.
*/
log(message?: any, ...args: Array<object | string>): void;
/**
* Starts recording a performance profile.
*
* TODO: Implement this.
*/
profile(): void;
/**
* Stops recording a performance profile.
*
* TODO: Implement this.
*/
profileEnd(): void;
/**
* Displays tabular data as a table.
*
* @param data Data.
*/
table(data: {
[key: string]: number | string | boolean;
} | string[]): void;
/**
* Starts a timer you can use to track how long an operation takes.
*
* @param [label=default] Label.
*/
time(label?: string): void;
/**
* Stops a timer that was previously started by calling console.time().
* The method logs the elapsed time in milliseconds.
*
* @param [label=default] Label.
*/
timeEnd(label?: string): void;
/**
* Logs the current value of a timer that was previously started by calling console.time().
* The method logs the elapsed time in milliseconds.
*
* @param [label=default] Label.
* @param [args] Arguments.
*/
timeLog(label?: string, ...args: Array<object | string>): void;
/**
* Adds a single marker to the browser's Performance tool.
*
* TODO: Implement this.
*/
timeStamp(): void;
/**
* Outputs a stack trace to the console.
*
* @param message Message.
* @param args Arguments.
*/
trace(message?: any, ...args: Array<object | string>): void;
/**
* Outputs a warning message to the console.
*
* @param message Message.
* @param args Arguments.
*/
warn(message?: any, ...args: Array<object | string>): void;
}
//# sourceMappingURL=VirtualConsole.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"VirtualConsole.d.ts","sourceRoot":"","sources":["../../src/console/VirtualConsole.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AAIjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,OAAO;;IAG9C,OAAO,EAAE,kBAAkB,CAAC;IAQnC;;;;OAIG;gBACS,OAAO,EAAE,sBAAsB;IAI3C;;;;;;OAMG;IACI,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI;IAWvF;;OAEG;IACI,KAAK,IAAI,IAAI;IAIpB;;;;OAIG;IACI,KAAK,CAAC,KAAK,SAAY,GAAG,IAAI;IAerC;;;;OAIG;IACI,UAAU,CAAC,KAAK,SAAY,GAAG,IAAI;IAW1C;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI;IASlE;;;;OAIG;IACI,GAAG,CAA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G,IAAI;IAaxE;;;;OAIG;IACI,SAAS,IAAI,IAAI;IAIxB;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI;IAYlE;;;;;OAKG;IACI,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI;CAQjE"}

View File

@@ -0,0 +1,99 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const VirtualConsoleLogLevelEnum_js_1 = __importDefault(require("./enums/VirtualConsoleLogLevelEnum.cjs"));
const Event_js_1 = __importDefault(require("../event/Event.cjs"));
const VirtualConsoleLogEntryStringifier_js_1 = __importDefault(require("./utilities/VirtualConsoleLogEntryStringifier.cjs"));
/**
* Virtual console printer.
*/
class VirtualConsolePrinter {
#logEntries = [];
#listeners = { print: [], clear: [] };
/**
* Writes to the output.
*
* @param logEntry Log entry.
*/
print(logEntry) {
this.#logEntries.push(logEntry);
this.dispatchEvent(new Event_js_1.default('print'));
}
/**
* Clears the output.
*/
clear() {
this.#logEntries = [];
this.dispatchEvent(new Event_js_1.default('clear'));
}
/**
* Adds an event listener.
*
* @param eventType Event type ("print" or "clear").
* @param listener Listener.
*/
addEventListener(eventType, listener) {
if (!this.#listeners[eventType]) {
throw new Error(`Event type "${eventType}" is not supported.`);
}
this.#listeners[eventType].push(listener);
}
/**
* Removes an event listener.
*
* @param eventType Event type ("print" or "clear").
* @param listener Listener.
*/
removeEventListener(eventType, listener) {
if (!this.#listeners[eventType]) {
throw new Error(`Event type "${eventType}" is not supported.`);
}
const index = this.#listeners[eventType].indexOf(listener);
if (index !== -1) {
this.#listeners[eventType].splice(index, 1);
}
}
/**
* Dispatches an event.
*
* @param event Event.
*/
dispatchEvent(event) {
if (!this.#listeners[event.type]) {
throw new Error(`Event type "${event.type}" is not supported.`);
}
for (const listener of this.#listeners[event.type]) {
listener(event);
}
}
/**
* Reads the buffer.
*
* @returns Console log entries.
*/
read() {
const logEntries = this.#logEntries;
this.#logEntries = [];
return logEntries;
}
/**
* Returns the buffer as a string.
*
* @param [logLevel] Log level.
* @returns Buffer as a string of concatenated log entries.
*/
readAsString(logLevel = VirtualConsoleLogLevelEnum_js_1.default.log) {
const logEntries = this.read();
let output = '';
for (const logEntry of logEntries) {
if (logEntry.level >= logLevel) {
output += VirtualConsoleLogEntryStringifier_js_1.default.toString(logEntry);
}
}
return output;
}
}
exports.default = VirtualConsolePrinter;
//# sourceMappingURL=VirtualConsolePrinter.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"VirtualConsolePrinter.cjs","sourceRoot":"","sources":["../../src/console/VirtualConsolePrinter.ts"],"names":[],"mappings":";;;;;AACA,0GAA+E;AAC/E,iEAAsC;AACtC,4HAAiG;AAGjG;;GAEG;AACH,MAAqB,qBAAqB;IACzC,WAAW,GAA8B,EAAE,CAAC;IAC5C,UAAU,GAGN,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAE7B;;;;OAIG;IACI,KAAK,CAAC,QAAiC;QAC7C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,IAAI,CAAC,aAAa,CAAC,IAAI,kBAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACI,KAAK;QACX,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,aAAa,CAAC,IAAI,kBAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACxC,CAAC;IAED;;;;;OAKG;IACI,gBAAgB,CAAC,SAA4B,EAAE,QAAgC;QACrF,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;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,CAAC;QAC/B,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,QAAQ,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC;gBAChC,MAAM,IAAI,8CAAiC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAChE,CAAC;QACF,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;CACD;AAjGD,wCAiGC"}

View File

@@ -0,0 +1,54 @@
import IVirtualConsoleLogEntry from './IVirtualConsoleLogEntry.cjs';
import VirtualConsoleLogLevelEnum from './enums/VirtualConsoleLogLevelEnum.cjs';
import Event from '../event/Event.cjs';
import IVirtualConsolePrinter from './IVirtualConsolePrinter.cjs';
/**
* Virtual console printer.
*/
export default class VirtualConsolePrinter implements IVirtualConsolePrinter {
#private;
/**
* Writes to the output.
*
* @param logEntry Log entry.
*/
print(logEntry: IVirtualConsoleLogEntry): void;
/**
* Clears the output.
*/
clear(): void;
/**
* Adds an event listener.
*
* @param eventType Event type ("print" or "clear").
* @param listener Listener.
*/
addEventListener(eventType: 'print' | 'clear', listener: (event: Event) => void): void;
/**
* Removes an event listener.
*
* @param eventType Event type ("print" or "clear").
* @param listener Listener.
*/
removeEventListener(eventType: 'print' | 'clear', listener: (event: Event) => void): void;
/**
* Dispatches an event.
*
* @param event Event.
*/
dispatchEvent(event: Event): void;
/**
* Reads the buffer.
*
* @returns Console log entries.
*/
read(): IVirtualConsoleLogEntry[];
/**
* Returns the buffer as a string.
*
* @param [logLevel] Log level.
* @returns Buffer as a string of concatenated log entries.
*/
readAsString(logLevel?: VirtualConsoleLogLevelEnum): string;
}
//# sourceMappingURL=VirtualConsolePrinter.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"VirtualConsolePrinter.d.ts","sourceRoot":"","sources":["../../src/console/VirtualConsolePrinter.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,0BAA0B,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAEtC,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AAEjE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAsB,YAAW,sBAAsB;;IAO3E;;;;OAIG;IACI,KAAK,CAAC,QAAQ,EAAE,uBAAuB,GAAG,IAAI;IAKrD;;OAEG;IACI,KAAK,IAAI,IAAI;IAKpB;;;;;OAKG;IACI,gBAAgB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI;IAO7F;;;;;OAKG;IACI,mBAAmB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI;IAUhG;;;;OAIG;IACI,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IASxC;;;;OAIG;IACI,IAAI,IAAI,uBAAuB,EAAE;IAMxC;;;;;OAKG;IACI,YAAY,CAClB,QAAQ,GAAE,0BAA2D,GACnE,MAAM;CAUT"}

View File

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Virtual console log level.
*
* @see https://console.spec.whatwg.org/#loglevel-severity
*/
var VirtualConsoleLogLevelEnum;
(function (VirtualConsoleLogLevelEnum) {
VirtualConsoleLogLevelEnum[VirtualConsoleLogLevelEnum["log"] = 0] = "log";
VirtualConsoleLogLevelEnum[VirtualConsoleLogLevelEnum["info"] = 1] = "info";
VirtualConsoleLogLevelEnum[VirtualConsoleLogLevelEnum["warn"] = 2] = "warn";
VirtualConsoleLogLevelEnum[VirtualConsoleLogLevelEnum["error"] = 3] = "error";
})(VirtualConsoleLogLevelEnum || (VirtualConsoleLogLevelEnum = {}));
exports.default = VirtualConsoleLogLevelEnum;
//# sourceMappingURL=VirtualConsoleLogLevelEnum.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"VirtualConsoleLogLevelEnum.cjs","sourceRoot":"","sources":["../../../src/console/enums/VirtualConsoleLogLevelEnum.ts"],"names":[],"mappings":";;AAAA;;;;GAIG;AACH,IAAK,0BAKJ;AALD,WAAK,0BAA0B;IAC9B,yEAAO,CAAA;IACP,2EAAQ,CAAA;IACR,2EAAQ,CAAA;IACR,6EAAS,CAAA;AACV,CAAC,EALI,0BAA0B,KAA1B,0BAA0B,QAK9B;AACD,kBAAe,0BAA0B,CAAC"}

View File

@@ -0,0 +1,13 @@
/**
* Virtual console log level.
*
* @see https://console.spec.whatwg.org/#loglevel-severity
*/
declare enum VirtualConsoleLogLevelEnum {
log = 0,
info = 1,
warn = 2,
error = 3
}
export default VirtualConsoleLogLevelEnum;
//# sourceMappingURL=VirtualConsoleLogLevelEnum.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"VirtualConsoleLogLevelEnum.d.ts","sourceRoot":"","sources":["../../../src/console/enums/VirtualConsoleLogLevelEnum.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,aAAK,0BAA0B;IAC9B,GAAG,IAAI;IACP,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;CACT;AACD,eAAe,0BAA0B,CAAC"}

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Virtual console log type.
*/
var VirtualConsoleLogTypeEnum;
(function (VirtualConsoleLogTypeEnum) {
// Log
VirtualConsoleLogTypeEnum["log"] = "log";
VirtualConsoleLogTypeEnum["table"] = "table";
VirtualConsoleLogTypeEnum["trace"] = "trace";
VirtualConsoleLogTypeEnum["dir"] = "dir";
VirtualConsoleLogTypeEnum["dirxml"] = "dirxml";
VirtualConsoleLogTypeEnum["group"] = "group";
VirtualConsoleLogTypeEnum["groupCollapsed"] = "groupCollapsed";
VirtualConsoleLogTypeEnum["debug"] = "debug";
VirtualConsoleLogTypeEnum["timeLog"] = "timeLog";
// Info
VirtualConsoleLogTypeEnum["info"] = "info";
VirtualConsoleLogTypeEnum["count"] = "count";
VirtualConsoleLogTypeEnum["timeEnd"] = "timeEnd";
// Warning
VirtualConsoleLogTypeEnum["warn"] = "warn";
VirtualConsoleLogTypeEnum["countReset"] = "countReset";
// Error
VirtualConsoleLogTypeEnum["error"] = "error";
VirtualConsoleLogTypeEnum["assert"] = "assert";
})(VirtualConsoleLogTypeEnum || (VirtualConsoleLogTypeEnum = {}));
exports.default = VirtualConsoleLogTypeEnum;
//# sourceMappingURL=VirtualConsoleLogTypeEnum.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"VirtualConsoleLogTypeEnum.cjs","sourceRoot":"","sources":["../../../src/console/enums/VirtualConsoleLogTypeEnum.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,IAAK,yBAwBJ;AAxBD,WAAK,yBAAyB;IAC7B,MAAM;IACN,wCAAW,CAAA;IACX,4CAAe,CAAA;IACf,4CAAe,CAAA;IACf,wCAAW,CAAA;IACX,8CAAiB,CAAA;IACjB,4CAAe,CAAA;IACf,8DAAiC,CAAA;IACjC,4CAAe,CAAA;IACf,gDAAmB,CAAA;IAEnB,OAAO;IACP,0CAAa,CAAA;IACb,4CAAe,CAAA;IACf,gDAAmB,CAAA;IAEnB,UAAU;IACV,0CAAa,CAAA;IACb,sDAAyB,CAAA;IAEzB,QAAQ;IACR,4CAAe,CAAA;IACf,8CAAiB,CAAA;AAClB,CAAC,EAxBI,yBAAyB,KAAzB,yBAAyB,QAwB7B;AACD,kBAAe,yBAAyB,CAAC"}

View File

@@ -0,0 +1,23 @@
/**
* Virtual console log type.
*/
declare enum VirtualConsoleLogTypeEnum {
log = "log",
table = "table",
trace = "trace",
dir = "dir",
dirxml = "dirxml",
group = "group",
groupCollapsed = "groupCollapsed",
debug = "debug",
timeLog = "timeLog",
info = "info",
count = "count",
timeEnd = "timeEnd",
warn = "warn",
countReset = "countReset",
error = "error",
assert = "assert"
}
export default VirtualConsoleLogTypeEnum;
//# sourceMappingURL=VirtualConsoleLogTypeEnum.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"VirtualConsoleLogTypeEnum.d.ts","sourceRoot":"","sources":["../../../src/console/enums/VirtualConsoleLogTypeEnum.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,aAAK,yBAAyB;IAE7B,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,cAAc,mBAAmB;IACjC,KAAK,UAAU;IACf,OAAO,YAAY;IAGnB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;IAGnB,IAAI,SAAS;IACb,UAAU,eAAe;IAGzB,KAAK,UAAU;IACf,MAAM,WAAW;CACjB;AACD,eAAe,yBAAyB,CAAC"}

View File

@@ -0,0 +1,97 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const VirtualConsoleLogTypeEnum_js_1 = __importDefault(require("../enums/VirtualConsoleLogTypeEnum.cjs"));
/**
* Virtual console utility.
*/
class VirtualConsoleLogEntryStringifier {
/**
* Stringifies a log entry.
*
* @param logEntry Log entry.
* @returns Stringified message.
*/
static toString(logEntry) {
if (this.isLogEntryCollapsed(logEntry)) {
return '';
}
const tabbing = this.getLogEntryGroupTabbing(logEntry);
let output = tabbing;
for (const part of logEntry.message) {
output += output !== '' && output !== tabbing ? ' ' : '';
if (typeof part === 'object' &&
(part === null || part.constructor.name === 'Object' || Array.isArray(part))) {
try {
output += JSON.stringify(part);
}
catch (error) {
output += new Error('Failed to JSON stringify object in log entry.').stack.replace(/\n at/gm, '\n ' + tabbing + 'at');
}
}
else if (typeof part === 'object' && part['message'] && part['stack']) {
output += part['stack'].replace(/\n at/gm, '\n ' + tabbing + 'at');
}
else {
output += this.getLogEntryIcon(logEntry) + String(part);
}
}
return output + '\n';
}
/**
* Gets the log entry icon.
*
* @param logEntry Log entry.
* @returns Icon.
*/
static getLogEntryIcon(logEntry) {
switch (logEntry.type) {
case VirtualConsoleLogTypeEnum_js_1.default.group:
return '▼ ';
case VirtualConsoleLogTypeEnum_js_1.default.groupCollapsed:
return '▶ ';
}
return '';
}
/**
* Gets the log entry group tabbing.
*
* @param logEntry Log entry.
* @returns Tabbing.
*/
static getLogEntryGroupTabbing(logEntry) {
let tabs = '';
let group = logEntry.type === VirtualConsoleLogTypeEnum_js_1.default.group ||
logEntry.type === VirtualConsoleLogTypeEnum_js_1.default.groupCollapsed
? logEntry.group?.parent
: logEntry.group;
while (group) {
tabs += ' ';
group = group.parent;
}
return tabs;
}
/**
* Checks if the log entry content is collapsed.
*
* @param logEntry Log entry.
* @returns True if collapsed.
*/
static isLogEntryCollapsed(logEntry) {
let group = logEntry.type === VirtualConsoleLogTypeEnum_js_1.default.group ||
logEntry.type === VirtualConsoleLogTypeEnum_js_1.default.groupCollapsed
? logEntry.group?.parent
: logEntry.group;
while (group) {
if (group.collapsed) {
return true;
}
group = group.parent;
}
return false;
}
}
exports.default = VirtualConsoleLogEntryStringifier;
//# sourceMappingURL=VirtualConsoleLogEntryStringifier.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"VirtualConsoleLogEntryStringifier.cjs","sourceRoot":"","sources":["../../../src/console/utilities/VirtualConsoleLogEntryStringifier.ts"],"names":[],"mappings":";;;;;AACA,yGAA8E;AAE9E;;GAEG;AACH,MAAqB,iCAAiC;IACrD;;;;;OAKG;IACI,MAAM,CAAC,QAAQ,CAAC,QAAiC;QACvD,IAAI,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxC,OAAO,EAAE,CAAC;QACX,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;QACvD,IAAI,MAAM,GAAG,OAAO,CAAC;QACrB,KAA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AC5C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,EAAE,CAAC;IACX,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,uBAAuB,CAAC,QAAiC;QACvE,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,IAAI,KAAK,GACR,QAAQ,CAAC,IAAI,KAAK,sCAAyB,CAAC,KAAK;YACjD,QAAQ,CAAC,IAAI,KAAK,sCAAyB,CAAC,cAAc;YACzD,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM;YACxB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;QACnB,OAAO,KAAK,EAAE,CAAC;YACd,IAAI,IAAI,IAAI,CAAC;YACb,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;QACtB,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,mBAAmB,CAAC,QAAiC;QACnE,IAAI,KAAK,GACR,QAAQ,CAAC,IAAI,KAAK,sCAAyB,CAAC,KAAK;YACjD,QAAQ,CAAC,IAAI,KAAK,sCAAyB,CAAC,cAAc;YACzD,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM;YACxB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;QACnB,OAAO,KAAK,EAAE,CAAC;YACd,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;gBACrB,OAAO,IAAI,CAAC;YACb,CAAC;YACD,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;QACtB,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AA7FD,oDA6FC"}

View File

@@ -0,0 +1,35 @@
import IVirtualConsoleLogEntry from '../IVirtualConsoleLogEntry.cjs';
/**
* Virtual console utility.
*/
export default class VirtualConsoleLogEntryStringifier {
/**
* Stringifies a log entry.
*
* @param logEntry Log entry.
* @returns Stringified message.
*/
static toString(logEntry: IVirtualConsoleLogEntry): string;
/**
* Gets the log entry icon.
*
* @param logEntry Log entry.
* @returns Icon.
*/
private static getLogEntryIcon;
/**
* Gets the log entry group tabbing.
*
* @param logEntry Log entry.
* @returns Tabbing.
*/
private static getLogEntryGroupTabbing;
/**
* Checks if the log entry content is collapsed.
*
* @param logEntry Log entry.
* @returns True if collapsed.
*/
private static isLogEntryCollapsed;
}
//# sourceMappingURL=VirtualConsoleLogEntryStringifier.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"VirtualConsoleLogEntryStringifier.d.ts","sourceRoot":"","sources":["../../../src/console/utilities/VirtualConsoleLogEntryStringifier.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,MAAM,+BAA+B,CAAC;AAGpE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iCAAiC;IACrD;;;;;OAKG;WACW,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,GAAG,MAAM;IA8BjE;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAU9B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IActC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;CAclC"}