feat: add live Discord sharing functionality with dynamic habit progress images
- Implemented live card image generation for user habits using canvas. - Created API endpoints for starting and managing live Discord sharing sessions. - Added tests for live Discord sharing to ensure functionality and reliability. - Introduced CSS styles for the live Discord sharing interface. - Enhanced error handling and state management for Discord message updates.
This commit is contained in:
6
build.ts
6
build.ts
@@ -1,5 +1,5 @@
|
||||
import tailwind from "bun-plugin-tailwind";
|
||||
import { rm } from "node:fs/promises";
|
||||
import { rm, mkdir, copyFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
const outdir = path.join(process.cwd(), "dist");
|
||||
@@ -11,6 +11,7 @@ const result = await Bun.build({
|
||||
plugins: [tailwind],
|
||||
minify: true,
|
||||
target: "bun",
|
||||
external: ["@napi-rs/canvas"],
|
||||
sourcemap: "linked",
|
||||
define: {
|
||||
"process.env.NODE_ENV": JSON.stringify("production"),
|
||||
@@ -24,3 +25,6 @@ if (!result.success) {
|
||||
for (const output of result.outputs) {
|
||||
console.log(` ${path.relative(process.cwd(), output.path)} ${(output.size / 1024).toFixed(1)} KB`);
|
||||
}
|
||||
|
||||
await mkdir(path.join(outdir, "fonts"), { recursive: true });
|
||||
await copyFile("src/assets/fonts/InstrumentSerif-Regular.ttf", path.join(outdir, "fonts/InstrumentSerif-Regular.ttf"));
|
||||
|
||||
Reference in New Issue
Block a user