From 0f804f9f6e6e9f19ae152f183fcb037499a183b0 Mon Sep 17 00:00:00 2001 From: Lewis Crichton Date: Mon, 4 Dec 2023 21:05:09 +0000 Subject: [PATCH] feat: autogenerated release notes --- meta/dev.vencord.Vesktop.metainfo.xml | 169 ++++++++++++++++++++++++++ package.json | 3 +- pnpm-lock.yaml | 15 +++ scripts/utils/updateMeta.mts | 93 ++++++++++++++ 4 files changed, 279 insertions(+), 1 deletion(-) create mode 100644 meta/dev.vencord.Vesktop.metainfo.xml create mode 100644 scripts/utils/updateMeta.mts diff --git a/meta/dev.vencord.Vesktop.metainfo.xml b/meta/dev.vencord.Vesktop.metainfo.xml new file mode 100644 index 0000000..cb04ef7 --- /dev/null +++ b/meta/dev.vencord.Vesktop.metainfo.xml @@ -0,0 +1,169 @@ + + + + dev.vencord.Vesktop + Vesktop + Snappier Discord app with Vencord + Vencord Contributors + dev.vencord.Vesktop.desktop + CC0-1.0 + GPL-3.0 + Vencord + +

Vesktop is a cross platform desktop app aiming to give you a snappier Discord experience with Vencord pre-installed.

+

Vesktop comes bundled with Venmic, a purpose-built library to provide functioning audio screenshare.

+
+ + + Vencord settings page and about window open + https://vencord.dev/assets/screenshots/vesktop-1-appstream.png + + + A dialog showing screenshare options + https://vencord.dev/assets/screenshots/vesktop-2-appstream.png + + + A screenshot of a Discord server + https://vencord.dev/assets/screenshots/vesktop-3-appstream.png + + + + + + https://github.com/Vencord/Vesktop/releases/tag/v0.4.4 + +

What's Changed

+
    +
  • improve venmic system compatibility by @Curve in https://github.com/Vencord/Vesktop/pull/230
  • +
  • Update steamdeck controller layout by @AAGaming00 in https://github.com/Vencord/Vesktop/pull/236
  • +
  • feat: Add option to disable smooth scrolling by @ZirixCZ in https://github.com/Vencord/Vesktop/pull/255
  • +
  • unblur shiggy in splash screen by @viacoro in https://github.com/Vencord/Vesktop/pull/221
  • +
  • update electron & arrpc @D3SOX in https://github.com/Vencord/Vesktop/pull/258
  • +
+
+
+ + + https://github.com/Vencord/Vesktop/releases/tag/v0.4.3 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.4.2 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.4.1 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.4.0 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.3.3 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.3.2 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.3.1 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.3.0 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.2.9 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.2.8 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.2.7 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.2.6 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.2.5 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.2.4 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.2.3 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.2.2 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.2.1 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.2.0 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.1.9 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.1.8 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.1.7 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.1.6 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.1.5 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.1.4 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.1.3 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.1.2 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.1.1 + + + https://github.com/Vencord/Vesktop/releases/tag/v0.1.0 + +
+ https://vencord.dev/ + https://github.com/Vencord/Vesktop/issues + https://vencord.dev/faq/ + https://github.com/Vencord/Vesktop/issues + https://github.com/sponsors/Vendicated + https://github.com/Vencord/Vesktop + + InstantMessaging + AudioVideo + + + pointing + keyboard + 420 + always + + + voice + 760 + 1200 + always + + + always + + + intense + intense + intense + intense + + + Discord + Vencord + Vesktop + Privacy + Mod + +
\ No newline at end of file diff --git a/package.json b/package.json index 2fe0c75..d5cbc9f 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,8 @@ "source-map-support": "^0.5.21", "tsx": "^3.13.0", "type-fest": "^4.4.0", - "typescript": "^5.2.2" + "typescript": "^5.2.2", + "xml-formatter": "^3.6.0" }, "packageManager": "pnpm@8.6.11", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b3d4db8..0983412 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -84,6 +84,9 @@ devDependencies: typescript: specifier: ^5.2.2 version: 5.2.2 + xml-formatter: + specifier: ^3.6.0 + version: 3.6.0 packages: @@ -4618,6 +4621,18 @@ packages: optional: true dev: false + /xml-formatter@3.6.0: + resolution: {integrity: sha512-Wic80ENNLF/5mLcc82hVLmoOWQlLDJtVv+N1/hkP4hBuVXPLKrXo92/4V23QYPKfUxvCU6Y2AcdpHCIA/xexFw==} + engines: {node: '>= 14'} + dependencies: + xml-parser-xo: 4.1.1 + dev: true + + /xml-parser-xo@4.1.1: + resolution: {integrity: sha512-Ggf2y90+Y6e9IK5hoPuembVHJ03PhDSdhldEmgzbihzu9k0XBo0sfcFxaSi4W1PlUSSI1ok+MJ0JCXUn+U4Ilw==} + engines: {node: '>= 14'} + dev: true + /xmlbuilder@15.1.1: resolution: {integrity: sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==} engines: {node: '>=8.0'} diff --git a/scripts/utils/updateMeta.mts b/scripts/utils/updateMeta.mts new file mode 100644 index 0000000..1d87482 --- /dev/null +++ b/scripts/utils/updateMeta.mts @@ -0,0 +1,93 @@ +/* + * SPDX-License-Identifier: GPL-3.0 + * Vesktop, a desktop app aiming to give you a snappier Discord Experience + * Copyright (c) 2023 Vendicated and Vencord contributors + */ + +import { promises as fs } from "node:fs"; + +import { DOMParser, XMLSerializer } from "@xmldom/xmldom"; +import xmlFormat from "xml-formatter"; + +function generateDescription(description: string, descriptionNode: Element) { + const lines = description.replace(/\r/g, "").split("\n"); + let currentList: Element | null = null; + + for (let i = 0; i < lines.length; i++) { + const line = lines[i]; + + if (line.includes("New Contributors")) { + // we're done, don't parse any more since the new contributors section is the last one + break; + } + + if (line.startsWith("## ")) { + const pNode = descriptionNode.ownerDocument.createElement("p"); + pNode.textContent = line.slice(3); + descriptionNode.appendChild(pNode); + } else if (line.startsWith("* ")) { + const liNode = descriptionNode.ownerDocument.createElement("li"); + liNode.textContent = line.slice(2); + + if (!currentList) { + currentList = descriptionNode.ownerDocument.createElement("ul"); + } + + currentList.appendChild(liNode); + } + + if (currentList && !lines[i + 1].startsWith("* ")) { + descriptionNode.appendChild(currentList); + currentList = null; + } + } +} + +const latestReleaseInformation = await fetch("https://api.github.com/repos/Vencord/Vesktop/releases/latest", { + headers: { + Accept: "application/vnd.github+json", + "X-Github-Api-Version": "2022-11-28" + } +}).then(res => res.json()); + +const metaInfo = await fs.readFile("./meta/dev.vencord.Vesktop.metainfo.xml", "utf-8"); + +const parser = new DOMParser().parseFromString(metaInfo, "text/xml"); + +const releaseList = parser.getElementsByTagName("releases")[0]; + +for (let i = 0; i < releaseList.childNodes.length; i++) { + const release = releaseList.childNodes[i] as Element; + + if (release.nodeType === 1 && release.getAttribute("version") === latestReleaseInformation.name) { + console.log("Latest release already added, nothing to be done"); + process.exit(0); + } +} + +const release = parser.createElement("release"); +release.setAttribute("version", latestReleaseInformation.name); +release.setAttribute("date", latestReleaseInformation.published_at.split("T")[0]); +release.setAttribute("type", "stable"); + +const releaseUrl = parser.createElement("url"); +releaseUrl.textContent = latestReleaseInformation.html_url; + +release.appendChild(releaseUrl); + +const description = parser.createElement("description"); + +// we're not using a full markdown parser here since we don't have a lot of formatting options to begin with +generateDescription(latestReleaseInformation.body, description); + +release.appendChild(description); + +releaseList.insertBefore(release, releaseList.childNodes[2]); + +const output = xmlFormat(new XMLSerializer().serializeToString(parser), { + lineSeparator: "\n", + collapseContent: true, + indentation: " " +}); + +await fs.writeFile("./meta/dev.vencord.Vesktop.metainfo.xml", output, "utf-8");