Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ade1b8f69c | |||
| 06914b3af4 | |||
| 95c52d8a11 |
@@ -1,3 +0,0 @@
|
|||||||
node_modules
|
|
||||||
Dockerfile
|
|
||||||
docker-compose.*
|
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 2
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
charset = utf-8
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es2021": true
|
||||||
|
},
|
||||||
|
"ignorePatterns": [
|
||||||
|
"node_modules/*",
|
||||||
|
"dist/*",
|
||||||
|
"electron/preload/*",
|
||||||
|
"vite.config.ts",
|
||||||
|
"post-install.js"
|
||||||
|
],
|
||||||
|
"extends": [
|
||||||
|
"plugin:react/recommended",
|
||||||
|
"plugin:react-hooks/recommended",
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:typescript-sort-keys/recommended",
|
||||||
|
"prettier"
|
||||||
|
],
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaFeatures": {
|
||||||
|
"jsx": true
|
||||||
|
},
|
||||||
|
"ecmaVersion": "latest",
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
"react",
|
||||||
|
"@typescript-eslint",
|
||||||
|
"import",
|
||||||
|
"sort-keys-fix",
|
||||||
|
"promise"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"react-hooks/exhaustive-deps": [
|
||||||
|
"warn",
|
||||||
|
{ "enableDangerousAutofixThisMayCauseInfiniteLoops": true }
|
||||||
|
],
|
||||||
|
"react/jsx-sort-props": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"callbacksLast": true,
|
||||||
|
"ignoreCase": false,
|
||||||
|
"noSortAlphabetically": false,
|
||||||
|
"reservedFirst": true,
|
||||||
|
"shorthandFirst": true,
|
||||||
|
"shorthandLast": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"import/order": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"groups": ["builtin", "external", "internal", ["parent", "sibling"]],
|
||||||
|
"pathGroups": [
|
||||||
|
{
|
||||||
|
"pattern": "react",
|
||||||
|
"group": "external",
|
||||||
|
"position": "before"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"pathGroupsExcludedImportTypes": ["react"],
|
||||||
|
"newlines-between": "never",
|
||||||
|
"alphabetize": {
|
||||||
|
"order": "asc",
|
||||||
|
"caseInsensitive": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sort-keys-fix/sort-keys-fix": "warn",
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
"consistent-return": "off",
|
||||||
|
"object-curly-newline": "off",
|
||||||
|
"indent": "off",
|
||||||
|
"no-tabs": "off",
|
||||||
|
"react/jsx-indent": "off",
|
||||||
|
"react/jsx-indent-props": "off",
|
||||||
|
"react/react-in-jsx-scope": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
* text eol=lf
|
|
||||||
*.exe binary
|
|
||||||
*.png binary
|
|
||||||
*.jpg binary
|
|
||||||
*.jpeg binary
|
|
||||||
*.ico binary
|
|
||||||
*.icns binary
|
|
||||||
*.webp binary
|
|
||||||
*.eot binary
|
|
||||||
*.otf binary
|
|
||||||
*.ttf binary
|
|
||||||
*.woff binary
|
|
||||||
*.woff2 binary
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
ko_fi: jeffvli
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
name: Feature request
|
|
||||||
description: Request a feature to be added to Feishin
|
|
||||||
title: '[Feature]: '
|
|
||||||
labels: ['enhancement']
|
|
||||||
body:
|
|
||||||
- type: checkboxes
|
|
||||||
id: check-duplicate
|
|
||||||
attributes:
|
|
||||||
label: I have already checked through the existing feature requests and found no duplicates
|
|
||||||
options:
|
|
||||||
- label: 'Yes'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: dropdown
|
|
||||||
id: server-specific
|
|
||||||
attributes:
|
|
||||||
label: Is this a server-specific feature?
|
|
||||||
options:
|
|
||||||
- Not server-specific
|
|
||||||
- OpenSubsonic
|
|
||||||
- Jellyfin
|
|
||||||
- Navidrome
|
|
||||||
default: 0
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: solution
|
|
||||||
attributes:
|
|
||||||
label: What do you want to be added?
|
|
||||||
placeholder: I would like to see [...]
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
name: Bug report
|
|
||||||
description: You're having technical issues.
|
|
||||||
title: '[Bug]: '
|
|
||||||
labels: ['bug']
|
|
||||||
body:
|
|
||||||
- type: checkboxes
|
|
||||||
id: check-duplicate
|
|
||||||
attributes:
|
|
||||||
label: I have already checked through the existing bug reports and found no duplicates
|
|
||||||
options:
|
|
||||||
- label: 'Yes'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
id: version
|
|
||||||
attributes:
|
|
||||||
label: App Version
|
|
||||||
description: What version of the app are you running?
|
|
||||||
placeholder: ex. 1.0.0
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
id: server-version
|
|
||||||
attributes:
|
|
||||||
label: Music Server and Version
|
|
||||||
description: What music server are you using?
|
|
||||||
placeholder: ex. Navidrome v0.55.0, LMS v3.67.0, Jellyfin v10.10.7, etc.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: dropdown
|
|
||||||
id: environments
|
|
||||||
attributes:
|
|
||||||
label: What local environments are you seeing the problem on?
|
|
||||||
multiple: true
|
|
||||||
options:
|
|
||||||
- Desktop Windows
|
|
||||||
- Desktop macOS
|
|
||||||
- Desktop Linux
|
|
||||||
- Web Firefox
|
|
||||||
- Web Chrome
|
|
||||||
- Web Safari
|
|
||||||
- Web Microsoft Edge
|
|
||||||
- Other (please specify in the next field)
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: what-happened
|
|
||||||
attributes:
|
|
||||||
label: What happened?
|
|
||||||
description: Also tell us, what did you expect to happen?
|
|
||||||
placeholder: Include screenshots and error logs if possible. The browser devtools can be opened using CTRL + SHIFT + I (Windows/Linux) or CMD + SHIFT + I (macOS).
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: reproduction
|
|
||||||
attributes:
|
|
||||||
label: Steps to reproduce
|
|
||||||
description: How can we reproduce this issue? Are there any specific settings that are enabled that could be the cause?
|
|
||||||
placeholder: |
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '....'
|
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: logs
|
|
||||||
attributes:
|
|
||||||
label: Relevant log output
|
|
||||||
description: Please copy and paste any relevant log output. This will be automatically formatted into code.
|
|
||||||
render: shell
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
blank_issues_enabled: false
|
|
||||||
contact_links:
|
|
||||||
- name: Questions or help
|
|
||||||
url: https://github.com/jeffvli/feishin/discussions
|
|
||||||
about: Ask questions or get help in the discussions section
|
|
||||||
- name: Discord Community
|
|
||||||
url: https://discord.gg/FVKpcMDy5f
|
|
||||||
about: The discord/matrix servers are bridged so you can join whichever you prefer
|
|
||||||
- name: Matrix Community
|
|
||||||
url: https://matrix.to/#/#sonixd:matrix.org
|
|
||||||
about: The discord/matrix servers are bridged so you can join whichever you prefer
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
requiredHeaders:
|
|
||||||
- Prerequisites
|
|
||||||
- Expected Behavior
|
|
||||||
- Current Behavior
|
|
||||||
- Possible Solution
|
|
||||||
- Your Environment
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
# Number of days of inactivity before an issue becomes stale
|
|
||||||
daysUntilStale: 60
|
|
||||||
# Number of days of inactivity before a stale issue is closed
|
|
||||||
daysUntilClose: 7
|
|
||||||
# Issues with these labels will never be considered stale
|
|
||||||
exemptLabels:
|
|
||||||
- discussion
|
|
||||||
- security
|
|
||||||
# Label to use when marking an issue as stale
|
|
||||||
staleLabel: wontfix
|
|
||||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
|
||||||
markComment: >
|
|
||||||
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
|
|
||||||
|
|
||||||
|
|
||||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
|
||||||
closeComment: false
|
|
||||||
@@ -1,189 +0,0 @@
|
|||||||
# Alpha builds published to Cloudflare R2 with date versioning (e.g. 1.0.0-alpha-20260205).
|
|
||||||
# Required repo secrets: R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY (from R2 API token in Cloudflare dashboard).
|
|
||||||
name: Publish Alpha
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: 'Semantic version number (e.g., 1.0.0) - alpha suffix will be added automatically'
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
schedule:
|
|
||||||
# Run at 3:00 AM PST daily (11:00 UTC; PST = UTC-8)
|
|
||||||
- cron: '0 11 * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check-new-commits:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
has_new_commits: ${{ steps.manual.outputs.has_new_commits || steps.check.outputs['has-new-commits'] }}
|
|
||||||
steps:
|
|
||||||
- name: Set has new commits (manual trigger)
|
|
||||||
id: manual
|
|
||||||
if: github.event_name == 'workflow_dispatch'
|
|
||||||
run: echo "has_new_commits=true" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Check for new commits (24 hr interval)
|
|
||||||
id: check
|
|
||||||
if: github.event_name != 'workflow_dispatch'
|
|
||||||
uses: adriangl/check-new-commits-action@v1
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
seconds: 86400
|
|
||||||
|
|
||||||
prepare:
|
|
||||||
needs: check-new-commits
|
|
||||||
if: needs.check-new-commits.outputs.has_new_commits == 'true'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
version: ${{ steps.version.outputs.version }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout git repo
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Install Node and PNPM
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Set date-based alpha version
|
|
||||||
id: version
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$inputVersion = "${{ github.event.inputs.version }}"
|
|
||||||
Write-Host "Input version: $inputVersion"
|
|
||||||
|
|
||||||
if ($inputVersion -eq "" -or $inputVersion -eq "null") {
|
|
||||||
# No input version provided (scheduled run or manual without input), auto-increment patch version
|
|
||||||
Write-Host "No version provided, auto-incrementing patch version..."
|
|
||||||
|
|
||||||
$currentVersion = (Get-Content package.json | ConvertFrom-Json).version
|
|
||||||
Write-Host "Current version: $currentVersion"
|
|
||||||
|
|
||||||
$cleanVersion = $currentVersion -replace '-.*$', ''
|
|
||||||
$versionParts = $cleanVersion.Split('.')
|
|
||||||
if ($versionParts.Length -ne 3) {
|
|
||||||
Write-Error "Current version format is invalid: $cleanVersion"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
$major = [int]$versionParts[0]
|
|
||||||
$minor = [int]$versionParts[1]
|
|
||||||
$patch = [int]$versionParts[2]
|
|
||||||
$newPatch = $patch + 1
|
|
||||||
$inputVersion = "$major.$minor.$newPatch"
|
|
||||||
Write-Host "Auto-generated version: $inputVersion"
|
|
||||||
} else {
|
|
||||||
# Validate semantic version format (major.minor.patch)
|
|
||||||
$versionPattern = '^\d+\.\d+\.\d+$'
|
|
||||||
if ($inputVersion -notmatch $versionPattern) {
|
|
||||||
Write-Error "Invalid version format. Expected semantic version (e.g., 1.0.0), got: $inputVersion"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Date in YYYYMMDD (PST / America/Los_Angeles)
|
|
||||||
$pst = [TimeZoneInfo]::FindSystemTimeZoneById('America/Los_Angeles')
|
|
||||||
$dateInPst = [TimeZoneInfo]::ConvertTimeFromUtc([DateTime]::UtcNow, $pst)
|
|
||||||
$dateStr = $dateInPst.ToString("yyyyMMdd")
|
|
||||||
$alphaVersion = "$inputVersion-alpha-$dateStr"
|
|
||||||
Write-Host "Alpha version: $alphaVersion"
|
|
||||||
|
|
||||||
# Update package.json
|
|
||||||
$packageJson = Get-Content package.json | ConvertFrom-Json
|
|
||||||
$packageJson.version = $alphaVersion
|
|
||||||
$packageJson | ConvertTo-Json -Depth 10 | Set-Content package.json
|
|
||||||
|
|
||||||
echo "version=$alphaVersion" >> $env:GITHUB_OUTPUT
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
needs: prepare
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
|
||||||
R2_ENDPOINT_URL: ${{ secrets.R2_ENDPOINT_URL }}
|
|
||||||
steps:
|
|
||||||
- name: Delete all objects in R2 bucket
|
|
||||||
run: |
|
|
||||||
aws s3 rm s3://feishin-nightly --recursive --endpoint-url $R2_ENDPOINT_URL
|
|
||||||
|
|
||||||
publish:
|
|
||||||
needs: [prepare, cleanup]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
env:
|
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [windows-latest, macos-26, ubuntu-latest]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout git repo
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Install Node and PNPM
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Set version from prepare job
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$version = "${{ needs.prepare.outputs.version }}"
|
|
||||||
Write-Host "Setting version: $version"
|
|
||||||
$packageJson = Get-Content package.json | ConvertFrom-Json
|
|
||||||
$packageJson.version = $version
|
|
||||||
$packageJson | ConvertTo-Json -Depth 10 | Set-Content package.json
|
|
||||||
|
|
||||||
- name: Build and Publish to R2 (Windows)
|
|
||||||
if: matrix.os == 'windows-latest'
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:win:alpha
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
|
|
||||||
- name: Build and Publish to R2 (macOS)
|
|
||||||
if: matrix.os == 'macos-26'
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:mac:alpha
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
|
|
||||||
- name: Build and Publish to R2 (Linux)
|
|
||||||
if: matrix.os == 'ubuntu-latest'
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:linux:alpha
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
|
|
||||||
- name: Build and Publish to R2 (Linux ARM64)
|
|
||||||
if: matrix.os == 'ubuntu-latest'
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:linux-arm64:alpha
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
@@ -1,381 +0,0 @@
|
|||||||
name: Publish Beta (Manual)
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: 'Semantic version number (e.g., 1.0.0) - beta suffix will be added automatically'
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
prepare:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
version: ${{ steps.version.outputs.version }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout git repo
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Install Node and PNPM
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Validate and set version with incrementing beta suffix
|
|
||||||
id: version
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
$inputVersion = "${{ github.event.inputs.version }}"
|
|
||||||
Write-Host "Input version: $inputVersion"
|
|
||||||
|
|
||||||
if ($inputVersion -eq "" -or $inputVersion -eq "null") {
|
|
||||||
# No input version provided, auto-increment patch version
|
|
||||||
Write-Host "No version provided, auto-incrementing patch version..."
|
|
||||||
|
|
||||||
# Get current version from package.json
|
|
||||||
$currentVersion = (Get-Content package.json | ConvertFrom-Json).version
|
|
||||||
Write-Host "Current version: $currentVersion"
|
|
||||||
|
|
||||||
# Remove any existing suffix (like -beta) to get clean semantic version
|
|
||||||
$cleanVersion = $currentVersion -replace '-.*$', ''
|
|
||||||
|
|
||||||
# Extract major, minor, patch components
|
|
||||||
$versionParts = $cleanVersion.Split('.')
|
|
||||||
if ($versionParts.Length -ne 3) {
|
|
||||||
Write-Error "Current version format is invalid: $cleanVersion"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
$major = [int]$versionParts[0]
|
|
||||||
$minor = [int]$versionParts[1]
|
|
||||||
$patch = [int]$versionParts[2]
|
|
||||||
|
|
||||||
# Increment patch version
|
|
||||||
$newPatch = $patch + 1
|
|
||||||
$inputVersion = "$major.$minor.$newPatch"
|
|
||||||
Write-Host "Auto-generated version: $inputVersion"
|
|
||||||
} else {
|
|
||||||
# Validate semantic version format (major.minor.patch)
|
|
||||||
$versionPattern = '^\d+\.\d+\.\d+$'
|
|
||||||
if ($inputVersion -notmatch $versionPattern) {
|
|
||||||
Write-Error "Invalid version format. Expected semantic version (e.g., 1.0.0), got: $inputVersion"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check for existing beta releases with the same base version
|
|
||||||
Write-Host "Checking for existing beta releases with base version: $inputVersion"
|
|
||||||
$existingReleases = gh release list --limit 100 --json tagName,isPrerelease | ConvertFrom-Json | Where-Object { $_.isPrerelease -eq $true }
|
|
||||||
|
|
||||||
$maxBetaNumber = 0
|
|
||||||
|
|
||||||
foreach ($release in $existingReleases) {
|
|
||||||
$tagName = $release.tagName
|
|
||||||
Write-Host "Checking tag: $tagName"
|
|
||||||
|
|
||||||
# Extract beta number from tag name (format: v1.0.0-beta.1)
|
|
||||||
if ($tagName -match "v$([regex]::Escape($inputVersion))-beta\.(\d+)$") {
|
|
||||||
$betaNumber = [int]$matches[1]
|
|
||||||
Write-Host "Found beta release with number: $betaNumber"
|
|
||||||
|
|
||||||
if ($betaNumber -gt $maxBetaNumber) {
|
|
||||||
$maxBetaNumber = $betaNumber
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Calculate next beta number
|
|
||||||
$nextBetaNumber = $maxBetaNumber + 1
|
|
||||||
Write-Host "Next beta number: $nextBetaNumber"
|
|
||||||
|
|
||||||
# Create beta suffix with incrementing number
|
|
||||||
$betaSuffix = "beta.$nextBetaNumber"
|
|
||||||
$versionWithBeta = "$inputVersion-$betaSuffix"
|
|
||||||
Write-Host "Setting version to: $versionWithBeta"
|
|
||||||
|
|
||||||
# Update package.json
|
|
||||||
$packageJson = Get-Content package.json | ConvertFrom-Json
|
|
||||||
$packageJson.version = $versionWithBeta
|
|
||||||
$packageJson | ConvertTo-Json -Depth 10 | Set-Content package.json
|
|
||||||
|
|
||||||
Write-Host "Updated package.json version to: $versionWithBeta"
|
|
||||||
|
|
||||||
# Set output for other jobs
|
|
||||||
echo "version=$versionWithBeta" >> $env:GITHUB_OUTPUT
|
|
||||||
|
|
||||||
publish:
|
|
||||||
needs: prepare
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [windows-latest, macos-26, ubuntu-latest]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout git repo
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Install Node and PNPM
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Set version from prepare job
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$versionWithBeta = "${{ needs.prepare.outputs.version }}"
|
|
||||||
Write-Host "Setting version from prepare job: $versionWithBeta"
|
|
||||||
|
|
||||||
# Update package.json with the version from prepare job
|
|
||||||
$packageJson = Get-Content package.json | ConvertFrom-Json
|
|
||||||
$packageJson.version = $versionWithBeta
|
|
||||||
$packageJson | ConvertTo-Json -Depth 10 | Set-Content package.json
|
|
||||||
|
|
||||||
Write-Host "Updated package.json version to: $versionWithBeta"
|
|
||||||
|
|
||||||
- name: Build and Publish releases (Windows)
|
|
||||||
if: matrix.os == 'windows-latest'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:win:beta
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
|
|
||||||
- name: Build and Publish releases (macOS)
|
|
||||||
if: matrix.os == 'macos-26'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:mac:beta
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
|
|
||||||
- name: Build and Publish releases (Linux)
|
|
||||||
if: matrix.os == 'ubuntu-latest'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:linux:beta
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
|
|
||||||
- name: Build and Publish releases (Linux ARM64)
|
|
||||||
if: matrix.os == 'ubuntu-latest'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:linux-arm64:beta
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
|
|
||||||
edit-release:
|
|
||||||
needs: [prepare, publish]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout git repo
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Edit release with commits and title
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
# Get the version from the prepare job
|
|
||||||
$versionWithBeta = "${{ needs.prepare.outputs.version }}"
|
|
||||||
$tagVersion = "v" + $versionWithBeta
|
|
||||||
Write-Host "Editing release for tag: $tagVersion"
|
|
||||||
|
|
||||||
# Check if release exists
|
|
||||||
$releaseExists = gh release view $tagVersion 2>$null
|
|
||||||
if ($LASTEXITCODE -eq 0) {
|
|
||||||
Write-Host "Found release with tag $tagVersion"
|
|
||||||
|
|
||||||
# Get current release notes
|
|
||||||
|
|
||||||
# Find the latest non-prerelease tag
|
|
||||||
Write-Host "Finding latest non-prerelease tag..."
|
|
||||||
$latestNonPrerelease = gh release list --limit 100 --json tagName,isPrerelease | ConvertFrom-Json | Where-Object { $_.isPrerelease -eq $false -and $_.tagName -ne $tagVersion } | Select-Object -First 1
|
|
||||||
|
|
||||||
if ($latestNonPrerelease) {
|
|
||||||
$latestTag = $latestNonPrerelease.tagName
|
|
||||||
Write-Host "Latest non-prerelease tag: $latestTag"
|
|
||||||
|
|
||||||
# Get commits between latest non-prerelease and current HEAD
|
|
||||||
Write-Host "Getting commits between $latestTag and HEAD..."
|
|
||||||
|
|
||||||
# Use proper git range syntax and handle PowerShell string interpolation
|
|
||||||
$gitRange = "$latestTag..HEAD"
|
|
||||||
Write-Host "Git range: $gitRange"
|
|
||||||
|
|
||||||
# Get commits using proper git command with datetime
|
|
||||||
$commits = git log --oneline --pretty=format:"%ad|%s|%h" --date=short $gitRange
|
|
||||||
|
|
||||||
# Check if commits exist
|
|
||||||
if ($commits -and $commits.Trim() -ne "") {
|
|
||||||
Write-Host "Found commits:"
|
|
||||||
Write-Host $commits
|
|
||||||
|
|
||||||
# Group commits by date
|
|
||||||
$groupedCommits = @{}
|
|
||||||
foreach ($line in $commits) {
|
|
||||||
if ($line.Trim() -ne "") {
|
|
||||||
$parts = $line.Split('|')
|
|
||||||
$date = $parts[0]
|
|
||||||
$message = $parts[1]
|
|
||||||
$hash = $parts[2]
|
|
||||||
|
|
||||||
if (-not $groupedCommits.ContainsKey($date)) {
|
|
||||||
$groupedCommits[$date] = @()
|
|
||||||
}
|
|
||||||
$groupedCommits[$date] += "- $message ($hash)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Build formatted release notes grouped by date
|
|
||||||
$commitNotes = "## Changes since $latestTag`n`n"
|
|
||||||
$sortedDates = $groupedCommits.Keys | Sort-Object -Descending
|
|
||||||
foreach ($date in $sortedDates) {
|
|
||||||
$commitNotes += "### $date`n"
|
|
||||||
foreach ($commit in $groupedCommits[$date]) {
|
|
||||||
$commitNotes += "$commit`n"
|
|
||||||
}
|
|
||||||
$commitNotes += "`n"
|
|
||||||
}
|
|
||||||
|
|
||||||
$releaseNotes = $commitNotes
|
|
||||||
} else {
|
|
||||||
Write-Host "No commits found between $latestTag and HEAD"
|
|
||||||
Write-Host "Trying alternative approach..."
|
|
||||||
|
|
||||||
# Alternative: get commits since the tag (not range) with datetime
|
|
||||||
$commits = git log --oneline --pretty=format:"%ad|%s|%h" --date=short $latestTag.. --not $latestTag
|
|
||||||
|
|
||||||
if ($commits -and $commits.Trim() -ne "") {
|
|
||||||
Write-Host "Found commits with alternative method:"
|
|
||||||
Write-Host $commits
|
|
||||||
|
|
||||||
# Group commits by date
|
|
||||||
$groupedCommits = @{}
|
|
||||||
foreach ($line in $commits) {
|
|
||||||
if ($line.Trim() -ne "") {
|
|
||||||
$parts = $line.Split('|')
|
|
||||||
$date = $parts[0]
|
|
||||||
$message = $parts[1]
|
|
||||||
$hash = $parts[2]
|
|
||||||
|
|
||||||
if (-not $groupedCommits.ContainsKey($date)) {
|
|
||||||
$groupedCommits[$date] = @()
|
|
||||||
}
|
|
||||||
$groupedCommits[$date] += "- $message ($hash)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Build formatted release notes grouped by date
|
|
||||||
$commitNotes = "## Changes since $latestTag`n`n"
|
|
||||||
$sortedDates = $groupedCommits.Keys | Sort-Object -Descending
|
|
||||||
foreach ($date in $sortedDates) {
|
|
||||||
$commitNotes += "### $date`n"
|
|
||||||
foreach ($commit in $groupedCommits[$date]) {
|
|
||||||
$commitNotes += "$commit`n"
|
|
||||||
}
|
|
||||||
$commitNotes += "`n"
|
|
||||||
}
|
|
||||||
|
|
||||||
$releaseNotes = $commitNotes
|
|
||||||
} else {
|
|
||||||
Write-Host "Still no commits found, using basic release notes"
|
|
||||||
$releaseNotes = "## Beta Release`n`nThis is a beta release."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Write-Host "No non-prerelease tags found, using basic release notes"
|
|
||||||
$releaseNotes = "## Beta Release`n`nThis is a beta release."
|
|
||||||
}
|
|
||||||
|
|
||||||
# Prepend beta update instructions to release notes
|
|
||||||
$betaInstructions = "To receive automatic beta updates, set the release channel to ``Beta`` under ``Advanced`` settings.`n`n"
|
|
||||||
$releaseNotes = $betaInstructions + $releaseNotes
|
|
||||||
|
|
||||||
# Update the release with new title and notes
|
|
||||||
Write-Host "Updating release with title 'Beta' and new notes..."
|
|
||||||
gh release edit $tagVersion --title "Beta" --notes "$releaseNotes"
|
|
||||||
Write-Host "Successfully updated release title to 'Beta' and added commit notes"
|
|
||||||
} else {
|
|
||||||
Write-Host "No release found with tag $tagVersion"
|
|
||||||
}
|
|
||||||
- name: Set release as prerelease
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
# Get the version from the prepare job
|
|
||||||
$versionWithBeta = "${{ needs.prepare.outputs.version }}"
|
|
||||||
$tagVersion = "v" + $versionWithBeta
|
|
||||||
Write-Host "Setting release as prerelease for tag: $tagVersion"
|
|
||||||
gh release edit $tagVersion --prerelease --draft=false
|
|
||||||
Write-Host "Successfully set release as prerelease"
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
needs: [prepare, publish, edit-release]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout git repo
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Delete existing prereleases
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
# Get the current version that was just created
|
|
||||||
$versionWithBeta = "${{ needs.prepare.outputs.version }}"
|
|
||||||
Write-Host "Current release version: $versionWithBeta"
|
|
||||||
|
|
||||||
# Find and delete any old prereleases (excluding the current one)
|
|
||||||
Write-Host "Deleting old prereleases..."
|
|
||||||
Write-Host "Searching for releases with isPrerelease 'true'..."
|
|
||||||
|
|
||||||
$betaReleases = gh release list --limit 100 --json tagName,isPrerelease,name | ConvertFrom-Json | Where-Object { $_.isPrerelease -eq $true }
|
|
||||||
|
|
||||||
if ($betaReleases) {
|
|
||||||
Write-Host "Found $($betaReleases.Count) release(s) with isPrerelease 'true':"
|
|
||||||
foreach ($release in $betaReleases) {
|
|
||||||
$tagName = $release.tagName
|
|
||||||
# Skip the current release
|
|
||||||
if ($tagName -ne "v$versionWithBeta") {
|
|
||||||
Write-Host " - Tag: $tagName, Title: $($release.name)"
|
|
||||||
gh release delete $tagName --yes --cleanup-tag
|
|
||||||
Write-Host " Deleted release with tag: $tagName"
|
|
||||||
} else {
|
|
||||||
Write-Host " - Skipping current release: $tagName"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Write-Host "No releases found with isPrerelease 'true'"
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
# Referenced from: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#introduction
|
|
||||||
name: Publish Docker to GHCR
|
|
||||||
permissions: write-all
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'v*.*.*'
|
|
||||||
|
|
||||||
env:
|
|
||||||
REGISTRY: ghcr.io
|
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-push-image:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
- name: Log in to the Container registry
|
|
||||||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
|
||||||
with:
|
|
||||||
registry: ${{ env.REGISTRY }}
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
|
||||||
with:
|
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=ref,event=pr
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
type=semver,pattern={{major}}
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Setup Docker buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
platforms: |
|
|
||||||
linux/amd64
|
|
||||||
linux/arm64/v8
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
# Referenced from: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#introduction
|
|
||||||
name: Publish Docker to GHCR (Manual)
|
|
||||||
|
|
||||||
on: workflow_dispatch
|
|
||||||
|
|
||||||
env:
|
|
||||||
REGISTRY: ghcr.io
|
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-push-image:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
- name: Log in to the Container registry
|
|
||||||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
|
||||||
with:
|
|
||||||
registry: ${{ env.REGISTRY }}
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Setup Docker buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
platforms: |
|
|
||||||
linux/amd64
|
|
||||||
linux/arm/v7
|
|
||||||
linux/arm64/v8
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
name: Publish Linux (Manual)
|
|
||||||
|
|
||||||
on: workflow_dispatch
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout git repo
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Install Node and PNPM
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Build and Publish releases
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:linux
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
|
|
||||||
- name: Build and Publish releases (arm64)
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:linux-arm64
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
name: Publish macOS (Manual)
|
|
||||||
|
|
||||||
on: workflow_dispatch
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [macos-26]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout git repo
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Install Node and PNPM
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Build and Publish releases
|
|
||||||
env:
|
|
||||||
NODE_OPTIONS: --max-old-space-size=4096
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:mac
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
name: Comment on pull request
|
|
||||||
on:
|
|
||||||
workflow_run:
|
|
||||||
workflows: ['Publish (PR)']
|
|
||||||
types: [completed]
|
|
||||||
jobs:
|
|
||||||
pr_comment:
|
|
||||||
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/github-script@v6
|
|
||||||
with:
|
|
||||||
# This snippet is public-domain, taken from
|
|
||||||
# https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml
|
|
||||||
script: |
|
|
||||||
async function upsertComment(owner, repo, issue_number, purpose, body) {
|
|
||||||
const {data: comments} = await github.rest.issues.listComments(
|
|
||||||
{owner, repo, issue_number});
|
|
||||||
const marker = `<!-- bot: ${purpose} -->`;
|
|
||||||
body = marker + "\n" + body;
|
|
||||||
const existing = comments.filter((c) => c.body.includes(marker));
|
|
||||||
if (existing.length > 0) {
|
|
||||||
const last = existing[existing.length - 1];
|
|
||||||
core.info(`Updating comment ${last.id}`);
|
|
||||||
await github.rest.issues.updateComment({
|
|
||||||
owner, repo,
|
|
||||||
body,
|
|
||||||
comment_id: last.id,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
core.info(`Creating a comment in issue / PR #${issue_number}`);
|
|
||||||
await github.rest.issues.createComment({issue_number, body, owner, repo});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const {owner, repo} = context.repo;
|
|
||||||
const run_id = ${{github.event.workflow_run.id}};
|
|
||||||
const pull_requests = ${{ toJSON(github.event.workflow_run.pull_requests) }};
|
|
||||||
if (!pull_requests.length) {
|
|
||||||
return core.error("This workflow doesn't match any pull requests!");
|
|
||||||
}
|
|
||||||
const artifacts = await github.paginate(
|
|
||||||
github.rest.actions.listWorkflowRunArtifacts, {owner, repo, run_id});
|
|
||||||
if (!artifacts.length) {
|
|
||||||
return core.error(`No artifacts found`);
|
|
||||||
}
|
|
||||||
let body = `Download the artifacts for this pull request:\n`;
|
|
||||||
for (const art of artifacts) {
|
|
||||||
body += `\n* [${art.name}.zip](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
|
|
||||||
}
|
|
||||||
core.info("Review thread message body:", body);
|
|
||||||
for (const pr of pull_requests) {
|
|
||||||
await upsertComment(owner, repo, pr.number,
|
|
||||||
"nightly-link", body);
|
|
||||||
}
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
name: Publish (PR)
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- development
|
|
||||||
paths:
|
|
||||||
- 'src/**'
|
|
||||||
- 'electron-builder*.yml'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
wait-for-lint:
|
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Wait for Test workflow to complete
|
|
||||||
uses: lewagon/wait-on-check-action@v1.4.1
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
check-name: 'lint'
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
wait-interval: 10
|
|
||||||
allowed-conclusions: success
|
|
||||||
|
|
||||||
publish:
|
|
||||||
needs: wait-for-lint
|
|
||||||
if: always() && (needs.wait-for-lint.result == 'success' || needs.wait-for-lint.result == 'skipped')
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [macos-26, ubuntu-latest, windows-latest]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout git repo
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Install Node and PNPM
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Build for Windows
|
|
||||||
if: ${{ matrix.os == 'windows-latest' }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run package:win:pr
|
|
||||||
|
|
||||||
- name: Build for Linux
|
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run package:linux:pr
|
|
||||||
|
|
||||||
- name: Build for MacOS
|
|
||||||
if: ${{ matrix.os == 'macos-26' }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run package:mac:pr
|
|
||||||
|
|
||||||
- name: Zip Windows Binaries
|
|
||||||
if: ${{ matrix.os == 'windows-latest' }}
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
Compress-Archive -Path "dist/*.exe" -DestinationPath "dist/windows-binaries.zip" -Force
|
|
||||||
|
|
||||||
- name: Zip Linux Binaries
|
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
||||||
run: |
|
|
||||||
zip -r dist/linux-binaries.zip dist/*.{AppImage,deb,rpm}
|
|
||||||
|
|
||||||
- name: Zip MacOS Binaries
|
|
||||||
if: ${{ matrix.os == 'macos-26' }}
|
|
||||||
run: |
|
|
||||||
zip -r dist/macos-binaries.zip dist/*.dmg
|
|
||||||
|
|
||||||
- name: Upload Windows Binaries
|
|
||||||
if: ${{ matrix.os == 'windows-latest' }}
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: windows-binaries
|
|
||||||
path: dist/windows-binaries.zip
|
|
||||||
|
|
||||||
- name: Upload Linux Binaries
|
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: linux-binaries
|
|
||||||
path: dist/linux-binaries.zip
|
|
||||||
|
|
||||||
- name: Upload MacOS Binaries
|
|
||||||
if: ${{ matrix.os == 'macos-26' }}
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: macos-binaries
|
|
||||||
path: dist/macos-binaries.zip
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
name: Publish Windows (Manual)
|
|
||||||
|
|
||||||
on: workflow_dispatch
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [windows-latest]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout git repo
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Install Node and PNPM
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Build and Publish releases
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:win
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
name: Publish release to WinGet
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [released]
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
tag_name:
|
|
||||||
description: "Specific tag name"
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- uses: vedantmgoyal9/winget-releaser@main
|
|
||||||
with:
|
|
||||||
identifier: jeffvli.Feishin
|
|
||||||
installers-regex: 'Feishin-*-win-(x64|arm64)\.exe'
|
|
||||||
token: ${{ secrets.WINGET_ACC_TOKEN }}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
name: Publish (Manual)
|
|
||||||
|
|
||||||
on: workflow_dispatch
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [windows-latest, macos-26, ubuntu-latest]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout git repo
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Install Node and PNPM
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Build and Publish releases (Windows)
|
|
||||||
if: matrix.os == 'windows-latest'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:win
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
|
|
||||||
- name: Build and Publish releases (macOS)
|
|
||||||
if: matrix.os == 'macos-26'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:mac
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
|
|
||||||
- name: Build and Publish releases (Linux)
|
|
||||||
if: matrix.os == 'ubuntu-latest'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:linux
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
|
|
||||||
- name: Build and Publish releases (Linux ARM64)
|
|
||||||
if: matrix.os == 'ubuntu-latest'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: nick-invision/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 3
|
|
||||||
retry_on: error
|
|
||||||
command: |
|
|
||||||
pnpm run publish:linux-arm64
|
|
||||||
on_retry_command: pnpm cache delete
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
name: 'Close stale issues and PRs'
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '30 1 * * *'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
jobs:
|
|
||||||
stale:
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
pull-requests: write
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: dessant/lock-threads@v5
|
|
||||||
with:
|
|
||||||
process-only: 'issues, prs'
|
|
||||||
issue-inactive-days: 120
|
|
||||||
pr-inactive-days: 120
|
|
||||||
log-output: true
|
|
||||||
add-issue-labels: 'frozen-due-to-age'
|
|
||||||
add-pr-labels: 'frozen-due-to-age'
|
|
||||||
- uses: actions/stale@v9
|
|
||||||
with:
|
|
||||||
operations-per-run: 999
|
|
||||||
days-before-issue-stale: 180
|
|
||||||
days-before-pr-stale: 180
|
|
||||||
days-before-issue-close: 30
|
|
||||||
days-before-pr-close: 30
|
|
||||||
stale-issue-message: >
|
|
||||||
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Feishin team are limited, and so we are asking for your help.
|
|
||||||
|
|
||||||
If this is a **bug** and you can still reproduce this error on the <code>development</code> branch, please reply with all of the information you have about it in order to keep the issue open.
|
|
||||||
|
|
||||||
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.
|
|
||||||
|
|
||||||
|
|
||||||
stale-pr-message: >
|
|
||||||
This PR has been automatically marked as stale because it has not had recent activity. The resources of the Feishin team are limited, and so we are asking for your help.
|
|
||||||
|
|
||||||
This PR will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.
|
|
||||||
|
|
||||||
|
|
||||||
stale-issue-label: 'stale'
|
|
||||||
exempt-issue-labels: 'keep,security'
|
|
||||||
stale-pr-label: 'stale'
|
|
||||||
exempt-pr-labels: 'keep,security'
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
name: Test
|
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Check out Git repository
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Install Node.js and PNPM
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Lint Files
|
|
||||||
run: pnpm run lint
|
|
||||||
@@ -1,7 +1,29 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
out
|
dist-ssr
|
||||||
|
*.local
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.eslintcache
|
*.suo
|
||||||
*.log*
|
*.ntvs*
|
||||||
release
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
|
|
||||||
|
release/app/dist
|
||||||
|
release/build
|
||||||
|
.vscode/.debug.env
|
||||||
|
./package-lock.json
|
||||||
|
pnpm-lock.yaml
|
||||||
|
yarn.lock
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
out
|
|
||||||
dist
|
|
||||||
pnpm-lock.yaml
|
|
||||||
LICENSE.md
|
|
||||||
tsconfig.json
|
|
||||||
tsconfig.*.json
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 120,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false,
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "es5",
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"jsxBracketSameLine": false,
|
||||||
|
"arrowParens": "always",
|
||||||
|
"proseWrap": "preserve"
|
||||||
|
}
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
singleQuote: true
|
|
||||||
semi: true
|
|
||||||
printWidth: 100
|
|
||||||
tabWidth: 4
|
|
||||||
trailingComma: all
|
|
||||||
useTabs: false
|
|
||||||
arrowParens: always
|
|
||||||
proseWrap: never
|
|
||||||
htmlWhitespaceSensitivity: strict
|
|
||||||
endOfLine: lf
|
|
||||||
singleAttributePerLine: false
|
|
||||||
bracketSpacing: true
|
|
||||||
plugins:
|
|
||||||
- prettier-plugin-packagejson
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": [
|
|
||||||
"stylelint-config-standard",
|
|
||||||
"stylelint-config-css-modules",
|
|
||||||
"stylelint-config-recess-order"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"block-no-empty": null,
|
|
||||||
"selector-type-case": ["lower", { "ignoreTypes": ["/^\\$\\w+/"] }],
|
|
||||||
"selector-type-no-unknown": [true, { "ignoreTypes": ["/-styled-mixin/", "/^\\$\\w+/"] }],
|
|
||||||
"declaration-block-no-shorthand-property-overrides": null,
|
|
||||||
"declaration-block-no-redundant-longhand-properties": null,
|
|
||||||
"at-rule-no-unknown": [true, { "ignoreAtRules": ["mixin", "value"] }],
|
|
||||||
"function-no-unknown": [true, { "ignoreFunctions": ["darken", "alpha", "lighten"] }],
|
|
||||||
"declaration-property-value-no-unknown": null,
|
|
||||||
"no-descending-specificity": null,
|
|
||||||
"no-empty-source": null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import fs from 'fs'
|
||||||
|
import path from 'path'
|
||||||
|
import { fileURLToPath } from 'url'
|
||||||
|
import { createRequire } from 'module'
|
||||||
|
import { spawn } from 'child_process'
|
||||||
|
|
||||||
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||||
|
const require = createRequire(import.meta.url)
|
||||||
|
const pkg = require('../package.json')
|
||||||
|
|
||||||
|
// write .debug.env
|
||||||
|
const envContent = Object.entries(pkg.debug.env).map(([key, val]) => `${key}=${val}`)
|
||||||
|
fs.writeFileSync(path.join(__dirname, '.debug.env'), envContent.join('\n'))
|
||||||
|
|
||||||
|
// bootstrap
|
||||||
|
spawn(
|
||||||
|
// TODO: terminate `npm run dev` when Debug exits.
|
||||||
|
process.platform === 'win32' ? 'npm.cmd' : 'npm',
|
||||||
|
['run', 'dev'],
|
||||||
|
{
|
||||||
|
stdio: 'inherit',
|
||||||
|
env: Object.assign(process.env, { VSCODE_DEBUG: 'true' }),
|
||||||
|
},
|
||||||
|
)
|
||||||
@@ -1,3 +1,10 @@
|
|||||||
{
|
{
|
||||||
"recommendations": ["dbaeumer.vscode-eslint"]
|
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||||
|
// for the documentation about the extensions.json format
|
||||||
|
"recommendations": [
|
||||||
|
"editorconfig.editorconfig",
|
||||||
|
"mrmlnc.vscode-json5",
|
||||||
|
"rbbit.typescript-hero",
|
||||||
|
"syler.sass-indented",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +1,47 @@
|
|||||||
{
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
|
"compounds": [
|
||||||
|
{
|
||||||
|
"name": "Debug App",
|
||||||
|
"preLaunchTask": "start .debug.script.mjs",
|
||||||
|
"configurations": [
|
||||||
|
"Debug Main Process",
|
||||||
|
"Debug Renderer Process"
|
||||||
|
],
|
||||||
|
"presentation": {
|
||||||
|
"hidden": false,
|
||||||
|
"group": "",
|
||||||
|
"order": 1
|
||||||
|
},
|
||||||
|
"stopAll": true
|
||||||
|
}
|
||||||
|
],
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "Debug Main Process",
|
"name": "Debug Main Process",
|
||||||
"type": "node",
|
"type": "pwa-node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"cwd": "${workspaceRoot}",
|
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
|
||||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite",
|
|
||||||
"windows": {
|
"windows": {
|
||||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite.cmd"
|
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
|
||||||
},
|
},
|
||||||
"runtimeArgs": ["--sourcemap"],
|
"runtimeArgs": [
|
||||||
"env": {
|
"--no-sandbox",
|
||||||
"REMOTE_DEBUGGING_PORT": "9222"
|
"--remote-debugging-port=9229",
|
||||||
}
|
"."
|
||||||
|
],
|
||||||
|
"envFile": "${workspaceFolder}/.vscode/.debug.env",
|
||||||
|
"console": "integratedTerminal"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Debug Renderer Process",
|
"name": "Debug Renderer Process",
|
||||||
"port": 9222,
|
"port": 9229,
|
||||||
"request": "attach",
|
"request": "attach",
|
||||||
"type": "chrome",
|
"type": "pwa-chrome",
|
||||||
"webRoot": "${workspaceFolder}/src/renderer",
|
"timeout": 60000
|
||||||
"timeout": 60000,
|
},
|
||||||
"presentation": {
|
|
||||||
"hidden": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"compounds": [
|
|
||||||
{
|
|
||||||
"name": "Debug All",
|
|
||||||
"configurations": ["Debug Main Process", "Debug Renderer Process"],
|
|
||||||
"presentation": {
|
|
||||||
"order": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,84 +0,0 @@
|
|||||||
{
|
|
||||||
"[typescript]": {
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
||||||
},
|
|
||||||
"[javascript]": {
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
||||||
},
|
|
||||||
"[json]": {
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
||||||
},
|
|
||||||
"files.associations": {
|
|
||||||
".eslintrc": "jsonc",
|
|
||||||
".prettierrc": "jsonc",
|
|
||||||
".eslintignore": "ignore"
|
|
||||||
},
|
|
||||||
"eslint.validate": ["typescript", "typescriptreact"],
|
|
||||||
"eslint.workingDirectories": [{ "directory": "./", "changeProcessCWD": true }],
|
|
||||||
"typescript.tsserver.experimental.enableProjectDiagnostics": false,
|
|
||||||
"editor.codeActionsOnSave": {
|
|
||||||
"source.fixAll.eslint": "explicit",
|
|
||||||
"source.fixAll.stylelint": "explicit",
|
|
||||||
"source.organizeImports": "never",
|
|
||||||
"source.formatDocument": "explicit"
|
|
||||||
},
|
|
||||||
"css.validate": true,
|
|
||||||
"javascript.validate.enable": false,
|
|
||||||
"javascript.format.enable": false,
|
|
||||||
"typescript.format.enable": false,
|
|
||||||
"search.exclude": {
|
|
||||||
".git": true,
|
|
||||||
".eslintcache": true,
|
|
||||||
".erb/dll": true,
|
|
||||||
"release/{build,app/dist}": true,
|
|
||||||
"node_modules": true,
|
|
||||||
"npm-debug.log.*": true,
|
|
||||||
"test/**/__snapshots__": true,
|
|
||||||
"package-lock.json": true,
|
|
||||||
"*.{css,sass,scss}.d.ts": true,
|
|
||||||
"out/**/*": true,
|
|
||||||
"dist/**/*": true
|
|
||||||
},
|
|
||||||
"i18n-ally.localesPaths": ["src/i18n", "src/i18n/locales"],
|
|
||||||
"typescript.tsdk": "node_modules/typescript/lib",
|
|
||||||
"typescript.preferences.importModuleSpecifier": "non-relative",
|
|
||||||
"stylelint.config": null,
|
|
||||||
"stylelint.validate": ["css", "postcss"],
|
|
||||||
"typescript.updateImportsOnFileMove.enabled": "always",
|
|
||||||
"typescript.preferences.autoImportFileExcludePatterns": [
|
|
||||||
"@mantine/core",
|
|
||||||
"@mantine/modals",
|
|
||||||
"@mantine/dates",
|
|
||||||
"@mantine/hooks",
|
|
||||||
"@mantine/form",
|
|
||||||
"@radix-ui/react-context-menu"
|
|
||||||
],
|
|
||||||
"[typescriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
|
|
||||||
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": true,
|
|
||||||
"folderTemplates.structures": [
|
|
||||||
{
|
|
||||||
"name": "TypeScript Feature Component With CSS Modules",
|
|
||||||
"omitParentDirectory": true,
|
|
||||||
"structure": [
|
|
||||||
{
|
|
||||||
"fileName": "<FTName | kebabcase>.tsx",
|
|
||||||
"template": "Functional Component with CSS Modules"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fileName": "<FTName | kebabcase>.module.css"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"folderTemplates.fileTemplates": {
|
|
||||||
"Functional Component with CSS Modules": [
|
|
||||||
"import styles from './<FTName | kebabcase>.module.css';",
|
|
||||||
"",
|
|
||||||
"interface <FTName | pascalcase>Props {}",
|
|
||||||
"",
|
|
||||||
"export const <FTName | pascalcase> = ({}: <FTName | pascalcase>Props) => {",
|
|
||||||
" return <div></div>;",
|
|
||||||
"};"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "start .debug.script.mjs",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "node .vscode/.debug.script.mjs",
|
||||||
|
"isBackground": true,
|
||||||
|
"problemMatcher": {
|
||||||
|
"owner": "typescript",
|
||||||
|
"fileLocation": "relative",
|
||||||
|
"pattern": {
|
||||||
|
// TODO: correct "regexp"
|
||||||
|
"regexp": "^([a-zA-Z]\\:\/?([\\w\\-]\/?)+\\.\\w+):(\\d+):(\\d+): (ERROR|WARNING)\\: (.*)$",
|
||||||
|
"file": 1,
|
||||||
|
"line": 3,
|
||||||
|
"column": 4,
|
||||||
|
"code": 5,
|
||||||
|
"message": 6
|
||||||
|
},
|
||||||
|
"background": {
|
||||||
|
"activeOnStart": true,
|
||||||
|
"endsPattern": "^.*[startup] Electron App.*$",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://code.visualstudio.com/docs/editor/tasks#_operating-system-specific-properties
|
||||||
|
// https://code.visualstudio.com/docs/editor/tasks#_background-watching-tasks
|
||||||
|
// https://code.visualstudio.com/docs/editor/tasks#_can-a-background-task-be-used-as-a-prelaunchtask-in-launchjson
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# Changelog
|
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
# --- Builder stage
|
|
||||||
FROM node:23-alpine AS builder
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Copy package.json first to cache node_modules
|
|
||||||
COPY package.json pnpm-lock.yaml .
|
|
||||||
|
|
||||||
RUN npm install -g pnpm
|
|
||||||
|
|
||||||
RUN pnpm install
|
|
||||||
|
|
||||||
# Copy code and build with cached modules
|
|
||||||
COPY . .
|
|
||||||
RUN pnpm run build:web
|
|
||||||
|
|
||||||
# --- Production stage
|
|
||||||
FROM nginxinc/nginx-unprivileged:alpine-slim
|
|
||||||
|
|
||||||
COPY --chown=nginx:nginx --from=builder /app/out/web /usr/share/nginx/html
|
|
||||||
COPY --chown=nginx:nginx ./settings.js.template /etc/nginx/templates/settings.js.template
|
|
||||||
COPY --chown=nginx:nginx ng.conf.template /etc/nginx/templates/default.conf.template
|
|
||||||
|
|
||||||
ENV SERVER_LOCK=false SERVER_NAME="" SERVER_TYPE="" SERVER_URL="" REMOTE_URL=""
|
|
||||||
ENV LEGACY_AUTHENTICATION="" ANALYTICS_DISABLED="" PUBLIC_PATH="/"
|
|
||||||
|
|
||||||
EXPOSE 9180
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
@@ -1,226 +1,15 @@
|
|||||||
<img src="assets/icons/icon.png" alt="logo" title="feishin" align="right" height="60px" width="60px" />
|
# Sonixd (rewrite)
|
||||||
|
|
||||||
# Feishin
|
Repository for the rewrite of [Sonixd](https://github.com/jeffvli/sonixd).
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<a href="https://github.com/jeffvli/feishin/blob/main/LICENSE">
|
|
||||||
<img src="https://img.shields.io/github/license/jeffvli/feishin?style=flat-square&color=brightgreen"
|
|
||||||
alt="License">
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/jeffvli/feishin/releases">
|
|
||||||
<img src="https://img.shields.io/github/v/release/jeffvli/feishin?style=flat-square&color=blue"
|
|
||||||
alt="Release">
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/jeffvli/feishin/releases">
|
|
||||||
<img src="https://img.shields.io/github/downloads/jeffvli/feishin/total?style=flat-square&color=orange"
|
|
||||||
alt="Downloads">
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
<p align="center">
|
|
||||||
<a href="https://discord.gg/FVKpcMDy5f">
|
|
||||||
<img src="https://img.shields.io/discord/922656312888811530?color=black&label=discord&logo=discord&logoColor=white"
|
|
||||||
alt="Discord">
|
|
||||||
</a>
|
|
||||||
<a href="https://matrix.to/#/#sonixd:matrix.org">
|
|
||||||
<img src="https://img.shields.io/matrix/sonixd:matrix.org?color=black&label=matrix&logo=matrix&logoColor=white"
|
|
||||||
alt="Matrix">
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Rewrite of [Sonixd](https://github.com/jeffvli/sonixd).
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- [x] MPV player backend
|
|
||||||
- [x] Web player backend
|
|
||||||
- [x] Modern UI
|
|
||||||
- [x] Scrobble playback to your server
|
|
||||||
- [x] Smart playlist editor (Navidrome)
|
|
||||||
- [x] Synchronized and unsynchronized lyrics support
|
|
||||||
- [ ] [Request a feature](https://github.com/jeffvli/feishin/issues) or [view taskboard](https://github.com/users/jeffvli/projects/5/views/1)
|
|
||||||
|
|
||||||
## Screenshots
|
|
||||||
|
|
||||||
<a href="./media/preview_full_screen_player.png"><img src="./media/preview_full_screen_player.png" width="49.5%"/></a> <a href="./media/preview_album_artist_detail.png"><img src="./media/preview_album_artist_detail.png" width="49.5%"/></a> <a href="./media/preview_album_detail.png"><img src="./media/preview_album_detail.png" width="49.5%"/></a> <a href="./media/preview_smart_playlist.png"><img src="./media/preview_smart_playlist.png" width="49.5%"/></a>
|
|
||||||
|
|
||||||
## Getting Started
|
|
||||||
|
|
||||||
### Desktop (recommended)
|
|
||||||
|
|
||||||
Download the [latest desktop client](https://github.com/jeffvli/feishin/releases). The desktop client is the recommended way to use Feishin. It supports both the MPV and web player backends, as well as includes built-in fetching for lyrics.
|
|
||||||
|
|
||||||
#### macOS Notes
|
|
||||||
|
|
||||||
If you're using a device running macOS 12 (Monterey) or higher, [check here](https://github.com/jeffvli/feishin/issues/104#issuecomment-1553914730) for instructions on how to remove the app from quarantine.
|
|
||||||
|
|
||||||
For media keys to work, you will be prompted to allow Feishin to be a Trusted Accessibility Client. After allowing, you will need to restart Feishin for the privacy settings to take effect.
|
|
||||||
|
|
||||||
#### Linux Notes
|
|
||||||
|
|
||||||
Feishin is available in [Flathub](https://flathub.org/en/apps/org.jeffvli.feishin).
|
|
||||||
|
|
||||||
Alternatively, you can install it as an Appimage.
|
|
||||||
We provide a small install script to download the latest `.AppImage`, make it executable, and also download the icons required by Desktop Environments.
|
|
||||||
Finally, it generates a `.desktop` file to add Feishin to your Application Launcher.
|
|
||||||
|
|
||||||
Simply run the installer like this:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
dir=/your/application/directory
|
|
||||||
curl 'https://raw.githubusercontent.com/jeffvli/feishin/refs/heads/development/install-feishin-appimage' | sh -s -- "$dir"
|
|
||||||
```
|
|
||||||
|
|
||||||
The script also has an option to add launch arguments to run Feishin in native Wayland mode. Note that this is experimental in Electron and therefore not officially supported. If you want to use it, run this instead:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
dir=/your/application/directory
|
|
||||||
curl 'https://raw.githubusercontent.com/jeffvli/feishin/refs/heads/development/install-feishin-appimage' | sh -s -- "$dir" wayland-native
|
|
||||||
```
|
|
||||||
|
|
||||||
It also provides a simple uninstall routine, removing the downloaded files:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
dir=/your/application/directory
|
|
||||||
curl 'https://raw.githubusercontent.com/jeffvli/feishin/refs/heads/development/install-feishin-appimage' | sh -s -- "$dir" remove
|
|
||||||
```
|
|
||||||
|
|
||||||
The entry should show up in your Application Launcher immediately. If it does not, simply log out, wait 10 seconds, and log back in. Your Desktop Environment may alternatively provide a way to reload entries.
|
|
||||||
|
|
||||||
### Web and Docker
|
|
||||||
|
|
||||||
Visit [https://feishin.vercel.app](https://feishin.vercel.app) to use the hosted web version of Feishin. The web client only supports the web player backend.
|
|
||||||
|
|
||||||
Feishin is also available as a Docker image. The images are hosted via `ghcr.io` and are available to view [here](https://github.com/jeffvli/feishin/pkgs/container/feishin). You can run the container using the following commands:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Run the latest version
|
|
||||||
docker run --name feishin -p 9180:9180 ghcr.io/jeffvli/feishin:latest
|
|
||||||
|
|
||||||
# Build the image locally
|
|
||||||
docker build -t feishin .
|
|
||||||
docker run --name feishin -p 9180:9180 feishin
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Docker Compose
|
|
||||||
|
|
||||||
To install via Docker Compose, use the following snippet. This also works on Portainer.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
services:
|
|
||||||
feishin:
|
|
||||||
container_name: feishin
|
|
||||||
image: 'ghcr.io/jeffvli/feishin:latest'
|
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
|
||||||
- SERVER_NAME=jellyfin # pre-defined server name
|
|
||||||
- SERVER_LOCK=true # When true AND name/type/url are set, only username/password can be toggled
|
|
||||||
- SERVER_TYPE=jellyfin # the allowed types are: jellyfin, navidrome, subsonic. These values are case insensitive
|
|
||||||
- SERVER_URL= # http://address:port or https://address:port
|
|
||||||
- REMOTE_URL= # http://address or https://address
|
|
||||||
- LEGACY_AUTHENTICATION=false # When SERVER_LOCK is true, sets the legacy (plaintext) authentication flag for Subsonic/OpenSubsonic servers
|
|
||||||
- ANALYTICS_DISABLED=true # Set to true to disable Umami analytics tracking
|
|
||||||
ports:
|
|
||||||
- 9180:9180
|
|
||||||
# Alternatively, to restrict to only localhost, - 127.0.0.1:9180:8190
|
|
||||||
```
|
|
||||||
|
|
||||||
### Configuration
|
|
||||||
|
|
||||||
1. Upon startup you will be greeted with a prompt to select the path to your MPV binary. If you do not have MPV installed, you can download it [here](https://mpv.io/installation/) or install it using any package manager supported by your OS. After inputting the path, restart the app.
|
|
||||||
|
|
||||||
2. After restarting the app, you will be prompted to select a server. Click the `Open menu` button and select `Manage servers`. Click the `Add server` button in the popup and fill out all applicable details. You will need to enter the full URL to your server, including the protocol and port if applicable (e.g. `https://navidrome.my-server.com` or `http://192.168.0.1:4533`).
|
|
||||||
|
|
||||||
- **Navidrome** - For the best experience, select "Save password" when creating the server and configure the `SessionTimeout` setting in your Navidrome config to a larger value (e.g. 72h).
|
|
||||||
- **Linux users** - The default password store uses `libsecret`. `kwallet4/5/6` are also supported, but must be explicitly set in Settings > Window > Passwords/secret store.
|
|
||||||
|
|
||||||
3. _Optional_ - If you want to host Feishin on a subpath (not `/`), then pass in the following environment variable: `PUBLIC_PATH=PATH`. For example, to host on `/feishin`, pass in `PUBLIC_PATH=/feishin`.
|
|
||||||
|
|
||||||
4. _Optional_ - To hard code the server url, pass the following environment variables: `SERVER_NAME`, `SERVER_TYPE` (one of `jellyfin` or `navidrome` or `subsonic`), `SERVER_URL`. To prevent users from changing these settings, pass `SERVER_LOCK=true`. This can only be set if all three of the previous values are set. When `SERVER_LOCK=true`, you can also set `LEGACY_AUTHENTICATION=true` or `LEGACY_AUTHENTICATION=false` to configure the legacy authentication flag for the server (only applicable for Subsonic/OpenSubsonic servers).
|
|
||||||
|
|
||||||
5. _Optional_ - If your server uses a separate public-facing URL than what integrating applications use internally to communicate with your server, such as a separate Navidrome `ShareURL`, set `REMOTE_URL` to said public-facing URL.
|
|
||||||
|
|
||||||
6. _Optional_ - To disable Umami analytics tracking in the Docker/web version, set the environment variable `ANALYTICS_DISABLED=true`. When enabled, the analytics script will not be loaded and all tracking will be disabled.
|
|
||||||
|
|
||||||
7. _Optional_ - App settings (theme, language, sidebar options, etc.) can be overridden with environment variables on first run. The variables use the `FS_` prefix (e.g. `FS_GENERAL_THEME=defaultDark`, `FS_GENERAL_LANGUAGE=de`). See [the settings environment variable documentation](docs/ENV_SETTINGS.md) for the full list.
|
|
||||||
|
|
||||||
## FAQ
|
|
||||||
|
|
||||||
### MPV is either not working or is rapidly switching between pause/play states
|
|
||||||
|
|
||||||
First thing to do is check that your MPV binary path is correct. Navigate to the settings page and re-set the path and restart the app. If your issue still isn't resolved, try reinstalling MPV. Known working versions include `v0.35.x` and `v0.36.x`. `v0.34.x` is a known broken version.
|
|
||||||
|
|
||||||
### What music servers does Feishin support?
|
|
||||||
|
|
||||||
Feishin supports any music server that implements a [Navidrome](https://www.navidrome.org/), [Jellyfin](https://jellyfin.org/), or [OpenSubsonic compatible](https://opensubsonic.netlify.app/) API.
|
|
||||||
|
|
||||||
- [Navidrome](https://github.com/navidrome/navidrome)
|
|
||||||
- [Jellyfin](https://github.com/jellyfin/jellyfin)
|
|
||||||
- [OpenSubsonic](https://opensubsonic.netlify.app/) compatible servers, such as...
|
|
||||||
- [Airsonic-Advanced](https://github.com/airsonic-advanced/airsonic-advanced)
|
|
||||||
- [Ampache](https://ampache.org)
|
|
||||||
- [Astiga](https://asti.ga/)
|
|
||||||
- [Funkwhale](https://www.funkwhale.audio/)
|
|
||||||
- [Gonic](https://github.com/sentriz/gonic)
|
|
||||||
- [LMS](https://github.com/epoupon/lms)
|
|
||||||
- [Nextcloud Music](https://apps.nextcloud.com/apps/music)
|
|
||||||
- [Supysonic](https://github.com/spl0k/supysonic)
|
|
||||||
- [Qm-Music](https://github.com/chenqimiao/qm-music)
|
|
||||||
- More (?)
|
|
||||||
|
|
||||||
- [Plex](https://www.plex.tv/media-server-downloads)
|
|
||||||
- [Feishin fork by lux032](https://github.com/lux032/feishin) - Plex is not natively supported. Use the fork by lux032 to use Plex with Feishin.
|
|
||||||
|
|
||||||
|
|
||||||
### I have the issue "The SUID sandbox helper binary was found, but is not configured correctly" on Linux
|
|
||||||
|
|
||||||
This happens when you have user (unprivileged) namespaces disabled (`sysctl kernel.unprivileged_userns_clone` returns 0). You can fix this by either enabling unprivileged namespaces, or by making the `chrome-sandbox` Setuid.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
chmod 4755 chrome-sandbox
|
|
||||||
sudo chown root:root chrome-sandbox
|
|
||||||
```
|
|
||||||
|
|
||||||
Ubuntu 24.04 specifically introduced breaking changes that affect how namespaces work. Please see https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890#:~:text=security%20improvements%20 for possible fixes.
|
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
Built and tested using Node `v23.11.0`.
|
TBD
|
||||||
|
|
||||||
This project is built off of [electron-vite](https://github.com/alex8088/electron-vite)
|
### Developing with Docker Compose
|
||||||
|
|
||||||
- `pnpm run dev` - Start the development server
|
TBD
|
||||||
- `pnpm run dev:watch` - Start the development server in watch mode (for main / preload HMR)
|
|
||||||
- `pnpm run start` - Starts the app in production preview mode
|
|
||||||
- `pnpm run build` - Builds the app for desktop
|
|
||||||
- `pnpm run build:electron` - Build the electron app (main, preload, and renderer)
|
|
||||||
- `pnpm run build:remote` - Build the remote app (remote)
|
|
||||||
- `pnpm run build:web` - Build the standalone web app (renderer)
|
|
||||||
- `pnpm run package` - Package the project
|
|
||||||
- `pnpm run package:dev` - Package the project for development locally
|
|
||||||
- `pnpm run package:linux` - Package the project for Linux locally
|
|
||||||
- `pnpm run package:mac` - Package the project for Mac locally
|
|
||||||
- `pnpm run package:win` - Package the project for Windows locally
|
|
||||||
- `pnpm run publish:linux` - Publish the project for Linux
|
|
||||||
- `pnpm run publish:linux:beta` - Publish the project for Linux (beta channel)
|
|
||||||
- `pnpm run publish:linux-arm64` - Publish the project for Linux ARM64
|
|
||||||
- `pnpm run publish:linux-arm64:beta` - Publish the project for Linux ARM64 (beta channel)
|
|
||||||
- `pnpm run publish:mac` - Publish the project for Mac
|
|
||||||
- `pnpm run publish:mac:beta` - Publish the project for Mac (beta channel)
|
|
||||||
- `pnpm run publish:win` - Publish the project for Windows
|
|
||||||
- `pnpm run publish:win:beta` - Publish the project for Windows (beta channel)
|
|
||||||
- `pnpm run typecheck` - Type check the project
|
|
||||||
- `pnpm run typecheck:node` - Type check the project with tsconfig.node.json
|
|
||||||
- `pnpm run typecheck:web` - Type check the project with tsconfig.web.json
|
|
||||||
- `pnpm run lint` - Lint the project
|
|
||||||
- `pnpm run lint:fix` - Lint the project and fix linting errors
|
|
||||||
- `pnpm run i18next` - Generate i18n files
|
|
||||||
|
|
||||||
## Translation
|
|
||||||
|
|
||||||
This project uses [Weblate](https://hosted.weblate.org/projects/feishin/) for translations. If you would like to contribute, please visit the link and submit a translation.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[GNU General Public License v3.0 ©](https://github.com/jeffvli/feishin/blob/dev/LICENSE)
|
[GNU General Public License v3.0 ©](https://github.com/jeffvli/sonixd-rewrite/blob/dev/LICENSE)
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
type Styles = Record<string, string>;
|
|
||||||
|
|
||||||
declare module '*.svg' {
|
|
||||||
const content: string;
|
|
||||||
export default content;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module '*.png' {
|
|
||||||
const content: string;
|
|
||||||
export default content;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module '*.jpg' {
|
|
||||||
const content: string;
|
|
||||||
export default content;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module '*.scss' {
|
|
||||||
const content: Styles;
|
|
||||||
export default content;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module '*.sass' {
|
|
||||||
const content: Styles;
|
|
||||||
export default content;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module '*.css' {
|
|
||||||
const content: Styles;
|
|
||||||
export default content;
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>com.apple.security.cs.allow-jit</key>
|
|
||||||
<true/>
|
|
||||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
|
||||||
<true/>
|
|
||||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 651 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 277 B |
|
Before Width: | Height: | Size: 447 B |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 422 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 896 B |
|
Before Width: | Height: | Size: 971 B |
|
Before Width: | Height: | Size: 479 B |
|
Before Width: | Height: | Size: 524 B |
@@ -1,3 +0,0 @@
|
|||||||
provider: generic
|
|
||||||
url: https://example.com/auto-updates
|
|
||||||
updaterCacheDirName: feishin-updater
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
services:
|
|
||||||
feishin:
|
|
||||||
container_name: feishin
|
|
||||||
image: "ghcr.io/jeffvli/feishin:latest"
|
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
|
||||||
- SERVER_NAME=jellyfin # pre-defined server name
|
|
||||||
- SERVER_LOCK=false # When true AND name/type/url are set, only username/password can be toggled
|
|
||||||
- SERVER_TYPE=jellyfin # the allowed types are: jellyfin, navidrome, subsonic. These values are case insensitive
|
|
||||||
- SERVER_URL=http://localhost:8096 # http://address:port or https://address:port
|
|
||||||
# - REMOTE_URL=http://share.localhost # Used for compatibility with external functionality, such as custom sharing URLs on Navidrome
|
|
||||||
- LEGACY_AUTHENTICATION=false # When SERVER_LOCK is true, sets the legacyauth flag for server authentication (true or false)
|
|
||||||
- ANALYTICS_DISABLED=false # Set to true to disable Umami analytics tracking
|
|
||||||
ports:
|
|
||||||
- 9180:9180
|
|
||||||
# Alternatively, to restrict to only localhost, - 127.0.0.1:9180:8190
|
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
# Environment variables for settings (web / Docker)
|
|
||||||
|
|
||||||
These variables override app settings **on first run** when no persisted settings exist. They are injected via `settings.js` (from `settings.js.template`) and only apply to the **web** build.
|
|
||||||
|
|
||||||
**Format:** All values are strings; booleans use `true`/`false`, numbers are numeric strings. Leave unset or empty to use the default.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## General
|
|
||||||
|
|
||||||
| Setting | Default | Env variable | Available values / Description |
|
|
||||||
|-------------|---------|--------------|--------------------------------|
|
|
||||||
| `general.accent` | `rgb(53, 116, 252)` | `FS_GENERAL_ACCENT` | CSS `rgb(r, g, b)` string (e.g. `rgb(53, 116, 252)`). Invalid values are ignored. |
|
|
||||||
| `general.albumBackground` | `false` | `FS_GENERAL_ALBUM_BACKGROUND` | `true` / `false` — Show album background image. |
|
|
||||||
| `general.albumBackgroundBlur` | `3` | `FS_GENERAL_ALBUM_BACKGROUND_BLUR` | Blur amount for album background (number). |
|
|
||||||
| `general.artistBackground` | `true` | `FS_GENERAL_ARTIST_BACKGROUND` | `true` / `false` — Show artist background image. |
|
|
||||||
| `general.artistBackgroundBlur` | `3` | `FS_GENERAL_ARTIST_BACKGROUND_BLUR` | Blur amount for artist background (number). |
|
|
||||||
| `general.blurExplicitImages` | `false` | `FS_GENERAL_BLUR_EXPLICIT_IMAGES` | `true` / `false` — Blur explicit images. |
|
|
||||||
| `general.combinedLyricsAndVisualizer` | `false` | `FS_GENERAL_COMBINED_LYRICS_AND_VISUALIZER` | `true` / `false` — Combine lyrics and visualizer panel. |
|
|
||||||
| `general.enableGridMultiSelect` | `false` | `FS_GENERAL_ENABLE_GRID_MULTI_SELECT` | `true` / `false` — Enable multi-select in grid views. |
|
|
||||||
| `general.externalLinks` | `true` | `FS_GENERAL_EXTERNAL_LINKS` | `true` / `false` — Show external links in UI. |
|
|
||||||
| `general.followCurrentSong` | `true` | `FS_GENERAL_FOLLOW_CURRENT_SONG` | `true` / `false` — Follow current song in list. |
|
|
||||||
| `general.followSystemTheme` | `false` | `FS_GENERAL_FOLLOW_SYSTEM_THEME` | `true` / `false` — Use OS light/dark preference. |
|
|
||||||
| `general.homeFeature` | `true` | `FS_GENERAL_HOME_FEATURE` | `true` / `false` — Show home featured carousel. |
|
|
||||||
| `general.homeFeatureStyle` | `single` | `FS_GENERAL_HOME_FEATURE_STYLE` | `multiple` / `single` — Home featured carousel style. |
|
|
||||||
| `general.language` | `en` | `FS_GENERAL_LANGUAGE` | UI language code (e.g. `en`, `de`, `fr`). |
|
|
||||||
| `general.theme` | `defaultDark` | `FS_GENERAL_THEME` | One of: `ayuDark`, `ayuLight`, `catppuccinLatte`, `catppuccinMocha`, `defaultDark`, `defaultLight`, `dracula`, `githubDark`, `githubLight`, `glassyDark`, `gruvboxDark`, `gruvboxLight`, `highContrastDark`, `highContrastLight`, `materialDark`, `materialLight`, `monokai`, `nightOwl`, `nord`, `oneDark`, `rosePine`, `rosePineDawn`, `rosePineMoon`, `shadesOfPurple`, `solarizedDark`, `solarizedLight`, `tokyoNight`, `vscodeDarkPlus`, `vscodeLightPlus`. |
|
|
||||||
| `general.themeDark` | `defaultDark` | `FS_GENERAL_THEME_DARK` | Same as theme (used when system is dark). |
|
|
||||||
| `general.themeLight` | `defaultLight` | `FS_GENERAL_THEME_LIGHT` | Same as theme (used when system is light). |
|
|
||||||
| `general.lastfmApiKey` | *(empty)* | `FS_GENERAL_LASTFM_API_KEY` | Last.fm API key. |
|
|
||||||
| `general.lastFM` | `true` | `FS_GENERAL_LAST_FM` | `true` / `false` — Enable Last.fm. |
|
|
||||||
| `general.listenBrainz` | `true` | `FS_GENERAL_LISTEN_BRAINZ` | `true` / `false` — ListenBrainz links. |
|
|
||||||
| `general.musicBrainz` | `true` | `FS_GENERAL_MUSIC_BRAINZ` | `true` / `false` — MusicBrainz links. |
|
|
||||||
| `general.nativeAspectRatio` | `false` | `FS_GENERAL_NATIVE_ASPECT_RATIO` | `true` / `false` — Use native cover art aspect ratio. |
|
|
||||||
| `general.pathReplace` | *(empty)* | `FS_GENERAL_PATH_REPLACE` | Path pattern to replace (e.g. server path in Docker). |
|
|
||||||
| `general.pathReplaceWith` | *(empty)* | `FS_GENERAL_PATH_REPLACE_WITH` | Replacement path. |
|
|
||||||
| `general.playerbarOpenDrawer` | `false` | `FS_GENERAL_PLAYERBAR_OPEN_DRAWER` | `true` / `false` — Open queue/lyrics as drawer from player bar. |
|
|
||||||
| `general.primaryShade` | `6` | `FS_GENERAL_PRIMARY_SHADE` | Mantine primary shade 0–9 (number). |
|
|
||||||
| `general.qobuz` | `true` | `FS_GENERAL_QOBUZ` | `true` / `false` — Qobuz links. |
|
|
||||||
| `general.resume` | `true` | `FS_GENERAL_RESUME` | `true` / `false` — Resume playback on load. |
|
|
||||||
| `general.showLyricsInSidebar` | `true` | `FS_GENERAL_SHOW_LYRICS_IN_SIDEBAR` | `true` / `false` — Show lyrics in sidebar. |
|
|
||||||
| `general.showRatings` | `true` | `FS_GENERAL_SHOW_RATINGS` | `true` / `false` — Show star ratings. |
|
|
||||||
| `general.showVisualizerInSidebar` | `true` | `FS_GENERAL_SHOW_VISUALIZER_IN_SIDEBAR` | `true` / `false` — Show visualizer in sidebar. |
|
|
||||||
| `general.sidebarCollapsedNavigation` | `true` | `FS_GENERAL_SIDEBAR_COLLAPSED_NAVIGATION` | `true` / `false` — Start with collapsed sidebar nav. |
|
|
||||||
| `general.sidebarCollapseShared` | `false` | `FS_GENERAL_SIDEBAR_COLLAPSE_SHARED` | `true` / `false` — Share sidebar collapse state. |
|
|
||||||
| `general.sidebarPlaylistList` | `true` | `FS_GENERAL_SIDEBAR_PLAYLIST_LIST` | `true` / `false` — Show playlist list in sidebar. |
|
|
||||||
| `general.sidebarPlaylistSorting` | `false` | `FS_GENERAL_SIDEBAR_PLAYLIST_SORTING` | `true` / `false` — Enable playlist sorting in sidebar. |
|
|
||||||
| `general.sideQueueType` | `sideQueue` | `FS_GENERAL_SIDE_QUEUE_TYPE` | `sideDrawerQueue` / `sideQueue` — Side play queue style. |
|
|
||||||
| `general.sideQueueLayout` | `horizontal` | `FS_GENERAL_SIDE_QUEUE_LAYOUT` | `horizontal` / `vertical` — Attached side queue layout orientation. |
|
|
||||||
| `general.useThemeAccentColor` | `false` | `FS_GENERAL_USE_THEME_ACCENT_COLOR` | `true` / `false` — Use theme’s accent color instead of custom. |
|
|
||||||
| `general.useThemePrimaryShade` | `true` | `FS_GENERAL_USE_THEME_PRIMARY_SHADE` | `true` / `false` — Use theme’s primary shade. |
|
|
||||||
| `general.zoomFactor` | `100` | `FS_GENERAL_ZOOM_FACTOR` | UI zoom percentage (number). |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Playback
|
|
||||||
|
|
||||||
| Setting path | Default | Env variable | Available values / Description |
|
|
||||||
|-------------|---------|--------------|--------------------------------|
|
|
||||||
| `playback.mediaSession` | `false` | `FS_PLAYBACK_MEDIA_SESSION` | `true` / `false` — Media Session API (e.g. browser/media keys). |
|
|
||||||
| `playback.webAudio` | `true` | `FS_PLAYBACK_WEB_AUDIO` | `true` / `false` — Use Web Audio for playback. |
|
|
||||||
| `playback.audioFadeOnStatusChange` | `true` | `FS_PLAYBACK_AUDIO_FADE_ON_STATUS_CHANGE` | `true` / `false` — Fade on play/pause. |
|
|
||||||
| `playback.preservePitch` | `true` | `FS_PLAYBACK_PRESERVE_PITCH` | `true` / `false` — Preserve pitch when changing speed. |
|
|
||||||
| `playback.scrobble.enabled` | `true` | `FS_PLAYBACK_SCROBBLE_ENABLED` | `true` / `false` — Enable scrobbling. |
|
|
||||||
| `playback.scrobble.notify` | `false` | `FS_PLAYBACK_SCROBBLE_NOTIFY` | `true` / `false` — Scrobble notifications. |
|
|
||||||
| `playback.scrobble.scrobbleAtDuration` | `240` | `FS_PLAYBACK_SCROBBLE_AT_DURATION` | Seconds of playback before scrobble. |
|
|
||||||
| `playback.scrobble.scrobbleAtPercentage` | `75` | `FS_PLAYBACK_SCROBBLE_AT_PERCENTAGE` | Percentage of track before scrobble. |
|
|
||||||
| `playback.transcode.enabled` | `false` | `FS_PLAYBACK_TRANSCODE_ENABLED` | `true` / `false` — Enable transcoding. |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Discord
|
|
||||||
|
|
||||||
| Setting path | Default | Env variable | Available values / Description |
|
|
||||||
|-------------|---------|--------------|--------------------------------|
|
|
||||||
| `discord.enabled` | `false` | `FS_DISCORD_ENABLED` | `true` / `false` — Discord rich presence. |
|
|
||||||
| `discord.clientId` | *(built-in)* | `FS_DISCORD_CLIENT_ID` | Custom Discord application ID. |
|
|
||||||
| `discord.displayType` | `feishin` | `FS_DISCORD_DISPLAY_TYPE` | `artist` / `feishin` / `song`. |
|
|
||||||
| `discord.linkType` | `none` | `FS_DISCORD_LINK_TYPE` | `last_fm` / `musicbrainz` / `musicbrainz_last_fm` / `none`. |
|
|
||||||
| `discord.showAsListening` | `false` | `FS_DISCORD_SHOW_AS_LISTENING` | `true` / `false`. |
|
|
||||||
| `discord.showPaused` | `true` | `FS_DISCORD_SHOW_PAUSED` | `true` / `false` — Show paused state. |
|
|
||||||
| `discord.showServerImage` | `false` | `FS_DISCORD_SHOW_SERVER_IMAGE` | `true` / `false`. |
|
|
||||||
| `discord.showStateIcon` | `true` | `FS_DISCORD_SHOW_STATE_ICON` | `true` / `false`. |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Lyrics
|
|
||||||
|
|
||||||
| Setting path | Default | Env variable | Available values / Description |
|
|
||||||
|-------------|---------|--------------|--------------------------------|
|
|
||||||
| `lyrics.fetch` | `true` | `FS_LYRICS_FETCH` | `true` / `false` — Fetch lyrics. |
|
|
||||||
| `lyrics.follow` | `true` | `FS_LYRICS_FOLLOW` | `true` / `false` — Follow current line. |
|
|
||||||
| `lyrics.delayMs` | `0` | `FS_LYRICS_DELAY_MS` | Sync delay in milliseconds. |
|
|
||||||
| `lyrics.preferLocalLyrics` | `true` | `FS_LYRICS_PREFER_LOCAL` | `true` / `false` — Prefer local lyric files. |
|
|
||||||
| `lyrics.showMatch` | `true` | `FS_LYRICS_SHOW_MATCH` | `true` / `false`. |
|
|
||||||
| `lyrics.showProvider` | `true` | `FS_LYRICS_SHOW_PROVIDER` | `true` / `false`. |
|
|
||||||
| `lyrics.enableAutoTranslation` | `false` | `FS_LYRICS_ENABLE_AUTO_TRANSLATION` | `true` / `false`. |
|
|
||||||
| `lyrics.translationApiKey` | *(empty)* | `FS_LYRICS_TRANSLATION_API_KEY` | API key for lyric translation. |
|
|
||||||
| `lyrics.translationTargetLanguage` | `en` | `FS_LYRICS_TRANSLATION_TARGET_LANGUAGE` | Target language code. |
|
|
||||||
| `lyrics.alignment` | `center` | `FS_LYRICS_ALIGNMENT` | `center` / `left` / `right`. |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Auto DJ
|
|
||||||
|
|
||||||
| Setting path | Default | Env variable | Available values / Description |
|
|
||||||
|-------------|---------|--------------|--------------------------------|
|
|
||||||
| `autoDJ.enabled` | `false` | `FS_AUTO_DJ_ENABLED` | `true` / `false`. |
|
|
||||||
| `autoDJ.itemCount` | `5` | `FS_AUTO_DJ_ITEM_COUNT` | Number of items to add. |
|
|
||||||
| `autoDJ.timing` | `1` | `FS_AUTO_DJ_TIMING` | Timing value (number). |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## CSS
|
|
||||||
|
|
||||||
| Setting path | Default | Env variable | Available values / Description |
|
|
||||||
|-------------|---------|--------------|--------------------------------|
|
|
||||||
| `css.content` | *(empty)* | `FS_CSS_CONTENT` | Custom CSS string (sanitized like in-app custom CSS). Set `FS_CSS_ENABLED=true` to apply. |
|
|
||||||
| `css.enabled` | `false` | `FS_CSS_ENABLED` | `true` / `false` — Enable custom CSS. |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Font
|
|
||||||
|
|
||||||
| Setting path | Default | Env variable | Available values / Description |
|
|
||||||
|-------------|---------|--------------|--------------------------------|
|
|
||||||
| `font.type` | `builtIn` | `FS_FONT_TYPE` | `builtIn` / `system` / `custom`. |
|
|
||||||
| `font.builtIn` | `Inter` | `FS_FONT_BUILT_IN` | Built-in font name. |
|
|
||||||
| `font.system` | *(empty)* | `FS_FONT_SYSTEM` | System font name (when type is `system`). |
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
appId: org.jeffvli.feishin
|
|
||||||
productName: Feishin
|
|
||||||
artifactName: ${productName}-${version}-${os}-${arch}.${ext}
|
|
||||||
electronVersion: 39.4.0
|
|
||||||
directories:
|
|
||||||
buildResources: assets
|
|
||||||
files:
|
|
||||||
- 'out/**/*'
|
|
||||||
- 'package.json'
|
|
||||||
extraResources:
|
|
||||||
- assets/**
|
|
||||||
asarUnpack:
|
|
||||||
- resources/**
|
|
||||||
win:
|
|
||||||
target:
|
|
||||||
- target: zip
|
|
||||||
arch:
|
|
||||||
- x64
|
|
||||||
- arm64
|
|
||||||
- target: nsis
|
|
||||||
arch:
|
|
||||||
- x64
|
|
||||||
- arm64
|
|
||||||
icon: assets/icons/icon.ico
|
|
||||||
|
|
||||||
nsis:
|
|
||||||
allowToChangeInstallationDirectory: true
|
|
||||||
oneClick: false
|
|
||||||
shortcutName: ${productName}
|
|
||||||
uninstallDisplayName: ${productName}
|
|
||||||
createDesktopShortcut: always
|
|
||||||
|
|
||||||
mac:
|
|
||||||
target:
|
|
||||||
- target: dmg
|
|
||||||
arch:
|
|
||||||
- arm64
|
|
||||||
- x64
|
|
||||||
- target: zip
|
|
||||||
arch:
|
|
||||||
- arm64
|
|
||||||
- x64
|
|
||||||
icon: media/feishin.icon
|
|
||||||
type: distribution
|
|
||||||
hardenedRuntime: false
|
|
||||||
identity: '-'
|
|
||||||
gatekeeperAssess: false
|
|
||||||
notarize: false
|
|
||||||
extendInfo:
|
|
||||||
NSAudioCaptureUsageDescription: "System audio access is required for mpv visualizer capture in Feishin"
|
|
||||||
NSLocalNetworkUsageDescription: 'Local network is necessary for accessing servers hosted on the same system as Feishin'
|
|
||||||
|
|
||||||
dmg:
|
|
||||||
contents: [{ x: 130, y: 220 }, { x: 410, y: 220, type: link, path: /Applications }]
|
|
||||||
|
|
||||||
linux:
|
|
||||||
target:
|
|
||||||
- AppImage
|
|
||||||
- deb
|
|
||||||
- tar.xz
|
|
||||||
category: AudioVideo;Audio;Player
|
|
||||||
icon: assets/icons/icon.png
|
|
||||||
artifactName: ${productName}-${os}-${arch}.${ext}
|
|
||||||
|
|
||||||
toolsets:
|
|
||||||
appimage: '1.0.2'
|
|
||||||
|
|
||||||
npmRebuild: false
|
|
||||||
|
|
||||||
publish:
|
|
||||||
provider: s3
|
|
||||||
bucket: feishin-nightly
|
|
||||||
channel: alpha
|
|
||||||
endpoint: https://065f090c64de2dc707dd70ac72db9669.r2.cloudflarestorage.com
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
appId: org.jeffvli.feishin
|
|
||||||
productName: Feishin
|
|
||||||
artifactName: ${productName}-${version}-${os}-${arch}.${ext}
|
|
||||||
electronVersion: 39.4.0
|
|
||||||
directories:
|
|
||||||
buildResources: assets
|
|
||||||
files:
|
|
||||||
- 'out/**/*'
|
|
||||||
- 'package.json'
|
|
||||||
extraResources:
|
|
||||||
- assets/**
|
|
||||||
asarUnpack:
|
|
||||||
- resources/**
|
|
||||||
win:
|
|
||||||
target:
|
|
||||||
- target: zip
|
|
||||||
arch:
|
|
||||||
- x64
|
|
||||||
- arm64
|
|
||||||
- target: nsis
|
|
||||||
arch:
|
|
||||||
- x64
|
|
||||||
- arm64
|
|
||||||
icon: assets/icons/icon.ico
|
|
||||||
|
|
||||||
nsis:
|
|
||||||
allowToChangeInstallationDirectory: true
|
|
||||||
oneClick: false
|
|
||||||
shortcutName: ${productName}
|
|
||||||
uninstallDisplayName: ${productName}
|
|
||||||
createDesktopShortcut: always
|
|
||||||
|
|
||||||
mac:
|
|
||||||
target:
|
|
||||||
- target: dmg
|
|
||||||
arch:
|
|
||||||
- arm64
|
|
||||||
- x64
|
|
||||||
- target: zip
|
|
||||||
arch:
|
|
||||||
- arm64
|
|
||||||
- x64
|
|
||||||
icon: media/feishin.icon
|
|
||||||
type: distribution
|
|
||||||
hardenedRuntime: false
|
|
||||||
identity: '-'
|
|
||||||
gatekeeperAssess: false
|
|
||||||
notarize: false
|
|
||||||
extendInfo:
|
|
||||||
NSAudioCaptureUsageDescription: "System audio access is required for mpv visualizer capture in Feishin"
|
|
||||||
NSLocalNetworkUsageDescription: 'Local network is necessary for accessing servers hosted on the same system as Feishin'
|
|
||||||
|
|
||||||
dmg:
|
|
||||||
contents: [{ x: 130, y: 220 }, { x: 410, y: 220, type: link, path: /Applications }]
|
|
||||||
|
|
||||||
linux:
|
|
||||||
target:
|
|
||||||
- AppImage
|
|
||||||
- deb
|
|
||||||
- tar.xz
|
|
||||||
category: AudioVideo;Audio;Player
|
|
||||||
icon: assets/icons/icon.png
|
|
||||||
artifactName: ${productName}-${os}-${arch}.${ext}
|
|
||||||
|
|
||||||
toolsets:
|
|
||||||
appimage: '1.0.2'
|
|
||||||
|
|
||||||
npmRebuild: false
|
|
||||||
publish:
|
|
||||||
provider: github
|
|
||||||
owner: jeffvli
|
|
||||||
repo: feishin
|
|
||||||
channel: beta
|
|
||||||
releaseType: draft
|
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
"appId": "TEST",
|
||||||
|
"productName": "TEST",
|
||||||
|
"copyright": "Copyright © 2022 ${author}",
|
||||||
|
"directories": {
|
||||||
|
"app": "release/app",
|
||||||
|
"output": "release/build",
|
||||||
|
"buildResources": "electron/resources"
|
||||||
|
},
|
||||||
|
"extends": null,
|
||||||
|
"asar": true,
|
||||||
|
"asarUnpack": ["**\\*.{node,dll}", "prisma"],
|
||||||
|
"files": [
|
||||||
|
"dist",
|
||||||
|
"node_modules",
|
||||||
|
"package.json",
|
||||||
|
"prisma/**/*",
|
||||||
|
"resources/**/*",
|
||||||
|
"!**/node_modules/@prisma/engines/introspection-engine*",
|
||||||
|
"!**/node_modules/@prisma/engines/migration-engine*",
|
||||||
|
"!**/node_modules/@prisma/engines/prisma-fmt*",
|
||||||
|
"!**/node_modules/@prisma/engines/query_engine-*",
|
||||||
|
"!**/node_modules/@prisma/engines/libquery_engine*",
|
||||||
|
"!**/node_modules/prisma/query_engine*",
|
||||||
|
"!**/node_modules/prisma/libquery_engine*",
|
||||||
|
"!**/node_modules/prisma/**/*.mjs"
|
||||||
|
],
|
||||||
|
"win": {
|
||||||
|
"target": [
|
||||||
|
{
|
||||||
|
"target": "nsis",
|
||||||
|
"arch": ["x64"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"artifactName": "${productName}-Windows-${version}-Setup.${ext}"
|
||||||
|
},
|
||||||
|
"nsis": {
|
||||||
|
"oneClick": false,
|
||||||
|
"perMachine": false,
|
||||||
|
"allowToChangeInstallationDirectory": true,
|
||||||
|
"deleteAppDataOnUninstall": false
|
||||||
|
},
|
||||||
|
"mac": {
|
||||||
|
"target": ["dmg"],
|
||||||
|
"artifactName": "${productName}-Mac-${version}-Installer.${ext}"
|
||||||
|
},
|
||||||
|
"linux": {
|
||||||
|
"icon": "electron/resources/iconset",
|
||||||
|
"target": ["AppImage", "deb"],
|
||||||
|
"artifactName": "${productName}-Linux-${version}.${ext}"
|
||||||
|
},
|
||||||
|
"extraResources": [
|
||||||
|
"./assets/**",
|
||||||
|
"prisma/**/*",
|
||||||
|
"node_modules/@prisma/engines/migration-engine*",
|
||||||
|
"node_modules/@prisma/engines/query*",
|
||||||
|
"node_modules/@prisma/engines/libquery*"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
appId: org.jeffvli.feishin
|
|
||||||
productName: Feishin
|
|
||||||
artifactName: ${productName}-${version}-${os}-${arch}.${ext}
|
|
||||||
electronVersion: 39.4.0
|
|
||||||
directories:
|
|
||||||
buildResources: assets
|
|
||||||
files:
|
|
||||||
- 'out/**/*'
|
|
||||||
- 'package.json'
|
|
||||||
extraResources:
|
|
||||||
- assets/**
|
|
||||||
asarUnpack:
|
|
||||||
- resources/**
|
|
||||||
win:
|
|
||||||
target:
|
|
||||||
- target: zip
|
|
||||||
arch:
|
|
||||||
- x64
|
|
||||||
- arm64
|
|
||||||
- target: nsis
|
|
||||||
arch:
|
|
||||||
- x64
|
|
||||||
- arm64
|
|
||||||
icon: assets/icons/icon.ico
|
|
||||||
|
|
||||||
nsis:
|
|
||||||
allowToChangeInstallationDirectory: true
|
|
||||||
oneClick: false
|
|
||||||
shortcutName: ${productName}
|
|
||||||
uninstallDisplayName: ${productName}
|
|
||||||
createDesktopShortcut: always
|
|
||||||
|
|
||||||
mac:
|
|
||||||
target:
|
|
||||||
- target: dmg
|
|
||||||
arch:
|
|
||||||
- arm64
|
|
||||||
- x64
|
|
||||||
- target: zip
|
|
||||||
arch:
|
|
||||||
- arm64
|
|
||||||
- x64
|
|
||||||
icon: media/feishin.icon
|
|
||||||
type: distribution
|
|
||||||
hardenedRuntime: false
|
|
||||||
identity: '-'
|
|
||||||
gatekeeperAssess: false
|
|
||||||
notarize: false
|
|
||||||
extendInfo:
|
|
||||||
NSAudioCaptureUsageDescription: 'System audio access is required for mpv visualizer capture in Feishin'
|
|
||||||
NSLocalNetworkUsageDescription: 'Local network is necessary for accessing servers hosted on the same system as Feishin'
|
|
||||||
|
|
||||||
dmg:
|
|
||||||
contents: [{ x: 130, y: 220 }, { x: 410, y: 220, type: link, path: /Applications }]
|
|
||||||
|
|
||||||
linux:
|
|
||||||
target:
|
|
||||||
- AppImage
|
|
||||||
- deb
|
|
||||||
- tar.xz
|
|
||||||
category: AudioVideo;Audio;Player
|
|
||||||
icon: assets/icons/icon.png
|
|
||||||
artifactName: ${productName}-${os}-${arch}.${ext}
|
|
||||||
|
|
||||||
toolsets:
|
|
||||||
appimage: '1.0.2'
|
|
||||||
|
|
||||||
npmRebuild: false
|
|
||||||
afterAllArtifactBuild: scripts/after-all-artifact-build.mjs
|
|
||||||
publish:
|
|
||||||
provider: github
|
|
||||||
owner: jeffvli
|
|
||||||
repo: feishin
|
|
||||||
channel: latest
|
|
||||||
releaseType: draft
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
import { externalizeDepsPlugin, UserConfig } from 'electron-vite';
|
|
||||||
import { resolve } from 'path';
|
|
||||||
import conditionalImportPlugin from 'vite-plugin-conditional-import';
|
|
||||||
import dynamicImportPlugin from 'vite-plugin-dynamic-import';
|
|
||||||
import { ViteEjsPlugin } from 'vite-plugin-ejs';
|
|
||||||
|
|
||||||
import { createReactPlugin } from './vite.react-plugin';
|
|
||||||
|
|
||||||
const currentOSEnv = process.platform;
|
|
||||||
const electronRendererTarget = 'chrome87';
|
|
||||||
|
|
||||||
const config: UserConfig = {
|
|
||||||
main: {
|
|
||||||
build: {
|
|
||||||
rollupOptions: {
|
|
||||||
external: ['source-map-support'],
|
|
||||||
},
|
|
||||||
sourcemap: true,
|
|
||||||
},
|
|
||||||
define: {
|
|
||||||
'import.meta.env.IS_LINUX': JSON.stringify(currentOSEnv === 'linux'),
|
|
||||||
'import.meta.env.IS_MACOS': JSON.stringify(currentOSEnv === 'darwin'),
|
|
||||||
'import.meta.env.IS_WIN': JSON.stringify(currentOSEnv === 'win32'),
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
externalizeDepsPlugin(),
|
|
||||||
dynamicImportPlugin(),
|
|
||||||
conditionalImportPlugin({
|
|
||||||
currentEnv: currentOSEnv,
|
|
||||||
envs: ['win32', 'linux', 'darwin'],
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
'/@/main': resolve('src/main'),
|
|
||||||
'/@/shared': resolve('src/shared'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
preload: {
|
|
||||||
build: {
|
|
||||||
sourcemap: true,
|
|
||||||
},
|
|
||||||
plugins: [externalizeDepsPlugin()],
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
'/@/preload': resolve('src/preload'),
|
|
||||||
'/@/shared': resolve('src/shared'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
renderer: {
|
|
||||||
build: {
|
|
||||||
cssMinify: 'esbuild',
|
|
||||||
minify: 'esbuild',
|
|
||||||
modulePreload: {
|
|
||||||
polyfill: false,
|
|
||||||
},
|
|
||||||
sourcemap: true,
|
|
||||||
target: electronRendererTarget,
|
|
||||||
},
|
|
||||||
css: {
|
|
||||||
modules: {
|
|
||||||
generateScopedName: 'fs-[name]-[local]',
|
|
||||||
localsConvention: 'camelCase',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
plugins: [createReactPlugin(), ViteEjsPlugin({ web: false })],
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
'/@/i18n': resolve('src/i18n'),
|
|
||||||
'/@/remote': resolve('src/remote'),
|
|
||||||
'/@/renderer': resolve('src/renderer'),
|
|
||||||
'/@/shared': resolve('src/shared'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/// <reference types="vite-electron-plugin/electron-env" />
|
||||||
|
|
||||||
|
declare namespace NodeJS {
|
||||||
|
interface ProcessEnv {
|
||||||
|
DIST: string;
|
||||||
|
DIST_ELECTRON: string;
|
||||||
|
/** /dist/ or /public/ */
|
||||||
|
PUBLIC: string;
|
||||||
|
VSCODE_DEBUG?: 'true';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
import fs from 'fs';
|
||||||
|
import path from 'path';
|
||||||
|
import { PrismaClient } from '@prisma/client';
|
||||||
|
import { app, ipcMain } from 'electron';
|
||||||
|
import isDev from 'electron-is-dev';
|
||||||
|
import './server';
|
||||||
|
|
||||||
|
const dbPath = isDev
|
||||||
|
? path.join(__dirname, '../../../../prisma/dev.db')
|
||||||
|
: path.join(app.getPath('userData'), 'database.db');
|
||||||
|
|
||||||
|
if (!isDev) {
|
||||||
|
try {
|
||||||
|
// database file does not exist, need to create
|
||||||
|
fs.copyFileSync(path.join(process.resourcesPath, 'prisma/dev.db'), dbPath, fs.constants.COPYFILE_EXCL);
|
||||||
|
console.log(`DB does not exist. Create new DB from ${path.join(process.resourcesPath, 'prisma/dev.db')}`);
|
||||||
|
} catch (err) {
|
||||||
|
if (err && 'code' in (err as { code: string }) && (err as { code: string }).code !== 'EEXIST') {
|
||||||
|
console.error(`DB creation faild. Reason:`, err);
|
||||||
|
} else {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPlatformName(): string {
|
||||||
|
const isDarwin = process.platform === 'darwin';
|
||||||
|
if (isDarwin && process.arch === 'arm64') {
|
||||||
|
return `${process.platform}Arm64`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return process.platform;
|
||||||
|
}
|
||||||
|
|
||||||
|
const platformToExecutables: Record<string, any> = {
|
||||||
|
darwin: {
|
||||||
|
migrationEngine: 'node_modules/@prisma/engines/migration-engine-darwin',
|
||||||
|
queryEngine: 'node_modules/@prisma/engines/libquery_engine-darwin.dylib.node',
|
||||||
|
},
|
||||||
|
darwinArm64: {
|
||||||
|
migrationEngine: 'node_modules/@prisma/engines/migration-engine-darwin-arm64',
|
||||||
|
queryEngine: 'node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node',
|
||||||
|
},
|
||||||
|
linux: {
|
||||||
|
migrationEngine: 'node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x',
|
||||||
|
queryEngine: 'node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node',
|
||||||
|
},
|
||||||
|
win32: {
|
||||||
|
migrationEngine: 'node_modules/@prisma/engines/migration-engine-windows.exe',
|
||||||
|
queryEngine: 'node_modules/@prisma/engines/query_engine-windows.dll.node',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const extraResourcesPath = app.getAppPath().replace('app.asar', ''); // impacted by extraResources setting in electron-builder.yml
|
||||||
|
const platformName = getPlatformName();
|
||||||
|
|
||||||
|
const mePath = path.join(extraResourcesPath, platformToExecutables[platformName].migrationEngine);
|
||||||
|
const qePath = path.join(extraResourcesPath, platformToExecutables[platformName].queryEngine);
|
||||||
|
|
||||||
|
ipcMain.on('config:get-app-path', (event) => {
|
||||||
|
event.returnValue = app.getAppPath();
|
||||||
|
});
|
||||||
|
|
||||||
|
ipcMain.on('config:get-platform-name', (event) => {
|
||||||
|
const isDarwin = process.platform === 'darwin';
|
||||||
|
event.returnValue =
|
||||||
|
isDarwin && process.arch === 'arm64' ? `${process.platform}Arm64` : (event.returnValue = process.platform);
|
||||||
|
});
|
||||||
|
|
||||||
|
ipcMain.on('config:get-prisma-db-path', (event) => {
|
||||||
|
event.returnValue = dbPath;
|
||||||
|
});
|
||||||
|
|
||||||
|
ipcMain.on('config:get-prisma-me-path', (event) => {
|
||||||
|
event.returnValue = mePath;
|
||||||
|
});
|
||||||
|
|
||||||
|
ipcMain.on('config:get-prisma-qe-path', (event) => {
|
||||||
|
event.returnValue = qePath;
|
||||||
|
});
|
||||||
|
|
||||||
|
export const prisma = new PrismaClient({
|
||||||
|
datasources: {
|
||||||
|
db: {
|
||||||
|
url: `file:${dbPath}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
errorFormat: 'minimal',
|
||||||
|
// see https://github.com/prisma/prisma/discussions/5200
|
||||||
|
// __internal: {
|
||||||
|
// engine: {
|
||||||
|
// binaryPath: qePath,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
});
|
||||||
|
|
||||||
|
prisma.server.findMany({
|
||||||
|
where: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const exclude = <T, Key extends keyof T>(resultSet: T, ...keys: Key[]): Omit<T, Key> => {
|
||||||
|
// eslint-disable-next-line no-restricted-syntax
|
||||||
|
for (const key of keys) {
|
||||||
|
delete resultSet[key];
|
||||||
|
}
|
||||||
|
return resultSet;
|
||||||
|
};
|
||||||
|
|
||||||
|
function sleep(ms: number) {
|
||||||
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||||
|
}
|
||||||
|
|
||||||
|
prisma.$use(async (params, next) => {
|
||||||
|
const maxRetries = 5;
|
||||||
|
let retries = 0;
|
||||||
|
|
||||||
|
do {
|
||||||
|
try {
|
||||||
|
const result = await next(params);
|
||||||
|
return result;
|
||||||
|
} catch (err) {
|
||||||
|
retries += 1;
|
||||||
|
return sleep(500);
|
||||||
|
}
|
||||||
|
} while (retries < maxRetries);
|
||||||
|
});
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { ipcMain } from 'electron';
|
||||||
|
import { prisma } from '..';
|
||||||
|
|
||||||
|
export enum ServerApi {
|
||||||
|
GET_SERVER = 'api:server:get-server',
|
||||||
|
GET_SERVERS = 'api:server:get-servers',
|
||||||
|
}
|
||||||
|
|
||||||
|
ipcMain.handle(ServerApi.GET_SERVERS, async () => {
|
||||||
|
const result = await prisma.server.findMany();
|
||||||
|
return result;
|
||||||
|
});
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
import './mpv-player';
|
||||||
|
import './api';
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
import { ipcMain } from 'electron';
|
||||||
|
import MpvAPI from 'node-mpv';
|
||||||
|
import { getWindow } from '../../..';
|
||||||
|
|
||||||
|
const mpv = new MpvAPI(
|
||||||
|
{
|
||||||
|
audio_only: true,
|
||||||
|
auto_restart: true,
|
||||||
|
binary: 'C:/ProgramData/chocolatey/lib/mpv.install/tools/mpv.exe',
|
||||||
|
time_update: 1,
|
||||||
|
},
|
||||||
|
['--gapless-audio=yes', '--prefetch-playlist']
|
||||||
|
);
|
||||||
|
|
||||||
|
mpv.start().catch((error: any) => {
|
||||||
|
console.log('error', error);
|
||||||
|
});
|
||||||
|
|
||||||
|
mpv.on('status', (status: any) => {
|
||||||
|
if (status.property === 'playlist-pos') {
|
||||||
|
if (status.value !== 0) {
|
||||||
|
getWindow()?.webContents.send('renderer-player-auto-next');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Automatically updates the play button when the player is playing
|
||||||
|
mpv.on('started', () => {
|
||||||
|
getWindow()?.webContents.send('renderer-player-play');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Automatically updates the play button when the player is stopped
|
||||||
|
mpv.on('stopped', () => {
|
||||||
|
getWindow()?.webContents.send('renderer-player-stop');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Automatically updates the play button when the player is paused
|
||||||
|
mpv.on('paused', () => {
|
||||||
|
getWindow()?.webContents.send('renderer-player-pause');
|
||||||
|
});
|
||||||
|
|
||||||
|
mpv.on('quit', () => {
|
||||||
|
console.log('mpv quit');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Event output every interval set by time_update, used to update the current time
|
||||||
|
mpv.on('timeposition', (time: number) => {
|
||||||
|
getWindow()?.webContents.send('renderer-player-current-time', time);
|
||||||
|
});
|
||||||
|
|
||||||
|
mpv.on('seek', () => {
|
||||||
|
console.log('mpv seek');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Starts the player
|
||||||
|
ipcMain.on('player-play', async () => {
|
||||||
|
await mpv.play();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Pauses the player
|
||||||
|
ipcMain.on('player-pause', async () => {
|
||||||
|
await mpv.pause();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Stops the player
|
||||||
|
ipcMain.on('player-stop', async () => {
|
||||||
|
await mpv.stop();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Stops the player
|
||||||
|
ipcMain.on('player-next', async () => {
|
||||||
|
await mpv.next();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Stops the player
|
||||||
|
ipcMain.on('player-previous', async () => {
|
||||||
|
await mpv.prev();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Seeks forward or backward by the given amount of seconds
|
||||||
|
ipcMain.on('player-seek', async (_event, time: number) => {
|
||||||
|
await mpv.seek(time);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Seeks to the given time in seconds
|
||||||
|
ipcMain.on('player-seek-to', async (_event, time: number) => {
|
||||||
|
await mpv.goToPosition(time);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Sets the queue in position 0 and 1 to the given data. Used when manually starting a song or using the next/prev buttons
|
||||||
|
ipcMain.on('player-set-queue', async (_event, data: any) => {
|
||||||
|
if (data.queue.current) {
|
||||||
|
await mpv.load(data.queue.current.streamUrl, 'replace');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.queue.next) {
|
||||||
|
await mpv.load(data.queue.next.streamUrl, 'append');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Replaces the queue in position 1 to the given data
|
||||||
|
ipcMain.on('player-set-queue-next', async (_event, data: any) => {
|
||||||
|
const size = await mpv.getPlaylistSize();
|
||||||
|
|
||||||
|
if (size > 1) {
|
||||||
|
await mpv.playlistRemove(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.queue.next) {
|
||||||
|
await mpv.load(data.queue.next.streamUrl, 'append');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Sets the next song in the queue when reaching the end of the queue
|
||||||
|
ipcMain.on('player-auto-next', async (_event, data: any) => {
|
||||||
|
// Always keep the current song as position 0 in the mpv queue
|
||||||
|
// This allows us to easily set update the next song in the queue without
|
||||||
|
// disturbing the currently playing song
|
||||||
|
await mpv.playlistRemove(0);
|
||||||
|
|
||||||
|
if (data.queue.next) {
|
||||||
|
await mpv.load(data.queue.next.streamUrl, 'append');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Sets the volume to the given value (0-100)
|
||||||
|
ipcMain.on('player-volume', async (_event, value: number) => {
|
||||||
|
mpv.volume(value);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Toggles the mute status
|
||||||
|
ipcMain.on('player-mute', async () => {
|
||||||
|
mpv.mute();
|
||||||
|
});
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import './core';
|
||||||
|
|
||||||
|
require(`./${process.platform}`);
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
// The built directory structure
|
||||||
|
//
|
||||||
|
// ├─┬ dist-electron
|
||||||
|
// │ ├─┬ main
|
||||||
|
// │ │ └── index.js > Electron-Main
|
||||||
|
// │ └─┬ preload
|
||||||
|
// │ └── index.js > Preload-Scripts
|
||||||
|
// ├─┬ dist
|
||||||
|
// │ └── index.html > Electron-Renderer
|
||||||
|
//
|
||||||
|
process.env.DIST_ELECTRON = join(__dirname, '..');
|
||||||
|
process.env.DIST = join(process.env.DIST_ELECTRON, '../dist');
|
||||||
|
process.env.PUBLIC = app.isPackaged ? process.env.DIST : join(process.env.DIST_ELECTRON, '../public');
|
||||||
|
|
||||||
|
import { release } from 'os';
|
||||||
|
import { join } from 'path';
|
||||||
|
import { app, BrowserWindow, shell, ipcMain } from 'electron';
|
||||||
|
import './features';
|
||||||
|
|
||||||
|
// Disable GPU Acceleration for Windows 7
|
||||||
|
if (release().startsWith('6.1')) app.disableHardwareAcceleration();
|
||||||
|
|
||||||
|
// Set application name for Windows 10+ notifications
|
||||||
|
if (process.platform === 'win32') app.setAppUserModelId(app.getName());
|
||||||
|
|
||||||
|
if (!app.requestSingleInstanceLock()) {
|
||||||
|
app.quit();
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
let win: BrowserWindow | null = null;
|
||||||
|
// Here, you can also use other preload
|
||||||
|
const preload = join(__dirname, '../preload/index.js');
|
||||||
|
const url = process.env.VITE_DEV_SERVER_URL as string;
|
||||||
|
const indexHtml = join(process.env.DIST, 'index.html');
|
||||||
|
|
||||||
|
async function createWindow() {
|
||||||
|
win = new BrowserWindow({
|
||||||
|
icon: join(process.env.PUBLIC as string, 'favicon.svg'),
|
||||||
|
title: 'Main window',
|
||||||
|
webPreferences: {
|
||||||
|
contextIsolation: true,
|
||||||
|
nodeIntegration: false,
|
||||||
|
preload,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (app.isPackaged) {
|
||||||
|
win.loadFile(indexHtml);
|
||||||
|
} else {
|
||||||
|
win.loadURL(url);
|
||||||
|
// win.webContents.openDevTools()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test actively push message to the Electron-Renderer
|
||||||
|
win.webContents.on('did-finish-load', () => {
|
||||||
|
win?.webContents.send('main-process-message', new Date().toLocaleString());
|
||||||
|
});
|
||||||
|
|
||||||
|
// Make all links open with the browser, not with the application
|
||||||
|
win.webContents.setWindowOpenHandler(({ url }) => {
|
||||||
|
if (url.startsWith('https:')) shell.openExternal(url);
|
||||||
|
return { action: 'deny' };
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
app.whenReady().then(createWindow);
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
win = null;
|
||||||
|
if (process.platform !== 'darwin') app.quit();
|
||||||
|
});
|
||||||
|
|
||||||
|
app.on('second-instance', () => {
|
||||||
|
if (win) {
|
||||||
|
// Focus on the main window if the user tried to open another
|
||||||
|
if (win.isMinimized()) win.restore();
|
||||||
|
win.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
const allWindows = BrowserWindow.getAllWindows();
|
||||||
|
if (allWindows.length) {
|
||||||
|
allWindows[0].focus();
|
||||||
|
} else {
|
||||||
|
createWindow();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// new window example arg: new windows url
|
||||||
|
ipcMain.handle('open-win', (event, arg) => {
|
||||||
|
const childWindow = new BrowserWindow({
|
||||||
|
webPreferences: {
|
||||||
|
preload,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (app.isPackaged) {
|
||||||
|
childWindow.loadFile(indexHtml, { hash: arg });
|
||||||
|
} else {
|
||||||
|
childWindow.loadURL(`${url}/#${arg}`);
|
||||||
|
// childWindow.webContents.openDevTools({ mode: "undocked", activate: true })
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const getWindow = () => {
|
||||||
|
return win;
|
||||||
|
};
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
import { contextBridge, ipcRenderer } from 'electron';
|
||||||
|
|
||||||
|
function domReady(condition: DocumentReadyState[] = ['complete', 'interactive']) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
if (condition.includes(document.readyState)) {
|
||||||
|
resolve(true);
|
||||||
|
} else {
|
||||||
|
document.addEventListener('readystatechange', () => {
|
||||||
|
if (condition.includes(document.readyState)) {
|
||||||
|
resolve(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const safeDOM = {
|
||||||
|
append(parent: HTMLElement, child: HTMLElement) {
|
||||||
|
if (!Array.from(parent.children).find((e) => e === child)) {
|
||||||
|
return parent.appendChild(child);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
remove(parent: HTMLElement, child: HTMLElement) {
|
||||||
|
if (Array.from(parent.children).find((e) => e === child)) {
|
||||||
|
return parent.removeChild(child);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https://tobiasahlin.com/spinkit
|
||||||
|
* https://connoratherton.com/loaders
|
||||||
|
* https://projects.lukehaas.me/css-loaders
|
||||||
|
* https://matejkustec.github.io/SpinThatShit
|
||||||
|
*/
|
||||||
|
function useLoading() {
|
||||||
|
const className = `loaders-css__square-spin`;
|
||||||
|
const styleContent = `
|
||||||
|
@keyframes square-spin {
|
||||||
|
25% { transform: perspective(100px) rotateX(180deg) rotateY(0); }
|
||||||
|
50% { transform: perspective(100px) rotateX(180deg) rotateY(180deg); }
|
||||||
|
75% { transform: perspective(100px) rotateX(0) rotateY(180deg); }
|
||||||
|
100% { transform: perspective(100px) rotateX(0) rotateY(0); }
|
||||||
|
}
|
||||||
|
.${className} > div {
|
||||||
|
animation-fill-mode: both;
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
background: #fff;
|
||||||
|
animation: square-spin 3s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite;
|
||||||
|
}
|
||||||
|
.app-loading-wrap {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: #282c34;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
const oStyle = document.createElement('style');
|
||||||
|
const oDiv = document.createElement('div');
|
||||||
|
|
||||||
|
oStyle.id = 'app-loading-style';
|
||||||
|
oStyle.innerHTML = styleContent;
|
||||||
|
oDiv.className = 'app-loading-wrap';
|
||||||
|
oDiv.innerHTML = `<div class="${className}"><div></div></div>`;
|
||||||
|
|
||||||
|
return {
|
||||||
|
appendLoading() {
|
||||||
|
safeDOM.append(document.head, oStyle);
|
||||||
|
safeDOM.append(document.body, oDiv);
|
||||||
|
},
|
||||||
|
removeLoading() {
|
||||||
|
safeDOM.remove(document.head, oStyle);
|
||||||
|
safeDOM.remove(document.body, oDiv);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
const { appendLoading, removeLoading } = useLoading();
|
||||||
|
domReady().then(appendLoading);
|
||||||
|
|
||||||
|
window.onmessage = (ev) => {
|
||||||
|
ev.data.payload === 'removeLoading' && removeLoading();
|
||||||
|
};
|
||||||
|
|
||||||
|
setTimeout(removeLoading, 4999);
|
||||||
|
|
||||||
|
const serverApi = {
|
||||||
|
getServer: () => ipcRenderer.invoke('api:server:get-server'), // ServerApi.GET_SERVER
|
||||||
|
getServers: () => ipcRenderer.invoke('api:server:get-servers'), // ServerApi.GET_SERVERS
|
||||||
|
};
|
||||||
|
|
||||||
|
const api = {
|
||||||
|
prisma: {
|
||||||
|
server: serverApi,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
contextBridge.exposeInMainWorld('electron', api);
|
||||||
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 36 KiB |
@@ -1,55 +0,0 @@
|
|||||||
import eslintConfigPrettier from '@electron-toolkit/eslint-config-prettier';
|
|
||||||
import tseslint from '@electron-toolkit/eslint-config-ts';
|
|
||||||
import perfectionist from 'eslint-plugin-perfectionist';
|
|
||||||
import eslintPluginReact from 'eslint-plugin-react';
|
|
||||||
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
|
|
||||||
import eslintPluginReactRefresh from 'eslint-plugin-react-refresh';
|
|
||||||
|
|
||||||
export default tseslint.config(
|
|
||||||
{ ignores: ['**/node_modules', '**/dist', '**/out'] },
|
|
||||||
tseslint.configs.recommended,
|
|
||||||
perfectionist.configs['recommended-natural'],
|
|
||||||
eslintPluginReact.configs.flat.recommended,
|
|
||||||
eslintPluginReact.configs.flat['jsx-runtime'],
|
|
||||||
{
|
|
||||||
settings: {
|
|
||||||
react: {
|
|
||||||
version: 'detect',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['**/*.{ts,tsx}'],
|
|
||||||
plugins: {
|
|
||||||
'react-hooks': eslintPluginReactHooks,
|
|
||||||
'react-refresh': eslintPluginReactRefresh,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
...eslintPluginReactHooks.configs['recommended-latest'].rules,
|
|
||||||
...eslintPluginReactRefresh.configs.vite.rules,
|
|
||||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
||||||
'@typescript-eslint/no-duplicate-enum-values': 'off',
|
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
|
||||||
'@typescript-eslint/no-unused-vars': 'warn',
|
|
||||||
curly: ['error', 'all'],
|
|
||||||
indent: [
|
|
||||||
'error',
|
|
||||||
'tab',
|
|
||||||
{
|
|
||||||
offsetTernaryExpressions: true,
|
|
||||||
SwitchCase: 1,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'no-unused-vars': 'off',
|
|
||||||
'no-use-before-define': 'off',
|
|
||||||
quotes: ['error', 'single'],
|
|
||||||
'react-hooks/refs': 'off',
|
|
||||||
'react-hooks/set-state-in-effect': 'off',
|
|
||||||
'react-refresh/only-export-components': 'off',
|
|
||||||
'react/display-name': 'off',
|
|
||||||
semi: ['error', 'always'],
|
|
||||||
'single-attribute-per-line': 'off',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
eslintConfigPrettier,
|
|
||||||
);
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Name=Feishin
|
|
||||||
GenericName=Music player
|
|
||||||
Exec=${FEISHIN_DESKTOP_EXECUTABLE} ${FEISHIN_DESKTOP_ARGS}
|
|
||||||
TryExec=${FEISHIN_DESKTOP_EXECUTABLE}
|
|
||||||
Terminal=false
|
|
||||||
Type=Application
|
|
||||||
Icon=org.jeffvli.feishin
|
|
||||||
StartupWMClass=feishin
|
|
||||||
SingleMainWindow=true
|
|
||||||
Categories=AudioVideo;Audio;Player;Music;
|
|
||||||
Keywords=Navidrome;Jellyfin;Subsonic;OpenSubsonic
|
|
||||||
Comment=A player for your self-hosted music server
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/src/assets/favicon.svg" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
<title>Vite App</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
if [ "$#" -lt 1 ]; then
|
|
||||||
echo "Usage: $0 <installation-directory> <option>"
|
|
||||||
echo "Options:"
|
|
||||||
echo " wayland-native Enable native Wayland support"
|
|
||||||
echo " remove Remove Feishin AppImage and desktop entries"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
dir="$(readlink -f "${1}")"
|
|
||||||
arg="${2:-""}"
|
|
||||||
arch="$(uname -m)"
|
|
||||||
|
|
||||||
if [ "$arg" != "wayland-native" ] && [ "$arg" != "remove" ] && [ "$arg" != "" ]; then
|
|
||||||
echo "Invalid option: $arg"
|
|
||||||
echo "Valid options are: wayland-native, remove"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${arch}" != "x86_64" ] && [ "${arch}" != "aarch64" ]; then
|
|
||||||
echo "CPU architecture not recognised (not x86_64 or aarch64). Aborting."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# workaround if we're not renaming the artifact
|
|
||||||
if [ "${arch}" = "aarch64" ]; then
|
|
||||||
arch="arm64"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d "${dir}" ]; then
|
|
||||||
echo "${dir} is not a directory or does not exist. Please provide an existing directory."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
localShare="${XDG_DATA_HOME:-$HOME/.local/share}"
|
|
||||||
localShareIcons="${localShare}/icons/hicolor"
|
|
||||||
|
|
||||||
if [ "${arg}" = "remove" ]; then
|
|
||||||
rm -v \
|
|
||||||
"${localShareIcons}/512x512/apps/org.jeffvli.feishin.png" \
|
|
||||||
"${localShareIcons}/256x256/apps/org.jeffvli.feishin.png" \
|
|
||||||
"${localShareIcons}/128x128/apps/org.jeffvli.feishin.png" \
|
|
||||||
"${localShareIcons}/64x64/apps/org.jeffvli.feishin.png" \
|
|
||||||
"${localShareIcons}/32x32/apps/org.jeffvli.feishin.png" \
|
|
||||||
"${localShare}/applications/org.jeffvli.feishin.desktop" \
|
|
||||||
"${dir}/Feishin-linux-${arch}.AppImage"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
curl --fail -L --create-dirs --write-out '%{filename_effective}\n' \
|
|
||||||
-o "${dir}/Feishin-linux-${arch}.AppImage" "https://github.com/jeffvli/feishin/releases/latest/download/Feishin-linux-${arch}.AppImage" \
|
|
||||||
-o "${localShareIcons}/512x512/apps/org.jeffvli.feishin.png" 'https://github.com/jeffvli/feishin/blob/development/assets/icons/512x512.png?raw=true' \
|
|
||||||
-o "${localShareIcons}/256x256/apps/org.jeffvli.feishin.png" 'https://github.com/jeffvli/feishin/blob/development/assets/icons/256x256.png?raw=true' \
|
|
||||||
-o "${localShareIcons}/128x128/apps/org.jeffvli.feishin.png" 'https://github.com/jeffvli/feishin/blob/development/assets/icons/128x128.png?raw=true' \
|
|
||||||
-o "${localShareIcons}/64x64/apps/org.jeffvli.feishin.png" 'https://github.com/jeffvli/feishin/blob/development/assets/icons/64x64.png?raw=true' \
|
|
||||||
-o "${localShareIcons}/32x32/apps/org.jeffvli.feishin.png" 'https://github.com/jeffvli/feishin/blob/development/assets/icons/32x32.png?raw=true'
|
|
||||||
chmod -v u+x "${dir}/Feishin-linux-${arch}.AppImage"
|
|
||||||
|
|
||||||
waylandFlags=""
|
|
||||||
if [ "${arg}" = "wayland-native" ]; then
|
|
||||||
waylandFlags="--enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform-hint=auto"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# this is for Debian-based kernels and ALT respectively
|
|
||||||
# https://unix.stackexchange.com/a/303214/145722
|
|
||||||
sandboxFlag=""
|
|
||||||
if [ "$(sysctl kernel.unprivileged_userns_clone 2>/dev/null)" = "0" ] \
|
|
||||||
|| [ "$(sysctl kernel.userns_restrict 2>/dev/null)" = "1" ]; then
|
|
||||||
sandboxFlag="--no-sandbox"
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -pv "${localShare}/applications"
|
|
||||||
|
|
||||||
export FEISHIN_DESKTOP_EXECUTABLE="${dir}/Feishin-linux-${arch}.AppImage"
|
|
||||||
export FEISHIN_DESKTOP_ARGS="${sandboxFlag} ${waylandFlags}"
|
|
||||||
curl --fail https://raw.githubusercontent.com/jeffvli/feishin/refs/heads/development/feishin.desktop.tmpl | envsubst > "${localShare}/applications/org.jeffvli.feishin.desktop"
|
|
||||||
|
Before Width: | Height: | Size: 81 KiB |