Stabilize build: add Capacitor deps, TS target, stubs and guards

This commit is contained in:
MrPiglr 2025-12-27 19:37:48 +00:00
parent 6f15448197
commit 0f68fcb57e
5 changed files with 1463 additions and 6 deletions

View file

@ -235,9 +235,12 @@ export default function Notifications() {
<Check className="w-4 h-4" />
</Button>
)}
{notification.actionUrl && (
{(notification.actionUrl || (notification as any).action_url) && (
<Button
onClick={() => window.location.href = notification.actionUrl!}
onClick={() => {
const url = notification.actionUrl ?? (notification as any).action_url;
if (typeof url === 'string') window.location.href = url;
}}
variant="ghost"
size="sm"
className="h-8 px-3 text-cyan-400 hover:bg-cyan-500/10"

View file

@ -249,7 +249,7 @@ export default function Projects() {
{/* Technologies */}
<div className="flex flex-wrap gap-2 mb-4">
{project.technologies.slice(0, 3).map((tech) => (
{(Array.isArray(project.technologies) ? project.technologies : []).slice(0, 3).map((tech) => (
<span
key={tech}
className="bg-slate-700 text-cyan-300 text-xs px-2 py-1 rounded"
@ -257,9 +257,9 @@ export default function Projects() {
{tech}
</span>
))}
{project.technologies.length > 3 && (
{Array.isArray(project.technologies) && project.technologies.length > 3 && (
<span className="text-slate-400 text-xs px-2 py-1">
+{project.technologies.length - 3}
+{(project.technologies.length - 3)}
</span>
)}
</div>

View file

@ -0,0 +1,40 @@
// Minimal app registry stub to satisfy imports and provide types
export type AppId = string;
export interface AppDefinition {
id: AppId;
name: string;
route?: string;
icon?: string;
roles?: string[];
capabilities?: string[];
hidden?: boolean;
}
export const AppRegistry: Record<AppId, AppDefinition> = {};
export function getAppById(id: AppId): AppDefinition | undefined {
return AppRegistry[id];
}
export function listApps(): AppDefinition[] {
return Object.values(AppRegistry);
}
// Basic enums to satisfy mode/realm references
export enum Mode {
Web = "web",
Desktop = "desktop",
Mobile = "mobile"
}
export enum Realm {
Foundation = "foundation",
Studio = "studio",
Network = "network"
}
// Minimal route access check placeholder (always allows)
export function canAccessRoute(_user: unknown, _route: string): boolean {
return true;
}

1414
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -6,6 +6,8 @@
"tsBuildInfoFile": "./node_modules/typescript/tsbuildinfo",
"noEmit": true,
"module": "ESNext",
"target": "ES2017",
"downlevelIteration": true,
"strict": true,
"lib": ["esnext", "dom", "dom.iterable"],
"jsx": "preserve",