diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml new file mode 100644 index 0000000..bc2af86 --- /dev/null +++ b/.github/workflows/meta.yml @@ -0,0 +1,38 @@ +name: Update metainfo on release + +on: + release: + types: + - published + workflow_dispatch: + +jobs: + update: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 # Install pnpm using packageManager key in package.json + + - name: Use Node.js 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install dependencies + run: pnpm i + + - name: Update metainfo + run: pnpm updateMeta + + - name: Commit and merge in changes + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git checkout -b ci/meta-update + git add meta/dev.vencord.Vesktop.metainfo.xml + git commit -m "Insert release changes for ${{ github.event.release.tag_name }}" + git push origin ci/meta-update + gh pr create -B main -H ci/meta-update -t "Metainfo for ${{ github.event.release.tag_name }}" -b "This PR updates the metainfo for release ${{ github.event.release.tag_name }}. @lewisakura @Vendicated" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index e729f08..1a277b4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,25 +1,25 @@ -{ - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true - }, - "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[typescriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[javascriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[json]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[jsonc]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "cSpell.words": ["Vesktop"] -} +{ + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit" + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "cSpell.words": ["Vesktop"] +} diff --git a/README.md b/README.md index c776011..9c941dd 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ Download and run Vesktop-VERSION.dmg from [releases](https://github.com/Vencord/ ### Linux +[![](https://dl.flathub.org/assets/badges/flathub-badge-en.svg)](https://flathub.org/apps/dev.vencord.Vesktop) + #### Arch based Install [vencord-desktop-git](https://aur.archlinux.org/packages/vencord-desktop-git) from the AUR using your favourite AUR helper, for example [yay](https://github.com/Jguer/yay) @@ -39,7 +41,7 @@ Download Vesktop-VERSION.rpm from [releases](https://github.com/Vencord/Vesktop/ Either download Vesktop-VERSION.AppImage and just run it directly or grab Vesktop-VERSION.tar.gz, extract it somewhere and run `vencorddesktop`. -A flatpak is planned, if you want packages for other repos, feel free to create them and they can be linked as unofficial here +If other packages are created, feel free to open an issue and we'll link them here. ## Building diff --git a/meta/dev.vencord.Vesktop.metainfo.xml b/meta/dev.vencord.Vesktop.metainfo.xml new file mode 100644 index 0000000..d897226 --- /dev/null +++ b/meta/dev.vencord.Vesktop.metainfo.xml @@ -0,0 +1,167 @@ + + + + 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
  • +
  • Update steamdeck controller layout by @AAGaming00
  • +
  • feat: Add option to disable smooth scrolling by @ZirixCZ
  • +
  • unblur shiggy in splash screen by @viacoro
  • +
  • update electron & arrpc @D3SOX
  • +
+
+
+ + 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 f6eacd6..fb23c98 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "start:watch": "pnpm build:dev && tsx scripts/startWatch.mts", "test": "pnpm lint && pnpm testTypes", "testTypes": "tsc --noEmit", - "watch": "pnpm build --watch" + "watch": "pnpm build --watch", + "updateMeta": "tsx scripts/utils/updateMeta.mts" }, "dependencies": { "arrpc": "github:OpenAsar/arrpc#3e22fd776273afaa4a80c51deb86077ffdd4d2ae" @@ -51,7 +52,8 @@ "source-map-support": "^0.5.21", "tsx": "^4.6.0", "type-fest": "^4.8.2", - "typescript": "^5.3.2" + "typescript": "^5.3.2", + "xml-formatter": "^3.6.0" }, "packageManager": "pnpm@8.11.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8ac9af2..6d089f4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -84,6 +84,9 @@ devDependencies: typescript: specifier: ^5.3.2 version: 5.3.2 + xml-formatter: + specifier: ^3.6.0 + version: 3.6.0 packages: @@ -4585,6 +4588,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..44327b7 --- /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).split("in https://github.com")[0].trim(); // don't include links to github + + 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[0]); + +const output = xmlFormat(new XMLSerializer().serializeToString(parser), { + lineSeparator: "\n", + collapseContent: true, + indentation: " " +}); + +await fs.writeFile("./meta/dev.vencord.Vesktop.metainfo.xml", output, "utf-8"); diff --git a/static/views/splash.html b/static/views/splash.html index a82ff33..94ef13e 100644 --- a/static/views/splash.html +++ b/static/views/splash.html @@ -22,8 +22,8 @@ } img { - width: 6em; - height: 6em; + width: 128px; + height: 128px; image-rendering: pixelated; }