style: format server and shared with prettier

A mechanical prettier --write over server/src, server/tests, server/scripts
and shared/src with the workspaces' .prettierrc; nothing but layout and
import order changes, and every file keeps the same set of imports. shared
is formatted throughout and its format baseline is empty. The server
baseline keeps the 35 files that Prettier would grow past their lint:size
limit (they need a split first, which is not a formatting change), and the
generated entity files stay as their generator writes them.
This commit is contained in:
Maurice
2026-10-10 21:23:37 +02:00
parent f4e518b2df
commit 724c88c201
1978 changed files with 78448 additions and 39347 deletions
+4 -6
View File
@@ -1,6 +1,7 @@
import semver from 'semver';
import type { NoticeCondition, SystemNotice } from './types.js';
import semver from 'semver';
interface ConditionContext {
user: { login_count: number; first_seen_version: string; role: string; noTrips: number };
currentAppVersion: string;
@@ -50,10 +51,7 @@ function evaluateOne(condition: NoticeCondition, ctx: ConditionContext): boolean
if (!noticeVersion) return false;
// Strip prerelease/build metadata so '3.0.0-pre.42' is treated as '3.0.0'.
const appVersion = semver.coerce(ctx.currentAppVersion)?.version ?? '0.0.0';
return (
semver.lt(userVersion, noticeVersion) &&
semver.gte(appVersion, noticeVersion)
);
return semver.lt(userVersion, noticeVersion) && semver.gte(appVersion, noticeVersion);
}
case 'dateWindow': {
@@ -87,7 +85,7 @@ function evaluateOne(condition: NoticeCondition, ctx: ConditionContext): boolean
/** Returns true only if ALL conditions pass (AND logic). */
export function evaluate(notice: SystemNotice, ctx: ConditionContext): boolean {
return notice.conditions.every(c => evaluateOne(c, ctx));
return notice.conditions.every((c) => evaluateOne(c, ctx));
}
export type { ConditionContext };
+2 -2
View File
@@ -1,5 +1,5 @@
import type { SystemNotice } from './types.js';
import { registerPredicate } from './conditions.js';
import type { SystemNotice } from './types.js';
/**
* Registered at module load, unchanged from before this plan (Plan 3f Task
@@ -184,7 +184,7 @@ export const SYSTEM_NOTICES: SystemNotice[] = [
severity: 'warn',
icon: 'AlertTriangle',
titleKey: 'system_notice.v3014_whitespace_collision.title',
bodyKey: 'system_notice.v3014_whitespace_collision.body',
bodyKey: 'system_notice.v3014_whitespace_collision.body',
dismissible: true,
conditions: [
{ kind: 'existingUserBeforeVersion', version: '3.0.14' },
+10 -3
View File
@@ -1,7 +1,8 @@
import semver from 'semver';
import { readEnv } from '../app-config';
import type { SystemNotice } from './types.js';
import semver from 'semver';
export function getCurrentAppVersion(): string {
const fromEnv = semver.valid(readEnv().app.appVersion ?? '');
if (fromEnv) return fromEnv;
@@ -17,12 +18,18 @@ export function isNoticeVersionActive(n: SystemNotice, currentAppVersion: string
const appVersion = semver.coerce(currentAppVersion)?.version ?? '0.0.0';
if (n.minVersion !== undefined) {
const min = semver.valid(n.minVersion);
if (!min) { console.warn(`[systemNotices] "${n.id}" invalid minVersion "${n.minVersion}" — skipping`); return false; }
if (!min) {
console.warn(`[systemNotices] "${n.id}" invalid minVersion "${n.minVersion}" — skipping`);
return false;
}
if (semver.lt(appVersion, min)) return false;
}
if (n.maxVersion !== undefined) {
const max = semver.valid(n.maxVersion);
if (!max) { console.warn(`[systemNotices] "${n.id}" invalid maxVersion "${n.maxVersion}" — skipping`); return false; }
if (!max) {
console.warn(`[systemNotices] "${n.id}" invalid maxVersion "${n.maxVersion}" — skipping`);
return false;
}
if (semver.gte(appVersion, max)) return false;
}
return true;
+8 -5
View File
@@ -1,5 +1,5 @@
export type Display = 'modal' | 'banner' | 'toast';
export type Severity = 'info' | 'warn' | 'critical';
export type Display = 'modal' | 'banner' | 'toast';
export type Severity = 'info' | 'warn' | 'critical';
export type NoticeCondition =
| { kind: 'firstLogin' }
@@ -24,8 +24,8 @@ export interface NoticeMedia {
}
export type NoticeCta =
| { kind: 'nav'; labelKey: string; href: string }
| { kind: 'link'; labelKey: string; href: string } // external URL, opens in a new tab
| { kind: 'nav'; labelKey: string; href: string }
| { kind: 'link'; labelKey: string; href: string } // external URL, opens in a new tab
| { kind: 'action'; labelKey: string; actionId: string; dismissOnAction?: boolean };
export interface NoticeReleaseFeature {
@@ -95,4 +95,7 @@ export interface SystemNotice {
}
// DTO sent to client (same shape minus the conditions — server evaluates those)
export type SystemNoticeDTO = Omit<SystemNotice, 'conditions' | 'publishedAt' | 'minVersion' | 'maxVersion' | 'priority' | 'recurring'>;
export type SystemNoticeDTO = Omit<
SystemNotice,
'conditions' | 'publishedAt' | 'minVersion' | 'maxVersion' | 'priority' | 'recurring'
>;