### npm Scripts for Project Development and Build Source: https://context7.com/kaktaknet/n8n-mcp.ru/llms.txt Standard npm scripts are provided for managing the project's lifecycle. This includes installing dependencies with `pnpm install`, starting a local development server with `pnpm dev`, building the production site with `pnpm build`, and previewing the production build locally using `pnpm preview`. The scripts also allow direct execution of Astro CLI commands via `pnpm astro`. ```bash # Install dependencies pnpm install # Start development server at http://localhost:4321 pnpm dev # Build production site with post-build cleanup pnpm build # Preview production build locally pnpm preview # Run Astro CLI commands directly pnpm astro ``` -------------------------------- ### Post-Build HTML Cleanup Script (JavaScript) Source: https://context7.com/kaktaknet/n8n-mcp.ru/llms.txt This Node.js script traverses a 'dist' directory to find and clean HTML files. It specifically removes meta tags generated by frameworks like Astro and Starlight to produce cleaner production output. The script uses Node.js built-in 'fs/promises' for file operations. ```javascript import { readdir, readFile, writeFile, stat } from 'fs/promises' import { join } from 'path' const DIST_DIR = 'dist' async function getHtmlFiles(dir) { const files = [] const entries = await readdir(dir, { withFileTypes: true }) for (const entry of entries) { const fullPath = join(dir, entry.name) if (entry.isDirectory()) { files.push(...(await getHtmlFiles(fullPath))) } else if (entry.name.endsWith('.html')) { files.push(fullPath) } } return files } async function cleanHtmlFile(filePath) { let content = await readFile(filePath, 'utf-8') let modified = false // Remove Astro generator meta tag const astroRegex = //gi if (astroRegex.test(content)) { content = content.replace(astroRegex, '') modified = true } // Remove Starlight generator meta tag const starlightRegex = //gi if (starlightRegex.test(content)) { content = content.replace(starlightRegex, '') modified = true } if (modified) { content = content.replace(/\n\s*\n\s*\n/g, '\n\n') await writeFile(filePath, content, 'utf-8') console.log(`Cleaned: ${filePath}`) } } async function main() { console.log('Post-build: Removing generator meta tags...') try { const files = await getHtmlFiles(DIST_DIR) console.log(`Found ${files.length} HTML files`) for (const file of files) { await cleanHtmlFile(file) } console.log('Post-build: Complete!') } catch (error) { console.error('Post-build error:', error) process.exit(1) } } main() ``` -------------------------------- ### Astro SDKCard Component for Language-Specific SDKs Source: https://context7.com/kaktaknet/n8n-mcp.ru/llms.txt The SDKCard component displays information about SDKs for various programming languages, utilizing devicon integrations for visual representation. It supports languages like Python, TypeScript, PHP, Rust, and Go, along with others. The component takes language, title, description, and link as props, with an optional badge, and applies distinct accent colors based on the specified programming language. ```astro --- import IconPython from '~icons/devicon/python' import IconTypescript from '~icons/devicon/typescript' import IconPhp from '~icons/devicon/php' import IconRust from '~icons/devicon/rust' import IconGo from '~icons/devicon/go' interface Props { lang: 'python' | 'typescript' | 'php' | 'rust' | 'go' | 'csharp' | 'java' | 'kotlin' | 'ruby' | 'swift'; title: string; description: string; href: string; badge?: string; } const { lang, title, description, href, badge } = Astro.props; const icons = { python: IconPython, typescript: IconTypescript, php: IconPhp, rust: IconRust, go: IconGo, // ... other languages }; const langColors = { python: '#3776AB', typescript: '#3178C6', php: '#777BB4', rust: '#DEA584', go: '#00ADD8', // ... other colors }; const IconComponent = icons[lang]; ---

{title}

{badge && {badge}}

{description}

``` -------------------------------- ### Astro ServerCard Component for Displaying MCP Servers Source: https://context7.com/kaktaknet/n8n-mcp.ru/llms.txt The ServerCard component renders an interactive card for MCP servers, featuring type-specific icons and customizable colors. It accepts props for server type, title, description, link, and an optional badge, with built-in support for a 'featured' state. Icons and colors are defined using JavaScript objects, and the component dynamically applies styles based on the server type. ```astro --- interface Props { type: 'context7' | 'filesystem' | 'git' | 'fetch' | 'memory' | 'time' | 'everything' | 'sequentialthinking'; title: string; description: string; href: string; badge?: string; featured?: boolean; } const { type, title, description, href, badge, featured = false } = Astro.props; const icons: Record = { context7: ``, filesystem: ``, git: `` // ... other icons }; const colors: Record = { context7: '#8b5cf6', filesystem: '#f59e0b', git: '#ef4444', fetch: '#06b6d4', memory: '#ec4899', time: '#10b981', everything: '#f97316', sequentialthinking: '#6366f1', }; --- {featured && }

{title}

{badge && {badge}}

{description}

``` -------------------------------- ### StatsSection Component (Astro) Source: https://context7.com/kaktaknet/n8n-mcp.ru/llms.txt A reusable Astro component that displays a collection of statistics. Each statistic item includes a value, label, and a color, which is used for gradient styling. The component is designed for flexibility and can be easily integrated into pages to visualize data. ```astro --- interface StatItem { value: string; label: string; color: string; } interface Props { stats: StatItem[]; } const { stats } = Astro.props; ---
{stats.map((stat) => (
{stat.value} {stat.label}
))}
``` -------------------------------- ### Translation Utility Function (TypeScript) Source: https://context7.com/kaktaknet/n8n-mcp.ru/llms.txt A TypeScript function designed for localization in Astro projects. It resolves translations for given links and descriptions, with a fallback mechanism to a default language. It relies on Starlight's configuration for the default locale and ensures that a translation exists for the default language to prevent errors. ```typescript import { AstroError } from 'astro/errors' import starlightConfig from 'virtual:starlight/user-config' export const defaultLang = starlightConfig.defaultLocale?.lang || starlightConfig.defaultLocale?.locale || 'ru' export function getTranslation( translations: Record, link: string, description: string, currentLocale?: string ) { const defaultTranslation = translations[defaultLang] if (!defaultTranslation) { throw new AstroError( `The ${description} for "${link}" must have a key for the default language "${defaultLang}".`, 'Update the Starlight config to include a topic label for the default language.', ) } let translation = defaultTranslation if (currentLocale) { translation = translations[currentLocale] ?? defaultTranslation } return translation } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.