From bc9f5bcfb469d9081a4c38b3bf576019bef18d98 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Wed, 4 Mar 2026 21:15:06 -0800 Subject: [PATCH] fix: re-apply rSocials canvas route and vite build entry The rSocials refactor commit overwrote the canvas route changes. Re-adds: default canvas view, ?view=feed for old demo feed, ?view=landing for landing page, and vite build entry for folk-socials-canvas.ts. Co-Authored-By: Claude Opus 4.6 --- modules/rsocials/mod.ts | 41 +++++++++++++++++++++++++++++++++-------- vite.config.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 8 deletions(-) diff --git a/modules/rsocials/mod.ts b/modules/rsocials/mod.ts index 99ff106..3713435 100644 --- a/modules/rsocials/mod.ts +++ b/modules/rsocials/mod.ts @@ -530,20 +530,45 @@ routes.get("/", (c) => { })); } - const isDemo = space === "demo"; - const body = isDemo ? renderDemoFeedHTML() : renderLanding(); - const styles = isDemo - ? `` - : ``; + if (view === "feed") { + const isDemo = space === "demo"; + const body = isDemo ? renderDemoFeedHTML() : renderLanding(); + const styles = isDemo + ? `` + : ``; + return c.html(renderShell({ + title: `${space} — Socials Feed | rSpace`, + moduleId: "rsocials", + spaceSlug: space, + modules: getModuleInfoList(), + theme: "dark", + body, + styles, + })); + } + if (view === "landing") { + return c.html(renderShell({ + title: `${space} — rSocials | rSpace`, + moduleId: "rsocials", + spaceSlug: space, + modules: getModuleInfoList(), + theme: "dark", + body: renderLanding(), + styles: ``, + })); + } + + // Default: canvas view return c.html(renderShell({ - title: `${space} — Socials | rSpace`, + title: `${space} — rSocials | rSpace`, moduleId: "rsocials", spaceSlug: space, modules: getModuleInfoList(), + body: ``, + scripts: ``, + styles: ``, theme: "dark", - body, - styles, })); }); diff --git a/vite.config.ts b/vite.config.ts index 9752e19..68cbb08 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -635,6 +635,32 @@ export default defineConfig({ resolve(__dirname, "dist/modules/rsocials/socials.css"), ); + // Build socials canvas component + await build({ + configFile: false, + root: resolve(__dirname, "modules/rsocials/components"), + build: { + emptyOutDir: false, + outDir: resolve(__dirname, "dist/modules/rsocials"), + lib: { + entry: resolve(__dirname, "modules/rsocials/components/folk-socials-canvas.ts"), + formats: ["es"], + fileName: () => "folk-socials-canvas.js", + }, + rollupOptions: { + output: { + entryFileNames: "folk-socials-canvas.js", + }, + }, + }, + }); + + // Copy socials canvas CSS + copyFileSync( + resolve(__dirname, "modules/rsocials/components/socials-canvas.css"), + resolve(__dirname, "dist/modules/rsocials/socials-canvas.css"), + ); + // Build tube module component await build({ configFile: false,