diff --git a/scripts/check-analytics.js b/scripts/check-analytics.js deleted file mode 100644 index f5c8f59..0000000 --- a/scripts/check-analytics.js +++ /dev/null @@ -1,31 +0,0 @@ -const TOKEN = ""; -const ACCOUNT_ID = ""; - -async function showTables() { - const url = `https://api.cloudflare.com/client/v4/accounts/${ACCOUNT_ID}/analytics_engine/sql`; - - const options = { - method: "POST", - headers: { - Authorization: `Bearer ${TOKEN}`, - "Content-Type": "application/x-www-form-urlencoded", - }, - body: "SHOW TABLES", - }; - - try { - console.log("Sending request to Cloudflare Analytics Engine..."); - const response = await fetch(url, options); - - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - - const data = await response.json(); - console.log("Response received:", JSON.stringify(data, null, 2)); - } catch (error) { - console.error("Error occurred:", error.message); - } -} - -showTables(); diff --git a/scripts/gen_sitemap.js b/scripts/generate_sitemap.js similarity index 100% rename from scripts/gen_sitemap.js rename to scripts/generate_sitemap.js diff --git a/scripts/get_groq_models.js b/scripts/get_groq_models.js deleted file mode 100644 index 50935ed..0000000 --- a/scripts/get_groq_models.js +++ /dev/null @@ -1,22 +0,0 @@ -(async () => { - // Run the script with bun so it automatically picks up the env - const apiKey = process.env.GROQ_API_KEY; - - try { - const response = await fetch("https://api.groq.com/openai/v1/models", { - method: "GET", - headers: { - Authorization: `Bearer ${apiKey}`, - }, - }); - - if (!response.ok) { - throw new Error(`HTTP error! Status: ${response.status}`); - } - - const data = await response.json(); - console.log(JSON.stringify(data)); - } catch (error) { - console.error("Error fetching data:", error); - } -})(); diff --git a/scripts/killport.js b/scripts/killport.js deleted file mode 100644 index 4e380df..0000000 --- a/scripts/killport.js +++ /dev/null @@ -1,36 +0,0 @@ -import * as child_process from "node:child_process"; - -export const killProcessOnPort = (port) => { - return new Promise((resolve, reject) => { - child_process.exec(`lsof -t -i :${port}`.trim(), (err, stdout) => { - if (err) { - if (err.code !== 1) { - console.error(`Error finding process on port ${port}:`, err); - return reject(err); - } else { - console.log(`No process found on port ${port}`); - return resolve(); - } - } - - const pid = stdout.trim(); - if (!pid) { - console.log(`No process is currently running on port ${port}`); - return resolve(); - } - - child_process.exec(`kill -9 ${pid}`.trim(), (killErr) => { - if (killErr) { - console.error( - `Failed to kill process ${pid} on port ${port}`, - killErr, - ); - return reject(killErr); - } - - console.log(`Successfully killed process ${pid} on port ${port}`); - resolve(); - }); - }); - }); -}; diff --git a/vite.config.ts b/vite.config.ts index de5e442..04cba76 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -9,7 +9,7 @@ export default defineConfig(({ command }) => { name: "sitemap-generator", buildStart(options) { if (command === "build") { - child_process.execSync("./scripts/gen_sitemap.js"); + child_process.execSync("./scripts/generate_sitemap.js"); console.log("Generated Sitemap -> public/sitemap.xml"); } },