Compare commits
171 Commits
6b18e5c8ee
...
v4.11.163
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4d4c73c2b | ||
| 73fbc1c77a | |||
|
|
3dc732521f | ||
| b76aa3fe4a | |||
|
|
c0d1e87b8d | ||
| 04d4026e78 | |||
|
|
cfbc59d6a9 | ||
| dfe42fa942 | |||
|
|
6a8397425e | ||
| 641ec26142 | |||
|
|
1eaf246806 | ||
| 0e97e4d3b6 | |||
|
|
1636a8d0c6 | ||
| ac236750aa | |||
|
|
7e747e6c36 | ||
| 1b2cae5b12 | |||
|
|
76921c4e79 | ||
| 688efff7c9 | |||
|
|
9bc377b62a | ||
| 836ccce7a3 | |||
|
|
34c8e6e38c | ||
| e69bda3aa6 | |||
|
|
5d55e5d826 | ||
| b5902b9fc3 | |||
|
|
f60cf0bd3c | ||
| 83dec0ef54 | |||
|
|
40a76f02cd | ||
| 3def3cc456 | |||
|
|
30bd67d43a | ||
| ffeccee680 | |||
|
|
facbeee024 | ||
| 09102c7903 | |||
|
|
fa33ec7ac8 | ||
| c44f5cf14a | |||
|
|
27793d7c4f | ||
| 32b2902ef7 | |||
|
|
5cdb318854 | ||
| a28f05bb88 | |||
|
|
cecfe73b2e | ||
| b458c7918c | |||
|
|
d8660f4822 | ||
| dad83773a6 | |||
|
|
d2d35de46b | ||
| c752ec0b38 | |||
|
|
28752eb56e | ||
| 4f243a0fcf | |||
|
|
9bce616f26 | ||
| f16ab73c9a | |||
|
|
c29a15e073 | ||
| f5fe61e3eb | |||
|
|
a1a752b0fb | ||
| 7769250875 | |||
|
|
b3af9f3185 | ||
| 7906326790 | |||
|
|
3b4babb9d7 | ||
| 4b284ec747 | |||
| e1b4cfb9c8 | |||
|
|
c0266903ec | ||
| 81964d6f14 | |||
|
|
47e025cf55 | ||
| b400070ad0 | |||
| 529694ce66 | |||
|
|
791c3ab4df | ||
| de8d9db795 | |||
|
|
ffaf9ff66a | ||
| f0891ba4cc | |||
| 627b117119 | |||
|
|
b6c6659a5a | ||
| d7a73afebc | |||
| e469d51ba4 | |||
|
|
6ba03277e5 | ||
| fdb2dca794 | |||
|
|
8797bb5a22 | ||
| 4d154fd4f3 | |||
| 42e8fb71ef | |||
|
|
ff2c284984 | ||
| 75be84e472 | |||
| a3c91b306a | |||
|
|
20edc293bb | ||
| 6803eac8fb | |||
| fa5592f1e4 | |||
|
|
78601be6f4 | ||
| c940bdc78c | |||
|
|
9471fe2f5d | ||
| 57f7fe7086 | |||
| a2364f2622 | |||
|
|
df2220581d | ||
| 198eb0fe04 | |||
| fff114abef | |||
|
|
7013f1c22d | ||
| 1dbc7d6cc4 | |||
| f93f109d4a | |||
|
|
f707aa98f5 | ||
| 8a0be09d5d | |||
| a1b86f00ba | |||
|
|
c9f569a2b2 | ||
| 7a736b3adf | |||
| b6ecd16148 | |||
|
|
30d6b8dc74 | ||
| b6bcd8d05b | |||
|
|
0b5fe5f04c | ||
| c629c07bf9 | |||
|
|
fcd7d3e7ea | ||
| db994a5d43 | |||
| fea9ebd501 | |||
|
|
9238d80adb | ||
| a28d3c26b5 | |||
|
|
161030927f | ||
| c431c1d547 | |||
| 739c863601 | |||
|
|
5b6c213101 | ||
| 5acf981bd4 | |||
|
|
14b27717a6 | ||
| bd3e1d5b9c | |||
| a668544c6e | |||
|
|
dd8f4eb47d | ||
| 54cb11e55b | |||
| dec48f6c1d | |||
|
|
8f776f4f7c | ||
| c6aff43467 | |||
| 9f95ef1ecd | |||
|
|
aafda0d437 | ||
| f97a8d4929 | |||
|
|
a8c742376f | ||
| 938ab53d4b | |||
|
|
62352412d3 | ||
| fd33b3f6b7 | |||
| 3c0b4cf108 | |||
|
|
4eb48726ae | ||
| ba17993001 | |||
| cf39f0acd9 | |||
|
|
bce2cbec94 | ||
| f401b5ea3d | |||
| 4a5e3a1691 | |||
|
|
dc50f74971 | ||
| a198eb6896 | |||
| dc9b12dd26 | |||
|
|
6ea0e7a4fd | ||
| 51b13e0fcd | |||
|
|
1d7a48c57e | ||
| 0e34ca2063 | |||
|
|
6248d5843a | ||
| 5af79606c2 | |||
| 3cc31d8e05 | |||
|
|
0f7dd5f55c | ||
| de4f6ebbc9 | |||
|
|
fd25143489 | ||
| 5265674a58 | |||
|
|
39376e0003 | ||
| cf1f7fcec8 | |||
|
|
153e55705a | ||
| 77cdd66027 | |||
| 80580391cb | |||
|
|
6f0988f873 | ||
| 99358803d2 | |||
| 6a347d977f | |||
|
|
c03a4d3f41 | ||
| 50818f1d76 | |||
|
|
0f8c9b83f4 | ||
| 76cae46005 | |||
| ca22449d54 | |||
|
|
dda1041268 | ||
| b4f8f13213 | |||
| 9ad9971a03 | |||
| c38dc7bbf6 | |||
|
|
aaed71e37b | ||
| ed85051480 | |||
| d0524c2bc7 | |||
|
|
8a0f8f5422 | ||
| 8a95d9e67d | |||
| b8a126fd69 |
@@ -11,10 +11,9 @@ on:
|
||||
jobs:
|
||||
increment-version:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[skip ci]')
|
||||
outputs:
|
||||
version: ${{ steps.bump.outputs.VERSION }}
|
||||
should_build: ${{ steps.bump.outputs.SHOULD_BUILD }}
|
||||
version: ${{ steps.finalize.outputs.VERSION }}
|
||||
should_build: ${{ steps.decide.outputs.SHOULD_BUILD }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -22,9 +21,35 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Decide version behavior
|
||||
id: decide
|
||||
run: |
|
||||
CURRENT=$(grep -Po '"version":\s*"\K[^"]+' package.json | head -1)
|
||||
COMMIT_MSG="${{ github.event.head_commit.message || '' }}"
|
||||
|
||||
SHOULD_BUMP=false
|
||||
SHOULD_BUILD=true
|
||||
|
||||
if [ "${{ github.ref }}" = "refs/heads/main" ] && ! echo "$COMMIT_MSG" | grep -qi '\[skip ci\]'; then
|
||||
SHOULD_BUMP=true
|
||||
fi
|
||||
|
||||
if echo "$COMMIT_MSG" | grep -qi '\[skip ci\]'; then
|
||||
SHOULD_BUILD=false
|
||||
fi
|
||||
|
||||
echo "CURRENT_VERSION=$CURRENT" >> $GITHUB_OUTPUT
|
||||
echo "SHOULD_BUMP=$SHOULD_BUMP" >> $GITHUB_OUTPUT
|
||||
echo "SHOULD_BUILD=$SHOULD_BUILD" >> $GITHUB_OUTPUT
|
||||
|
||||
echo "Current version: $CURRENT"
|
||||
echo "Should bump: $SHOULD_BUMP"
|
||||
echo "Should build: $SHOULD_BUILD"
|
||||
|
||||
- name: Bump patch version
|
||||
id: bump
|
||||
if: ${{ steps.decide.outputs.SHOULD_BUMP == 'true' }}
|
||||
run: |
|
||||
# Get current version from package.json
|
||||
CURRENT=$(grep -Po '"version":\s*"\K[^"]+' package.json | head -1)
|
||||
@@ -45,15 +70,40 @@ jobs:
|
||||
grep '"version"' package.json | head -1
|
||||
|
||||
echo "VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT
|
||||
echo "SHOULD_BUILD=true" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Commit and push version bump
|
||||
if: ${{ steps.decide.outputs.SHOULD_BUMP == 'true' }}
|
||||
run: |
|
||||
git config user.name "GitHub Actions"
|
||||
git config user.email "actions@github.com"
|
||||
git add package.json
|
||||
git commit -m "chore: bump version to ${{ steps.bump.outputs.VERSION }} [skip ci]"
|
||||
git push
|
||||
for attempt in 1 2 3; do
|
||||
git fetch origin main
|
||||
git rebase origin/main || {
|
||||
git rebase --abort || true
|
||||
echo "Failed to rebase version bump onto latest main"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if git push origin HEAD:main; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Push rejected on attempt ${attempt}, retrying against latest main"
|
||||
done
|
||||
|
||||
echo "Failed to push version bump after 3 attempts"
|
||||
exit 1
|
||||
|
||||
- name: Finalize version output
|
||||
id: finalize
|
||||
run: |
|
||||
if [ -n "${{ steps.bump.outputs.VERSION }}" ]; then
|
||||
echo "VERSION=${{ steps.bump.outputs.VERSION }}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "VERSION=${{ steps.decide.outputs.CURRENT_VERSION }}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
build-windows:
|
||||
runs-on: windows
|
||||
@@ -70,7 +120,19 @@ jobs:
|
||||
- name: Checkout submodules manually
|
||||
shell: powershell
|
||||
run: |
|
||||
git submodule update --init --recursive
|
||||
git submodule sync --recursive
|
||||
|
||||
if (git submodule update --init --recursive) {
|
||||
Write-Host "Submodules checked out at pinned commits."
|
||||
exit 0
|
||||
}
|
||||
|
||||
Write-Warning "Pinned submodule commit is unavailable on remote. Falling back to remote submodule HEAD."
|
||||
git submodule deinit -f --all
|
||||
git submodule update --init --recursive --remote
|
||||
|
||||
Write-Host "Resolved submodule commit:"
|
||||
git -C cinny rev-parse HEAD
|
||||
|
||||
- name: Pull latest (after version bump)
|
||||
if: github.ref == 'refs/heads/main'
|
||||
@@ -83,11 +145,11 @@ jobs:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install dependencies (root)
|
||||
run: npm install --prefer-offline
|
||||
run: npm ci --prefer-offline
|
||||
|
||||
- name: Install dependencies (cinny)
|
||||
working-directory: ./cinny
|
||||
run: npm install --prefer-offline
|
||||
run: npm ci --prefer-offline
|
||||
|
||||
- name: Clean previous builds
|
||||
shell: powershell
|
||||
@@ -96,42 +158,26 @@ jobs:
|
||||
if (Test-Path dist-electron) { Remove-Item -Recurse -Force dist-electron }
|
||||
|
||||
- name: Build Electron app
|
||||
run: npm run build:win
|
||||
run: npm run build:local -- --win
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GHTOKEN }}
|
||||
|
||||
- name: Upload Squirrel Setup (x64)
|
||||
- name: Upload NSIS Installer (x64)
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Paarrot-Setup-x64.exe
|
||||
path: dist-electron/squirrel-windows/Paarrot-*-win-x64.exe
|
||||
path: dist-electron/Paarrot-*-win-x64.exe
|
||||
|
||||
- name: Upload latest.yml
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: latest.yml
|
||||
path: dist-electron/latest.yml
|
||||
|
||||
- name: List build output
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem -Path dist-electron -Recurse | Select-Object FullName
|
||||
|
||||
- name: Copy RELEASES file for upload
|
||||
shell: powershell
|
||||
run: |
|
||||
if (Test-Path "dist-electron/squirrel-windows/RELEASES") {
|
||||
Copy-Item "dist-electron/squirrel-windows/RELEASES" -Destination "dist-electron/RELEASES"
|
||||
} else {
|
||||
Write-Error "RELEASES file not found for x64"
|
||||
exit 1
|
||||
}
|
||||
|
||||
- name: Upload Squirrel RELEASES
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: RELEASES
|
||||
path: dist-electron/RELEASES
|
||||
|
||||
- name: Upload Squirrel nupkg (x64)
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Paarrot-x64.nupkg
|
||||
path: dist-electron/squirrel-windows/*.nupkg
|
||||
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -142,8 +188,25 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
submodules: false
|
||||
ref: ${{ github.ref_name }}
|
||||
|
||||
- name: Checkout submodules manually
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git submodule sync --recursive
|
||||
|
||||
if git submodule update --init --recursive; then
|
||||
echo "Submodules checked out at pinned commits."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Pinned submodule commit is unavailable on remote. Falling back to remote submodule HEAD."
|
||||
git submodule deinit -f --all
|
||||
git submodule update --init --recursive --remote
|
||||
|
||||
echo "Resolved submodule commit:"
|
||||
git -C cinny rev-parse HEAD
|
||||
|
||||
- name: Pull latest (after version bump)
|
||||
if: github.ref == 'refs/heads/main'
|
||||
@@ -166,7 +229,7 @@ jobs:
|
||||
rm -rf cinny/dist dist-electron
|
||||
|
||||
- name: Build Electron app
|
||||
run: npm run build:linux
|
||||
run: npm run build:local -- --linux
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GHTOKEN }}
|
||||
|
||||
@@ -175,6 +238,12 @@ jobs:
|
||||
with:
|
||||
name: Paarrot-Linux-x64.AppImage
|
||||
path: dist-electron/Paarrot-*.AppImage
|
||||
|
||||
- name: Upload latest-linux.yml
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: latest-linux.yml
|
||||
path: dist-electron/latest-linux.yml
|
||||
|
||||
create-release:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -232,7 +301,7 @@ jobs:
|
||||
- name: Prepare release files
|
||||
run: |
|
||||
mkdir -p release-files
|
||||
find artifacts -type f \( -name "*.exe" -o -name "*.AppImage" -o -name "*.nupkg" -o -name "RELEASES*" \) -exec cp {} release-files/ \;
|
||||
find artifacts -type f \( -name "*.exe" -o -name "*.AppImage" -o -name "*.yml" \) -exec cp {} release-files/ \;
|
||||
ls -la release-files/
|
||||
|
||||
- name: Create or Update Release
|
||||
@@ -244,6 +313,28 @@ jobs:
|
||||
API_BASE="http://synbox.ruv.wtf:8418/api/v1"
|
||||
REPO="litruv/cinny-desktop"
|
||||
|
||||
# Delete old releases (keep only current)
|
||||
echo "Cleaning up old releases..."
|
||||
OLD_RELEASES=$(curl -s -H "Authorization: token ${GITEA_TOKEN}" \
|
||||
"${API_BASE}/repos/${REPO}/releases" | jq -r '.[] | select(.tag_name != "'${TAG_NAME}'") | .id')
|
||||
|
||||
for OLD_ID in $OLD_RELEASES; do
|
||||
echo "Deleting old release ${OLD_ID}..."
|
||||
OLD_TAG=$(curl -s -H "Authorization: token ${GITEA_TOKEN}" \
|
||||
"${API_BASE}/repos/${REPO}/releases/${OLD_ID}" | jq -r '.tag_name')
|
||||
|
||||
# Delete release
|
||||
curl -s -X DELETE -H "Authorization: token ${GITEA_TOKEN}" \
|
||||
"${API_BASE}/repos/${REPO}/releases/${OLD_ID}"
|
||||
|
||||
# Delete tag
|
||||
if [ -n "$OLD_TAG" ]; then
|
||||
echo "Deleting old tag ${OLD_TAG}..."
|
||||
curl -s -X DELETE -H "Authorization: token ${GITEA_TOKEN}" \
|
||||
"${API_BASE}/repos/${REPO}/tags/${OLD_TAG}"
|
||||
fi
|
||||
done
|
||||
|
||||
# Check if release exists
|
||||
RELEASE_ID=$(curl -s -H "Authorization: token ${GITEA_TOKEN}" \
|
||||
"${API_BASE}/repos/${REPO}/releases/tags/${TAG_NAME}" | jq -r '.id // empty')
|
||||
@@ -292,6 +383,28 @@ jobs:
|
||||
TAG_NAME="v${VERSION}"
|
||||
GITHUB_REPO="Paarrot/Paarrot-Desktop"
|
||||
|
||||
# Delete old GitHub releases (keep only current)
|
||||
echo "Cleaning up old GitHub releases..."
|
||||
OLD_RELEASES=$(curl -s -H "Authorization: token ${GH_TOKEN}" \
|
||||
"https://api.github.com/repos/${GITHUB_REPO}/releases" | jq -r '.[] | select(.tag_name != "'${TAG_NAME}'") | .id')
|
||||
|
||||
for OLD_ID in $OLD_RELEASES; do
|
||||
echo "Deleting old GitHub release ${OLD_ID}..."
|
||||
OLD_TAG=$(curl -s -H "Authorization: token ${GH_TOKEN}" \
|
||||
"https://api.github.com/repos/${GITHUB_REPO}/releases/${OLD_ID}" | jq -r '.tag_name')
|
||||
|
||||
# Delete release
|
||||
curl -s -X DELETE -H "Authorization: token ${GH_TOKEN}" \
|
||||
"https://api.github.com/repos/${GITHUB_REPO}/releases/${OLD_ID}"
|
||||
|
||||
# Delete tag
|
||||
if [ -n "$OLD_TAG" ]; then
|
||||
echo "Deleting old GitHub tag ${OLD_TAG}..."
|
||||
curl -s -X DELETE -H "Authorization: token ${GH_TOKEN}" \
|
||||
"https://api.github.com/repos/${GITHUB_REPO}/git/refs/tags/${OLD_TAG}"
|
||||
fi
|
||||
done
|
||||
|
||||
# Check if release exists on GitHub
|
||||
RELEASE_ID=$(curl -s -H "Authorization: token ${GH_TOKEN}" \
|
||||
"https://api.github.com/repos/${GITHUB_REPO}/releases/tags/${TAG_NAME}" | jq -r '.id // empty')
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@ node_modules
|
||||
devAssets
|
||||
|
||||
.DS_Store
|
||||
dist-electron/
|
||||
|
||||
@@ -22,7 +22,7 @@ To setup development locally run the following commands:
|
||||
* `cd cinny-desktop/cinny`
|
||||
* `npm ci`
|
||||
* `cd ..`
|
||||
* `npm ci`
|
||||
* `npm ci`
|
||||
|
||||
To build the app locally, run:
|
||||
* `npm run build`
|
||||
|
||||
2
cinny
2
cinny
Submodule cinny updated: e5e296ca98...f62200ecd1
4
dev-app-update.yml
Normal file
4
dev-app-update.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
provider: github
|
||||
owner: Paarrot
|
||||
repo: Paarrot-Desktop
|
||||
updaterCacheDirName: paarrot-updater
|
||||
Binary file not shown.
@@ -10,6 +10,7 @@
|
||||
"files": [
|
||||
"electron/**/*",
|
||||
"cinny/dist/**/*",
|
||||
"dev-app-update.yml",
|
||||
"!**/*.map",
|
||||
"!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}",
|
||||
"!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}",
|
||||
@@ -35,6 +36,12 @@
|
||||
"filter": ["**/*"]
|
||||
}
|
||||
],
|
||||
"protocols": [
|
||||
{
|
||||
"name": "Paarrot URL",
|
||||
"schemes": ["paarrot"]
|
||||
}
|
||||
],
|
||||
"linux": {
|
||||
"target": [
|
||||
{
|
||||
@@ -50,6 +57,7 @@
|
||||
"Name": "Paarrot",
|
||||
"GenericName": "Matrix Client",
|
||||
"Comment": "A Matrix client built with Cinny",
|
||||
"MimeType": "x-scheme-handler/paarrot;",
|
||||
"Categories": "Network;InstantMessaging;",
|
||||
"Keywords": "matrix;chat;messaging;",
|
||||
"StartupWMClass": "paarrot"
|
||||
@@ -77,18 +85,24 @@
|
||||
"win": {
|
||||
"target": [
|
||||
{
|
||||
"target": "squirrel",
|
||||
"target": "nsis",
|
||||
"arch": ["x64"]
|
||||
}
|
||||
],
|
||||
"icon": "icons/icon.ico",
|
||||
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}"
|
||||
},
|
||||
"squirrelWindows": {
|
||||
"name": "Paarrot",
|
||||
"loadingGif": "icons/icon.png",
|
||||
"iconUrl": "https://raw.githubusercontent.com/Paarrot/Paarrot-Desktop/main/icons/icon.ico"
|
||||
"nsis": {
|
||||
"oneClick": true,
|
||||
"perMachine": false,
|
||||
"allowToChangeInstallationDirectory": false,
|
||||
"deleteAppDataOnUninstall": false,
|
||||
"createDesktopShortcut": true,
|
||||
"createStartMenuShortcut": true,
|
||||
"shortcutName": "Paarrot",
|
||||
"differentialPackage": false
|
||||
},
|
||||
"compression": "normal",
|
||||
"publish": [
|
||||
{
|
||||
"provider": "github",
|
||||
|
||||
928
electron/main.js
928
electron/main.js
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,8 @@ const commandMap = {
|
||||
'check_for_updates': 'check-for-updates',
|
||||
'download_update': 'download-update',
|
||||
'install_update': 'install-update',
|
||||
'get_desktop_sources': 'get-desktop-sources'
|
||||
'get_desktop_sources': 'get-desktop-sources',
|
||||
'get_protocol_status': 'protocol:get-status'
|
||||
};
|
||||
|
||||
// Shared invoke function for legacy API compatibility
|
||||
@@ -129,6 +130,7 @@ contextBridge.exposeInMainWorld('electron', {
|
||||
updater: {
|
||||
checkForUpdates: () => ipcRenderer.invoke('check-for-updates'),
|
||||
downloadAndInstallUpdate: () => ipcRenderer.invoke('download-and-install-update'),
|
||||
isMock: () => ipcRenderer.invoke('updater-is-mock'),
|
||||
onUpdateAvailable: (callback) => {
|
||||
ipcRenderer.on('update-available', (_, info) => callback(info));
|
||||
},
|
||||
@@ -138,6 +140,9 @@ contextBridge.exposeInMainWorld('electron', {
|
||||
onUpdateDownloaded: (callback) => {
|
||||
ipcRenderer.on('update-downloaded', (_, info) => callback(info));
|
||||
},
|
||||
onUpdateNotAvailable: (callback) => {
|
||||
ipcRenderer.on('update-not-available', (_, info) => callback(info));
|
||||
},
|
||||
downloadUpdate: () => ipcRenderer.invoke('download-update'),
|
||||
installUpdate: () => ipcRenderer.invoke('install-update'),
|
||||
},
|
||||
@@ -176,6 +181,12 @@ contextBridge.exposeInMainWorld('electron', {
|
||||
list: () => ipcRenderer.invoke('plugin:list'),
|
||||
uninstall: (pluginId) => ipcRenderer.invoke('plugin:uninstall', pluginId),
|
||||
readPluginCode: (pluginId) => ipcRenderer.invoke('plugin:read-code', pluginId)
|
||||
},
|
||||
|
||||
// Desktop protocol diagnostics
|
||||
protocol: {
|
||||
getStatus: () => ipcRenderer.invoke('protocol:get-status'),
|
||||
repair: () => ipcRenderer.invoke('protocol:repair')
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
3548
package-lock.json
generated
3548
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
36
package.json
36
package.json
@@ -1,17 +1,22 @@
|
||||
{
|
||||
"name": "paarrot",
|
||||
"version": "4.11.92",
|
||||
"version": "4.11.163",
|
||||
"description": "Paarrot - A Matrix client based on Cinny",
|
||||
"homepage": "https://github.com/Paarrot/Paarrot-Desktop",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Paarrot/Paarrot-Desktop.git"
|
||||
},
|
||||
"main": "electron/main.js",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "concurrently \"npm run dev:vite\" \"npm run dev:electron\"",
|
||||
"dev:vite": "cd cinny && npm start",
|
||||
"dev:vite": "cross-env BROWSER=none sh -c 'cd cinny && npm start'",
|
||||
"dev:electron": "wait-on http://localhost:38347 && cross-env NODE_ENV=development electron .",
|
||||
"build": "node -e \"require('fs').copyFileSync('config.json', 'cinny/config.json')\" && cd cinny && npm run build && cd .. && electron-builder --publish always",
|
||||
"build:local": "node -e \"require('fs').copyFileSync('config.json', 'cinny/config.json')\" && cd cinny && npm run build && cd .. && electron-builder",
|
||||
"build:linux": "npm run build -- --linux",
|
||||
"build:win": "npm run build -- --win",
|
||||
"postman:generate": "node scripts/generate-postman-collection.js"
|
||||
@@ -23,25 +28,28 @@
|
||||
},
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
"adm-zip": "^0.5.16",
|
||||
"body-parser": "2.2.2",
|
||||
"adm-zip": "^0.5.18",
|
||||
"body-parser": "2.3.0",
|
||||
"cors": "2.8.6",
|
||||
"electron-squirrel-startup": "^1.0.1",
|
||||
"electron-store": "^8.2.0",
|
||||
"electron-updater": "^6.3.9",
|
||||
"electron-store": "^11.0.2",
|
||||
"electron-updater": "^6.8.9",
|
||||
"express": "5.2.1",
|
||||
"open": "11.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@actions/github": "6.0.0",
|
||||
"@electron/rebuild": "4.0.3",
|
||||
"concurrently": "9.2.1",
|
||||
"@actions/github": "9.1.1",
|
||||
"@electron/rebuild": "4.2.0",
|
||||
"concurrently": "10.0.3",
|
||||
"cross-env": "10.1.0",
|
||||
"electron": "40.6.0",
|
||||
"electron-builder": "26.8.1",
|
||||
"electron": "43.1.0",
|
||||
"electron-builder": "26.15.3",
|
||||
"node-fetch": "3.3.2",
|
||||
"png2icons": "2.0.1",
|
||||
"sharp": "0.34.5",
|
||||
"wait-on": "9.0.4"
|
||||
"sharp": "0.35.3",
|
||||
"wait-on": "9.0.10"
|
||||
},
|
||||
"allowScripts": {
|
||||
"electron-winstaller@5.4.0": true,
|
||||
"electron@43.1.0": true
|
||||
}
|
||||
}
|
||||
|
||||
104
scripts/migrate-icons.mjs
Normal file
104
scripts/migrate-icons.mjs
Normal file
@@ -0,0 +1,104 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const srcRoot = path.resolve(__dirname, '../cinny/src');
|
||||
const iconsModule = path.resolve(srcRoot, 'app/components/icons');
|
||||
|
||||
const ICON_SYMBOLS = new Set(['Icon', 'Icons', 'IconName', 'IconSrc']);
|
||||
|
||||
function walk(dir, files = []) {
|
||||
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
||||
const fullPath = path.join(dir, entry.name);
|
||||
if (entry.isDirectory()) {
|
||||
walk(fullPath, files);
|
||||
} else if (/\.(tsx?)$/.test(entry.name)) {
|
||||
files.push(fullPath);
|
||||
}
|
||||
}
|
||||
return files;
|
||||
}
|
||||
|
||||
function getIconsImportPath(filePath) {
|
||||
const rel = path.relative(path.dirname(filePath), iconsModule).replace(/\\/g, '/');
|
||||
return rel.startsWith('.') ? rel : `./${rel}`;
|
||||
}
|
||||
|
||||
function splitFoldsImport(importClause) {
|
||||
const match = importClause.match(/^\{([^}]+)\}(?:\s+as\s+\w+)?$/);
|
||||
if (!match) return null;
|
||||
|
||||
const specifiers = match[1]
|
||||
.split(',')
|
||||
.map((part) => part.trim())
|
||||
.filter(Boolean)
|
||||
.map((part) => {
|
||||
const [local, imported] = part.split(/\s+as\s+/).map((s) => s.trim());
|
||||
return { local: local ?? imported, imported: imported ?? local };
|
||||
});
|
||||
|
||||
const iconSpecs = specifiers.filter((s) => ICON_SYMBOLS.has(s.imported));
|
||||
const foldsSpecs = specifiers.filter((s) => !ICON_SYMBOLS.has(s.imported));
|
||||
|
||||
if (iconSpecs.length === 0) return null;
|
||||
|
||||
return { iconSpecs, foldsSpecs };
|
||||
}
|
||||
|
||||
function migrateFile(filePath) {
|
||||
let content = fs.readFileSync(filePath, 'utf8');
|
||||
const importRegex = /import\s+(\{[^}]+\})\s+from\s+['"]folds['"];?/g;
|
||||
let changed = false;
|
||||
const iconImports = new Map();
|
||||
|
||||
content = content.replace(importRegex, (fullMatch, importClause) => {
|
||||
const split = splitFoldsImport(importClause);
|
||||
if (!split) return fullMatch;
|
||||
|
||||
changed = true;
|
||||
for (const spec of split.iconSpecs) {
|
||||
iconImports.set(spec.local, spec.imported);
|
||||
}
|
||||
|
||||
if (split.foldsSpecs.length === 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const foldsImport = split.foldsSpecs.map((s) => (s.local === s.imported ? s.local : `${s.imported} as ${s.local}`)).join(', ');
|
||||
return `import { ${foldsImport} } from 'folds';`;
|
||||
});
|
||||
|
||||
if (!changed) return false;
|
||||
|
||||
const iconsPath = getIconsImportPath(filePath);
|
||||
const iconExportList = [...iconImports.entries()]
|
||||
.map(([local, imported]) => (local === imported ? imported : `${imported} as ${local}`))
|
||||
.join(', ');
|
||||
|
||||
const iconsImportLine = `import { ${iconExportList} } from '${iconsPath}';`;
|
||||
|
||||
const foldsImportMatch = content.match(/^import\s+\{[^}]+\}\s+from\s+['"]folds['"];?\s*$/m);
|
||||
if (foldsImportMatch) {
|
||||
const insertAt = content.indexOf(foldsImportMatch[0]) + foldsImportMatch[0].length;
|
||||
content = `${content.slice(0, insertAt)}\n${iconsImportLine}${content.slice(insertAt)}`;
|
||||
} else {
|
||||
content = `${iconsImportLine}\n${content}`;
|
||||
}
|
||||
|
||||
content = content.replace(/\n{3,}/g, '\n\n');
|
||||
fs.writeFileSync(filePath, content);
|
||||
return true;
|
||||
}
|
||||
|
||||
const files = walk(srcRoot);
|
||||
let migrated = 0;
|
||||
|
||||
for (const file of files) {
|
||||
if (file.includes(`${path.sep}components${path.sep}icons${path.sep}`)) continue;
|
||||
if (migrateFile(file)) {
|
||||
migrated += 1;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Migrated ${migrated} files.`);
|
||||
Reference in New Issue
Block a user