diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index b05c1d8..93e058e 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -163,7 +163,7 @@ jobs: - name: Merge latest .ymls uses: mikefarah/yq@v4.44.6 with: - cmd: yq ea '. as $item ireduce ({}; . * $item )' dist/*/*.yml > dist/combined.yml + cmd: yq eval-all '. as $item ireduce ({}; . * $item )' dist/*/*.yml > merged.yml - name: Upload Release id: create_release @@ -176,7 +176,7 @@ jobs: dist/linux/*.AppImage dist/windows/*.exe dist/macos/*.dmg - dist/combined.yml + merged.yml aur: name: Publish to AUR @@ -184,24 +184,20 @@ jobs: needs: release env: AUR_TOKEN: ${{ secrets.AUR_TOKEN }} - steps: - name: Checkout git repo uses: actions/checkout@v3 - - name: Download checksums uses: actions/download-artifact@v4 with: name: checksums path: ./sha256sum.txt - - name: Extract checksum from sha256sum.txt run: | new_checksum=$(awk 'NR==1 { print $1 }' ./sha256sum.txt) sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD - - name: Publish AUR package - uses: KSXGitHub/github-actions-deploy-aur@3.0.1 + uses: KSXGitHub/github-actions-deploy-aur@v3.0.1 with: pkgname: bskydesktop pkgbuild: ./build/PKGBUILD @@ -209,4 +205,4 @@ jobs: commit_email: ${{ secrets.AUR_EMAIL }} ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} commit_message: New Version - ssh_keyscan_types: rsa,ecdsa,ed25519 + ssh_keyscan_types: rsa,ecdsa,ed25519 \ No newline at end of file diff --git a/package.json b/package.json index 7f1b874..1454e5b 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,10 @@ ], "artifactName": "bsky-desktop.${ext}", "mac": { + "target": [ + "dmg", + "pkg" + ], "icon": "src/ui/images/logo.icns", "category": "Network" }, diff --git a/src/app/main.js b/src/app/main.js index fdce1b5..2dbad0d 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -44,11 +44,11 @@ global.urls = { // Settings urls: global.settings = { - general: `${global.urls.main}/settings`, - account: `${global.urls.main}/settings/account`, - appearance: `${global.urls.main}/settings/appearance`, - privacy: `${global.urls.main}/settings/privacy-and-security`, + general: `${global.urls.main}/settings` }; +global.settings.account = `${global.settings.general}/account`; +global.settings.appearance = `${global.settings.general}/appearance`; +global.settings.privacy = `${global.settings.general}/privacy-and-security`; // Badge options: const badgeOptions = { diff --git a/src/app/utils/auto-update.js b/src/app/utils/auto-update.js index a0d817e..87f00bb 100644 --- a/src/app/utils/auto-update.js +++ b/src/app/utils/auto-update.js @@ -79,33 +79,75 @@ function asarUpdate() { } function checkForUpdates() { + // Current system information + logger.log('Current system information:', sys.platform, sys.getVersion()); + // Check if the current system is Windows if (sys.isWin()) { // Check if the system is before Windows 10 - if (sys.laterThan('10.0.0')) { - // Check for updates, and if there are updates, download and install them - logger.log('Checking for updates (win)...'); - } else { + if (sys.earlierThan('10.0.0')) { // Windows 10 and above are supported, but windows 7 and 8 are not supported logger.error('Windows 7 and 8 are not supported, please upgrade to Windows 10 or above, not updating...'); + } else { + // Check for updates, and if there are updates, download and install them + logger.log('Checking for updates (win)...'); } } // Check if the current system is macOS if (sys.isMac()) { - // Check if the current version is later than macOS 10.15.0 - if (sys.laterThan('10.15.0')) { + let macArch = ''; + // Check the current version of macOS, and whether we can use the pkg installer + if (sys.laterThan('10.0.0')) { + // Check if system is after macOS 10 (11, 12, etc.) + if (sys.laterThan('11.0.0')) { + // macOS 11 and above support ARM64, check if system is ARM64 + logger.log('Checkking system architecture...'); + if (sys.isARM64()) { + // System is ARM64 (mac-arm64) + macArch = 'arm64'; + } else { + // System is Intel (mac-x64) + macArch = 'intel'; + } + } else { + // macOS 10 is mostly Intel, but some versions are ARM64 + macArch = 'intel'; + } // Check for updates, and if there are updates, download and install them - logger.log('Checking for updates (macOS)...'); + logger.log('Checking for updates (mac)...'); + + // Run the .pkg installer + const pkgPath = path.join(global.paths.updateDir, 'bsky-desktop.pkg'); + const command = `sudo installer -pkg ${pkgPath} -target /`; + + // Spawn a new shell + const shellProcess = spawn('sh', ['-c', command], { + stdio: 'inherit', // Pipe input/output to/from the shell + }); + + shellProcess.on('error', (err) => { + console.error('Failed to spawn shell:', err); + }); + + shellProcess.on('close', (code) => { + if (code === 0) { + console.log('Update installed successfully.'); + } else { + console.error(`Shell process exited with code ${code}.`); + } + }); } else { - // macOS 10.15 and above are supported, but macOS 10.14 and below are not supported - logger.error('macOS 10.14 and below are not supported, please upgrade to macOS 10.15 or above, not updating...'); + // macOS versions before 10 are not supported + logger.error('macOS versions before 10 are not supported, not updating...'); } } // Check if the current system is Linux if (sys.isLinux()) { // Check for updates, and if there are updates, download and install them (no system version check) + // Linux versions use AppImage, so we instead need to check for a new asar file so that the app can + // load the new asar instead of the packaged one (or even just delete the old appimage and download a new one) logger.log('Checking for updates (linux)...'); asarUpdate(); } diff --git a/src/app/utils/sysInfo.js b/src/app/utils/sysInfo.js index 62658ee..66f9bf7 100644 --- a/src/app/utils/sysInfo.js +++ b/src/app/utils/sysInfo.js @@ -5,6 +5,7 @@ class SystemInfo { constructor() { this.platform = os.platform(); // 'win32', 'darwin', 'linux' this.release = os.release(); // OS version + this.arch = os.arch(); // 'arm', 'arm64', 'x64', 'x86' this.versionInfo = this._getVersionInfo(); // Parsed version } @@ -23,6 +24,26 @@ class SystemInfo { return this.platform === 'linux'; } + // Check if current system architecture is ARM + isARM() { + return this.arch === 'arm'; + } + + // Check if current system architecture is ARM64 + isARM64() { + return this.arch === 'arm64'; + } + + // Check if current system architecture is x64 + isX64() { + return this.arch === 'x64'; + } + + // Check if current system architecture is x86 + isX86() { + return this.arch === 'x86'; + } + // Compare if current version is later than the given version laterThan(compareVersion) { const current = this.versionInfo; @@ -35,6 +56,11 @@ class SystemInfo { return false; } + // Compare if current version is earlier than the given version + earlierThan(compareVersion) { + return !this.laterThan(compareVersion); + } + // Private: Parse version strings (e.g., "10.0.19045" -> [10, 0, 19045]) _parseVersion(version) { return version.split('.').map((num) => parseInt(num, 10) || 0); @@ -57,6 +83,11 @@ class SystemInfo { return [0, 0, 0]; // Unknown system } } + + // Get current version as a string (e.g., "10.15.7") + getVersion() { + return this.versionInfo.join('.'); + } } module.exports = SystemInfo; @@ -66,6 +97,6 @@ module.exports = SystemInfo; //console.log(`Is Windows: ${sys.isWin()}`); //console.log(`Is macOS: ${sys.isMac()}`); //console.log(`Is Linux: ${sys.isLinux()}`); -//console.log(`Current Version Info: ${sys.versionInfo.join('.')}`); +//console.log(`Current Version Info: ${sys.getVersion()}`); //console.log(`Later than 10.0.19044: ${sys.laterThan('10.0.19044')}`); //console.log(`Later than 5.15.0 (Linux Kernel): ${sys.laterThan('5.15.0')}`); \ No newline at end of file diff --git a/src/ui/rend/bsky-ext.js b/src/ui/rend/bsky-ext.js index b635a1d..4e5492d 100644 --- a/src/ui/rend/bsky-ext.js +++ b/src/ui/rend/bsky-ext.js @@ -374,6 +374,15 @@ const BskyExt = { }, "regex": /discord\.com\/invite\/([a-zA-Z0-9_]+)/ }, + "discord_profile": { + "name": "Discord", + "type": "social", + "icon": "fab fa-discord", + "brand": { + "color": "#7289DA", + }, + "regex": /discord\.com\/users\/([a-zA-Z0-9_]+)/ + }, "discord.gg": { "name": "Discord", "type": "messaging", @@ -473,6 +482,33 @@ const BskyExt = { }, "regex": /irc:\/\/([a-zA-Z0-9_]+)/ }, + "itchio": { + "name": "Itch.io", + "type": "content", + "icon": "fab fa-itch-io", + "brand": { + "color": "#FA5C5C", + }, + "regex": /([a-zA-Z0-9_]+)\.itch\.io/ + }, + "etsy_shop": { + "name": "Etsy", + "type": "content", + "icon": "fab fa-etsy", + "brand": { + "color": "#D5641C", + }, + "regex": /etsy\.com\/shop\/([a-zA-Z0-9_]+)/ + }, + "etsy_user": { + "name": "Etsy", + "type": "content", + "icon": "fab fa-etsy", + "brand": { + "color": "#D5641C", + }, + "regex": /([a-zA-Z0-9_]+)\.etsy\.com/ + }, "email": { "name": "Email", "type": "messaging", @@ -498,7 +534,43 @@ const BskyExt = { "brand": { "color": "#1DA1F2", }, - "regex": /twitter\.com\/([a-zA-Z0-9_]+)/ + "regex": /(twitter\.com|x\.com)\/([a-zA-Z0-9_]+)\/?$/ + }, + "xbox": { + "name": "Xbox", + "type": "social", + "icon": "fab fa-xbox", + "brand": { + "color": "#107C10", + }, + "regex": /xbox\.com\/([a-zA-Z0-9_]+)/ + }, + "playstation": { + "name": "PlayStation", + "type": "social", + "icon": "fab fa-playstation", + "brand": { + "color": "#003087", + }, + "regex": /playstation\.com\/([a-zA-Z0-9_]+)/ + }, + "steam": { + "name": "Steam", + "type": "content", + "icon": "fab fa-steam", + "brand": { + "color": "#000000", + }, + "regex": /steamcommunity\.com\/id\/([a-zA-Z0-9_]+)/ + }, + "tiktok": { + "name": "TikTok", + "type": "social", + "icon": "fab fa-tiktok", + "brand": { + "color": "#000000", + }, + "regex": /tiktok\.com\/@([a-zA-Z0-9_]+)/ }, "instagram": { "name": "Instagram", @@ -729,6 +801,72 @@ const BskyExt = { } }, + /** + * @constant {Object} linkStylesOverrides - Style overrides for specific link types + */ + linkStylesOverrides: { + "bluesky": { + "default": { + "color": "rgb(0, 133, 255)", + "background": "#0000", + "border": "#0000", + }, + "hover": { + "color": "#fff", + "background": "#0000", + "border": "#0000" + } + }, + "discord": { + "default": { + "color": "#FFFFFF", + "background": "#7289DA", + "border": "#7289DA", + }, + "hover": { + "color": "#7289DA", + "background": "#FFFFFF", + "border": "#7289DA" + } + }, + "linktree": { + "default": { + "color": "#FFFFFF", + "background": "#39e09b", + "border": "#39e09b", + }, + "hover": { + "color": "#39e09b", + "background": "#FFFFFF", + "border": "#39e09b" + } + }, + "carrd": { + "default": { + "color": "#FFFFFF", + "background": "#2C2F33", + "border": "#2C2F33", + }, + "hover": { + "color": "#2C2F33", + "background": "#FFFFFF", + "border": "#2C2F33" + } + }, + "dribbble": { + "default": { + "color": "#FFFFFF", + "background": "#EA4C89", + "border": "#EA4C89", + }, + "hover": { + "color": "#EA4C89", + "background": "#FFFFFF", + "border": "#EA4C89" + } + }, + }, + /** * @constant {Object} buttonStyles - The button styles for the supported messaging apps * @@ -1109,7 +1247,7 @@ const BskyExt = { let header = bio.closest("[data-testid='profileView']"); // Get the profile header button group element - let buttonGroup = header.querySelector('[role="button"]').parentElement; + let buttonGroup = header.querySelector("div.css-175oi2r.r-2llsf > div:nth-child(1) > div > div:nth-child(2) > div.css-175oi2r.r-12vffkv"); // Check if the profile header button group element exists if (!buttonGroup) {