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 <noreply@anthropic.com>
This commit is contained in:
parent
6822ee5b47
commit
bc9f5bcfb4
|
|
@ -530,20 +530,45 @@ routes.get("/", (c) => {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
const isDemo = space === "demo";
|
if (view === "feed") {
|
||||||
const body = isDemo ? renderDemoFeedHTML() : renderLanding();
|
const isDemo = space === "demo";
|
||||||
const styles = isDemo
|
const body = isDemo ? renderDemoFeedHTML() : renderLanding();
|
||||||
? `<link rel="stylesheet" href="/modules/rsocials/socials.css">`
|
const styles = isDemo
|
||||||
: `<style>${RICH_LANDING_CSS}</style>`;
|
? `<link rel="stylesheet" href="/modules/rsocials/socials.css">`
|
||||||
|
: `<style>${RICH_LANDING_CSS}</style>`;
|
||||||
|
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: `<style>${RICH_LANDING_CSS}</style>`,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default: canvas view
|
||||||
return c.html(renderShell({
|
return c.html(renderShell({
|
||||||
title: `${space} — Socials | rSpace`,
|
title: `${space} — rSocials | rSpace`,
|
||||||
moduleId: "rsocials",
|
moduleId: "rsocials",
|
||||||
spaceSlug: space,
|
spaceSlug: space,
|
||||||
modules: getModuleInfoList(),
|
modules: getModuleInfoList(),
|
||||||
|
body: `<folk-socials-canvas space="${escapeHtml(space)}"></folk-socials-canvas>`,
|
||||||
|
scripts: `<script type="module" src="/modules/rsocials/folk-socials-canvas.js"></script>`,
|
||||||
|
styles: `<link rel="stylesheet" href="/modules/rsocials/socials-canvas.css">`,
|
||||||
theme: "dark",
|
theme: "dark",
|
||||||
body,
|
|
||||||
styles,
|
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -635,6 +635,32 @@ export default defineConfig({
|
||||||
resolve(__dirname, "dist/modules/rsocials/socials.css"),
|
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
|
// Build tube module component
|
||||||
await build({
|
await build({
|
||||||
configFile: false,
|
configFile: false,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue