Skip to main content
Glama
buildStyles.ts908 B
#!/usr/bin/env tsx import fs from "fs"; import path from "path"; import { fileURLToPath } from "url"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); // Read the CSS file const cssPath = path.resolve(__dirname, "../ui/style.css"); const cssContent = fs.readFileSync(cssPath, "utf-8"); // Escape the CSS content for embedding in a TypeScript string const escapedCss = cssContent .replace(/\\/g, "\\\\") .replace(/`/g, "\\`") .replace(/\$/g, "\\$"); // Generate the TypeScript module const tsContent = `// This file is auto-generated by buildStyles.ts // DO NOT EDIT MANUALLY export const EMBEDDED_STYLES = \`${escapedCss}\`; `; // Write the generated file const outputPath = path.resolve(__dirname, "../ui/embeddedStyles.ts"); fs.writeFileSync(outputPath, tsContent, "utf-8"); console.log("✅ Generated embeddedStyles.ts with embedded CSS");

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aharvard/mcp_agentic-commerce'

If you have feedback or need assistance with the MCP directory API, please join our Discord server