diff --git a/.forgejo/ISSUE_TEMPLATE/bug_report.md b/.forgejo/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index dd84ea78..00000000 --- a/.forgejo/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.forgejo/scripts/convert/index.mjs b/.forgejo/scripts/convert/index.mjs deleted file mode 100644 index 340f3f5d..00000000 --- a/.forgejo/scripts/convert/index.mjs +++ /dev/null @@ -1,41 +0,0 @@ -import { readFile, writeFile } from "fs/promises"; -import { join } from "path"; -import { format } from "prettier"; - -console.time("Done"); - -console.log("Reading avatarsdatabase.css..."); -const avis = (await readFile(join("../../", "avatarsdatabase.css"), "utf8")) - .replace(/\r/g, "") - .split("\n"); - -const imageMatcher = /url\((?:'|")([^'"]+)(?:'|")\)/; -const avatarMatcher = /^\/\* Custom avatar for ([0-9]+) \*\/$/; -const badgeMatcher = /^\/\* Custom badge for (.*?) \*\/$/; - -const avatars = {}; -for (let i = 0; i < avis.length; i++) { - const l = avis[i]; - const id = l.match(avatarMatcher)?.[1]; - if (id) avatars[id] = avis[i + 2].match(imageMatcher)[1]; -} - -const badges = {}; -for (let i = 0; i < avis.length; i++) { - const l = avis[i]; - const bid = l.match(badgeMatcher)?.[1]; - if (bid) badges[bid] = avis[i + 10].match(imageMatcher)[1]; -} - -await writeFile( - join("../../", "source", "data.json"), - format( - JSON.stringify({ - avatars, - badges, - }), - { - parser: "json", - } - ) -); \ No newline at end of file diff --git a/.forgejo/scripts/generate/index.mjs b/.forgejo/scripts/generate/index.mjs deleted file mode 100644 index 7c03a3fe..00000000 --- a/.forgejo/scripts/generate/index.mjs +++ /dev/null @@ -1,49 +0,0 @@ -import { readFile, writeFile } from "fs/promises"; -import { join } from "path"; -import UglifyCSS from "uglifycss"; - -console.time("Done"); - -const uglify = !process.argv.includes("--debug"); - -console.log("Getting templates..."); -const templateLines = ( - await readFile(join("../../", "source", "template.css"), "utf8") -) - .replace(/\r/g, "") - .split("\n"); - -const templates = { - avatar: "", -}; - -for (const id of Object.keys(templates)) { - const start = templateLines.findIndex( - (x) => x === `/* ${id.toUpperCase()}-TEMPLATE-BEGIN */` - ), - end = templateLines.findIndex( - (x) => x === `/* ${id.toUpperCase()}-TEMPLATE-END */` - ); - - if (start >= 0 && end >= 0) - templates[id] = templateLines.slice(start + 1, end).join("\n"); - else throw new Error(`Failed to get template lines for: ${id}`); -} - -console.log("Generating import.css..."); -const data = JSON.parse( - await readFile(join("../../", "source", "data.json"), "utf8") -); - -const dist = []; - -for (const [id, img] of Object.entries(data.avatars)) { - dist.push(templates.avatar.replace(/{id}/g, id).replace(/{img}/g, img)); -} - -await writeFile( - join("../../", "import.css"), - uglify ? UglifyCSS.processString(dist.join("\n")) : dist.join("\n\n") -); - -console.timeEnd("Done"); diff --git a/.forgejo/scripts/package.json b/.forgejo/scripts/package.json deleted file mode 100644 index efd4914f..00000000 --- a/.forgejo/scripts/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "scripts", - "private": true, - "scripts": { - "convert": "node convert/index.mjs", - "generate": "node generate/index.mjs", - "generate:debug": "node generate/index.mjs --debug" - }, - "dependencies": { - "prettier": "^3.0.2", - "uglifycss": "^0.0.29" - } -} diff --git a/.forgejo/scripts/pnpm-lock.yaml b/.forgejo/scripts/pnpm-lock.yaml deleted file mode 100644 index ffae7571..00000000 --- a/.forgejo/scripts/pnpm-lock.yaml +++ /dev/null @@ -1,27 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -dependencies: - prettier: - specifier: ^3.0.2 - version: 3.0.2 - uglifycss: - specifier: ^0.0.29 - version: 0.0.29 - -packages: - - /prettier@3.0.2: - resolution: {integrity: sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==} - engines: {node: '>=14'} - hasBin: true - dev: false - - /uglifycss@0.0.29: - resolution: {integrity: sha512-J2SQ2QLjiknNGbNdScaNZsXgmMGI0kYNrXaDlr4obnPW9ni1jljb1NeEVWAiTgZ8z+EBWP2ozfT9vpy03rjlMQ==} - engines: {node: '>=6.4.0'} - hasBin: true - dev: false diff --git a/.forgejo/workflows/generate-db.yml b/.forgejo/workflows/generate-db.yml deleted file mode 100644 index ac2eec94..00000000 --- a/.forgejo/workflows/generate-db.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Generate Database - -on: - push: - branches: - - main - paths: - - ".forgejo/workflows/generate-source.yml" - - ".forgejo/scripts/generate/**/*.*" - - "source/data.json" - - "source/template.css" - pull_request: - branches: - - main - workflow_dispatch: - -concurrency: - group: ${{ github.ref }} - cancel-in-progress: true - -jobs: - generate: - runs-on: ubuntu-latest - permissions: - contents: write - # v this isn't really needed v - # strategy: - # matrix: - # retry-max: [3] # Set the maximum number of retries here - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - node-version: 18.x - - - name: Setup PNPM - working-directory: .forgejo/scripts - run: | - npm i -g pnpm - pnpm i - - - name: Run generate script - working-directory: .forgejo/scripts - run: pnpm run generate - - - name: Push changes - run: | - git config --global user.name "dingus" - git config --global user.email "bot@dorkbutt.lol" - - git add import.css - git commit -m "Update import.css (${{ github.sha || 'manual trigger' }})" || true - git push diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml deleted file mode 100644 index e401aca5..00000000 --- a/.forgejo/workflows/release.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Release - -on: - push: - tags: - - "v*" - -jobs: - release: - name: Release - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - name: Check out Git repository - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: 18 - - - uses: pnpm/action-setup@v2 - with: - version: latest - - - name: Install Node.js dependencies - run: pnpm install - - - name: Build TypeScript and bundle into asar - run: pnpm run bundle - - - uses: ncipollo/release-action@v1 - with: - artifacts: "bundle/*" - makeLatest: true \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4b097d22..fa6f7687 100644 --- a/.gitignore +++ b/.gitignore @@ -106,4 +106,7 @@ dist .tern-port .parcel-cache -/bundle \ No newline at end of file +/bundle + +# For now, as runners are unable to be deployed on local instance. +.forgejo