code cleanup
This commit is contained in:
		
							parent
							
								
									20e9e5e5ae
								
							
						
					
					
						commit
						fbd95726a0
					
				@ -8,7 +8,7 @@
 | 
			
		||||
    "build": "astro build",
 | 
			
		||||
    "preview": "astro preview",
 | 
			
		||||
    "astro": "astro",
 | 
			
		||||
    "check:health": "curl -f http://localhost:3000/health || exit 1"
 | 
			
		||||
    "check:health": "curl -f http://localhost:4321/health || exit 1"
 | 
			
		||||
  },
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@astrojs/node": "^9.3.0",
 | 
			
		||||
 | 
			
		||||
@ -231,40 +231,6 @@ domains.forEach((domain: any) => {
 | 
			
		||||
  // Make functions globally available
 | 
			
		||||
  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)
 | 
			
		||||
  window.showToolDetails = function(toolName) {
 | 
			
		||||
    const tool = toolsData.find(t => t.name === toolName);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										5
									
								
								src/env.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								src/env.d.ts
									
									
									
									
										vendored
									
									
								
							@ -13,11 +13,6 @@ declare global {
 | 
			
		||||
    hideToolDetails: () => void;
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  // Custom event types
 | 
			
		||||
  interface WindowEventMap {
 | 
			
		||||
    'toolsFiltered': CustomEvent<any[]>;
 | 
			
		||||
    'viewChanged': CustomEvent<string>;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Also declare the modules that might not be recognized
 | 
			
		||||
 | 
			
		||||
@ -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' }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
@ -53,10 +53,7 @@ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', ()
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// Initialize immediately when script loads
 | 
			
		||||
initTheme();
 | 
			
		||||
 | 
			
		||||
// Also initialize when DOM is ready (for safety)
 | 
			
		||||
// Initialize when DOM is ready (for safety)
 | 
			
		||||
document.addEventListener('DOMContentLoaded', initTheme);
 | 
			
		||||
 | 
			
		||||
// Export functions for use in Astro components
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user