From 91637e8c314dc93830b0540c8361d07e389bc27b Mon Sep 17 00:00:00 2001 From: Jordan Roher Date: Mon, 18 Dec 2023 13:46:15 -0800 Subject: [PATCH] Updated readme Removed more files --- default.conf | 2 -- postcss.config.js | 6 ----- readme.md | 5 ++++ start.js | 61 ----------------------------------------------- 4 files changed, 5 insertions(+), 69 deletions(-) delete mode 100644 postcss.config.js delete mode 100644 start.js diff --git a/default.conf b/default.conf index c723440..adb2f0d 100644 --- a/default.conf +++ b/default.conf @@ -11,8 +11,6 @@ server { add_header Cache-Control "public, max-age=604800, immutable"; } - # Additional configurations can be added here if needed - # For example, error handling, logging, etc. error_page 404 /index.html; error_page 500 502 503 504 /index.html; } diff --git a/postcss.config.js b/postcss.config.js deleted file mode 100644 index 2e7af2b..0000000 --- a/postcss.config.js +++ /dev/null @@ -1,6 +0,0 @@ -export default { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -} diff --git a/readme.md b/readme.md index 7b24439..35b683f 100644 --- a/readme.md +++ b/readme.md @@ -32,6 +32,11 @@ Inspired by [Ben Phelps' Homepage](https://gethomepage.dev/) and [Umbrel](https: # Change history +## 1.4.0 + +- Rewrote the entire application to not use React. Now it's just a Node application that emits static HTML. +- Removed lots of packages + ## 1.3.0 - Removed all JavaScript as part of the build step. The image will be slightly larger and take longer to start up and shut down, but the page will be even lighter. diff --git a/start.js b/start.js deleted file mode 100644 index d66f678..0000000 --- a/start.js +++ /dev/null @@ -1,61 +0,0 @@ -import { exec } from "child_process"; -import fs from "fs/promises"; -import puppeteer from "puppeteer"; - -function runNpmCommand(command) { - return new Promise((resolve, reject) => { - exec(`npm ${command}`, (error, stdout, stderr) => { - if (error) { - console.error(`Error executing command: ${error}`); - reject(error); - } else { - console.log(`Command output: ${stdout}`); - resolve(stdout); - } - }); - }); -} - -async function renderHomePage() { - const browser = await puppeteer.launch({ - headless: true, - args: ["--no-sandbox", "--disable-setuid-sandbox"], - executablePath: "chromium", // Remove this when running locally - }); - const page = await browser.newPage(); - - await page.goto("http://localhost:4173", { waitUntil: "networkidle0" }); - - // Wait for any additional content to load - await page.waitForNetworkIdle(); - - // Get the rendered HTML content - const renderedHTML = await page.content(); - - // Save the rendered HTML to a file - fs.writeFile("./dist/index.html", renderedHTML); - - await browser.close(); -} - -async function runCommands() { - try { - console.log("Building React site"); - await runNpmCommand("run build"); - - setTimeout(async () => { - console.log("Taking snapshot"); - await renderHomePage(); - await runNpmCommand("run html"); - await runNpmCommand("run replace"); - }, 2000); - - console.log("Starting web server"); - await runNpmCommand("run serve"); - } catch (err) { - // Handle errors - console.error("An error occurred:", err); - } -} - -runCommands();