code cleanup

This commit is contained in:
overcuriousity 2025-07-19 15:41:20 +02:00
parent 20e9e5e5ae
commit fbd95726a0
5 changed files with 2 additions and 82 deletions

View File

@ -8,7 +8,7 @@
"build": "astro build", "build": "astro build",
"preview": "astro preview", "preview": "astro preview",
"astro": "astro", "astro": "astro",
"check:health": "curl -f http://localhost:3000/health || exit 1" "check:health": "curl -f http://localhost:4321/health || exit 1"
}, },
"dependencies": { "dependencies": {
"@astrojs/node": "^9.3.0", "@astrojs/node": "^9.3.0",

View File

@ -231,40 +231,6 @@ domains.forEach((domain: any) => {
// Make functions globally available // Make functions globally available
window.toggleDomainAgnosticSection = toggleDomainAgnosticSection; window.toggleDomainAgnosticSection = toggleDomainAgnosticSection;
// Helper function to create compact tool cards
function createCollaborationToolCardCompact(tool) {
const hasValidProjectUrl = tool.projectUrl !== undefined &&
tool.projectUrl !== null &&
tool.projectUrl !== "" &&
tool.projectUrl.trim() !== "";
const cardDiv = document.createElement('div');
const cardClass = `collaboration-tool-compact ${hasValidProjectUrl ? 'hosted' : tool.license !== 'Proprietary' ? 'oss' : ''}`;
cardDiv.className = cardClass;
cardDiv.onclick = () => window.showToolDetails(tool.name);
cardDiv.innerHTML = `
<div class="tool-compact-header">
<h4 style="margin: 0; font-size: 0.875rem; font-weight: 600;">${tool.name}</h4>
<div style="display: flex; gap: 0.25rem;">
${hasValidProjectUrl ? '<span class="badge badge--mini badge-primary">Self-Hosted</span>' : ''}
${tool.license !== 'Proprietary' ? '<span class="badge badge--mini badge-success">OSS</span>' : ''}
${tool.knowledgebase === true ? '<span class="badge badge--mini badge-error">Infos 📖</span>' : ''}
</div>
</div>
<p class="text-muted">
${tool.description}
</p>
<div style="display: flex; gap: 0.75rem; font-size: 0.6875rem; color: var(--color-text-secondary);">
<span>${(tool.platforms || []).join(', ')}</span>
<span>•</span>
<span>${tool.skillLevel}</span>
</div>
`;
return cardDiv;
}
// Tool details functions (unchanged) // Tool details functions (unchanged)
window.showToolDetails = function(toolName) { window.showToolDetails = function(toolName) {
const tool = toolsData.find(t => t.name === toolName); const tool = toolsData.find(t => t.name === toolName);

5
src/env.d.ts vendored
View File

@ -13,11 +13,6 @@ declare global {
hideToolDetails: () => void; hideToolDetails: () => void;
} }
// Custom event types
interface WindowEventMap {
'toolsFiltered': CustomEvent<any[]>;
'viewChanged': CustomEvent<string>;
}
} }
// Also declare the modules that might not be recognized // Also declare the modules that might not be recognized

View File

@ -1,38 +0,0 @@
import type { APIRoute } from 'astro';
import { getSessionFromRequest, verifySession } from '../../../utils/auth.js';
export const prerender = false;
export const GET: APIRoute = async ({ request }) => {
try {
const sessionToken = getSessionFromRequest(request);
if (!sessionToken) {
return new Response(JSON.stringify({
authenticated: false
}), {
status: 200,
headers: { 'Content-Type': 'application/json' }
});
}
const session = await verifySession(sessionToken);
return new Response(JSON.stringify({
authenticated: session !== null,
expires: session?.exp ? new Date(session.exp * 1000).toISOString() : null
}), {
status: 200,
headers: { 'Content-Type': 'application/json' }
});
} catch (error) {
return new Response(JSON.stringify({
authenticated: false,
error: 'Session verification failed'
}), {
status: 200,
headers: { 'Content-Type': 'application/json' }
});
}
};

View File

@ -53,10 +53,7 @@ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', ()
} }
}); });
// Initialize immediately when script loads // Initialize when DOM is ready (for safety)
initTheme();
// Also initialize when DOM is ready (for safety)
document.addEventListener('DOMContentLoaded', initTheme); document.addEventListener('DOMContentLoaded', initTheme);
// Export functions for use in Astro components // Export functions for use in Astro components