fix: bun format

This commit is contained in:
Daniel 2026-03-21 16:56:05 -05:00
parent c40cd952a2
commit 6728b17efe
11 changed files with 8523 additions and 168 deletions

View file

@ -6,7 +6,7 @@
version: 2 version: 2
updates: updates:
- package-ecosystem: "devcontainers" - package-ecosystem: 'devcontainers'
directory: "/" directory: '/'
schedule: schedule:
interval: weekly interval: weekly

View file

@ -1,14 +1,18 @@
### Description ### Description
### Type of Change ### Type of Change
- [ ] Bug fix - [ ] Bug fix
- [ ] New feature - [ ] New feature
- [ ] Style/UI update - [ ] Style/UI update
- [ ] Docs only - [ ] Docs only
### Checklist ### Checklist
- [ ] **I have read the [Contributing Guidelines](https://github.com/monochrome-music/monochrome/blob/main/CONTRIBUTING.md).** - [ ] **I have read the [Contributing Guidelines](https://github.com/monochrome-music/monochrome/blob/main/CONTRIBUTING.md).**
- [ ] **I understand every line of code I am submitting.** - [ ] **I understand every line of code I am submitting.**
- [ ] I have tested these changes locally, and they work as expected. - [ ] I have tested these changes locally, and they work as expected.
--- ---
*By submitting this PR, I agree to follow the guidelines. I understand that the final decision to merge rests with the maintainers and that not all contributions can be accepted.*
_By submitting this PR, I agree to follow the guidelines. I understand that the final decision to merge rests with the maintainers and that not all contributions can be accepted._

View file

@ -1,125 +1,125 @@
name: Desktop Build name: Desktop Build
on: on:
push: push:
branches: [main, neutralino] branches: [main, neutralino]
workflow_dispatch: workflow_dispatch:
permissions: permissions:
contents: write contents: write
jobs: jobs:
build: build:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
platform: windows
binary_source: Monochrome-win_x64.exe
binary_dest: Monochrome.exe
archive_name: monochrome-windows.zip
- os: ubuntu-latest
platform: linux
binary_source: Monochrome-linux_x64
binary_dest: Monochrome
archive_name: monochrome-linux.zip
- os: macos-latest
platform: macos
binary_source: Monochrome-mac_universal
binary_dest: Monochrome
archive_name: monochrome-mac.zip
steps: strategy:
- name: Checkout code fail-fast: false
uses: actions/checkout@v4 matrix:
with: include:
fetch-depth: 1 - os: windows-latest
platform: windows
binary_source: Monochrome-win_x64.exe
binary_dest: Monochrome.exe
archive_name: monochrome-windows.zip
- os: ubuntu-latest
platform: linux
binary_source: Monochrome-linux_x64
binary_dest: Monochrome
archive_name: monochrome-linux.zip
- os: macos-latest
platform: macos
binary_source: Monochrome-mac_universal
binary_dest: Monochrome
archive_name: monochrome-mac.zip
- name: Setup Bun steps:
uses: oven-sh/setup-bun@v2 - name: Checkout code
with: uses: actions/checkout@v4
bun-version: latest with:
fetch-depth: 1
- name: Install dependencies - name: Setup Bun
run: bun install uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Download Neutralino binaries - name: Install dependencies
run: bun x neu update run: bun install
- name: Auto-Bump Version - name: Download Neutralino binaries
run: | run: bun x neu update
$json = Get-Content neutralino.config.json -Raw | ConvertFrom-Json
$v = $json.version.Split('.')
if ($v.Count -lt 2) { $v += "0" }
$newVersion = "{0}.{1}.{2}" -f $v[0], $v[1], ${{ github.run_number }}
$json.version = $newVersion
$json | ConvertTo-Json -Depth 5 | Set-Content neutralino.config.json
shell: pwsh
- name: Build application - name: Auto-Bump Version
run: bun run build run: |
$json = Get-Content neutralino.config.json -Raw | ConvertFrom-Json
$v = $json.version.Split('.')
if ($v.Count -lt 2) { $v += "0" }
$newVersion = "{0}.{1}.{2}" -f $v[0], $v[1], ${{ github.run_number }}
$json.version = $newVersion
$json | ConvertTo-Json -Depth 5 | Set-Content neutralino.config.json
shell: pwsh
- name: Prepare Release Folder - name: Build application
run: | run: bun run build
mkdir release
cp dist/Monochrome/resources.neu release/
cp neutralino.config.json release/
cp -r dist/Monochrome/extensions release/
cp dist/Monochrome/${{ matrix.binary_source }} release/${{ matrix.binary_dest }}
shell: bash
- name: Set Permissions (Linux/macOS) - name: Prepare Release Folder
if: matrix.platform != 'windows' run: |
run: chmod +x release/${{ matrix.binary_dest }} mkdir release
cp dist/Monochrome/resources.neu release/
cp neutralino.config.json release/
cp -r dist/Monochrome/extensions release/
cp dist/Monochrome/${{ matrix.binary_source }} release/${{ matrix.binary_dest }}
shell: bash
- name: Zip for R2 (Windows) - name: Set Permissions (Linux/macOS)
if: matrix.platform == 'windows' if: matrix.platform != 'windows'
run: Compress-Archive -Path release/* -DestinationPath ${{ matrix.archive_name }} -Force run: chmod +x release/${{ matrix.binary_dest }}
shell: pwsh
- name: Zip for R2 (Linux/macOS) - name: Zip for R2 (Windows)
if: matrix.platform != 'windows' if: matrix.platform == 'windows'
run: | run: Compress-Archive -Path release/* -DestinationPath ${{ matrix.archive_name }} -Force
cd release shell: pwsh
zip -r ../${{ matrix.archive_name }} .
shell: bash
- name: Isolate Zip File - name: Zip for R2 (Linux/macOS)
run: | if: matrix.platform != 'windows'
mkdir out_delivery run: |
mv ${{ matrix.archive_name }} out_delivery/ cd release
shell: bash zip -r ../${{ matrix.archive_name }} .
shell: bash
- name: Generate Update Manifest - name: Isolate Zip File
run: | run: |
$config = Get-Content neutralino.config.json | ConvertFrom-Json mkdir out_delivery
$version = $config.version mv ${{ matrix.archive_name }} out_delivery/
$platform = "${{ matrix.platform }}" shell: bash
$archive = "${{ matrix.archive_name }}"
$json = @{
version = $version
url = "https://downloads.samidy.com/out_delivery/$archive"
notes = "Update $version is available."
}
$json | ConvertTo-Json | Set-Content "out_delivery/update-$platform.json"
shell: pwsh
- name: Upload to R2 - name: Generate Update Manifest
uses: ryand56/r2-upload-action@latest run: |
with: $config = Get-Content neutralino.config.json | ConvertFrom-Json
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} $version = $config.version
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} $platform = "${{ matrix.platform }}"
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} $archive = "${{ matrix.archive_name }}"
r2-bucket: ${{ secrets.R2_BUCKET }} $json = @{
source-dir: 'out_delivery' version = $version
destination-dir: 'out_delivery' url = "https://downloads.samidy.com/out_delivery/$archive"
notes = "Update $version is available."
}
$json | ConvertTo-Json | Set-Content "out_delivery/update-$platform.json"
shell: pwsh
- name: Upload Artifact (GH Internal) - name: Upload to R2
uses: actions/upload-artifact@v4 uses: ryand56/r2-upload-action@latest
with: with:
name: Monochrome-${{ matrix.platform }} r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
path: release/ r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
retention-days: 30 r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: 'out_delivery'
destination-dir: 'out_delivery'
- name: Upload Artifact (GH Internal)
uses: actions/upload-artifact@v4
with:
name: Monochrome-${{ matrix.platform }}
path: release/
retention-days: 30

View file

@ -1,43 +1,43 @@
name: Update Lock File name: Update Lock File
on: on:
workflow_dispatch: workflow_dispatch:
permissions: permissions:
contents: write contents: write
jobs: jobs:
update-lock: update-lock:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
- name: Configure Git - name: Configure Git
uses: DanTheMan827/config-git-user-action@v1 uses: DanTheMan827/config-git-user-action@v1
- name: Setup Bun - name: Setup Bun
uses: oven-sh/setup-bun@v1 uses: oven-sh/setup-bun@v1
with: with:
bun-version: latest bun-version: latest
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: | path: |
./bun_modules ./bun_modules
./node_modules ./node_modules
./bun.lock ./bun.lock
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }} key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
- name: Install dependencies - name: Install dependencies
run: bun install run: bun install
- name: Commit changes - name: Commit changes
run: | run: |
git add -A . || true git add -A . || true
git commit "update lockfile" || true git commit "update lockfile" || true
git push || true git push || true

View file

@ -30,10 +30,10 @@ These instances are community instances of Monochrome & its WebUI:
These instances provide the tidal-ui web interface, not monochrome: These instances provide the tidal-ui web interface, not monochrome:
| Provider | URL | Status | | Provider | URL | Status |
| ------------------- | ---------------------------------------------- | --------- | | ------------- | ------------------------------------------- | --------- |
| **squid.wtf** | [tidal.squid.wtf](https://tidal.squid.wtf) | Community | | **squid.wtf** | [tidal.squid.wtf](https://tidal.squid.wtf) | Community |
| **QQDL** | [tidal.qqdl.site](https://tidal.qqdl.site/) | Community | | **QQDL** | [tidal.qqdl.site](https://tidal.qqdl.site/) | Community |
--- ---
@ -48,17 +48,17 @@ These are available API endpoints that can be used with Monochrome or other Hi-F
### Official & Community APIs ### Official & Community APIs
| Provider | URL | Notes | | Provider | URL | Notes |
| ----------------- | ----------------------------------- | ---------------- | | ----------------- | ----------------------------------- | ----------------------------------------------------------------------- |
| **Monochrome** | `https://monochrome-api.samidy.com` | Official API | | **Monochrome** | `https://monochrome-api.samidy.com` | Official API |
| | `https://api.monochrome.tf` | Official API | | | `https://api.monochrome.tf` | Official API |
| | `https://arran.monochrome.tf` | Official API | | | `https://arran.monochrome.tf` | Official API |
| **squid.wtf** | `https://triton.squid.wtf` | Community hosted | | **squid.wtf** | `https://triton.squid.wtf` | Community hosted |
| **Lucida (QQDL)** | `https://wolf.qqdl.site` | Community hosted | | **Lucida (QQDL)** | `https://wolf.qqdl.site` | Community hosted |
| | `https://maus.qqdl.site` | Community hosted | | | `https://maus.qqdl.site` | Community hosted |
| | `https://vogel.qqdl.site` | Community hosted | | | `https://vogel.qqdl.site` | Community hosted |
| | `https://katze.qqdl.site` | Community hosted | | | `https://katze.qqdl.site` | Community hosted |
| | `https://hund.qqdl.site` | Community hosted | | | `https://hund.qqdl.site` | Community hosted |
| **Kinoplus** | `https://tidal.kinoplus.online` | Community hosted - [Limited/No-Sub](https://rentry.co/limitedtidalaccs) | | **Kinoplus** | `https://tidal.kinoplus.online` | Community hosted - [Limited/No-Sub](https://rentry.co/limitedtidalaccs) |
--- ---

View file

@ -110,7 +110,6 @@ Our Recommended way to use monochrome is through our official instance:
**[monochrome.tf](https://monochrome.tf)** / **[monochrome.samidy.com](https://monochrome.samidy.com)** **[monochrome.tf](https://monochrome.tf)** / **[monochrome.samidy.com](https://monochrome.samidy.com)**
For alternative instances, check [INSTANCES.md](INSTANCES.md). For alternative instances, check [INSTANCES.md](INSTANCES.md).
--- ---
@ -282,4 +281,3 @@ We welcome contributions from the community! Please see our [Contributing Guide]
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=monochrome-music/monochrome&type=date&logscale&legend=top-left" /> <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=monochrome-music/monochrome&type=date&logscale&legend=top-left" />
</picture> </picture>
</a> </a>

View file

@ -13,10 +13,10 @@ export async function onRequest(context) {
const POCKETBASE_URL = 'https://data.samidy.xyz'; const POCKETBASE_URL = 'https://data.samidy.xyz';
const filter = `username="${username}"`; const filter = `username="${username}"`;
const profileUrl = `${POCKETBASE_URL}/api/collections/DB_users/records?filter=${encodeURIComponent(filter)}&fields=username,display_name,avatar_url,banner,about,status`; const profileUrl = `${POCKETBASE_URL}/api/collections/DB_users/records?filter=${encodeURIComponent(filter)}&fields=username,display_name,avatar_url,banner,about,status`;
const response = await fetch(profileUrl); const response = await fetch(profileUrl);
if (!response.ok) throw new Error(`PocketBase error: ${response.status}`); if (!response.ok) throw new Error(`PocketBase error: ${response.status}`);
const data = await response.json(); const data = await response.json();
const profile = data.items && data.items.length > 0 ? data.items[0] : null; const profile = data.items && data.items.length > 0 ? data.items[0] : null;
@ -24,7 +24,7 @@ export async function onRequest(context) {
const displayName = profile.display_name || profile.username; const displayName = profile.display_name || profile.username;
const title = `${displayName} (@${profile.username})`; const title = `${displayName} (@${profile.username})`;
let description = profile.about || `View ${displayName}'s profile on Monochrome.`; let description = profile.about || `View ${displayName}'s profile on Monochrome.`;
if (profile.status) { if (profile.status) {
try { try {
const statusObj = JSON.parse(profile.status); const statusObj = JSON.parse(profile.status);

View file

@ -5,7 +5,8 @@ import { authManager } from './auth.js';
const PUBLIC_COLLECTION = 'public_playlists'; const PUBLIC_COLLECTION = 'public_playlists';
const DEFAULT_POCKETBASE_URL = 'https://data.samidy.xyz'; const DEFAULT_POCKETBASE_URL = 'https://data.samidy.xyz';
const POCKETBASE_URL = window.__POCKETBASE_URL__ || localStorage.getItem('monochrome-pocketbase-url') || DEFAULT_POCKETBASE_URL; const POCKETBASE_URL =
window.__POCKETBASE_URL__ || localStorage.getItem('monochrome-pocketbase-url') || DEFAULT_POCKETBASE_URL;
console.log('[PocketBase] Using URL:', POCKETBASE_URL); console.log('[PocketBase] Using URL:', POCKETBASE_URL);

View file

@ -33,14 +33,17 @@ function trackHasAsianText(track) {
function cleanTrackerSearch(text) { function cleanTrackerSearch(text) {
if (!text) return ''; if (!text) return '';
// chud emojis will NOT be tolerated in my precious genius lyrics worker // chud emojis will NOT be tolerated in my precious genius lyrics worker
let cleaned = text.replace(/[\p{Extended_Pictographic}\p{Emoji_Component}\p{Emoji_Presentation}\p{Emoji_Modifier}\p{Emoji_Modifier_Base}\p{Symbol}]/gu, ''); let cleaned = text.replace(
/[\p{Extended_Pictographic}\p{Emoji_Component}\p{Emoji_Presentation}\p{Emoji_Modifier}\p{Emoji_Modifier_Base}\p{Symbol}]/gu,
''
);
cleaned = cleaned.replace(/[\u2600-\u27BF\u2B50\u2B06\u2194\u21AA\u2934\u203C\u2049\u3030\u303D\u3297\u3299]/g, ''); cleaned = cleaned.replace(/[\u2600-\u27BF\u2B50\u2B06\u2194\u21AA\u2934\u203C\u2049\u3030\u303D\u3297\u3299]/g, '');
cleaned = cleaned.replace(/\[v\s*\d+\s*\]/gi, ''); cleaned = cleaned.replace(/\[v\s*\d+\s*\]/gi, '');
cleaned = cleaned.replace(/\s+/g, ' '); cleaned = cleaned.replace(/\s+/g, ' ');
return cleaned.trim(); return cleaned.trim();
} }

File diff suppressed because one or more lines are too long

View file

@ -5,10 +5,10 @@ import type { Plugin } from 'vite';
import mime from 'mime'; import mime from 'mime';
import { createHash } from 'crypto'; import { createHash } from 'crypto';
function hashString(input: string, algorithm = "sha256"): string { function hashString(input: string, algorithm = 'sha256'): string {
return createHash(algorithm) return createHash(algorithm)
.update(input, "utf8") // specify string encoding .update(input, 'utf8') // specify string encoding
.digest("hex"); // return as hex .digest('hex'); // return as hex
} }
/** /**