diff --git a/app/features/changelog/changelog-constants.ts b/app/features/changelog/changelog-constants.ts index 429cd8026..5ebfed60a 100644 --- a/app/features/changelog/changelog-constants.ts +++ b/app/features/changelog/changelog-constants.ts @@ -22,12 +22,12 @@ export const DISCORD_EMOJI_NAMES: Record = { articles: "articles", vods: "vods", art: "art", - "tier-list-maker": "tier_list_maker", + "tier-list-maker": "tierlistmaker", links: "links", maps: "maps", medal: "medal", t: "t", - u: "u", + u: "user", associations: "associations", badges: "badges", luti: "luti", diff --git a/docs/dev/how-to.md b/docs/dev/how-to.md index b218ffbaf..7b84d8aa6 100644 --- a/docs/dev/how-to.md +++ b/docs/dev/how-to.md @@ -80,7 +80,7 @@ The image posted on social media on update day is built from the entry files in 1) Every commit with a user facing change adds one `changelog/YYYY-MM-DD-.md` per change. Frontmatter is `navItem` (optional, one of `NAV_ICONS` or a list of them such as `navItem: [calendar, scrims]`, omitted = sendou.ink logo) and `type` (`feature` or `bug`). The body is a one line headline, optionally followed by a markdown bullet list for a bigger release. Entries are never deleted, they are the update history. 2) Preview and tweak the graphic on the `/admin/changelog-image` page (dev only). Without a `?since=` it renders every entry ever committed. -3) With the dev server running, `pnpm run changelog:image ` writes `scripts/output/update-.png` from the entries added since that commit, copies the image to the clipboard. +3) With the dev server running, `pnpm run changelog:image ` (add `--port ` if the dev server is not on the default port) writes `scripts/output/update-.png` from the entries added since that commit, copies the image to the clipboard. ## Add a new translation string diff --git a/scripts/generate-changelog-image.ts b/scripts/generate-changelog-image.ts index 2ecdd5e65..d81e4bee6 100644 --- a/scripts/generate-changelog-image.ts +++ b/scripts/generate-changelog-image.ts @@ -8,7 +8,7 @@ import { execFile } from "node:child_process"; import fs from "node:fs/promises"; import path from "node:path"; import { fileURLToPath } from "node:url"; -import { promisify } from "node:util"; +import { parseArgs, promisify } from "node:util"; import { chromium, type Page } from "@playwright/test"; import { format } from "date-fns"; import sharp from "sharp"; @@ -25,7 +25,12 @@ try { // .env is optional, the dev server port can also come from the environment } -const CHANGELOG_IMAGE_PAGE_URL = `http://localhost:${process.env.PORT ?? 5173}/admin/changelog-image`; +const { values: args, positionals } = parseArgs({ + options: { port: { type: "string" } }, + allowPositionals: true, +}); + +const CHANGELOG_IMAGE_PAGE_URL = `http://localhost:${args.port ?? process.env.PORT ?? 5173}/admin/changelog-image`; const OUT_DIR = fileURLToPath(new URL("./output", import.meta.url)); @@ -40,10 +45,10 @@ interface ChangelogEntry { } async function main() { - const since = process.argv[2]; + const since = positionals[0]; if (!since) { throw new Error( - "Usage: pnpm run changelog:image ", + "Usage: pnpm run changelog:image [--port ]", ); }